Skip to content

Commit

Permalink
[tests] Add test for #8812 (#11953)
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz authored Jan 29, 2025
1 parent d67606a commit 07bedce
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/unit/src/unit/TestMisc.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 07bedce

Please sign in to comment.