Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-10229

Inconsistent type-checking for implicits with inferred return type

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.12.1
    • Fix Version/s: None
    • Component/s: Type Checker
    • Labels:

      Description

      An implicit with an inferred return type is (sometimes) visible before it's point of definition, despite the comments on SI-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

        Attachments

          Issue Links

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                Unassigned
                Reporter:
                dragos Iulian Dragos
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: