Skip to content

Calling an extension method after an inline extension method fails assertion #6395

Closed
@nicolasstucki

Description

@nicolasstucki
object Foo {
  inline def (self: Int) foo (that: Int): Int = 5
  def (self: Int) bar: Int = 5
  1.foo(2).bar
}

fails with

java.lang.AssertionError: assertion failed: dotty.tools.dotc.typer.Applications$ExtMethodApply@47e while compiling Foo.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: dotty.tools.dotc.typer.Applications$ExtMethodApply@47e
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
	at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldMoreCases(Trees.scala:1469)
	at dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1464)
	at dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1481)
	at dotty.tools.dotc.typer.Inliner$$anon$5.traverse(Inliner.scala:1115)
	at dotty.tools.dotc.typer.Inliner.dropUnusedDefs(Inliner.scala:1118)
	at dotty.tools.dotc.typer.Inliner.inlined(Inliner.scala:521)
	at dotty.tools.dotc.typer.Inliner$.inlineCall(Inliner.scala:109)
	at dotty.tools.dotc.typer.Typer.adaptNoArgsOther$6(Typer.scala:2775)
	at dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:2868)
	at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3077)
	at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2499)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2289)
	at dotty.tools.dotc.typer.Typer.typeSelectOnTerm$1(Typer.scala:461)
	at dotty.tools.dotc.typer.Typer.typedSelect(Typer.scala:484)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2093)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2166)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2201)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2213)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2256)

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