diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-21 11:12:08 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-24 14:17:09 -0800 |
commit | 72cda2b44092ea9ab67df8a6f6c8fbf63f830c10 (patch) | |
tree | e839d23304db38e4871eea78c6cdc160fb064aae /src | |
parent | 856d4e403c63c4ddb5d30f2cb7213e059eafb1e4 (diff) | |
download | scala-72cda2b44092ea9ab67df8a6f6c8fbf63f830c10.tar.gz scala-72cda2b44092ea9ab67df8a6f6c8fbf63f830c10.tar.bz2 scala-72cda2b44092ea9ab67df8a6f6c8fbf63f830c10.zip |
Got out in front of catastrophic failure.
Should be better than "typeConstructor inapplicable for <none>" being
the default message communicating "something is wrong with your attempt
to use a compiler programatically."
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/internal/Definitions.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/internal/Definitions.scala b/src/compiler/scala/reflect/internal/Definitions.scala index f7e276fdab..02d6737bdb 100644 --- a/src/compiler/scala/reflect/internal/Definitions.scala +++ b/src/compiler/scala/reflect/internal/Definitions.scala @@ -29,8 +29,13 @@ trait Definitions extends reflect.api.StandardDefinitions { self: definitions.type => private[Definitions] def valueCache(name: Name) = { - if (name.isTypeName) ScalaPackageClass.info member name - else ScalaPackageClass.info member name suchThat (_ hasFlag MODULE) + val res = ( + if (name.isTypeName) ScalaPackageClass.info member name + else ScalaPackageClass.info member name suchThat (_ hasFlag MODULE) + ) + if (res eq NoSymbol) + abort("Could not find value classes! This is a catastrophic failure. scala " + scala.util.Properties.versionString) + else res } private[Definitions] def valueModuleMethod(className: Name, methodName: Name): Symbol = { valueCache(className.toTermName).moduleClass.tpe member methodName |