GrammaticalFramework / gf-core

Grammatical Framework core: compiler, shell & runtimes
https://www.grammaticalframework.org
Other
131 stars 35 forks source link

Misleading error message when using `=` in place of `:` #139

Open inariksit opened 2 years ago

inariksit commented 2 years ago

Here's a typical error when creating some lincat:

lincat  VPS2 = X.VPS ** {c2 = Compl} ;

i.e. using, in error, c2 = Compl instead of the correct c2 : Compl.

The error message is this:

      record type expected for: v
       instead of the inferred: {s : Agr => Str; lock_VPS : {};
                                 sc : NPForm} ** {c2 = {s : Str; c : NPForm; isPre : Bool}}

All information is there, it is even showing the misplaced = in the message, but it's confusing because it says "record type expected" and then showing something that looks very much like a record, except for that one character. A better error message would point out the = sign and suggest a colon.