Skip to content

Error while typing inlined call in object parent. #2265

@nicolasstucki

Description

@nicolasstucki
object Test {
  def main(args: Array[String]): Unit = Foo.foo
}

object Foo extends Bar {
  inline def foo: Unit = bar
}

class Bar {
  def bar: Unit = println("bar")
}
exception while typing /* inlined from Foo*/ pleted (0/1, 1s)
  {
    final lazy module val Foo: Foo = Foo
    Foo.bar
  } of class class dotty.tools.dotc.ast.Trees$Inlined # 139
exception while typing def main(args: Array[String]): Unit = 
  /* inlined from Foo*/ 
    {
      final lazy module val Foo: Foo = Foo
      Foo.bar
    } of class class dotty.tools.dotc.ast.Trees$DefDef # 172
exception while typing @scala.annotation.internal.SourceFile("/Users/nicolas.stucki/GitHub/dotty/compiler/../tests/run/inline-1.scala")
   
final module class Test() extends Object() { 
  def main(args: Array[String]): Unit = 
    /* inlined from Foo*/ 
      {
        final lazy module val Foo: Foo = Foo
        Foo.bar
      }
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 175
exception while typing package <empty> {
  final lazy module val Test: Test = new Test()
  @scala.annotation.internal.SourceFile(
    "/Users/nicolas.stucki/GitHub/dotty/compiler/../tests/run/inline-1.scala"
  ) final module class Test() extends Object() { 
    def main(args: Array[String]): Unit = 
      /* inlined from Foo*/ 
        {
          final lazy module val Foo: Foo = Foo
          Foo.bar
        }
  }
  final lazy module val Foo: Foo = new Foo()
  @scala.annotation.internal.SourceFile(
    "/Users/nicolas.stucki/GitHub/dotty/compiler/../tests/run/inline-1.scala"
  ) final module class Foo() extends Bar() { 
    @Foo.bar inline def foo: Unit = Foo.bar
  }
  @scala.annotation.internal.SourceFile(
    "/Users/nicolas.stucki/GitHub/dotty/compiler/../tests/run/inline-1.scala"
  ) class Bar() extends Object() { 
    def bar: Unit = println("bar")
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 201
*** error while checking /Users/nicolas.stucki/GitHub/dotty/compiler/../tests/run/inline-1.scala after phase classOf ***
    Compilation failed for: '../tests/run/inline-1.scala'  

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions