浏览代码

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

Rudy Ges 7 月之前
父节点
当前提交
07bedce773
共有 1 个文件被更改,包括 18 次插入0 次删除
  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);
+	}
 }