pgenfer / mixinSharp

extension for VS2015 that adds mixins to C#
MIT License
11 stars 1 forks source link

Ignore invalid field declarations #24

Closed pgenfer closed 7 years ago

pgenfer commented 7 years ago

Given the following code snippet:

public interface IInterface
{
        bool startTyping
}

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.

pgenfer commented 7 years ago

Fixed in 1.6.1