diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-21 15:11:29 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-28 15:16:49 -0800 |
commit | 3bf51189f979eb0dd41744ca844fd12dfdaa0dee (patch) | |
tree | a5317cbc2cafad735cd2d3fa27c28d99785361e7 /src/compiler/scala/tools/nsc/interpreter/IMain.scala | |
parent | 422f461578ae0547181afe6d2c0c52ea1071d37b (diff) | |
download | scala-3bf51189f979eb0dd41744ca844fd12dfdaa0dee.tar.gz scala-3bf51189f979eb0dd41744ca844fd12dfdaa0dee.tar.bz2 scala-3bf51189f979eb0dd41744ca844fd12dfdaa0dee.zip |
Cleaning up type alias usage.
I determined that many if not most of the calls to .normalize
have no intent beyond dealiasing the type. In light of this I
went call site to call site knocking on doors and asking why
exactly they were calling any of
.normalize
.widen.normalize
.normalize.widen
and if I didn't like their answers they found themselves
introduced to 'dropAliasesAndSingleTypes', the recursive widener
and dealiaser which I concluded is necessary after all.
Discovered that the object called 'deAlias' actually depends
upon calling 'normalize', not 'dealias'. Decided this was
sufficient cause to rename it to 'normalizeAliases'.
Created dealiasWiden and dealiasWidenChain.
Dropped dropAliasesAndSingleTypes in favor of methods
on Type alongside dealias and widen (Type#dealiasWiden).
These should reduce the number of "hey, the type alias doesn't work" bugs.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/IMain.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/IMain.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala index 91e909b1f1..36f012229e 100644 --- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala +++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala @@ -523,7 +523,7 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends // normalize non-public types so we don't see protected aliases like Self def normalizeNonPublic(tp: Type) = tp match { - case TypeRef(_, sym, _) if sym.isAliasType && !sym.isPublic => tp.normalize + case TypeRef(_, sym, _) if sym.isAliasType && !sym.isPublic => tp.dealias case _ => tp } |