diff options
author | Paul Phillips <paulp@improving.org> | 2009-10-16 05:03:45 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-10-16 05:03:45 +0000 |
commit | 8ce658f6653bc6fedb7c7f43f9e307fe55847297 (patch) | |
tree | bfa9f9a34974e0904a5958c591afcad06e2d8a53 /src | |
parent | 6255d6f2a8295d407b7f6f505b69dbbcf0e929d3 (diff) | |
download | scala-8ce658f6653bc6fedb7c7f43f9e307fe55847297.tar.gz scala-8ce658f6653bc6fedb7c7f43f9e307fe55847297.tar.bz2 scala-8ce658f6653bc6fedb7c7f43f9e307fe55847297.zip |
Fix for #2467.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index ac3321ba78..3d88493c86 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3258,9 +3258,10 @@ trait Typers { self: Analyzer => phase.id <= currentRun.typerPhase.id && !sym.isConstructor && !(qual.tpe <:< NotNullClass.tpe) && !qual.tpe.isNotNull && - (result.symbol != Any_isInstanceOf) // null.isInstanceOf[T] is not a dereference; bug #1356 + !(List(Any_isInstanceOf, Any_asInstanceOf) contains result.symbol) // null.is/as is not a dereference } - if (settings.Xchecknull.value && isPotentialNullDeference) + // unit is null here sometimes; how are we to know when unit might be null? (See bug #2467.) + if (settings.Xchecknull.value && isPotentialNullDeference && unit != null) unit.warning(tree.pos, "potential null pointer dereference: "+tree) result |