diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-26 23:49:03 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-26 23:49:03 +0000 |
commit | e412524fee20da975954c929893e88db17dbdd9a (patch) | |
tree | e7c491b8d303879b49426d98f714d81c672d885f /test/files/pos/caseclass-parents.scala | |
parent | 660d80f682317eaf3d55a9b63bb95396ac417cdd (diff) | |
download | scala-e412524fee20da975954c929893e88db17dbdd9a.tar.gz scala-e412524fee20da975954c929893e88db17dbdd9a.tar.bz2 scala-e412524fee20da975954c929893e88db17dbdd9a.zip |
ProductN, and method synthesis toolbox.
- Finished giving case classes a ProductN parent, and flipped it on. The
"finish" part involved not breaking existing code where case classes
manually extend the appropriate ProductN. (Like, Tuple 1-22.)
- Generalized most of SyntheticMethods to ease method creation and class
manipulation in general.
- Fixed bugs related to the above, like the fact that this used to be a
compile error:
scala> case class Foo() extends Serializable
<console>:28: error: trait Serializable is inherited twice
case class Foo() extends Serializable
^
It feels like there's a better way to eliminate the duplicate parents,
but after spending a lot of time chasing my tail in that peril-fraught
zone between namer and typer, I don't see an easy path to improve on
it. Closes SI-1799. For that modification to Typers, review by odersky.
Diffstat (limited to 'test/files/pos/caseclass-parents.scala')
-rw-r--r-- | test/files/pos/caseclass-parents.scala | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/caseclass-parents.scala b/test/files/pos/caseclass-parents.scala new file mode 100644 index 0000000000..d4bc52154b --- /dev/null +++ b/test/files/pos/caseclass-parents.scala @@ -0,0 +1,11 @@ +case class Foo() extends Serializable +case object Bar extends Serializable + +case class Bippy[T, U](x: T, y: U) extends Product2[T, U] { } + +case class Bounded[T <: util.Random, U <: util.Random](x: T, y: U) { } + +class A { + def f(x: Bounded[_, _]) = x.productIterator foreach g + def g(rand: util.Random) = () +}
\ No newline at end of file |