Skip to content

Unresolved symbol when pickling triggered by inlining def that uses a type variable in summonFrom #7878

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
rcano opened this issue Dec 31, 2019 · 0 comments

Comments

@rcano
Copy link

rcano commented Dec 31, 2019

minimized code

object Boom {
  import scala.compiletime._
  trait Fail[A <: Int, B <: Int]

  erased inline given fail[X <: Int, Y <: Int]: Fail[X, Y] = {
     scala.compiletime.summonFrom {
       case t: Fail[X, y] if constValue[y] < constValue[Y] => ???
    }
  }

  val a: Int = 1
  given ev1: Fail[a.type, 2] = null

  summon[Fail[a.type, 3]]
}
assertion failed: unresolved symbols: type y(line 6) when pickling /testdotty/src/main/scala/boom.scala
java.lang.AssertionError: assertion failed: unresolved symbols: type y(line 6) when pickling /testdotty/src/main/scala/boom.scala
dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:704)
dotty.tools.dotc.transform.Pickler.run$$anonfun$10$$anonfun$8(Pickler.scala:63)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.immutable.List.foreach(List.scala:305)
dotty.tools.dotc.transform.Pickler.run$$anonfun$2(Pickler.scala:87)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.immutable.List.foreach(List.scala:305)
dotty.tools.dotc.transform.Pickler.run(Pickler.scala:87)
dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
scala.collection.immutable.List.map(List.scala:223)
dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
dotty.tools.dotc.transform.Pickler.runOn(Pickler.scala:91)
dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
dotty.tools.dotc.Run.runPhases$5(Run.scala:171)
dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
dotty.tools.dotc.Run.compileUnits(Run.scala:186)
dotty.tools.dotc.Run.compileSources(Run.scala:123)
dotty.tools.dotc.Run.compile(Run.scala:106)
dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
dotty.tools.dotc.Driver.process(Driver.scala:189)
dotty.tools.dotc.Main.process(Main.scala)
@rcano rcano changed the title Unresolved symbol when pickling trigged by inlinining def that uses a type variable in summonFrom Unresolved symbol when pickling triggered by inlining def that uses a type variable in summonFrom Dec 31, 2019
abgruszecki added a commit that referenced this issue Jan 7, 2020
Fix #7878: Make sure implicit match case bindings are properly substi…
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