Last active
December 17, 2015 03:09
-
-
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>>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compile with
haxe -x Test