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

Bug with PatternParameter while parsing with parseCompilationUnit #148

Open
Podmev opened this issue May 4, 2018 · 0 comments
Open

Bug with PatternParameter while parsing with parseCompilationUnit #148

Podmev opened this issue May 4, 2018 · 0 comments

Comments

@Podmev
Copy link

Podmev commented May 4, 2018

AssertError is thrown while parsing valid compiling code:

import ceylon.ast.redhat {
    parseCompilationUnit
}
shared void foo() {
    print({ "1"->"2" }.filter((a->b) => true));
}

String fooLiteral =
        """shared void foo() {
                 print({ "1"->"2" }.filter((a->b) => true));
           }
           """;

shared void fooParse(){
    print(parseCompilationUnit(fooLiteral));
}

Stack trace:

Exception in thread "main" ceylon.language.AssertionError "Assertion failed
	violated is JParameterDeclaration|JInitializerParameter parameter
		expression has class com.redhat.ceylon.compiler.typechecker.tree::Tree.PatternParameter which is not a subtype of com.redhat.ceylon.compiler.typechecker.tree::Tree.ParameterDeclaration|com.redhat.ceylon.compiler.typechecker.tree::Tree.InitializerParameter"
	at ceylon.ast.redhat.parameterToCeylon_.parameterToCeylon(Parameter.ceylon:21)
	at ceylon.ast.redhat.parametersToCeylon_$1.$call$(Parameters.ceylon)
	at ceylon.ast.redhat.parametersToCeylon_$1.$call$(Parameters.ceylon:17)
	at ceylon.ast.redhat.propagateUpdate_$1.$call$(propagateUpdate.ceylon:16)
	at ceylon.ast.redhat.propagateUpdate_$1.$call$(propagateUpdate.ceylon:16)
	at ceylon.language.Iterable$impl$3$1.next(Iterable.ceylon:400)
	at com.redhat.ceylon.compiler.java.language.ConstantIterable$1.next(ConstantIterable.java:51)
	at ceylon.language.Array.createArrayFromIterable(Array.java:164)
	at ceylon.language.Array.<init>(Array.java:112)
	at ceylon.language.Iterable$impl.sequence(Iterable.ceylon:286)
	at ceylon.language.impl.BaseIterable.sequence(bases.ceylon)
	...
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