summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2011-02-04 19:01:03 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2011-02-04 19:01:03 +0000
commit2d0e42041a7b3aedc3e2d0ccaacf87715bb3037b (patch)
tree4f31d2082ee51da8cc92f161588238b10fd3e287 /src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
parent5905acc722ffd760996abc2478dda12cced44846 (diff)
downloadscala-2d0e42041a7b3aedc3e2d0ccaacf87715bb3037b.tar.gz
scala-2d0e42041a7b3aedc3e2d0ccaacf87715bb3037b.tar.bz2
scala-2d0e42041a7b3aedc3e2d0ccaacf87715bb3037b.zip
[scaladoc] Scaladoc no longer crashes upon real...
[scaladoc] Scaladoc no longer crashes upon realising there is nothing to document. Closes #3928. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala')
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
index a034006a5c..7b8115b4c1 100644
--- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -26,16 +26,17 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
private var universe: Universe = null
/** */
- def makeModel: Universe = {
- val universe = new Universe { thisUniverse =>
- thisFactory.universe = thisUniverse
- val settings = thisFactory.settings
- val rootPackage =
- makeRootPackage getOrElse { throw new Error("no documentable class found in compilation units") }
+ def makeModel: Option[Universe] = {
+ makeRootPackage map { rootPack =>
+ val universe = new Universe { thisUniverse =>
+ thisFactory.universe = thisUniverse
+ val settings = thisFactory.settings
+ val rootPackage = rootPack
+ }
+ modelFinished = true
+ thisFactory.universe = null
+ universe
}
- modelFinished = true
- thisFactory.universe = null
- universe
}
/** */
@@ -419,8 +420,8 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
else None
else
Some(new NonTemplateMemberImpl(bSym, inTpl) with Val {
- override def isLazyVal = true
- })
+ override def isLazyVal = true
+ })
else if (bSym.isGetter && bSym.accessed.isMutable)
Some(new NonTemplateMemberImpl(bSym, inTpl) with Val {
override def isVar = true