-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
find-member recursion #18263
Comments
@soronpo I have same questions as in #18253:
|
It's a bug. This should compile. Dale is working with the following only slightly minimized form: final class Bar
final class Inv[T]
class Foo extends scala.reflect.Selectable:
type Boo = Bar
final given Boo = new Bar
class Test:
def mkInv(using bar: Bar): Inv[bar.type] = new Inv()
def test: Unit =
val foo1 /* : Foo { val foo2: { z1 => Foo { val inv1: Inv[(z1.given_Boo : z1.Boo)] }}} */ = new Foo:
val foo2 /* : { z1 => Foo { val inv1: Inv[(z1.given_Boo : z1.Boo)] }} */ = new Foo:
val inv1 /* : Inv[( given_Boo : Boo)] */ = mkInv /* (this.given_Boo) */
val inv2 = foo1.foo2.inv1 // error
() Note the added comments with the inferred structural types. This has to do with |
The workaround is to replace |
I'm not exactly sure if this minimizations are correct. The bisect of reproducer from #18495 (duplicate of this issue) based on the actual library in which this bug was found pointed to ded5d25 so the last good nightly was 3.3.1-RC1-bin-20230504-0e00420-NIGHTLY. |
You are right, but I think this is a case where "two wrongs make a right". This minimization shows a bug that always existed. The change in the compiler in ded5d25 just caused the bug to surface for the LTS release and the DFiant library use-case. |
Speaking to Martin, we should be able to consider a refined |
Not completely sure there is a bug. I found this trying to minimize a regression that yielded this bug, but eventually got an example that fails on all 3.x.x releases.
Compiler version
3.x.x
Minimized code
Output
Expectation
No error.
The text was updated successfully, but these errors were encountered: