Last active
December 16, 2015 03:48
-
-
Save back2dos/5372178 to your computer and use it in GitHub Desktop.
Inference issue.
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
| package ; | |
| abstract Abstract<T>(T->Void) from (T->Void) { | |
| function new(f:T->Void) | |
| this = f; | |
| } | |
| class Example { | |
| static function testAbstract(c:Abstract<haxe.ds.Option<Bool>>) { } | |
| static function testFunction(c:haxe.ds.Option<Bool>->Void) { } | |
| static function main() { | |
| testFunction(function (x) $type(x));//haxe.ds.Option<Bool> | |
| testFunction(function (x) x = None);//works | |
| testAbstract(function (x) $type(x));//Unknown<0> | |
| testAbstract(function (x) x = None);//Unknown identifier None | |
| var f = function (x) { } | |
| testAbstract(f); | |
| $type(f);//haxe.ds.Option -> Bool | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment