File tree 1 file changed +4
-4
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -844,17 +844,17 @@ object TypeOps:
844
844
val singletons = util.HashMap [Symbol , SingletonType ]()
845
845
val gadtSyms = new mutable.ListBuffer [Symbol ]
846
846
847
- def traverse (tp : Type ) = {
847
+ def traverse (tp : Type ) = try
848
848
val tpd = tp.dealias
849
849
if tpd ne tp then traverse(tpd)
850
850
else tp match
851
- case tp : ThisType if ! tp.tref.symbol.isStaticOwner && ! singletons.contains( tp.tref.symbol) =>
851
+ case tp : ThisType if ! singletons.contains( tp.tref.symbol) && ! tp.tref.symbol.isStaticOwner =>
852
852
singletons(tp.tref.symbol) = tp
853
853
traverseChildren(tp.tref)
854
854
case tp : TermRef if tp.symbol.is(Param ) =>
855
855
singletons(tp.typeSymbol) = tp
856
856
traverseChildren(tp)
857
- case tp : TypeRef if tp.symbol.isAbstractOrParamType =>
857
+ case tp : TypeRef if ! gadtSyms.contains(tp.symbol) && tp.symbol.isAbstractOrParamType =>
858
858
gadtSyms += tp.symbol
859
859
traverseChildren(tp)
860
860
// traverse abstract type infos, to add any singletons
@@ -863,7 +863,7 @@ object TypeOps:
863
863
traverseChildren(tp.info)
864
864
case _ =>
865
865
traverseChildren(tp)
866
- }
866
+ catch case ex : Throwable => handleRecursive( " traverseTp2 " , tp.show, ex)
867
867
TraverseTp2 .traverse(tp2)
868
868
val singletons = TraverseTp2 .singletons
869
869
val gadtSyms = TraverseTp2 .gadtSyms.toList
You can’t perform that action at this time.
0 commit comments