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

using an unimported type gives a bad error message #1174

Open
johnynek opened this issue Mar 17, 2024 · 1 comment
Open

using an unimported type gives a bad error message #1174

johnynek opened this issue Mar 17, 2024 · 1 comment

Comments

@johnynek
Copy link
Owner

For instance if you import and call a function that returns a type say Prop, but you haven't imported the Prop, you get an unknown type error:

unknown type: Bosatsu/Properties::Prop

but it should say, unimported type, since we know that type exists. We should give an error message like: you must add from Bosatsu/Properties import Prop to this file.

@johnynek johnynek changed the title using an unimproved type gives a bad error message using an unimported type gives a bad error message Mar 23, 2024
@johnynek
Copy link
Owner Author

A short term improvement would be to change the error message here:

case Infer.Error.UnknownDefined(const, reg) =>

to say "unimported type" not "unknown". We know the type since we have the full name, but we haven't imported it fully. That is an improvement until #946 is implemented.

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

1 participant