Menu

#437 Betere foutmelding gewenst bij type-checking van VIOLATIONs

new
nobody
None
<not fixed>
Type checker
low
bug
2014-11-13
2014-11-13
Rieks
No

Consider the script

{-1-} CONTEXT Session IN DUTCH LATEX
{-2-}
{-3-} persoonRol :: Persoon* Rol
{-4-} sessionUser:: SESSION * Persoon [UNI] -- ingelogde actor
{-5-} sessionRol :: SESSION * Rol -- geactiveerde rollen in de sessie
{-6-}
{-7-} RULE "Activeren van rollen": sessionUser;persoonRol |- sessionRol
{-8-} VIOLATION (TXT "Er is iets aan de hand met", TGT persoonRol)
{-9-}
{-10-} ENDCONTEXT

Which produces the error message

Error(s) found:
Type error, cannot match:
the concept "Persoon" (Src of persoonRol)
and concept "Rol" (Tgt of sessionUser;persoonRol |- sessionRol)
if you think there is no type error, add an order between concepts "Persoon" and "Rol".

Error at symbol RULE in file test.adl at line 7 : 1

Errorlevel = 10 - prototype files will not be installed

Note that the error message points to the line where the rule is defined, but the rule is OK. The error message should point to the line that contains the VIOLATION (the type error is in 'TGT persoonsRol'. While in this example this mis-reference is relatively easy to spot, this may not be the case when you actively document your rules with meanings, and the error is the result of the rule having been edited.

Related

Tickets: #437

Discussion

  • Bas Joosten

    Bas Joosten - 2014-11-13

    Ik pak deze wel op.

    On 13 Nov 2014, at 9:37 , Rieks rieksj@users.sf.net wrote:

    [tickets:#437] http://sourceforge.net/p/ampersand/tickets/437 Betere foutmelding gewenst bij type-checking van VIOLATIONs

    Status: new
    Milestone: Release 3.0.3 (current development)
    Created: Thu Nov 13, 2014 08:37 AM UTC by Rieks
    Last Updated: Thu Nov 13, 2014 08:37 AM UTC
    Owner: nobody

    Consider the script

    {-1-} CONTEXT Session IN DUTCH LATEX
    {-2-}
    {-3-} persoonRol :: Persoon* Rol
    {-4-} sessionUser:: SESSION * Persoon [UNI] -- ingelogde actor
    {-5-} sessionRol :: SESSION * Rol -- geactiveerde rollen in de sessie
    {-6-}
    {-7-} RULE "Activeren van rollen": sessionUser;persoonRol |- sessionRol
    {-8-} VIOLATION (TXT "Er is iets aan de hand met", TGT persoonRol)
    {-9-}
    {-10-} ENDCONTEXT

    Which produces the error message

    Error(s) found:
    Type error, cannot match:
    the concept "Persoon" (Src of persoonRol)
    and concept "Rol" (Tgt of sessionUser;persoonRol |- sessionRol)
    if you think there is no type error, add an order between concepts "Persoon" and "Rol".

    Error at symbol RULE in file test.adl at line 7 : 1

    Errorlevel = 10 - prototype files will not be installed

    Note that the error message points to the line where the rule is defined, but the rule is OK. The error message should point to the line that contains the VIOLATION (the type error is in 'TGT persoonsRol'. While in this example this mis-reference is relatively easy to spot, this may not be the case when you actively document your rules with meanings, and the error is the result of the rule having been edited.

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ampersand/tickets/437/ https://sourceforge.net/p/ampersand/tickets/437
    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions

     

    Related

    Tickets: #437

    • Bas Joosten

      Bas Joosten - 2014-11-13

      How's this as a message? (The numbering in your original script added 6 characters at the beginning of each line) Will try to send a pull request asap.

      Error(s) found:
      Type error, cannot match:
      the concept "Persoon" (Src of persoonRol, line 8 : 56)
      and concept "Rol" (Tgt of sessionUser;persoonRol |- sessionRol)
      if you think there is no type error, add an order between concepts "Persoon" and "Rol".
      Error at symbol RULE in file test.adl at line 7 : 7

       
      • Bas Joosten

        Bas Joosten - 2014-11-13

        Just created a pull-request (which can be merged automatically). I believe my work is done now. Please confirm this, or instruct me what to do.