Open radeusgd opened 1 month ago
I've encountered this problem when I was trying to understand our imports logic when working on the typechecker. I was surprised that ImportExportScope
has only typesOnlyNames
but it does not have anything to represent the hiding
concept.
This issue is partially blocking the typechecker work (#9812) because I need to replicate the logic for creating the runtime ModuleScope
but statically. Given that this bug means the logic will change, it is a bit hard to figure out how to replicate the not-yet-implemented logic. I will probably try to approximate it and then will refactor once this bug is fixed.
Project containing repro: testproject1.zip
The project above defines a type
Typ
defined inside of moduleTyp
, and extension methods defined in following modules:F1
we haveTyp.f1 self = 1
F23
we have analogousf2
andf3
F45
we havef4
andf4
.Then we do the following set of imports:
Actual behaviour
This yields the following output:
Expected behaviour
Instead, we would expect it to be:
The
f3
method should probably not show up because the import ishiding
it. But thef4
method is imported by name so it should be available. This is analogous to how we are doing exporting of extension methods - they are exported by the method name (#10274) (even if that may match multiple extension methods for various types). Imports should probably also be consistent with that.