diff options
author | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-14 17:42:00 -0500 |
---|---|---|
committer | Josh Suereth <joshua.suereth@gmail.com> | 2011-12-14 17:42:00 -0500 |
commit | 2f150c026785854b47132335fe44347dd16d0427 (patch) | |
tree | d90befc62e656c73683f09becd88da2ddfe048a8 /test/files/pos | |
parent | 981a9a028cfdae3198687b6591f8d9c2732ef0a8 (diff) | |
parent | 249be0ce81c89302b06aa3ed6444aa5bd55659db (diff) | |
download | scala-2f150c026785854b47132335fe44347dd16d0427.tar.gz scala-2f150c026785854b47132335fe44347dd16d0427.tar.bz2 scala-2f150c026785854b47132335fe44347dd16d0427.zip |
Merge branch 'xsbt' of github.com:scala/scala into xsbt
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t4063.scala | 39 | ||||
-rw-r--r-- | test/files/pos/t4273.scala | 8 |
2 files changed, 47 insertions, 0 deletions
diff --git a/test/files/pos/t4063.scala b/test/files/pos/t4063.scala new file mode 100644 index 0000000000..5e19c42edc --- /dev/null +++ b/test/files/pos/t4063.scala @@ -0,0 +1,39 @@ +trait Parallel +trait Parallelizable[+ParRepr <: Parallel] + +trait PIterableLike[+T, +Repr <: Parallel] extends Parallel with Parallelizable[PIterableLike[T, Repr]] + +trait PMap[K, V] extends PIterableLike[(K, V), PMap[K, V]] +trait PSet[T] extends PIterableLike[T, PSet[T]] + +trait CIterableLike[+T, +Repr] + +trait CSet[T] extends CIterableLike[T, CSet[T]] with Parallelizable[PSet[T]] + +trait CMap[K, V] extends CIterableLike[(K, V), CMap[K, V]] with Parallelizable[PMap[K, V]] + +object Test { + var x = 0 + + def main() { + val map: CMap[Int, CSet[Int]] = new CMap[Int, CSet[Int]] {} + val set: CSet[Int] = new CSet[Int] {} + + // should infer type argument + //map.synchronized[CIterableLike[Any, Any] with Parallelizable[PIterableLike[Any, Parallel with Parallelizable[Parallel]]]] { + // or: + //map.synchronized[CIterableLike[Any, Any] with Parallelizable[PIterableLike[Any, Parallel]]] { + // or, maybe it could also infer existential types: + //map.synchronized[CIterableLike[Any, _] with Parallelizable[PIterableLike[Any, _]]] { + + map.synchronized { + if (x == 0) { + map + } else { + set + } + } + + } +} + diff --git a/test/files/pos/t4273.scala b/test/files/pos/t4273.scala new file mode 100644 index 0000000000..9a942e8325 --- /dev/null +++ b/test/files/pos/t4273.scala @@ -0,0 +1,8 @@ +class A { + implicit def compareComparables[T](x: T)(implicit ord: Ordering[T]) = new ord.Ops(x) + + class Bippy + implicit val bippyOrdering = new Ordering[Bippy] { def compare(x: Bippy, y: Bippy) = util.Random.nextInt } + + (new Bippy) < (new Bippy) +}
\ No newline at end of file |