File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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
12031203 * @post: If result exists, `paramIndex` is defined for the name of
12041204 * every parameter in `params`.
12051205 */
1206- lazy val calleeType : Type = untpd.stripAnnotated(fnBody) match {
1206+ lazy val calleeType : Type = untpd.stripAnnotated(untpd.unsplice( fnBody) ) match {
12071207 case ident : untpd.Ident if isContextual =>
12081208 val ident1 = typedIdent(ident, WildcardType )
12091209 val tp = ident1.tpe.widen
@@ -2700,7 +2700,7 @@ class Typer extends Namer
27002700 // see tests/pos/i7778b.scala
27012701
27022702 val paramTypes = {
2703- val hasWildcard = formals.exists(_.isInstanceOf [WildcardType ])
2703+ val hasWildcard = formals.exists(_.existsPart(_. isInstanceOf [WildcardType ], stopAtStatic = true ) )
27042704 if hasWildcard then formals.map(_ => untpd.TypeTree ())
27052705 else formals.map(untpd.TypeTree )
27062706 }
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