To facilitate name binding a single s in concrete syntax produces the following AST

Node(
  NaBLHelp(
    "s"{Use([Def("/ Module:debug#0 / Rule:enRoll#0 / Variable:s#0 /")])}, Use()
  ),
  None(),
  None(){Scope([(NablNsThisForAttr(), "/ anon 1 /")])}
){(Type(), ["Student"])}

However running

test Type of parameter ref  [[
  [[s]].
]] run debug to "Student"{_}

yields NaBLHelp("s"{Use(Result(168))},Use) pointing at the nested NaBLHelp constructor

This causes run get-type to fail in

test Type of parameter ref  [[
  [[s]].
]] run get-type to "Student"{_}

(Note that NaBLHelp(name, Use()) and NaBLHelp(name, Def()) are used to distinguish use and definition sites, but the outer constructor actually defines what is defined or used.)

Submitted by Daco Harkes on 2 December 2014 at 10:47

On 2 December 2014 at 11:44 Daco Harkes commented:

I also have an example where the type is actually in the first child.

Debug gives NaBLHelp(AttrRef("name"{Use(Result(174))}){(NablProp_multiplicity,Result(179)),(Type,Result(177))},Bind), while AttrRef has the type annotation.

Log in to post comments