consulo / consulo-csharp

Languages: C#
Apache License 2.0
50 stars 6 forks source link

No error inside array initializer with explicit type #514

Open VISTALL opened 6 years ago

VISTALL commented 6 years ago

Error:

Cannot implicitly convert type 'dsadas.DA' to 'short'. An explicit conversion exists (are you missing a cast?)(CS0266)

Code:

    public enum DA {
        STRING,
        STRING2
    }

    public class EnumError {
        public void test() {
            short[] array = new short[]{DA.STRING, DA.STRING2};

        }
    }