Interface with property error Type mismatch, cannot assign "T" to "T"

Hi Team,

Please find below code, While declaring interface getting error(Type mismatch, cannot assign “T” to “T”).

NonWorkingInterface<T> = interface
    function GetSubject: T;
	  property Subject: T read GetSubject; // Error	(E62) Type mismatch, cannot assign "T" to "T"	 
	end; 

WorkingInterface<T> = interface
    function GetSubject: T;
	  property Subject: T read;
	end;

Thanks

What platform is this? I tried own .NET and this compiled fine:

Hi Team,

I tried this on .Net with version of Oxygene is (RemObjects Elements with Water - 10.0.0.2559)

Thanks!

Do you have a more complete example we can try? My colleague tried to reproduce this problem but couldn’t with the code given, so it might be a slight difference in what you are trying, or enclosing code.

Hi Team,

I tried the code in new version of Oxygene (RemObjects Elements with Water - 10.0.0.2595) and it’s working as expected.

Thanks!

1 Like

Ah, ok. 2559 is pretty old, so it could be this was fixed, or affected by some other related fix. thanx!