scryer-prolog icon indicating copy to clipboard operation
scryer-prolog copied to clipboard

incorrect line number in warning

Open grahamgower opened this issue 3 years ago • 1 comments

In contrast to errors, warnings print line numbers starting from 0 and appear to correspond to the line of the clause head rather than a more specific line inside the body.

foo(X).
foo(1) :-
    true,
    true,
    true,
    Y.
$ scryer-prolog foo.pl
Warning: singleton variables X at line 0 of foo.pl
Warning: singleton variables Y at line 1 of foo.pl

grahamgower avatar Mar 16 '22 13:03 grahamgower

Related to #302 What you can only expect (with reasonable effort) is the precise area of the complete clause. Everything else would imply a lot of extra work.

UWN avatar Mar 16 '22 14:03 UWN