Skip to content

Add inline changes semantics #15374

Closed
@liufengyun

Description

@liufengyun

Compiler version

master

Minimized code

class A(val x: Int):
  class X:
    inline def foo() = A.this.foo()           // remove inline changes semantics

  private def foo(): Unit = println(x)

class B extends A(20):
  val a = new A(10)
  val y: Y = new Y

  class Y extends a.X

class C:
  var b = new B
  b.y.foo()  // should print 10, but prints 20

@main
def test = new C()

Output

20

Expectation

It should print 10, but it prints 20.

Initial Diagnosis

The problem seems to be related to the encoding of outer-select in inlining. The example above seems to suggest that hops alone is ambiguous.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions