Details

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

      Description

      The following code works fine in latest nightly:

      Welcome to Scala version 2.8.0.r22036-b20100526020129 (Java HotSpot(TM) Client VM, Java 1.6.0_18).
      Type in expressions to have them evaluated.
      Type :help for more information.
      
      scala> trait A[T] { type B = T }
      defined trait A
      
      scala> def f[T <: A[_]](a : T#B) = 1
      f: [T <: A[_]](a: Any)Int
      
      scala> f[A[Int]]("hello")
      res0: Int = 1
      

      Instead of succeeding, it should give a type error on the last line.

        Activity

        Hide
        Paul Phillips added a comment -

        Ahahaha, I think we should listen more closely when adriaan says "or is asSeenFrom broken!? (oh my!)" (way back in May of 2010.) Indeed asSeenFrom was broken and the relevant commit, which made these examples start correctly failing, is b7b81ca286.

        Show
        Paul Phillips added a comment - Ahahaha, I think we should listen more closely when adriaan says "or is asSeenFrom broken!? (oh my!)" (way back in May of 2010.) Indeed asSeenFrom was broken and the relevant commit, which made these examples start correctly failing, is b7b81ca286.
        Hide
        Simon Ochsenreither added a comment -

        So should I close this now?

        Show
        Simon Ochsenreither added a comment - So should I close this now?
        Hide
        Paul Phillips added a comment -

        Still needs a test case. You can send me a pull request (it's a whole new ballgame over there now that we're on git.)

        Show
        Paul Phillips added a comment - Still needs a test case. You can send me a pull request (it's a whole new ballgame over there now that we're on git.)
        Hide
        Simon Ochsenreither added a comment -
        Show
        Simon Ochsenreither added a comment - Here you go: https://github.com/scala/scala/pull/10
        Show
        Simon Ochsenreither added a comment - Tests in https://github.com/scala/scala/commit/6ecca6d2b56918c202627bf95c40f3b7465bb808

          People

          • Assignee:
            Martin Odersky
            Reporter:
            Jesper Nordenberg
            TracCC:
            Ismael Juma, Mark Harrah, Miles Sabin, Paul Phillips, Seth Tisue
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development