You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing with the C# 14.0 extension feature and love it! While experimenting I discovered the following issue:
publicstructAStruct<K,V>:AStruct<K,V>.AnInterface<AStruct<K,V>>{publicinterfaceAnInterface<outT>{}}// Compiles finepublicstaticvoidOk<T,K,V>(T@this)whereT:AStruct<K,V>.AnInterface<T>{}// CS9295 on @thisextension<T,K,V>(T@this)whereT:AStruct<K,V>.AnInterface<T>{}
And the @this parameter is getting flagged with:
Program.cs(67,26,67,31): error CS9295: The extended type 'T' must reference all the type parameters declared by the extension, but type parameter 'K' is not referenced.
Program.cs(67,26,67,31): error CS9295: The extended type 'T' must reference all the type parameters declared by the extension, but type parameter 'V' is not referenced.
I would believe that it is a scenario that should be supported. Thoughts?
jnm2, viktor-svub, lindexi, Chri-Mue and Joy-lessnietras, frotty82 and DemoBytom