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

Duplicate similar errors. #6786

Open
esdrubal opened this issue Dec 12, 2024 · 0 comments
Open

Duplicate similar errors. #6786

esdrubal opened this issue Dec 12, 2024 · 0 comments
Assignees
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen

Comments

@esdrubal
Copy link
Contributor

Right now we are getting repeated similar errors:

          error
            --> /home/marcos/Documents/dev/sway3/test/src/e2e_vm_tests/test_programs/should_fail/language/import_star_name_clash/src/main.sw:37:35
             |
          35 | 
          36 | // Error: MyEnum is ambiguous
          37 | fn bad_enum_project_my_enum_b(e : MyEnum) -> u64 {
             |                                   ^^^^^^ Could not find symbol "MyEnum" in this scope.
          38 |     match e {
          39 |  // Error - MyEnum::A and MyEnum::B are ambiguous - not reported because the signature is faulty
             |
          ____

          error
            --> /home/marcos/Documents/dev/sway3/test/src/e2e_vm_tests/test_programs/should_fail/language/import_star_name_clash/src/main.sw:37:35
             |
          35 | 
          36 | // Error: MyEnum is ambiguous
          37 | fn bad_enum_project_my_enum_b(e : MyEnum) -> u64 {
             |                                   ^^^^^^ Unknown type name "MyEnum".
          38 |     match e {
          39 |  // Error - MyEnum::A and MyEnum::B are ambiguous - not reported because the signature is faulty
             |

To fix this we can make the following method call return the error if there is one to avoid similar errors:

let type_decl_opt = resolve_qualified_call_path(
handler,
engines,
namespace,
module_path,
&qualified_call_path,
self_type,
subst_ctx,
check_visibility,
)
.ok();

@esdrubal esdrubal added the compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen label Dec 12, 2024
@esdrubal esdrubal self-assigned this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
Projects
None yet
Development

No branches or pull requests

1 participant