Skip to content

Instantly share code, notes, and snippets.

@SimonRichardson
Last active December 17, 2015 03:09
Show Gist options
  • Select an option

  • Save SimonRichardson/5541205 to your computer and use it in GitHub Desktop.

Select an option

Save SimonRichardson/5541205 to your computer and use it in GitHub Desktop.
Abstract enum issue when nesting enums. Gives error message: Test.hx:5: characters 8-39 : AType<AType<Int>> should be A<A<Int>>
class Test {
static function main(){
var val0 : A<Int> = a(1); // This is fine.
trace(val0);
var val1 : A<A<Int>> = a(a(1)); // This fails.
trace(val1);
}
}
enum AType<T> {
a(v : T);
}
abstract A<T>(AType<T>) from AType<T> to AType<T> {
public function new(a : AType<T>) {
this = a;
}
}
@SimonRichardson
Copy link
Copy Markdown
Author

Compile with haxe -x Test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment