Skip to content

Commit

Permalink
Optimize isStable by using normalize, which is cached
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed May 4, 2018
1 parent c8fd337 commit 9e53387
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ trait Definitions extends api.StandardDefinitions {
case TypeRef(_, NothingClass | SingletonClass, _) => true
case TypeRef(_, sym, _) if sym.isAbstractType => tp.bounds.hi.typeSymbol isSubClass SingletonClass
case TypeRef(pre, sym, _) if sym.isModuleClass => isStable(pre)
case TypeRef(_, _, _) => val dealiased = tp.dealias; (dealiased ne tp) && isStable(dealiased)
case TypeRef(_, _, _) => val normalize = tp.normalize; (normalize ne tp) && isStable(normalize)
case TypeVar(origin, _) => isStable(origin)
case AnnotatedType(_, atp) => isStable(atp) // Really?
case _: SimpleTypeProxy => isStable(tp.underlying)
Expand Down

0 comments on commit 9e53387

Please sign in to comment.