Skip to content

Reject infix operators on command call on writes#3949

Merged
kddnewton merged 1 commit intomainfrom
command-call-and-or
Mar 2, 2026
Merged

Reject infix operators on command call on writes#3949
kddnewton merged 1 commit intomainfrom
command-call-and-or

Conversation

@kddnewton
Copy link
Collaborator

Fixes #3106

@kddnewton kddnewton merged commit 4e71dbf into main Mar 2, 2026
67 checks passed
@kddnewton kddnewton deleted the command-call-and-or branch March 2, 2026 17:34
@Earlopain
Copy link
Collaborator

This is casting too wide a net. This code used to be ok but now isn't:

# steep-1.10.0/lib/steep/interface/function.rb
kp = keyword_params | other.keyword_params or return
                                           ^~ unexpected 'or', expecting end-of-input
                                           ^~ unexpected 'or', ignoring it

I have a few more cases in https://gist.github.com/Earlopain/908f5744ae2c32bf4ab1d0a590b4e6c5 but I did not check them all. They all seem rather similar though (a = prefix != nil and prefix.length > 0, query_options = options.keys & [:select, :where, :order, :limit] and !query_options.empty?, etc.) so guessing it's the same cause for now.

Can you take a look?

@Earlopain
Copy link
Collaborator

I reverted for now in #3960 with some added tests for this

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.

Assigning command call is allowed where rejected in parse.y

2 participants