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

Predef.readLine(String, Any*) should call Console.readLine(text, args: _*)

    Details

      Description

      It seems there is a bug in Predef:

      def readLine(text: String, args: Any*) = Console.readLine(text, args)

      When I think it should be:

      def readLine(text: String, args: Any*) = Console.readLine(text, args: _*)

      The first version causes the args to be be wrapped in WrappedArray when called like this: readLine("hello %s%n", "world")

      See http://stackoverflow.com/questions/7693872/predef-readline-behaviour

      I'm not sure why WrappedArray but a quick test in REPL shows the second version would work and also it makes sense to use the type ascription to use the seq as a repeated parameter.

        Activity

        Hide
        Paul Phillips added a comment -

        5d782f24fc

        Show
        Paul Phillips added a comment - 5d782f24fc

          People

          • Assignee:
            Paul Phillips
            Reporter:
            huynhjl
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development