Skip to content

Instantly share code, notes, and snippets.

@paulp
Created August 13, 2014 12:55
Show Gist options
  • Select an option

  • Save paulp/e002d1e101d91dbdc021 to your computer and use it in GitHub Desktop.

Select an option

Save paulp/e002d1e101d91dbdc021 to your computer and use it in GitHub Desktop.
class A {
def f1(xs: Seq[Int]) = xs match { case xs: Seq[_] => xs } // infers Seq[Any]
def f2(xs: Seq[Int]) = xs match { case xs: List[_] => xs } // infers List[Any]
def f3(xs: List[Int]) = xs match { case xs: Seq[_] => xs } // infers List[Int]
def f4(xs: List[Int]) = xs match { case xs: List[_] => xs } // infers List[Any]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment