summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-06 14:51:34 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-12-07 09:07:17 +0100
commit8d74fa024262c1bd2dc7ed64788b95f888396c05 (patch)
tree2edc6f862e9d639b9edcd5320408b79a500e5866 /src
parent7e996c1b05902df0144709a37d9149252885495c (diff)
downloadscala-8d74fa024262c1bd2dc7ed64788b95f888396c05.tar.gz
scala-8d74fa024262c1bd2dc7ed64788b95f888396c05.tar.bz2
scala-8d74fa024262c1bd2dc7ed64788b95f888396c05.zip
[backport] SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.
`originalInfo` can return null for stub symbols; deal with that as we used to before a regression in 016bc3db. After this change, we can once again delete A_1.class and still compile code instantiating B_1. (A_1 is only referred to in a method signature of B_1 which is not called from our code.) scala> new B_1 warning: Class A_1 not found - continuing with a stub. res0: B_1 = B_1@5284b8f9 In practice, this situation arises when someone uses a third party class that was compiled against other libraries not avaialable on the current compilation classpath. (cherry picked from commit a95432168204964e4f6c4571e781559c1640f2d8)
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/internal/Symbols.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala
index 45c16b7302..b22c706bf4 100644
--- a/src/reflect/scala/reflect/internal/Symbols.scala
+++ b/src/reflect/scala/reflect/internal/Symbols.scala
@@ -709,7 +709,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
final def isMonomorphicType =
isType && {
val info = originalInfo
- info.isComplete && !info.isHigherKinded
+ ( (info eq null)
+ || (info.isComplete && !info.isHigherKinded)
+ )
}
def isStrictFP = hasAnnotation(ScalaStrictFPAttr) || (enclClass hasAnnotation ScalaStrictFPAttr)