Skip to content

Fix nightly build after eta-expansion changes #2802

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 1 commit into from
Jun 24, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 24, 2017

The nightly build runs the sbt incremental compilation tests (that can be
run by hand using sbt "sbt-dotty/scripted source-dependencies/*" but
take a while to complete). The implicit-params test started failing
after #2701 because B.scala contains:
val y = x(3)
which was supposed to fail when the implicit is not present but now
succeeds with y getting the type E => String. We restore the failure
by adding a type annotation to y

The nightly build runs the sbt incremental compilation tests (that can be
run by hand using sbt "sbt-dotty/scripted source-dependencies/*" but
take a while to complete). The implicit-params test started failing
after scala#2701 because B.scala contains:
  val y = x(3)
which was supposed to fail when the implicit is not present but now
succeeds with `y` getting the type `E => String`. We restore the failure
by adding a type annotation to `y`
@smarter smarter requested a review from odersky June 24, 2017 02:04
@smarter
Copy link
Member Author

smarter commented Jun 24, 2017

This shows that we really need a warning for pure statements, like scalac:

class IOCapability

object Test {
  // Forgot to mark `ev` implicit!
  def doSideEffects(x: Int)(ev: IOCapability) = {
    println("x: " + x)
  }

  implicit val cap: IOCapability = new IOCapability

  // This will compile but won't actually produce any side-effect
  doSideEffects(1)
}

In fact, I wonder if we could make automatic eta-expansion fail when the result is a pure statement

@odersky
Copy link
Contributor

odersky commented Jun 24, 2017

Good point about the purity warning. LGTM for this PR.

@odersky odersky merged commit 124778f into scala:master Jun 24, 2017
@allanrenucci allanrenucci deleted the fix-nightly-2 branch December 14, 2017 19:20
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.

2 participants