Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this issue Oct 8, 2011 · 2 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Oct 8, 2011

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.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 8, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5066?orig=1
Reporter: huynhjl
Affected Versions: 2.9.1
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jan 21, 2012

@paulp said:
5d782f24fc

@scabug scabug closed this Jan 21, 2012
@scabug scabug added the quickfix label Apr 7, 2017
@scabug scabug added this to the 2.10.0-M1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.