File tree 2 files changed +27
-0
lines changed
src/dotty/tools/dotc/parsing
2 files changed +27
-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
+ val g : Int => Boolean = contains(" " , (_))
7
+ val gg : Int => Boolean = contains(" " , ((_)))
8
+ f.apply(0 )
9
+ // sandbox/eta.scala:4: error: type mismatch:
10
+ // found : Int => Int
11
+ // required: Int
12
+ // val f = contains("", (_: Int))
13
+ // ^
14
+ // sandbox/eta.scala:5: error: apply is not a member of Boolean(f)
15
+ // f.apply(0)
16
+ // ^
17
+ }
18
+
19
+ def test2 = {
20
+ val f = " " .contains(" " , (_ : Int )) // dotc:
21
+ f.apply(0 )
22
+ // sandbox/eta.scala:18: error: apply is not a member of Boolean(f)
23
+ // f.apply(0)
24
+ // ^
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments