Skip to content

Commit d35b3f1

Browse files
committed
add test for HaxeFoundation#4862
1 parent 10e888a commit d35b3f1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package unit.issues;
2+
3+
#if js
4+
@:native("__issue4862__http_status")
5+
@:enum private extern abstract HttpStatus(Int) to Int {
6+
var Ok;
7+
var NotFound;
8+
9+
static function __init__():Void {
10+
untyped __js__("var __issue4862__http_status = {Ok: 200, NotFound: 404};");
11+
}
12+
}
13+
#end
14+
15+
class Issue4862 extends Test {
16+
#if js
17+
function test() {
18+
var a = Ok;
19+
eq(200, a);
20+
var b = HttpStatus.NotFound;
21+
eq(404, b);
22+
// TODO: support unqualified matching
23+
t(switch (a) { case HttpStatus.Ok: true; default: false; });
24+
t(switch (b) { case HttpStatus.NotFound: true; default: false; });
25+
}
26+
#end
27+
}

0 commit comments

Comments
 (0)