diff options
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 1 | ||||
-rw-r--r-- | tests/pos/i903.scala | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index 4b22eac95..caa15c7ff 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -322,6 +322,7 @@ object Parsers { case Ident(name1) => placeholderParams.nonEmpty && name1 == placeholderParams.head.name case Typed(t1, _) => isWildcard(t1) case Annotated(t1, _) => isWildcard(t1) + case Parens(t1) => isWildcard(t1) case _ => false } diff --git a/tests/pos/i903.scala b/tests/pos/i903.scala new file mode 100644 index 000000000..c84cb1636 --- /dev/null +++ b/tests/pos/i903.scala @@ -0,0 +1,24 @@ +object Test { + def contains(s: String, i: Int) = true + def test1 = { + val f = contains("", (_: Int)) + val ff = contains("", ((_: Int))) + f.apply(0) + // sandbox/eta.scala:4: error: type mismatch: + // found : Int => Int + // required: Int + // val f = contains("", (_: Int)) + // ^ + // sandbox/eta.scala:5: error: apply is not a member of Boolean(f) + // f.apply(0) + // ^ + } + + def test2 = { + val f = "".contains("", (_: Int)) // dotc: + f.apply(0) + // sandbox/eta.scala:18: error: apply is not a member of Boolean(f) + // f.apply(0) + // ^ + } +} |