File tree 2 files changed +25
-0
lines changed
src/dotty/tools/dotc/parsing 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ object Parsers {
322
322
case Ident (name1) => placeholderParams.nonEmpty && name1 == placeholderParams.head.name
323
323
case Typed (t1, _) => isWildcard(t1)
324
324
case Annotated (t1, _) => isWildcard(t1)
325
+ case Parens (t1) => isWildcard(t1)
325
326
case _ => false
326
327
}
327
328
Original file line number Diff line number Diff line change
1
+ object Test {
2
+ def contains (s : String , i : Int ) = true
3
+ def test1 = {
4
+ val f = contains(" " , (_ : Int ))
5
+ val ff = contains(" " , ((_ : Int )))
6
+ f.apply(0 )
7
+ // sandbox/eta.scala:4: error: type mismatch:
8
+ // found : Int => Int
9
+ // required: Int
10
+ // val f = contains("", (_: Int))
11
+ // ^
12
+ // sandbox/eta.scala:5: error: apply is not a member of Boolean(f)
13
+ // f.apply(0)
14
+ // ^
15
+ }
16
+
17
+ def test2 = {
18
+ val f = " " .contains(" " , (_ : Int )) // dotc:
19
+ f.apply(0 )
20
+ // sandbox/eta.scala:18: error: apply is not a member of Boolean(f)
21
+ // f.apply(0)
22
+ // ^
23
+ }
24
+ }
You can’t perform that action at this time.
0 commit comments