https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127554

            Bug ID: 127554
           Summary: Spell checking hint opportunity missed when building a
                    contant aggrgate
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: gaius at gcc dot gnu.org
  Target Milestone: ---

Following on from PR-127469 the error message generated could be improved to
emit a spell check hint.

$ cat MODULE VT100Test ;

FROM STextIO IMPORT WriteString;

TYPE
     callType =  RECORD
                     callNick   : ARRAY [0..8] OF CHAR;
                     callString : ARRAY [0..20] OF CHAR;
                 END;

CONST (* M2 Iso way *)
     cls = CallType { "cls", "callstring" };

(*
CONST
     rec : CallType = { "cls", "callstring" };
*)

     BEGIN
     (* for testing purpose *)
     WriteString("hello")
END VT100Test.

$ gm2 constaggregate.mod 
constaggregate.mod:12:6: error: the type of the constant declaration ‘cls’
cannot be determined
   12 |      cls = CallType { "cls", "callstring" };
      |      ^~~
constaggregate.mod:12:12: error: In program module ‘VT100Test’: the constructor
type before the opening { is unknown
   12 |      cls = CallType { "cls", "callstring" };
      |            ^~~~~~~~

a better error message would suggest a spelling mistake callType vs. CallType.

Reply via email to