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

Cannot infer type in pattern match (regression) #5400

Closed
scabug opened this issue Jan 23, 2012 · 2 comments
Closed

Cannot infer type in pattern match (regression) #5400

scabug opened this issue Jan 23, 2012 · 2 comments

Comments

@scabug
Copy link

scabug commented Jan 23, 2012

The following code compiles with 2.9.1, but fails with the nightly of Jan 23 2012. You may be able to minimize the test even further, not sure if the higher-kinded type is needed.

This could be a duplicate of #5399.

class Test {
  type AnyCyclic = Execute[Task]#CyclicException[_]

  trait Task[T]

  trait Execute[A[_] <: AnyRef] {
    class CyclicException[T](val caller: A[T], val target: A[T])
  }

  def convertCyclic(c: AnyCyclic): String =
    (c.caller, c.target) match {
      case (caller: Task[_], target: Task[_]) => "bazinga!"
    }
}

Errors with current trunk compiler:

existential2.scala:13: error: constructor of type (T1, T2) cannot be uniquely instantiated to expected type Tuple2[Test.this.Task[?>: Nothing <: Any], Test.this.Task[?>: Nothing <: Any]]
 --- because ---
undetermined type
      case (caller: Task[_], target: Task[_]) => "bazinga!"
           ^
one error found
@scabug
Copy link
Author

scabug commented Jan 23, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5400?orig=1
Reporter: @dragos
Affected Versions: 2.10.0
Duplicates #5399

@scabug
Copy link
Author

scabug commented Jan 24, 2012

@paulp said:
This also regressed with r25935, so let's call it a duplicate of #5399. I'll transplant the source for eventual test case diversity.

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

2 participants