summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala3
-rw-r--r--test/files/pos/t0674.scala113
2 files changed, 115 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index bce45e4b42..eb12867ea9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -810,7 +810,8 @@ trait Typers { self: Analyzer =>
}
if (coercion != EmptyTree) {
if (settings.debug.value) log("inferred view from "+tree.tpe+" to "+pt+" = "+coercion+":"+coercion.tpe)
- return typed(Apply(coercion, List(tree)) setPos tree.pos, mode, pt)
+ return newTyper(context.makeImplicit(context.reportAmbiguousErrors)).typed(
+ Apply(coercion, List(tree)) setPos tree.pos, mode, pt)
}
}
}
diff --git a/test/files/pos/t0674.scala b/test/files/pos/t0674.scala
index 9f7a78dda3..37ae1ce37c 100644
--- a/test/files/pos/t0674.scala
+++ b/test/files/pos/t0674.scala
@@ -18,5 +18,118 @@ for(a <- Some(1);
p <- Some(16);
q <- Some(17);
r <- Some(18);
+ s <- Some(19);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ b <- Some(2);
+ c <- Some(3);
+ d <- Some(4);
+ e <- Some(5);
+ f <- Some(6);
+ g <- Some(7);
+ h <- Some(8);
+ i <- Some(9);
+ j <- Some(10);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ s <- Some(19);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ b <- Some(2);
+ c <- Some(3);
+ d <- Some(4);
+ e <- Some(5);
+ f <- Some(6);
+ g <- Some(7);
+ h <- Some(8);
+ i <- Some(9);
+ j <- Some(10);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ s <- Some(19);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ b <- Some(2);
+ c <- Some(3);
+ d <- Some(4);
+ e <- Some(5);
+ f <- Some(6);
+ g <- Some(7);
+ h <- Some(8);
+ i <- Some(9);
+ j <- Some(10);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ s <- Some(19);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ b <- Some(2);
+ c <- Some(3);
+ d <- Some(4);
+ e <- Some(5);
+ f <- Some(6);
+ g <- Some(7);
+ h <- Some(8);
+ i <- Some(9);
+ j <- Some(10);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
+ s <- Some(19);
+ k <- Some(11);
+ l <- Some(12);
+ m <- Some(13);
+ n <- Some(14);
+ o <- Some(15);
+ p <- Some(16);
+ q <- Some(17);
+ r <- Some(18);
s <- Some(19)) yield a)
}