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

Narrow Regex.unapplySeq to take either CharSeq or Match

    Details

      Description

      It was requested to disallow at compile time:

      val r = "(\\d+)".r; List(1) collect { case r(i) => i }
      

      Regex.unapplySeq silently ignores anything that is not CharSequence or Match.

      Discussion:
      https://groups.google.com/forum/?fromgroups=#!topic/scala-user/F2vuVhxo_X8

      Regex has always unapplied Any, so there may be a countervailing use case.

        Activity

        Show
        A. P. Marki added a comment - https://github.com/scala/scala/pull/1369
        Hide
        Adriaan Moors added a comment -

        method brought back with correct deprecation version in https://github.com/scala/scala/pull/2519

        Show
        Adriaan Moors added a comment - method brought back with correct deprecation version in https://github.com/scala/scala/pull/2519

          People

          • Assignee:
            A. P. Marki
            Reporter:
            A. P. Marki
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development