Skip to content

Conversation

@Keno
Copy link
Member

@Keno Keno commented Nov 28, 2025

The flisp parser rejects expressions like [1,2].[(1,2)] with a syntax error, but JuliaSyntax was allowing them to parse and then fail at runtime with a confusing MethodError about getproperty.

Note that in the flisp parser, this was allowed in the parser, but then disallowed in lowering. It's all a bit messy. My preference is to disallow this at the parser level for now and then introduce this as a proper feature with syntax evolution in the future. I don't think we want the production here to match what the flisp parser used to do. Given all those considerations, I think a syntax error is appropriate here for the moment.

Fixes #60270

The flisp parser rejects expressions like `[1,2].[(1,2)]` with a syntax
error, but JuliaSyntax was allowing them to parse and then fail at
runtime with a confusing MethodError about getproperty.

This adds a check in `parse_call_chain` to emit a syntax error when
`[` or `{` follows `.`, matching the flisp parser's behavior.

Fixes #60270
@Keno Keno requested a review from mlechu November 28, 2025 20:41
@Keno Keno changed the title Fix Julia issue 60270 JuliaSyntax: Disallow broadcasted getindex Nov 28, 2025
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

Successfully merging this pull request may close these issues.

JuliaSyntax does not reject broadcasted getindex

3 participants