C# cannot implicitly convert type T to type T


my method:

public TableFilled<TKey, TRow> getTera()

        Func<TablesFilled<TKey,TRow>> _getTera=new Func<TablesFilled<TKey,TRow>>(
        ()=>{return (TablesFilled<TKey,TRow>) chGetTera();});

       //Above does not compile says: Cannot convert type 
       //'AcapsVerify.FunctionalTables.TableFilled<TKey,TRow>' to 
       // the line below has the same blue underline error.
       return _getTera.TimeAndReport("Finished Teradata",OutputIfListener);

       // this works fine
       return chGetTera;

The static method it calls

public static T TimeAndReport<T>(this Func<T> timedFunc, String reportLead, Action<String> reporterAction)
        T result;
        var s = new System.Diagnostics.Stopwatch();
        result = timedFunc();
        reporterAction(reportLead + " in " + s.WholePartOnly());
        return result;

return class definition:

public class TableFilled<TKey,TRow> where TRow: STeraRow<TKey>

Best Solution

You can typecast by using object.

return (T)(object)(result);

For me it works.