Created
March 18, 2014 19:35
-
-
Save Simn/9627713 to your computer and use it in GitHub Desktop.
haxe GADT + tuple bug
This file contains 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
enum E<T> { | |
BoolLit(b:Bool):E<Bool>; | |
IntLit(i:Int):E<Int>; | |
} | |
class Main { | |
static function main() { } | |
static function sameType<S>(o1:E<S>, o2:E<S>):Bool { | |
return switch [o1, o2] { // Unmatched patterns: [_,IntLit] | |
case [BoolLit(_), BoolLit(_)]: true; | |
case [IntLit(_), IntLit(_)]: true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment