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

import selector removes implicit nature of value

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M3, Scala 2.10.0
    • Component/s: Compiler (Misc)
    • Labels:
      None
    • Environment:

      import selector implicit remove

      Description

      Using a selector in an import statement removes the implicit nature of the imported value (tested in scala-2.7.5.final and scala-2.8.0.r18762):

      object A { implicit val x = 1 }
      import A.x
      implicitly[Int] // 1
       
      // restart
       
      object A { implicit val x = 1 }
      import A.{x => y}
      implicitly[Int] // error: could not find implicit value for parameter e: Int
      y // 1
      x // error: not found: value x [as expected]

      Is it on purpose ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                odersky Martin Odersky
                Reporter:
                rjolly rjolly
                TracCC:
                Paul Phillips, Seth Tisue
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: