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

SO in inferExprAlternative on erroneous code #5553

Closed
scabug opened this issue Mar 6, 2012 · 5 comments
Closed

SO in inferExprAlternative on erroneous code #5553

scabug opened this issue Mar 6, 2012 · 5 comments
Assignees

Comments

@scabug
Copy link

scabug commented Mar 6, 2012

It is surprising that we have so little code coverage for inferExprAlternative. This breaks:

class Base[T]

object Foo {
  def apply[T](a: Int): Base[T] = new Base[T]
  def apply[T](z: String): Base[T] = new Base[T]
}

object Test {
  def test[T]: Int = Foo[T]
}
@scabug
Copy link
Author

scabug commented Mar 6, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5553?orig=1
Reporter: @hubertp
See #6912

@scabug
Copy link
Author

scabug commented Mar 7, 2012

@paulp said:
I get, with 2.9 or trunk:

scalac ./a.scala 
./a.scala:12: error: type mismatch;
 found   : [T](z: String)Base[T] <and> (a: Int)Base[T]
 required: Int
  def test[T]: Int = Foo[T]
                        ^
one error found

What do you see?

@scabug
Copy link
Author

scabug commented Mar 7, 2012

@hubertp said:
Well it is because you applied my patch to trunk already. How I wish there was a good post-commit hook for that...

@scabug
Copy link
Author

scabug commented Mar 7, 2012

@hubertp said:
Try with M2

@scabug
Copy link
Author

scabug commented Mar 7, 2012

@hubertp said:
Fixed in 4f99c2e589164c300d3e86c0de5a0d3ca9efd3f7

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

No branches or pull requests

2 participants