Skip to content

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

@apblack

Description

@apblack

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions