From de2b0c68785afc0f801fbe8d2750366e90c9fa70 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 6 Jan 2012 16:38:45 -0800 Subject: Renamed a method and made it more available. We have too many methods called "widen" and/or "normalize". Renamed one of them to something more instructive. Or in the words of abe simpson, Dear Mr. President: There are too many states nowadays. Please eliminate three. P.S. I am not a crackpot. --- src/compiler/scala/tools/nsc/typechecker/Infer.scala | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/compiler/scala/tools/nsc') diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index b1612f24ef..9db291a306 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -1116,19 +1116,7 @@ trait Infer { } } - /** Type with all top-level occurrences of abstract types replaced by their bounds */ - def widen(tp: Type): Type = tp match { // @M don't normalize here (compiler loops on pos/bug1090.scala ) - case TypeRef(_, sym, _) if sym.isAbstractType => - widen(tp.bounds.hi) - case TypeRef(_, sym, _) if sym.isAliasType => - widen(tp.normalize) - case rtp @ RefinedType(parents, decls) => - copyRefinedType(rtp, parents mapConserve widen, decls) - case AnnotatedType(_, underlying, _) => - widen(underlying) - case _ => - tp - } + def widen(tp: Type): Type = abstractTypesToBounds(tp) /** Substitute free type variables undetparams of type constructor * tree in pattern, given prototype pt. -- cgit v1.2.3