Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpectedly no type error for invalid module qualification #2685

Closed
triska opened this issue Dec 7, 2024 · 5 comments
Closed

Unexpectedly no type error for invalid module qualification #2685

triska opened this issue Dec 7, 2024 · 5 comments

Comments

@triska
Copy link
Contributor

triska commented Dec 7, 2024

As mentioned in #2684 (comment):

?- p(X):true.
   true, unexpected.

In fact, we also have:

?- X:true.
   true. % unexpected (?)
@mthom
Copy link
Owner

mthom commented Dec 19, 2024

Should n+\user:t throw a type error then? Observe:

?- write_canonical(n+\user:t), nl.
:(+\(n,user),t)
   true.

@UWN
Copy link

UWN commented Dec 19, 2024

?- :(+\(n,user),t).
   existence_error(procedure,(+\):t/0), unexpected.
   type_error(atom,+\(n,user)). % expected, but not found

SICStus and SWI agree here.

@triska
Copy link
Contributor Author

triska commented Dec 20, 2024

Now:

?- X:true.
   error(type_error(atom,user:_514:true),call/0), unexpected.

I have not specified the type of X, so a type error is inappropriate (X may as well become an atom!).

@UWN
Copy link

UWN commented Dec 20, 2024

?- X:true.
   error(type_error(atom,user:_514:true),call/0), unexpected.
   instantiation_error. % expected, but  not found

@triska
Copy link
Contributor Author

triska commented Dec 26, 2024

Thank you a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants