summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-11-22 16:45:22 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-22 16:45:22 -0800
commit112ae862e0530c4e1148c2e67997e4c242c566bd (patch)
treeb797e1d9d38dd531855522b989c9561375d67c61 /test/files
parente96af842893c17a413931771b0cf008542ef4249 (diff)
parent60ac821192c1b19f91f19eb7a746f0889b3e804e (diff)
downloadscala-112ae862e0530c4e1148c2e67997e4c242c566bd.tar.gz
scala-112ae862e0530c4e1148c2e67997e4c242c566bd.tar.bz2
scala-112ae862e0530c4e1148c2e67997e4c242c566bd.zip
Merge pull request #3160 from retronym/ticket/7983
Fix implicit divergence regression
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/t7983.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/pos/t7983.scala b/test/files/pos/t7983.scala
new file mode 100644
index 0000000000..a583e538c5
--- /dev/null
+++ b/test/files/pos/t7983.scala
@@ -0,0 +1,31 @@
+package foo.bar.baz // the package nesting level material to this bug
+
+class DivergenceTest {
+
+ trait ColumnBase[T]
+
+ trait ShapeLevel
+ trait Flat extends ShapeLevel
+ trait Lower extends Flat
+
+ class Shape2[Level <: ShapeLevel, -M, U]
+
+ implicit final def columnBaseShape[Level >: Flat <: ShapeLevel, T, C <: ColumnBase[_]]
+ (implicit ev: C <:< ColumnBase[T]
+ ): Shape2[Level, C, T] = ???
+
+ implicit final def intShape[Level <: ShapeLevel, T]: Shape2[Level, Int, Int] = ???
+ implicit final def tuple2Shape[Level <: ShapeLevel, M1,M2, U1,U2]
+ (implicit u1: Shape2[_ <: Level, M1, U1],
+ u2: Shape2[_ <: Level, M2, U2]
+ ): Shape2[Level, (M1,M2), (U1,U2)] = ???
+
+ def foo {
+ class Coffees extends ColumnBase[Int]
+
+ def map1[F, T](f: F)(implicit shape: Shape2[_ <: Flat, F, T]) = ???
+
+ map1(((1, null: Coffees), 1))
+ map1(((null: Coffees, 1), 1)) // fails with implicit divergence error in 2.11.0-M6, works under 2.10.3
+ }
+}