summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-06 16:38:45 -0800
committerPaul Phillips <paulp@improving.org>2012-01-24 14:58:37 -0800
commitde2b0c68785afc0f801fbe8d2750366e90c9fa70 (patch)
tree2104e58922a3953d80646f0b550a2432d8abb8a3 /src/compiler/scala/tools/nsc
parent30b2064080044895bdf6ed0969b5bb001a0ee230 (diff)
downloadscala-de2b0c68785afc0f801fbe8d2750366e90c9fa70.tar.gz
scala-de2b0c68785afc0f801fbe8d2750366e90c9fa70.tar.bz2
scala-de2b0c68785afc0f801fbe8d2750366e90c9fa70.zip
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.
Diffstat (limited to 'src/compiler/scala/tools/nsc')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala14
1 files changed, 1 insertions, 13 deletions
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 <code>undetparams</code> of type constructor
* <code>tree</code> in pattern, given prototype <code>pt</code>.