We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.6.3
object X: extension (s: String) def huh = s.reverse object Y: def f(): String = import X.huh val huh = "huh".huh huh @main def test() = println: Y.f()
huh
DNC as with
val huh = huh("huh")
because the extension fails the visible under a simple name test.
visible under a simple name
The doc says
If m is imported by several imports which are all on the nesting level, try each import as an extension method instead of failing with an ambiguity.
That is, relaxed imports disambiguates among possible imports, not between an import and a local definition.
If the weird behavior is intended, then the doc should be more explicit about this use case.
Noticed at https://github.com/scala/scala3/blob/3.6.3/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala#L2709
where the diff looks unintended:
Imports are not relaxed with respect to local extension methods:
object Z: import X.huh extension (i: Int) def huh = i.toString.reverse val huh = "huh".huh // Required: Int def f(): String = huh
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Compiler version
3.6.3
Minimized code
Output
Expectation
DNC as with
because the extension fails the
visible under a simple name
test.The doc says
That is, relaxed imports disambiguates among possible imports, not between an import and a local definition.
If the weird behavior is intended, then the doc should be more explicit about this use case.
Noticed at https://github.com/scala/scala3/blob/3.6.3/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala#L2709
where the diff looks unintended:
Imports are not relaxed with respect to local extension methods:
The text was updated successfully, but these errors were encountered: