summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala2
-rw-r--r--test/files/neg/t3776.scala10
-rw-r--r--test/files/run/t3763.scala3
3 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index 0056dcd917..63b971d2fd 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -409,7 +409,7 @@ self: Analyzer =>
if (mt.isImplicit) matchesPtView(restpe, ptarg, ptres, undet)
else params.length == 1 && matchesArgRes(params.head.tpe, restpe, ptarg, ptres, undet)
case ExistentialType(tparams, qtpe) =>
- matchesPtView(normalize(tp), ptarg, ptres, undet)
+ matchesPtView(normalize(qtpe), ptarg, ptres, undet)
case Function1(arg1, res1) =>
matchesArgRes(arg1, res1, ptarg, ptres, undet)
case _ => false
diff --git a/test/files/neg/t3776.scala b/test/files/neg/t3776.scala
new file mode 100644
index 0000000000..6e368165aa
--- /dev/null
+++ b/test/files/neg/t3776.scala
@@ -0,0 +1,10 @@
+import util.parsing.combinator.{PackratParsers, RegexParsers}
+
+object MyParser extends RegexParsers with PackratParsers {
+}
+
+object Test {
+ class ParsedAs(a: String) (implicit pattern: MyParser.Parser[_]) {
+ def parsedAs[T](v: T) = MyParser.parse(pattern, a).get someOperation v
+ }
+}
diff --git a/test/files/run/t3763.scala b/test/files/run/t3763.scala
new file mode 100644
index 0000000000..c8462b7437
--- /dev/null
+++ b/test/files/run/t3763.scala
@@ -0,0 +1,3 @@
+object Test extends Application {
+ val x = Array(Array(1), List(1))
+}