C# cannot implicitly convert type T to type T

.net-3.5extension-methodslambda

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 
       //'AcapsVerify.FunctionalTables.TablesFilled<TKey,TRow>'
       // 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();
        s.Start();
        result = timedFunc();
        s.Stop();
        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.