Obviously, this is not valid code (but could appear while typing) but the fragment is interpreted as field declaration.
But since an interface cannot contain a field declaration, mixinSharp assumes that every field declaration is hosted inside a ClassDeclaration and therefore cannot cast the declaration of IInterface to the correct type.
An additional check should be added to ensure that field definitions that are not hosted inside a class declaration are ignored.
Given the following code snippet:
Obviously, this is not valid code (but could appear while typing) but the fragment is interpreted as field declaration.
But since an interface cannot contain a field declaration, mixinSharp assumes that every field declaration is hosted inside a ClassDeclaration and therefore cannot cast the declaration of
IInterface
to the correct type.An additional check should be added to ensure that field definitions that are not hosted inside a class declaration are ignored.