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

Confusing error messages when type mismatches involve types with same name #5985

Open
jjcnn opened this issue May 10, 2024 · 0 comments
Open
Labels
compiler: ui Mostly compiler messages

Comments

@jjcnn
Copy link
Contributor

jjcnn commented May 10, 2024

See test/src/e2e_vm_tests/test_programs/should_fail/language/import_star_name_clash/.

In the line the type of the argument is wrong:

    let my_enum_function_wrong_type = project_my_enum_b(my_enum_a_variant_legal); // Error - wrong MyEnum

The type of my_enum_a_variant_legal is a::MyEnum, but the argument type of project_my_enum_b is b::MyEnum. The error is caugt correctly with the following error message:

Mismatched types.
expected: MyEnum
found:    MyEnum.

This is clearly unhelpful. The found and expected types should report a full callpath to their respecitve declaration of MyEnum.

@jjcnn jjcnn added the compiler: ui Mostly compiler messages label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: ui Mostly compiler messages
Projects
None yet
Development

No branches or pull requests

1 participant