kitlang / kit

Kit: a magical, high performance programming language, designed for game development.
https://www.kitlang.org
Other
1.02k stars 29 forks source link

Name collision between enum constructors and type parameters #75

Closed bendmorris closed 5 years ago

bendmorris commented 5 years ago
// these enum constructors conflict with Int type parameter names
enum MyEnum {
    N;
    T;
    W;
}

function main() {
    var x: Int = 1;
    printf("%i\n", x);
}
----------------------------------------
Error: /usr/lib/kit/kit/numeric.kit:34: Comparison operator `==` requires operands of similar type:

  @/usr/lib/kit/kit/numeric.kit:34:19-24
      34            static if W == 0 {
                              ^^^^^^

    Expected type:  issue.MyEnum
      Actual type:  kit.numeric.Int[$0]