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

Allow implicit modifier in for comprehension

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Backlog
    • Component/s: Specification
    • Labels:

      Description

      Outgrowth of SI-1492, but that ticket has already been closed twice and the most important case works great. But as mentioned in its comments it would be useful and more consistent if this also worked:

      for (implicit a <- ...) {
        ...
      }
      

        Issue Links

          Activity

          Hide
          Martin Odersky added a comment -

          The problem I see is the interaction with many other things. The `a' might be a pattern – should the implicit then apply to all its variables? Then, the translation of generators in for expressions is quite involved. We'd have to speicfy how implicits are taken into account. This exceeds the design work usually associated with a ticket fix. I close the ticket but would welcome a SID that contains spec language to regulate all these things.

          Show
          Martin Odersky added a comment - The problem I see is the interaction with many other things. The `a' might be a pattern – should the implicit then apply to all its variables? Then, the translation of generators in for expressions is quite involved. We'd have to speicfy how implicits are taken into account. This exceeds the design work usually associated with a ticket fix. I close the ticket but would welcome a SID that contains spec language to regulate all these things.
          Hide
          Martin Odersky added a comment -

          On second thought let's keep this open and assign to scala_community. Maybe someone picks up the ball and provides the spec enhancements.

          Show
          Martin Odersky added a comment - On second thought let's keep this open and assign to scala_community. Maybe someone picks up the ball and provides the spec enhancements.
          Hide
          Kim Stebel added a comment -

          Are there any guidelines on how to write such a spec?

          About patterns: I think the behaviour should be analogous to

          implicit val <Pattern> = ...

          where the implicit modifier does apply to all variables in the pattern.

          Show
          Kim Stebel added a comment - Are there any guidelines on how to write such a spec? About patterns: I think the behaviour should be analogous to implicit val <Pattern> = ... where the implicit modifier does apply to all variables in the pattern.
          Hide
          Grzegorz Kossakowski added a comment -

          Unassigning and rescheduling to M7 as previous deadline was missed.

          Show
          Grzegorz Kossakowski added a comment - Unassigning and rescheduling to M7 as previous deadline was missed.

            People

            • Assignee:
              Adriaan Moors
              Reporter:
              Paul Phillips
              TracCC:
              Paul Phillips
            • Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:

                Development