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

Implicit views shouldn't be enabled when checking stability of a path

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.2, Scala 2.10.0-M6
    • Fix Version/s: Scala 2.10.0-M7, Scala 2.10.0
    • Component/s: Type Checker
    • Labels:
      None

      Description

      scala> class C(val a: Any) extends AnyVal; implicit def c2AnyRef(c: C): AnyRef = new {}
      warning: there were 1 feature warnings; re-run with -feature for details
      defined class C
      c2AnyRef: (c: C)AnyRef
      
      scala> val c = new C(0)
      c: C = C@0
      
      scala> type t = c.type
      <console>:13: error: stable identifier required, but c2AnyRef(c) found.
             type t = c.type
                      ^
      

      The attempt to adapted c to `AnyRef` when checking stability of the prefix of the singleton type is both surprising and futile.

        Activity

        Hide
        Paul Phillips added a comment -

        I fixed this but I unwisely bundled it in a pull request with other stuff which hit the wall. I'll narrow down that pull req.

        Show
        Paul Phillips added a comment - I fixed this but I unwisely bundled it in a pull request with other stuff which hit the wall. I'll narrow down that pull req.
        Show
        Paul Phillips added a comment - https://github.com/scala/scala/pull/1232
        Hide
        Grzegorz Kossakowski added a comment -

        Should this ticket be closed now since the pull request got merged?

        Show
        Grzegorz Kossakowski added a comment - Should this ticket be closed now since the pull request got merged?

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Jason Zaugg
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development