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

Wrong auto-completion in the case of changing an Iterable when iterating over it #533

Open
1 task
iscas-zac opened this issue Dec 23, 2024 · 1 comment
Open
1 task

Comments

@iscas-zac
Copy link

Bug Report

Environment

OS

Operating System: Windows

MoonBit CLI Tools Version

moon 0.1.20241218 (5a38a2f 2024-12-18) ~\.moon\bin\moon.exe
moonc v0.1.20241218+f4a066f5f ~\.moon\bin\moonc.exe
moonrun 0.1.20241218 (5a38a2f 2024-12-18) ~\.moon\bin\moonrun.exe

Steps to Reproduce

let new_connect = {}
for _, v in new_connect {
  let (members, extensions) = v
  for i4 in extensions.iter() {
    new_connect[joinTo([i4, ..members]..sort())] = (
      [i4, ..members],
      Set::of([])
    )
  }
}

Expected Behavior

The extensions.iter() expression, it should fail to induce the full type of new_connect, alert that I am making changes to an Iterable when iterating over it, or accept all the code.

Actual Behavior

Instead, the language server makes a prediction for the iter method when I type extensions. (which indicates that it guesses the type correctly), but after I accept the auto-completion, it alerts on iter that "Type _/0 has no method iter." The case for members is the same.

Checklist

  • (Optional) My case is minimal enough to be reproducible.
@Young-Flash
Copy link
Collaborator

cc @bzy-debug

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

2 participants