File tree 3 files changed +20
-1
lines changed
compiler/src/dotty/tools/dotc/core/classfile 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,19 @@ object ClassfileParser {
23
23
/** Indicate that there is nothing to unpickle and the corresponding symbols can
24
24
* be invalidated. */
25
25
object NoEmbedded extends Embedded
26
+
27
+ /** Replace raw types with wildcard applications */
28
+ def cook (implicit ctx : Context ) = new TypeMap {
29
+ def apply (tp : Type ): Type = tp match {
30
+ case tp : TypeRef if tp.symbol.typeParams.nonEmpty =>
31
+ AppliedType (tp, tp.symbol.typeParams.map(Function .const(TypeBounds .empty)))
32
+ case tp @ AppliedType (tycon, args) =>
33
+ // disregard tycon itself, but map over it to visit the prefix
34
+ tp.derivedAppliedType(mapOver(tycon), args.mapConserve(this ))
35
+ case _ =>
36
+ mapOver(tp)
37
+ }
38
+ }
26
39
}
27
40
28
41
class ClassfileParser (
@@ -241,7 +254,7 @@ class ClassfileParser(
241
254
addConstructorTypeParams(denot)
242
255
}
243
256
244
- denot.info = pool.getType(in.nextChar)
257
+ denot.info = cook.apply( pool.getType(in.nextChar) )
245
258
if (isEnum) denot.info = ConstantType (Constant (sym))
246
259
if (isConstructor) normalizeConstructorParams()
247
260
setPrivateWithin(denot, jflags)
Original file line number Diff line number Diff line change
1
+ interface Foo_1 {
2
+ void foo (java .util .List list );
3
+ }
Original file line number Diff line number Diff line change
1
+ class Test extends Foo_1 {
2
+ override def foo (list : java.util.List [_]): Unit = ???
3
+ }
You can’t perform that action at this time.
0 commit comments