-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add explicit types to stdlib bootstrapped #18032
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
Add explicit types to stdlib bootstrapped #18032
Conversation
6369906
to
4a342e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not comfortable with having copies of such giant files in this repo, only for tiny, surgical changes. The upstream sources will inevitably change, and then who is going to track those changes and re-apply them here?
IMO we should upstream the necessary changes, then wait for the next release of Scala 2.13. In the meantime, we can keep ignoring them with tasty-mima filters.
@@ -173,7 +173,7 @@ object ManifestFactory { | |||
|
|||
@SerialVersionUID(1L) | |||
final private[reflect] class ByteManifest extends AnyValManifest[scala.Byte]("Byte") { | |||
def runtimeClass = java.lang.Byte.TYPE | |||
def runtimeClass: Class[java.lang.Byte] = java.lang.Byte.TYPE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is annoying because it is not actually correct. The Java signature of Byte.TYPE
says it returns a Class<java.lang.Byte>
, but it actually returns the class for the primitive type byte
. In Scala, that should be typed as Class[scala.Byte]
instead.
Since this lives in a private[reflect]
class, I suggest we keep ignoring it for now, and instead send a patch upstream to declare it as
def runtimeClass: Class[java.lang.Byte] = java.lang.Byte.TYPE | |
def runtimeClass: Class[_] = java.lang.Byte.TYPE |
The same applies to all the other changes in this file.
I will change this directly in Scala 2. |
Add explicit result type to methods where Scala 2 and Scala 3 disagree with the inferred type. The aim is to have the same type in the Scala 2 pickles and the Scala 3 TASTy. Follow up of scala#10435 These where identified in and tested in * scala/scala3#18032 * scala/scala3#18029 * scala/scala3#17975 (BitSet)
Add explicit result type to methods where Scala 2 and Scala 3 disagree with the inferred type. The aim is to have the same type in the Scala 2 pickles and the Scala 3 TASTy. Follow up of scala/scala#10435 These where identified in and tested in * scala#18032 * scala#18029 * scala#17975 (BitSet)
Add explicit result type to methods where Scala 2 and Scala 3 disagree with the inferred type. The aim is to have the same type in the Scala 2 pickles and the Scala 3 TASTy. Follow up of scala/scala#10435 These where identified in and tested in * #18032 * #18029 * #17975 (BitSet)
No description provided.