File tree 2 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/typer 2 files changed +9
-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
+ 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
6
+
7
+ class A4 [T ](action : A1 [T ] ?=> String = " " ) // error
You can’t perform that action at this time.
0 commit comments