@@ -869,7 +869,9 @@ class Namer { typer: Typer =>
869
869
if (tparamSyms.nonEmpty && ! isDerived) tp.LambdaAbstract (tparamSyms)
870
870
// else if (toParameterize) tp.parameterizeWith(tparamSyms)
871
871
else tp
872
- sym.info = abstracted(TypeBounds .empty)
872
+
873
+ val dummyInfo = abstracted(TypeBounds .empty)
874
+ sym.info = dummyInfo
873
875
// Temporarily set info of defined type T to ` >: Nothing <: Any.
874
876
// This is done to avoid cyclic reference errors for F-bounds.
875
877
// This is subtle: `sym` has now an empty TypeBounds, but is not automatically
@@ -890,6 +892,19 @@ class Namer { typer: Typer =>
890
892
sym.info = NoCompleter
891
893
sym.info = checkNonCyclic(sym, unsafeInfo, reportErrors = true )
892
894
}
895
+
896
+ // Here we pay the price for the cavalier setting info to TypeBounds.empty above.
897
+ // We need to compensate by invalidating caches in references that might
898
+ // still contain the TypeBounds.empty. If we do not do this, stdlib factories
899
+ // fail with a bounds error in PostTyper.
900
+ def ensureUpToDate (tp : Type , outdated : Type ) = tp match {
901
+ case tref : TypeRef if tref.info == outdated && sym.info != outdated =>
902
+ tref.uncheckedSetSym(null )
903
+ case _ =>
904
+ }
905
+ ensureUpToDate(sym.typeRef, dummyInfo)
906
+ ensureUpToDate(sym.typeRef.appliedTo(tparamSyms.map(_.typeRef)), TypeBounds .empty)
907
+
893
908
etaExpandArgs.apply(sym.info)
894
909
}
895
910
0 commit comments