gracelang / minigrace

Self-hosting compiler for the Grace programming language
39 stars 22 forks source link

Can't create an alias for an implicit writer method #320

Open apblack opened 4 years ago

apblack commented 4 years ago

A class (graceScope in module scope)contains a var declaration:

    var node is public

This implicitly creates a method node:=(nu) in that class. However, if one attempts to inherit from graceScope and create an alias for that method:

    inherit graceScope
        alias superNode:=(n) = node:=(n)

minigrace incorrectly raises an error:

scope.grace[346:32-40]: Syntax error: can't define an alias for node:=(_) because it is not present in the inherited object
 345:         alias superClear = clear
 346:         alias superNode:=(n) = node:=(n)
-------------------------------------^^^^^^^^^

Until this is fixed, the workaround is to change the name of the variable, and declare the reader and writer methods explicitly.