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

Possible Regression in 2.12.0-RC1: "recursive value ... needs type" #9917

Closed
scabug opened this Issue Sep 8, 2016 · 6 comments

Comments

Projects
None yet
1 participant
@scabug

scabug commented Sep 8, 2016

Hi we are trying to build ScalaTest using the latest 2.12.0-RC1, but we hit a weird problem when compiling our source. To reproduce the problem, you can git clone the the following branch:

https://github.com/cheeseng/scalatest/tree/scala-2.12.0-RC1-error

cd into it and do a:

sbt ++2.12.0-RC1 compile

it will fail with error like the following:

[error] /home/cheeseng/git/scalatest/scalatest/src/main/scala/org/scalatest/selenium/WebBrowser.scala:4610: recursive value firefoxProfile needs type
[error] implicit val webDriver = new FirefoxDriver(firefoxProfile)
[error] ^
[error] /home/cheeseng/git/scalatest/scalatest/src/main/scala/org/scalatest/selenium/WebBrowser.scala:4616: could not find implicit value for parameter driver: org.openqa.selenium.WebDriver
[error] capture to directory
[error] ^
[warn] 10 warnings found
[error] two errors found

The code had no issue with 2.10, 2.11 and previous version of 2.12, and error message is misleading imho. We did a quick by by sticking:

implicit val webDriver: WebDriver = new FirefoxDriver(firefoxProfile)

and it fixed both the error above. It does not really makes sense to us, and since it is a RC release, we think we should report here in case it is a regression.

Thanks.

@scabug

This comment has been minimized.

scabug commented Sep 8, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9917?orig=1
Reporter: Chua Chee Seng (cheeseng)
Affected Versions: 2.12.0-RC1

@scabug

This comment has been minimized.

scabug commented Sep 8, 2016

@szeiger said:
Some cases like this are to be expected (and we already knew about this specific one). It's caused by the changes to type inference to align inference for val and def. This can cause other types to be inferred (overrides keep their original type instead of being widened to the new type) and can also cause new cycles to show up (what you encountered). The new type inference strategy is the same one used by Dotty.

@scabug

This comment has been minimized.

scabug commented Sep 8, 2016

@adriaanm said:
Thanks for reporting -- sorry we didn't communicate this known issue to you. In addition to Stefan's comment, I'd like to caution in general against implicit definitions without a result type. Implicits will be required to have a result type in some future release of Scala (perhaps as early as 2.13).

@scabug

This comment has been minimized.

scabug commented Sep 11, 2016

@SethTisue said:
The relevant PR is scala/scala#5141 with the main relevant commit being scala/scala@a97297d

That PR didn't have the "release notes" tag, but it does now.

@scabug scabug closed this Sep 11, 2016

@scabug

This comment has been minimized.

scabug commented Sep 12, 2016

Chua Chee Seng (cheeseng) said:
Hi all,

Thanks for the replies, another worrying concern we have is the compile/build time seems to have grown 3x as compared to 2.11.8/2.12.0-M5, here's the measurement using my machine doing a full ScalaTest build:

2.11.8 - 681s
2.12.0-M5 - 790s
2.12.0-RC1 - 1765s

Shall we create a new separate issue for the compile time performance problem?

Thanks.

@scabug

This comment has been minimized.

scabug commented Sep 13, 2016

@SethTisue said:
[~cheeseng] I'll comment over at scala/scala-dev#225

@scabug scabug added the regression label Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment