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

if(_)then(_)else(_) not allowed as reciever #316

Open
apblack opened this issue Jan 19, 2020 · 0 comments
Open

if(_)then(_)else(_) not allowed as reciever #316

apblack opened this issue Jan 19, 2020 · 0 comments

Comments

@apblack
Copy link
Contributor

apblack commented Jan 19, 2020

Because if(_)then(_)else(_) is treated by minigrace as a special from, not as a request, there are a number of places where you can't use it.

Specifically, this source code won't compile:

if (aSourceNode.numArgs == 0) then {
    ast.memberNode.new(request, receiver)
} else {
    ast.callNode.new(receiver, aSourceNode.parts)
}.setScope(nodeScope)

As I attempted to write on line 198 of identifierresolution.

The root problem is that minigrace's identifier resolution uses case analysis, and simply does not consider this case. If it used OOP and method dispatch, this would not be an issue.

No re-writing of the receiver is necessary, so nothing has to be done — but the case needs to be recognized.

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