Skip to content

Crash with inline accessor for implicit functions #5295

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 Oct 19, 2018 · 0 comments · Fixed by #6305
Closed

Crash with inline accessor for implicit functions #5295

nicolasstucki opened this issue Oct 19, 2018 · 0 comments · Fixed by #6305

Comments

@nicolasstucki
Copy link
Contributor

nicolasstucki commented Oct 19, 2018

inline def foo: String = bar given (4)
private def bar: given Int => String = "baz"

crashes with

checking tests/run/tasty-getfile/Macro_1.scala after phase MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments}
result of tests/run/tasty-getfile/Macro_1.scala after Ycheck:
  Unchanged since MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments}
exception occurred while compiling tests/run/tasty-getfile/Macro_1.scala
Exception in thread "main" scala.MatchError: Ident(bar) (of class dotty.tools.dotc.ast.Trees$Ident)
	at dotty.tools.dotc.transform.ShortcutImplicits.splitClosure$1(ShortcutImplicits.scala:115)
	at dotty.tools.dotc.transform.ShortcutImplicits.transformDefDef(ShortcutImplicits.scala:136)
	at dotty.tools.dotc.transform.MegaPhase.goDefDef(MegaPhase.scala:941)
	at dotty.tools.dotc.transform.MegaPhase.goDefDef(MegaPhase.scala:942)
	at dotty.tools.dotc.transform.MegaPhase.goDefDef(MegaPhase.scala:942)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:248)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
	at dotty.tools.dotc.transform.MegaPhase.transformStat$1(MegaPhase.scala:404)
	at dotty.tools.dotc.transform.MegaPhase.$anonfun$transformStats$2(MegaPhase.scala:409)
	at scala.collection.immutable.List.mapConserve(List.scala:179)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:339)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
	at dotty.tools.dotc.transform.MegaPhase.transformNamed$1(MegaPhase.scala:251)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:394)
	at dotty.tools.dotc.transform.MegaPhase.transformStat$1(MegaPhase.scala:404)
	at dotty.tools.dotc.transform.MegaPhase.$anonfun$transformStats$2(MegaPhase.scala:409)
	at scala.collection.immutable.List.mapConserve(List.scala:179)
	at dotty.tools.dotc.transform.MegaPhase.transformStats(MegaPhase.scala:409)
	at dotty.tools.dotc.transform.MegaPhase.mapPackage$1(MegaPhase.scala:356)
	at dotty.tools.dotc.transform.MegaPhase.transformUnnamed$1(MegaPhase.scala:359)
	at dotty.tools.dotc.transform.MegaPhase.transformTree(MegaPhase.scala:396)
	at dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:415)
	at dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:427)
	at dotty.tools.dotc.core.Phases$Phase.$anonfun$runOn$1(Phases.scala:316)
	at scala.collection.immutable.List.map(List.scala:286)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:314)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:158)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at dotty.tools.dotc.util.Stats$.trackTime(Stats.scala:49)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$2(Run.scala:155)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$2$adapted(Run.scala:153)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:198)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:153)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$1(Run.scala:178)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:102)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:133)
	at dotty.tools.dotc.Run.compileSources(Run.scala:120)
	at dotty.tools.dotc.Run.compile(Run.scala:104)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:33)
	at dotty.tools.dotc.Driver.process(Driver.scala:170)
	at dotty.tools.dotc.Driver.process(Driver.scala:139)
	at dotty.tools.dotc.Driver.process(Driver.scala:151)
	at dotty.tools.dotc.Driver.main(Driver.scala:178)
	at dotty.tools.dotc.Main.main(Main.scala)
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.

1 participant