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

By name and by value unambiguous #4226

Closed
scabug opened this issue Feb 8, 2011 · 3 comments
Closed

By name and by value unambiguous #4226

scabug opened this issue Feb 8, 2011 · 3 comments

Comments

@scabug
Copy link

scabug commented Feb 8, 2011

=== What steps will reproduce the problem (please be specific and use wikiformatting)? ===

Following #4193:

object Log {
  def log(m: => String) = println("1:"+m) 
  def log(m: String) = println("2:"+m)
}

=== What is the expected behavior? ===

A message reporting an ambiguity.

=== What do you see instead? ===

The by-value parameter method is picked.

=== Additional information ===

Ticket #4193.

@scabug
Copy link
Author

scabug commented Feb 8, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4226?orig=1
Reporter: @axel22
See #3761

@scabug
Copy link
Author

scabug commented Feb 8, 2011

@adriaanm said:
the only way to call the log method is to cast up the defining type to something that does not overload log

the current behaviour is as spec'ed for intricate reasons, can't change that anymore

@scabug scabug closed this as completed May 18, 2011
@scabug
Copy link
Author

scabug commented Feb 26, 2014

@som-snytt said:
For #3761 there is a rejected PR scala/scala#585 that tries to force the issue (if I ask for =>A, give me that) and the accepted PR scala/scala#595 where Lukas says Martin was surprised by the outcome of this issue. FWIW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant