File tree 2 files changed +17
-1
lines changed
compiler/src/dotty/tools/dotc/typer 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -503,7 +503,7 @@ object Inferencing {
503
503
* $i is a skolem of type `scala.internal.TypeBox`, and `CAP` is its
504
504
* type member. See the documentation of `TypeBox` for a rationale why we do this.
505
505
*/
506
- def captureWildcards (tp : Type )(using Context ): Type = tp match {
506
+ def captureWildcards (tp : Type )(using Context ): Type = tp.dealias match {
507
507
case tp @ AppliedType (tycon, args) if tp.hasWildcardArg =>
508
508
tycon.typeParams match {
509
509
case tparams @ ((_ : Symbol ) :: _) =>
Original file line number Diff line number Diff line change
1
+ object O {
2
+
3
+ class CA [A ](var x : A )
4
+ type C = CA [_]
5
+
6
+ val c : C = ???
7
+ def f [A ](r : CA [A ]): A = r.x
8
+
9
+ def g (): CA [_] = CA (" hello" )
10
+
11
+ f(g())
12
+ f(c)
13
+ f(c.asInstanceOf [CA [_]])
14
+ f(c.asInstanceOf [C ])
15
+ f(c.asInstanceOf [c.type ])
16
+ }
You can’t perform that action at this time.
0 commit comments