Menu

#122 No error when prolog function has wrong arity

open
nobody
None
5
2006-12-01
2006-12-01
No

In the following example selectors B and C are invalid because isClassWithName has 2 parameters:

superimposition
A = { C | isClassWithName(C,'foo') }; // ok
B = { C | isClassWithName(C) }; // wrong
C = { C | isClassWithName(C, 'foo', 'bar') }; // wrong
==========
The expected behaviour would be an error or warning message that there is no isClassWithName with 1 or 3 parameters. The actual behaviour is a warning that the selectors don't match any language elements with no indication of the real problem:
==========
foo.cps(35): LOLA warning : Selector does not match any program elements
foo.cps(36): LOLA warning : Selector does not match any program elements
==========

Discussion


Log in to post a comment.

Auth0 Logo