-
Notifications
You must be signed in to change notification settings - Fork 396
Introduce UnaryOp.CheckNotNull
in the IR.
#5037
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
Conversation
d38ebf5
to
2fff817
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.
Just one nit RE the backwards compat.
|
||
@deprecated("use the overload with the argument type instead", since = "1.17.0") | ||
def resultTypeOf(op: Code): Type = | ||
resultTypeOf(op, NothingType): 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.
I'd remove this. It doesn't yield a correct result for CheckNotNull
.
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.
Done.
@@ -2056,7 +2056,7 @@ object Build { | |||
Some(ExpectedSizes( | |||
fastLink = 425000 to 426000, | |||
fullLink = 282000 to 283000, | |||
fastLinkGz = 61000 to 62000, | |||
fastLinkGz = 60000 to 61000, |
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.
Heh, nice. Do you know what that is?
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 exactly sure. Apparently the inlining of val
s can be a little bit better in some cases. This is the diff: https://gist.github.com/sjrd/28e5929fa16e0e030a3384bfad1fe59b
Now that we have non-nullable reference types in the IR, it makes sense to offer that operation at the IR level. It replaces the `Transient` of the same name. We use it in the compiler instead of `GetClass`, as it is more direct.
2fff817
to
a707dea
Compare
Now that we have non-nullable reference types in the IR, it makes sense to offer that operation at the IR level. It replaces the
Transient
of the same name.We use it in the compiler instead of
GetClass
, as it is more direct.