Describe the Bug
Pyrefly shows import suggestions also based on alias imports in other files. When using such an import it creates a from foo import NameAlias statement instead of from foo import Name as NameAlias. Here is a minimal example to reproduce it:
# model.py
class MyModel: pass
# alias_user.py
from pyrefly_repro.model import MyModel as MyModelAlias
# normal_user.py
x: MyM # and continue typing
Pressing enter results in an invalid import:
# normal_user.py
from pyrefly_repro.model import MyModelAlias # Could not import `MyModelAlias` from `pyrefly_repro.model`
x: MyModelAlias
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
VS Code with Pyrefly v0.53.0
Describe the Bug
Pyrefly shows import suggestions also based on alias imports in other files. When using such an import it creates a
from foo import NameAliasstatement instead offrom foo import Name as NameAlias. Here is a minimal example to reproduce it:Pressing enter results in an invalid import:
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
VS Code with Pyrefly v0.53.0