Strange warning message from compile or listing

I’m using: SWI-Prolog version 8.3.21

I get a weird warning message when compiling or when listing a clause. Similar clauses produce no message. And I can make the message go away by removing a meta_predicate directive.
And, as far as I can tell the message is bogus (the resulting term expansion appears to be correct).

I can trace the code to bool/expand.pl predicate call_goal_expansion/5, where there’s a call to either M:goal_expansion(G0,P0,G,P) or M:goal_expansion(G0,G) … but when I single-step, all I get is the weird error message. (Question to @jan - how to trace such low-level predicates?)

This is the message from compiling (and a similar message from calling listing/1):

Warning: /home/peter/Downloads/extended_pos_msg_bug.pl:28:
Warning:    Unknown message: extended_pos(list_position(1376,1400,[term_position(1378,1398,1396,1397,[term_position(1378,1396,1386,1387,[1378-1386,1387-1396]),1397-1398])],none),7)
Warning: /home/peter/Downloads/extended_pos_msg_bug.pl:28:
Warning:    Unknown message: extended_pos(list_position(1376,1400,[term_position(1378,1398,1396,1397,[term_position(1378,1396,1386,1387,[1378-1386,1387-1396]),1397-1398])],none),7)

I can make the message go away by removing the meta_predicate directive on line 16.

The code can be downloaded from extended_pos_msg_bug.pl (1.6 KB)

To duplicate the bug, simply download the file and run:
swipl extended_pos_msg_bug.pl
The best spy point I could find was ci_expand.

1 Like