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

classManifest[List[_]] doesn't work under some rare conditions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.11.0-M2
    • Component/s: Reflection
    • Labels:
      None

      Description

      object Test extends App {
        implicit val m1 = classManifest[Int]
        implicit val m2 = classManifest[String]
        println(classManifest[List[_]])
        // same bug happens for: println(classManifest[List[Any]])
      }
      
      C:\Projects\Kepler\sandbox @ ticket/6329>myke compile Test.scala
      Test.scala:7: error: ambiguous implicit values:
       both value m1 in object Test of type => ClassManifest[Int]
       and value m2 in object Test of type => ClassManifest[String]
       match expected type scala.reflect.OptManifest[Any]
        println(classManifest[List[Any]])
                             ^
      one error found
      

        Activity

        Hide
        Eugene Burmako added a comment -

        OptManifest is covariant in T (no idea why), hence implicit manifests in scope can prevent some manifests from being constructed (for types that are subtypes of the lub of those manifests).

        Show
        Eugene Burmako added a comment - OptManifest is covariant in T (no idea why), hence implicit manifests in scope can prevent some manifests from being constructed (for types that are subtypes of the lub of those manifests).
        Hide
        Jason Zaugg added a comment -

        The residual test cases pass now, I've graduated them from pending: https://github.com/scala/scala/pull/3175

        Show
        Jason Zaugg added a comment - The residual test cases pass now, I've graduated them from pending: https://github.com/scala/scala/pull/3175

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development