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

Internal error with initialization check #15465

Closed
liufengyun opened this issue Jun 16, 2022 · 1 comment · Fixed by #15606
Closed

Internal error with initialization check #15465

liufengyun opened this issue Jun 16, 2022 · 1 comment · Fixed by #15606

Comments

@liufengyun
Copy link
Contributor

Compiler version

Master

Minimized code

With -Ysafe-init:

class TestSuite:
  protected val it = new ItWord

  protected final class ItWord:
    def should(string: String) = new ItVerbString("should", string)

  private def registerTestToRun(fun: => Any): Unit = ()

  protected final class ItVerbString(verb: String, name: String):
    inline def in(testFun: => Any): Unit = registerTestToRun(testFun)

class MyTest extends TestSuite:
  it should "not cause outer select errors" in {
    assert(1 + 1 == 2)
  }

  val n = 10

Output

unexpected outerSelect, thisV = Warm(class ItVerbString,ThisRef(class MyTest),method <init>,List(Hot, Hot)), target = class MyTest, hops = 1

Expectation

The code should compile without issue. This is blocked by #15374 . It should work once #15374 is fixed.

@liufengyun liufengyun added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 16, 2022
@liufengyun liufengyun self-assigned this Jun 16, 2022
@liufengyun liufengyun added area:initialization and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 16, 2022
@liufengyun
Copy link
Contributor Author

Need to revert 73b3331 once this issue is fixed.

liufengyun added a commit to dotty-staging/dotty that referenced this issue Jul 6, 2022
liufengyun added a commit to dotty-staging/dotty that referenced this issue Jul 6, 2022
liufengyun added a commit that referenced this issue Jul 7, 2022
Fix #15465: Use resolveThis for outerSelect resolution
@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants