Skip to content

Instantly share code, notes, and snippets.

@Simn
Created March 18, 2014 19:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Simn/9627713 to your computer and use it in GitHub Desktop.
Save Simn/9627713 to your computer and use it in GitHub Desktop.
haxe GADT + tuple bug
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