trait Cap:
type M
class Id[X]
object Test:
def withCap[X](op: Cap => X): X = ???
class retains1(xs: Any*) extends annotation.StaticAnnotation
def leaking1(c: Cap): Id[Cap @retains1(c)] = ??? // used to crash with orphan parameter on pickling
def leaking2(c: Cap): Id[c.type] = ???
val bad1 = withCap(leaking1)
val bad2 = withCap(leaking2)
Output
Pickling test fails with -Xprint-types -Ytest-pickler -Yprint-pos -Yprint-pos-syms.
Expectation
It should pass the pickling test (i.e. the representation before and after pickling should be the same).
(taken from
tests/pos/i15922.scala
in #15948)Compiler version
main
Minimized code
Output
Pickling test fails with
-Xprint-types -Ytest-pickler -Yprint-pos -Yprint-pos-syms
.Expectation
It should pass the pickling test (i.e. the representation before and after pickling should be the same).