Ampersand
Ampersand copied to clipboard
Compile time restrictions w.r.t SESSION
What happened
I got a run time error message immediately after deploying a script:
I was surprised because the compiler found my script correct and yet its deployment produces a database error. Since Ampersand must generate code that doesn't break, this is a bug.
Analysis
I made the script as small as I could, based on the assumption that there is something wrong with my use of "SESSION". This is the script:
CONTEXT Issue
RELATION link[SESSION*Link] [UNI]
POPULATION link[SESSION*Link] CONTAINS
[ ("_SESSION","P0")
]
INTERFACE ShowAll : "_SESSION";I[SESSION] BOX
[ Links : V[SESSION*Link] BOX
[ Link : I
, "Session (link~)" : link~
]
, Sessions : V[SESSION] BOX
[ Session : I
, "Link (link)" : link
]
]
ENDCONTEXT
And this is what I saw:
Obviously, I should not have obtained a red error message because Ampersand must never generate software that breaks. So even though this error message looks different, it exposes some way of using SESSION that isn't kosher.
What I expected
In the small example, I expected to see the following