question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compiler crash when quoting an inline argument of function type

See original GitHub issue
$ dotty-0.8.0-RC1/bin/dotr
Starting dotty REPL...
scala> inline def h(inline f: Int => String): String = ~ '(f(42)) 

Exception in thread "main" java.lang.AssertionError: assertion failed: unresolved symbols: value f$1 when pickling rs$line$1
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:36)
	at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:634)
	at dotty.tools.dotc.core.quoted.PickledQuotes$.pickle(PickledQuotes.scala:98)
	at dotty.tools.dotc.core.quoted.PickledQuotes$.pickleQuote(PickledQuotes.scala:31)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.pickleAsTasty$1(ReifyQuotes.scala:394)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.pickledQuote(ReifyQuotes.scala:413)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.quotation(ReifyQuotes.scala:382)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:547)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transformWithCapturer$2(ReifyQuotes.scala:472)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.body$4(ReifyQuotes.scala:499)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.$anonfun$4(ReifyQuotes.scala:505)
	at dotty.tools.dotc.ast.tpd$.polyDefDef(tpd.scala:229)
	at dotty.tools.dotc.ast.tpd$.DefDef(tpd.scala:191)
	at dotty.tools.dotc.ast.tpd$.Closure(tpd.scala:103)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.makeLambda(ReifyQuotes.scala:505)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.split(ReifyQuotes.scala:523)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.splice(ReifyQuotes.scala:431)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:552)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.transform(MacroTransformWithImplicits.scala:84)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.mapOverTree$1(ReifyQuotes.scala:539)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:606)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:585)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.traverse$1(MacroTransformWithImplicits.scala:53)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.transformStats(MacroTransformWithImplicits.scala:60)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:60)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.transform(MacroTransformWithImplicits.scala:86)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.mapOverTree$1(ReifyQuotes.scala:539)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:606)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1211)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:54)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.transform(MacroTransformWithImplicits.scala:86)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.mapOverTree$1(ReifyQuotes.scala:539)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:606)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform$$anonfun$2(Trees.scala:1231)
	at scala.collection.immutable.List.mapConserve(List.scala:176)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1231)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transformStats(Trees.scala:1229)
	at dotty.tools.dotc.ast.Trees$Instance$TreeMap.transform(Trees.scala:1217)
	at dotty.tools.dotc.transform.MacroTransform$Transformer.transform(MacroTransform.scala:54)
	at dotty.tools.dotc.transform.MacroTransformWithImplicits$ImplicitsTransformer.transform(MacroTransformWithImplicits.scala:86)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.mapOverTree$1(ReifyQuotes.scala:539)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.op1$1(ReifyQuotes.scala:606)
	at dotty.tools.dotc.transform.ReifyQuotes$Reifier.transform(ReifyQuotes.scala:537)
	at dotty.tools.dotc.transform.MacroTransform.run(MacroTransform.scala:22)
	at dotty.tools.dotc.transform.ReifyQuotes.run(ReifyQuotes.scala:104)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:295)
	at scala.collection.immutable.List.map(List.scala:283)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:297)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:171)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:18)
	at scala.compat.java8.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:191)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:186)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:194)
	at scala.compat.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:88)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:201)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:141)
	at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:188)
	at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:197)
	at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:229)
	at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:202)
	at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:150)
	at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:154)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput$$anonfun$2$$anonfun$1(ReplDriver.scala:163)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
	at scala.Console$.withErr(Console.scala:192)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput$$anonfun$1(ReplDriver.scala:163)
	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:58)
	at scala.Console$.withOut(Console.scala:163)
	at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:163)
	at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:154)
	at dotty.tools.repl.Main$.main(Main.scala:6)
	at dotty.tools.repl.Main.main(Main.scala)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolasstuckicommented, May 4, 2018

See #4460

1reaction
nicolasstuckicommented, May 4, 2018

I created a PR where the semantics are modified to allow inline functions as parameters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C C++ Function name conflicts and crash inconsistency
Since the function is defined inline it chooses one of the definitions at random and drops the other, without an error. (This is...
Read more >
EXP37-C. Call functions with the correct number and type of ...
For a call to a function without a function prototype in scope where the function is not defined with a function prototype, the...
Read more >
inline - ModernesCpp.com
In modern compilers, the keyword inline is not about inlining functions anymore. Modern compilers almost completely ignore it. The more or less ...
Read more >
Untitled
When using the ULP option --advice:power=all with C++ code, the compiler may crash while trying to print the name of a C++ member...
Read more >
C++ Compiler Front-End Fixes In VS2015
Connect ID Connect Customer Bug Description 1152789 108065 Compiler crash and error C1001 1135528 6XGate C6011 Not Issued for Obvious Error 1076827 A D R I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found