Scala Programming Language
  1. Scala Programming Language
  2. SI-4910

implicit object not given singleton type during implicit resolution

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0
    • Component/s: None
    • Labels:
      None

      Description

      This was defensible when the type of object foo was "object foo", but now it is foo.type and this is a bug.

      class A {
        implicit object foo
        // it compiles if we uncomment this
        // implicit val bar = foo
        implicitly[foo.type]
      }
      // 
      // ./a.scala:4: error: could not find implicit value for parameter e: A.this.foo.type
      //   implicitly[foo.type]
      //             ^
      // one error found
      
      scala> object foo
      defined module foo
      
      scala> def f = foo
      f: foo.type
      

        Activity

        Hide
        Paul Phillips added a comment -

        a7f68ce32c

        Show
        Paul Phillips added a comment - a7f68ce32c

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Paul Phillips
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development