Skip to content
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

Pickling test fails for annotated types #15956

Open
Linyxus opened this issue Sep 3, 2022 · 2 comments
Open

Pickling test fails for annotated types #15956

Linyxus opened this issue Sep 3, 2022 · 2 comments

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Sep 3, 2022

(taken from tests/pos/i15922.scala in #15948)

Compiler version

main

Minimized code

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).

@Linyxus Linyxus added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Sep 3, 2022
@odersky
Copy link
Contributor

odersky commented Sep 3, 2022

Yes I agree. If we fix that then we can also drop the exclude for i15922.scala. It would be great if someone could take a closer look here.

@prolativ prolativ added area:pickling and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Sep 5, 2022
@Kordyjan Kordyjan added this to the Future versions milestone Dec 12, 2022
@Kordyjan Kordyjan removed this from the Future versions milestone Jan 16, 2023
@Linyxus
Copy link
Contributor Author

Linyxus commented Aug 7, 2024

could be a duplicate of #20272

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

4 participants