-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #3539: Add regression tests #4958
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
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.
LGTM. I would put everything in a single file though
tests/pos/i3539c.scala
Outdated
@@ -0,0 +1,3 @@ | |||
class Test { | |||
asInstanceOf.asInstanceOf[AnyRef => String].apply(null) |
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.
There is a typo in the original issue. I meant to write:
asInstanceOf[Nothing].asInstanceOf[AnyRef => String].apply(null)
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.
Changed and squashed in one file
d105229
to
05cd85b
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.
Do we get the expected results running this? I know that's not what the issue's about, but seems worth checking/testing.
tests/run/i3539.scala
Outdated
@@ -1,7 +1,7 @@ | |||
object Test { | |||
def main(args: Array[String]): Unit = { | |||
val i2s = (x: Int) => "" | |||
assert(asInstanceOf.asInstanceOf[AnyRef => String].apply(null) == "") | |||
assert(i2s.asInstanceOf.asInstanceOf[AnyRef => String].apply(null) == "") |
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.
But the original compilation failure was (asInstanceOf.asInstanceOf[AnyRef => String].apply(null) == "")
— testing results shouldn't mean dropping regressions tests.
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.
That test would clearly fail at runtime. But the same test is bellow.
No description provided.