Browse Source

[tests] Add test for #8812 (#11953)

Rudy Ges 6 months ago
parent
commit
07bedce773
1 changed files with 18 additions and 0 deletions
  1. 18 0
      tests/unit/src/unit/TestMisc.hx

+ 18 - 0
tests/unit/src/unit/TestMisc.hx

@@ -108,6 +108,16 @@ enum abstract MyEnumAbstract(Int) {
 	var C = 3;
 }
 
+class Node {
+	public function new() {}
+
+	public function addNode<T:Node>(node:T):T {
+		return node;
+	}
+}
+
+class AnotherNode extends Node {}
+
 class TestMisc extends Test {
 	static var unit = "testing package conflict";
 
@@ -626,4 +636,12 @@ class TestMisc extends Test {
 		eq(8, 0b1000);
 		eq(0xFFFFFFFF, 0b11111111111111111111111111111111);
 	}
+
+	function test8812() {
+		var s:Node = new Node();
+		var n1 = new AnotherNode();
+		var f = s.addNode.bind(n1);
+		var n2:AnotherNode = f();
+		eq(n1, n2);
+	}
 }