Ampersand icon indicating copy to clipboard operation
Ampersand copied to clipboard

Compile time restrictions w.r.t SESSION

Open stefjoosten opened this issue 1 year ago • 3 comments

What happened

I got a run time error message immediately after deploying a script: afbeelding 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: afbeelding 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 afbeelding

Version of ampersand that was used

Steps to reproduce

Screenshot / Video

Context / Source of ampersand script

stefjoosten avatar Dec 23 '23 07:12 stefjoosten