https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127657
Bug ID: 127657
Summary: Intrinsic procedure functions should filter spelling
hints based on context
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: ---
Consider:
$ cat valspell.mod
MODULE valspell ;
CONST
CARDINAl = 1 ;
VAR
c: CARDINAL ;
i: INTEGER ;
BEGIN
i := 1 ;
c := VAL (CARDIN, i)
END valspell.
$ gm2 valspell.mod
valspell.mod:10:14: error: In program module ‘valspell’: undeclared type found
in builtin procedure function VAL ‘CARDIN’, did you mean CARDINAl?
10 | c := VAL (CARDIN, i)
| ^~~~~~
the 1st parameter to VAL is a type and the spell hint could filter on all
types, avoiding the CARDINAl candidate.