|
@@ -1,29 +1,28 @@
|
|
package unit.issues;
|
|
package unit.issues;
|
|
|
|
|
|
import haxe.macro.Context.*;
|
|
import haxe.macro.Context.*;
|
|
-import haxe.ds.Option;
|
|
|
|
|
|
|
|
#if macro
|
|
#if macro
|
|
class Issue9828 {
|
|
class Issue9828 {
|
|
- static macro function foo() {
|
|
|
|
- var t = typeExpr(macro {
|
|
|
|
- var y:Option<String> = x;
|
|
|
|
- switch y {
|
|
|
|
- case Some(v): v;
|
|
|
|
- case None: '';
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ static macro function foo(e) {
|
|
|
|
+ var t = typeExpr(e);
|
|
return storeTypedExpr(t);
|
|
return storeTypedExpr(t);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
class Issue9828 extends unit.Test {
|
|
class Issue9828 extends unit.Test {
|
|
- var x = Some('hello');
|
|
|
|
|
|
+ var x = BadCtor(123);
|
|
|
|
|
|
function test() {
|
|
function test() {
|
|
- eq('hello', foo());
|
|
|
|
|
|
+ t(Type.enumEq(BadCtor(123), foo(BadCtor(123))));
|
|
}
|
|
}
|
|
|
|
|
|
static macro function foo(e:haxe.macro.Expr):haxe.macro.Expr;
|
|
static macro function foo(e:haxe.macro.Expr):haxe.macro.Expr;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+private typedef BadTypedef = BadGadt<Int>;
|
|
|
|
+
|
|
|
|
+private enum BadGadt<T> {
|
|
|
|
+ BadCtor(v:Int):BadTypedef;
|
|
|
|
+}
|
|
#end
|
|
#end
|