File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed
compiler/src/dotty/tools/dotc/core/classfile Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,19 @@ object ClassfileParser {
2323 /** Indicate that there is nothing to unpickle and the corresponding symbols can
2424 * be invalidated. */
2525 object NoEmbedded extends Embedded
26+
27+ /** Replace raw types with wildcad 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+ }
2639}
2740
2841class ClassfileParser (
@@ -241,7 +254,7 @@ class ClassfileParser(
241254 addConstructorTypeParams(denot)
242255 }
243256
244- denot.info = pool.getType(in.nextChar)
257+ denot.info = cook.apply( pool.getType(in.nextChar) )
245258 if (isEnum) denot.info = ConstantType (Constant (sym))
246259 if (isConstructor) normalizeConstructorParams()
247260 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