File tree 4 files changed +23
-2
lines changed
compiler/src/dotty/tools/dotc/typer
4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -1203,7 +1203,7 @@ class Typer extends Namer
1203
1203
* @post: If result exists, `paramIndex` is defined for the name of
1204
1204
* every parameter in `params`.
1205
1205
*/
1206
- lazy val calleeType : Type = untpd.stripAnnotated(fnBody) match {
1206
+ lazy val calleeType : Type = untpd.stripAnnotated(untpd.unsplice( fnBody) ) match {
1207
1207
case ident : untpd.Ident if isContextual =>
1208
1208
val ident1 = typedIdent(ident, WildcardType )
1209
1209
val tp = ident1.tpe.widen
@@ -2700,7 +2700,7 @@ class Typer extends Namer
2700
2700
// see tests/pos/i7778b.scala
2701
2701
2702
2702
val paramTypes = {
2703
- val hasWildcard = formals.exists(_.isInstanceOf [WildcardType ])
2703
+ val hasWildcard = formals.exists(_.existsPart(_. isInstanceOf [WildcardType ], stopAtStatic = true ) )
2704
2704
if hasWildcard then formals.map(_ => untpd.TypeTree ())
2705
2705
else formals.map(untpd.TypeTree )
2706
2706
}
Original file line number Diff line number Diff line change
1
+ -- [E081] Type Error: tests/neg/i11350.scala:1:39 ----------------------------------------------------------------------
2
+ 1 |class A1[T](action: A1[T] ?=> String = "") // error
3
+ | ^
4
+ | Missing parameter type
5
+ |
6
+ | I could not infer the type of the parameter evidence$1.
7
+ | What I could infer was: A1[<?>]
8
+ -- [E081] Type Error: tests/neg/i11350.scala:2:39 ----------------------------------------------------------------------
9
+ 2 |class A2[T](action: A1[T] ?=> String = summon[A1[T]]) // error
10
+ | ^
11
+ | Missing parameter type
12
+ |
13
+ | I could not infer the type of the parameter evidence$2.
14
+ | What I could infer was: A1[<?>]
Original file line number Diff line number Diff line change
1
+ class A1 [T ](action : A1 [T ] ?=> String = " " ) // error
2
+ class A2 [T ](action : A1 [T ] ?=> String = summon[A1 [T ]]) // error
Original file line number Diff line number Diff line change
1
+ case class A [T ](action : A [T ] ?=> String ) // error
2
+
3
+ class A1 [T ](action : A1 [T ] ?=> String = (_ : A1 [T ]) ?=> " " ) // works
4
+ case class A2 [T ](action : A2 [? ] ?=> String ) // works
5
+ case class A3 [T ](action : A3 [T ] => String ) // works as well
You can’t perform that action at this time.
0 commit comments