Refers to clause on nullary constructor pattern produces code that does nothing
The binding rule:
This(): refers to Field "this"
translates to
nabl-get-name : This() -> "this" nabl-use-site(|lang__, partition__, uniques__, uris__, states__) = ?This() ; origin-track-forced(This()|)
which doesn’t do anything.
Submitted by Gabriël Konat on 13 November 2013 at 15:16
Issue Log
This actually works, if the term is the reference itself:
This(): refers to Field This()
I think the general problem here is that the name is not part of the pattern.
I think it is an error, if the name is not part of the pattern. It causes all kinds of problems. Where should the annotation go? What should
get-name
return? What is the annotation of the returned name? Instead, I think you should either use a desugaring fromThis()
toFieldRef("this")
, if you really like to use the string version, or the term itself as the name.If you agree, please close.
That’s fine with me, but we should show an error for cases like these that we don’t handle.
In NaBL Core, I enforce variables in the syntax of defines clause. Alternatively, you can use a string for implicit definitions, which results in a different constructor for the defines clause. The latter might be generalised to arbitrary terms, except for variables.
Log in to post comments