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
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/pos/i3539.scala → tests/run/i3539.scala
Original file line number Diff line number Diff line change
@@ -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.

val i2i = (x: Int) => x + 1
assert(i2i.asInstanceOf[AnyRef => Int].apply(null) == 1)
}
Expand Down