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

pickle/unpickle regression with AnnotatedType with only non-static annotations #8497

Closed
scabug opened this issue Apr 13, 2014 · 10 comments
Closed

Comments

@scabug
Copy link

scabug commented Apr 13, 2014

% scalac211 -version
Scala compiler version 2.11.0-RC3 -- Copyright 2002-2013, LAMP/EPFL

// a.scala
package p { object Crash { def f(s: (String @unchecked)): Unit = () } }
// b.scala
package p { object Test { Crash } }
/**
% scalac211 a.scala && scalac211 b.scala
error: java.lang.RuntimeException: malformed Scala signature of Crash at 160; annotation expected (9)
	at scala.reflect.internal.pickling.UnPickler$Scan.errorBadSignature(UnPickler.scala:662)
	at scala.reflect.internal.pickling.UnPickler$Scan.readAnnotation(UnPickler.scala:481)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readAnnotationRef$1.apply(UnPickler.scala:618)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readAnnotationRef$1.apply(UnPickler.scala:618)
	at scala.reflect.internal.pickling.UnPickler$Scan.at(UnPickler.scala:179)
	at scala.reflect.internal.pickling.UnPickler$Scan.readAnnotationRef(UnPickler.scala:618)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readAnnots$1$1.apply(UnPickler.scala:347)
	at scala.reflect.internal.pickling.UnPickler$Scan$$anonfun$readAnnots$1$1.apply(UnPickler.scala:347)
**/
@scabug
Copy link
Author

scabug commented Apr 13, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8497?orig=1
Reporter: @paulp
Affected Versions: 2.11.0-M7

@scabug
Copy link
Author

scabug commented Apr 13, 2014

@retronym said:
Looks like things went astray scala/scala#3033 (scala-hash has a blind spot around there, but it resolves close enough to bet the house.)

@scabug
Copy link
Author

scabug commented Apr 13, 2014

@retronym said:
Mixing versions suggests the regression was introduced in the pickler, rather than the unpicker:

% (export V=v2.11.0-M7~70; scalac-hash v2.10.4 sandbox/a.scala && scalac-hash $V sandbox/b.scala)
% (export V=v2.11.0-M7~70; scalac-hash $V sandbox/a.scala && scalac-hash v2.10.4 sandbox/b.scala)
...
error: java.lang.RuntimeException: malformed Scala signature of Crash at 160; annotation expected (9)

@scabug
Copy link
Author

scabug commented Apr 13, 2014

@paulp said:
It always leads back to that guy.

@scabug
Copy link
Author

scabug commented Apr 13, 2014

@paulp said:
I hope it's this: paulp/scala@2e396cfd408

Ah the memories.

@scabug
Copy link
Author

scabug commented Apr 14, 2014

@retronym said:
scala/scala#3682

@scabug
Copy link
Author

scabug commented Apr 14, 2014

@retronym said (edited on Apr 14, 2014 9:53:24 AM UTC):
@paulp How did you bump into this one? Using annotations that extend s.a.Annotation directly, rather than extending s.a.StaticAnnotation seems to be rare.

I'm trying to decide whether or not this one should block the release.

@scabug
Copy link
Author

scabug commented Apr 14, 2014

@paulp said:
I was generating code, and generated List[A @unchecked] in a pattern match, but used the same type in parameter position.

By all accounts I am the only person who ever encounters most of the bugs I encounter. In this case it might even be true. I definitely wouldn't hold up the release.

@scabug
Copy link
Author

scabug commented Apr 14, 2014

@gkossakowski said:
One could ask whether

List[A @unchecked]

should be allowed in public signature of a method, at all?

@scabug
Copy link
Author

scabug commented Apr 14, 2014

@paulp said:
It doesn't make any sense, but it could as easily be A @foo so I'm not sure how much it can buy you to disallow it. Warning when it's apparent that an annotation won't accomplish anything seems better to me.

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

2 participants