Browse Source

add test (closes #4250)

Simon Krajewski 9 years ago
parent
commit
a460ca8bb4

+ 14 - 0
tests/misc/projects/Issue4250/Main.hx

@@ -0,0 +1,14 @@
+typedef Node = { parent: Node };
+
+class SomeNode {
+    public var parent:SomeNode;
+    public function new() { }
+}
+
+class Main {
+    static function main() {
+        var someNode = new SomeNode();
+        var n:Node = someNode;
+        n.parent = { parent: null };
+    }
+}

+ 2 - 0
tests/misc/projects/Issue4250/compile-fail.hxml

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

+ 5 - 0
tests/misc/projects/Issue4250/compile-fail.hxml.stderr

@@ -0,0 +1,5 @@
+Main.hx:11: characters 8-30 : SomeNode should be Node
+Main.hx:11: characters 8-30 : SomeNode should be { parent : Node }
+Main.hx:11: characters 8-30 : Invalid type for field parent :
+Main.hx:11: characters 8-30 : SomeNode should be Node
+Main.hx:11: characters 8-30 : SomeNode should be { parent : Node }