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

[Bug][move-compiler-v2] Mysterious error message about variants in use_struct_overlap_with_module test case #14632

Open
brmataptos opened this issue Sep 14, 2024 · 0 comments
Labels

Comments

@brmataptos
Copy link
Contributor

🐛 Bug

V1 and V2 (when using language V1) both successfully compile the test case use_struct_overlap_with_module.move:

  • ./third_party/move/move-compiler-v2/tests/checking-lang-v1/use_struct_overlap_with_module.move
  • ./third_party/move/move-compiler/tests/move_check/expansion/use_struct_overlap_with_module.move

However, when V2 compiler builds for language V2, it yields a weird error message on this case:

  • ./third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.move
% cat ./third_party/move/move-compiler-v2/tests/more-v1/expansion/use_struct_overlap_with_module.exp                                                       

Diagnostics:
warning: unused alias
  ┌─ tests/more-v1/expansion/use_struct_overlap_with_module.move:7:14
  │
7 │     use 0x2::X::{Self, S as X};
  │              ^ Unused 'use' of alias 'X'. Consider removing it

error: variants not allowed in this context
  ┌─ tests/more-v1/expansion/use_struct_overlap_with_module.move:8:27
  │
8 │     struct A { f1: X, f2: X::S }
  │                           ^^^^

It looks like a bug in the name resolution related to structs/variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant