diff options
author | Paul Phillips <paulp@improving.org> | 2013-08-15 15:02:19 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-08-17 07:33:42 -0700 |
commit | 130b5d79e039352f21ae5fb05ef987ba2ef56ac2 (patch) | |
tree | 6780d74ec64cd4404621403d250cccd1caa26ee4 | |
parent | 5eb5ad51c75573e51ad48d1b0bf06879de2b4ca6 (diff) | |
download | scala-130b5d79e039352f21ae5fb05ef987ba2ef56ac2.tar.gz scala-130b5d79e039352f21ae5fb05ef987ba2ef56ac2.tar.bz2 scala-130b5d79e039352f21ae5fb05ef987ba2ef56ac2.zip |
Make memberType less crashy.
It's a source of constant peril that sym.tpe on NoSymbol
is fine (it's NoType) but tpe memberType sym on NoSymbol throws
a NSDNHO. The last thing we should be doing is discouraging
people from using memberType in favor of sym.tpe, the latter
being almost always the wrong thing.
-rw-r--r-- | src/reflect/scala/reflect/internal/Types.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 71f46fedb7..0639a8e3f0 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -704,7 +704,7 @@ trait Types case OverloadedType(_, alts) => OverloadedType(this, alts) case tp => - tp.asSeenFrom(this, sym.owner) + if (sym eq NoSymbol) NoType else tp.asSeenFrom(this, sym.owner) } /** Substitute types `to` for occurrences of references to |