'has type' construct doesn't work
I extended the Entity lang with the following templates:
Definition.VarDecl = <var <ID>:<ID>> Definition.PropRef = <propRef <ID>.<ID>>and binding rules:
VarDecl(v, e): refers to Entity e defines Var v of type e PropRef(v, p): refers to Var v refers to Property p in Entity e where v has type eIn the following program, the last occurence of
namegives an unresolved reference while it should actually reference the propertynameof EntityUser:module example entity User { name : String } var v1:User propRef v1.nameIs something broken or did I do something wrong?
Submitted by Oskar van Rest on 23 March 2014 at 06:13
Issue Log
btw, the following error shows up in the console:
Could not create task for property Type on term "v1"But when I select either of occurences
v1, the properties view does show that it is of typeUser.
The
has typeproposition does not work onvbecause there is no typing rule for it. You need to wrap it in a constructor, such asVarRef, and create a typing rule for it in TS:VarRef(v) : ty where definition of v : tyI’ve seen people use this pattern a few times before, we should support getting the type of a name with a resolution task, with
has type, for simple cases like these.
Was this fixed, Oskar?
Yes it did, closing the issue…
Log in to post comments