Skip to content
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 Regression test for Scala Bug 7131 #7441

Merged
merged 1 commit into from
Nov 27, 2018
Merged

Conversation

diesalbla
Copy link
Contributor

@diesalbla diesalbla commented Nov 16, 2018

Fixes scala/bug#7131, in so far as the compiler no longer crashes.

The program in t7131.scala caused the compiler to crash with StackOverflow This has been solved before version 2.13.x and 2.12.7, and the compiler no longer crashes. In This PR adds the program in question, to watch for regressions. We add the compile error generated in the current version.

Although the compiler no longer crashes, the output is different between versions 2.13.x and 2.12.7. In the latter, it reports one error, on the definition of the ObservableValue trait:

t7131.scala:5: error: contravariant type T occurs in covariant position in type => T of method value
  def value: T

Instead, current version 2.13.x misses that error, and instead reports the error noted in the t7131.check file. This may indicate another compiler bug, since the variance error above should also be reported. Interestingly, when writing that trait into the REPL, the 2.13.x does reject it.

Welcome to Scala 2.13.0-20181116-133635-1f76b24 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_172).

scala> trait Ann[- X]{ def value: X}
                           ^
       error: contravariant type X occurs in covariant position in type => X of method value

@scala-jenkins scala-jenkins added this to the 2.13.0-RC1 milestone Nov 16, 2018
@diesalbla
Copy link
Contributor Author

/rebuild

@som-snytt
Copy link
Contributor

Needs a check file update:

[test] -t7131.scala:27: error: type mismatch;
[test] +t7131.scala:21: error: type mismatch;

@som-snytt
Copy link
Contributor

It would be great if jenkins could do these updates automatically.

You'll also need to squash the commits, since every commit must pass.

Scala Bug 7131 reported a compiler crash at the typer phase.
Testing recently, that same program no longer crashes the compiler.
This commit adds the program in question, to watch for regressions.
@SethTisue SethTisue merged commit 52b3e35 into scala:2.13.x Nov 27, 2018
@diesalbla diesalbla deleted the t7131.scala branch December 22, 2018 01:06
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.

4 participants