Details

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

      Description

      import language.dynamics
      
      object Test {
        def main(args: Array[String]) {
          class Lenser[T] extends Dynamic {
            def selectDynamic(propName: String) = ???
          }
      
          def lens[T] = new Lenser[T]
      
          val qq = lens[String]
        }
      }
      
      12:03 ~/Projects/aaa$ scalac Test.scala 
      Test.scala:11: error: method selectDynamic: (propName: String)Nothing does not take type parameters.
      error after rewriting to lens[T].selectDynamic[String]("apply")
      possible cause: maybe a wrong Dynamic method signature?
          val qq = lens[String]
                   ^
      one error found
      

        Activity

        Hide
        Jason Zaugg added a comment -

        At the moment, seeing as applyPossible is only called from that spot.

        Show
        Jason Zaugg added a comment - At the moment, seeing as applyPossible is only called from that spot.
        Hide
        Adriaan Moors added a comment -

        I think the check Jason proposes makes sense. I guess you can encounter a PolyType without being in POLYmode, so just checking that you're in EXPRmode is not enough.

        Show
        Adriaan Moors added a comment - I think the check Jason proposes makes sense. I guess you can encounter a PolyType without being in POLYmode, so just checking that you're in EXPRmode is not enough.
        Hide
        Jason Zaugg added a comment - - edited

        Further discussion on the best way to phrase this check. Penny for your thoughts, Adriaan.

        https://github.com/scala/scala/pull/1516#discussion_r1898814

        Show
        Jason Zaugg added a comment - - edited Further discussion on the best way to phrase this check. Penny for your thoughts, Adriaan. https://github.com/scala/scala/pull/1516#discussion_r1898814
        Show
        Paul Phillips added a comment - https://github.com/scala/scala/pull/1681
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/commit/edbcc64483ac0009eeeb58fe31e57a411da9e4c6

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development