aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-25 18:18:39 +0100
committerMartin Odersky <odersky@gmail.com>2015-03-25 18:18:39 +0100
commit261c87b5859882cd39f3427c59e97d2841937010 (patch)
treea3cf478231fa3ec8673c34f5ceaa260fb8e69146 /src/dotty/tools/dotc/core/SymDenotations.scala
parentc6792189ff2075ac8b90efc7fad42aafd6a7b67e (diff)
downloaddotty-261c87b5859882cd39f3427c59e97d2841937010.tar.gz
dotty-261c87b5859882cd39f3427c59e97d2841937010.tar.bz2
dotty-261c87b5859882cd39f3427c59e97d2841937010.zip
Fix #429
enclosingMethod should not crash on NoDenotation.
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 44629c036..bc253021f 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -744,7 +744,8 @@ object SymDenotations {
final def enclosingMethod(implicit ctx: Context): Symbol =
if (this is (Method, butNot = Label)) symbol
else if (this.isClass) primaryConstructor
- else owner.enclosingMethod
+ else if (this.exists) owner.enclosingMethod
+ else NoSymbol
/** The top-level class containing this denotation,
* except for a toplevel module, where its module class is returned.