Skip to content

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

Merged
merged 2 commits into from
Aug 18, 2018
Merged

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@allanrenucci allanrenucci left a 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

@@ -0,0 +1,3 @@
class Test {
asInstanceOf.asInstanceOf[AnyRef => String].apply(null)
Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor

@Blaisorblade Blaisorblade left a 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.

@@ -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) == "")
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@nicolasstucki nicolasstucki merged commit 20945a2 into scala:master Aug 18, 2018
@Blaisorblade Blaisorblade deleted the fix-#3539 branch August 19, 2018 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants