You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my attempts to port a macro to Scala 3, I stumbled on an issue that seems very similar to #5572 which was reported and fixed by @milessabin. Using his repro sample, I was able to reproduce the bug on 3.0.0-M1 (try it in Scastie)
When defining a trait inside the block passed to foo, if used with an Array, it will blow up with the exception below.
Changing the array to, say, a List or a Vector does not cause the issue, and moving the trait definition outside of the block also does not cause the issue.
Also seems that changing the by-name parameter to a lambda (e.g. () => A) does not cause the issue either.
The original code crashed when defining a Vector of those trait instances, followed by a call to .toArray, which caused the crash. I suspect this has possibly something to do with a ClassTag?
java.lang.AssertionError: assertion failed: unresolved symbols: �[33mtrait�[0m �[35mT1�[0m(line 8) when pickling /tmp/scastie7347053754411828221/src/main/scala/main.scala
at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:765)
at dotty.tools.dotc.transform.Pickler.run$$anonfun$3$$anonfun$2(Pickler.scala:69)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.transform.Pickler.run$$anonfun$1(Pickler.scala:105)
...
The text was updated successfully, but these errors were encountered:
hmemcpy
changed the title
Unresolved symbols assertion during pickling when inlining a 'by name' expression that defines a trait inside
Unresolved symbols assertion during pickling when using a 'by name' expression that defines a trait inside
Nov 28, 2020
I'm going to close this as a duplicate of #10542 since the root cause for both of these issues is very likely the same and the other one has more discussion, but I'll copy your example there since it's helpful to have an example that triggers the problem in a different way, thanks!
Uh oh!
There was an error while loading. Please reload this page.
In my attempts to port a macro to Scala 3, I stumbled on an issue that seems very similar to #5572 which was reported and fixed by @milessabin. Using his repro sample, I was able to reproduce the bug on 3.0.0-M1 (try it in Scastie)
When defining a trait inside the block passed to
foo
, if used with anArray
, it will blow up with the exception below.Changing the array to, say, a
List
or aVector
does not cause the issue, and moving the trait definition outside of the block also does not cause the issue.Also seems that changing the by-name parameter to a lambda (e.g.
() => A
) does not cause the issue either.The original code crashed when defining a Vector of those trait instances, followed by a call to
.toArray
, which caused the crash. I suspect this has possibly something to do with aClassTag
?Minimized code
Output (click arrow to expand)
Scastie output:
The text was updated successfully, but these errors were encountered: