Browse Source

test for #5008 (closes #5008)

Aleksandr Kuzmenko 6 years ago
parent
commit
0334896033

+ 17 - 0
tests/misc/projects/Issue5008/Main.hx

@@ -0,0 +1,17 @@
+class Main {
+    static function main() {
+        f(null);
+    }
+
+    static function f(t:Token) {
+        $type(t);
+        $type(t.type);
+        if (t.type || t.type == 42)
+            throw "WAT";
+    }
+}
+
+abstract Token(Array<Dynamic>) {
+    public var type(get,never):String;
+    inline function get_type() return this[0];
+}

+ 1 - 0
tests/misc/projects/Issue5008/compile-fail.hxml

@@ -0,0 +1 @@
+-main Main

+ 4 - 0
tests/misc/projects/Issue5008/compile-fail.hxml.stderr

@@ -0,0 +1,4 @@
+Main.hx:7: characters 15-16 : Warning : Token
+Main.hx:8: characters 15-21 : Warning : String
+Main.hx:9: characters 23-35 : Int should be String
+Main.hx:9: characters 13-35 : String should be Bool