Skip to content

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

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

Closed
nicolasstucki opened this issue Apr 30, 2019 · 0 comments

Comments

@nicolasstucki
Copy link
Contributor

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)
nicolasstucki added a commit that referenced this issue May 6, 2019
Fix #6395: Drop expected type in inlineCall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant