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

Parse error with receiver-less predicate method call #356

Open
yhara opened this issue Jun 9, 2022 · 1 comment
Open

Parse error with receiver-less predicate method call #356

yhara opened this issue Jun 9, 2022 · 1 comment

Comments

@yhara
Copy link
Collaborator

yhara commented Jun 9, 2022

Given

class A
  def foo?(x: Object) -> Bool
    true
  end
  def bar
    foo?(1) or foo?(2)
  end
end

Result

Error: expected Colon but got Separator

Seems that ? is treated as conditional operator.

Workaround

Parse succeeds with explicit self.

class A
  def foo?(x: Object) -> Bool
    true
  end
  def bar
    self.foo?(1) or self.foo?(2)
  end
end
@yamakoud
Copy link
Contributor

yamakoud commented Jan 4, 2024

It's good for me.

I'll work for this later.

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