Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pattern groups with GADT #2459

Closed
ncannasse opened this issue Dec 11, 2013 · 0 comments
Closed

Pattern groups with GADT #2459

ncannasse opened this issue Dec 11, 2013 · 0 comments

Comments

@ncannasse
Copy link
Member

Only patterns having the same type should be allowed to be grouped:

enum A<T> {
    X : A<Bool>;
    Y : A<Int>;
    Z : A<Int>;
}

class Test {

    static function foo<T>( a : A<T> ) : T {
        return switch( a ) {
        case X,Y: false; // should not be allowed
        case Z: 0; // we should still be allowed to have Y,Z
        }
    }

    static function main() {
        trace([foo(X),foo(Y),foo(Z)]);      
    }
}
@Simn Simn closed this as completed in 277f84a Dec 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant