We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10e888a commit d35b3f1Copy full SHA for d35b3f1
tests/unit/src/unit/issues/Issue4862.hx
@@ -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