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

too picky about precedence (violated is AssigningExpression right) #121

Closed
jvasileff opened this issue Sep 22, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@jvasileff
Copy link
Member

The typechecker accepts

class A(shared variable Anything b = null) {}
A().b = () => "violated is AssigningExpression right";

but ceylon.ast throws:

Assertion failed: Check precedence
        unviolated is ThenElseExpression left = expressionToCeylon(assignOperation.leftTerm, update)
        violated is AssigningExpression right = expressionToCeylon(assignOperation.rightTerm, update)
ceylon.language.AssertionError "Assertion failed: Check precedence
        unviolated is ThenElseExpression left = expressionToCeylon(assignOperation.leftTerm, update)
        violated is AssigningExpression right = expressionToCeylon(assignOperation.rightTerm, update)"
        at ceylon.ast.redhat.assignOperationToCeylon_.assignOperationToCeylon(AssignOperation.ceylon:16)
        at ceylon.ast.redhat.assignmentOperationToCeylon_.assignmentOperationToCeylon(AssignmentOperation.ceylon:20)
        at ceylon.ast.redhat.assignmentStatementToCeylon_.assignmentStatementToCeylon(AssignmentStatement.ceylon:16)
        at ceylon.ast.redhat.expressionStatementToCeylon_.expressionStatementToCeylon(ExpressionStatement.ceylon:20)
@lucaswerkmeister
Copy link
Member

It looks like the parser accepts any expression to the right-hand side of any assigning expression (including +=), so precedence just doesn’t exist on the rhs apparently.

lucaswerkmeister added a commit that referenced this issue Oct 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants