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

Inconsistent type-checking for implicits with inferred return type #10229

Open
scabug opened this issue Mar 15, 2017 · 2 comments
Open

Inconsistent type-checking for implicits with inferred return type #10229

scabug opened this issue Mar 15, 2017 · 2 comments
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) implicit typer
Milestone

Comments

@scabug
Copy link

scabug commented Mar 15, 2017

An implicit with an inferred return type is (sometimes) visible before it's point of definition, despite the comments on #801.

Example in the wild is in specs2

  • a clean compile succeeds
  • an incremental compile that touches only that file fails
[error] specs2/matcher/src/main/scala/org/specs2/matcher/MatchResultMessages.scala:13: could not find implicit value for parameter mm: scalaz.Monoid[Product with Serializable with MatchResultMessages.this.MatchResultMessage]
[error]     Reducer.unitReducer { r: MatchResult[T] => r match {
[error]                         ^
[error] one error found
[error] (matcher/compile:compileIncremental) Compilation failed

See discussion on Scala contributors

@scabug
Copy link
Author

scabug commented Mar 15, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10229?orig=1
Reporter: @dragos
Affected Versions: 2.12.1
See #801

@SethTisue SethTisue added this to the Backlog milestone Jul 24, 2023
@SethTisue
Copy link
Member

Note that Scala 2.13 now warns by default when an implicit doesn't have an explicitly declared type.

Scala 3 errors.

@SethTisue SethTisue added the fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in Scala 3 This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/) implicit typer
Projects
None yet
Development

No branches or pull requests

2 participants