aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/SymDenotations.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-02-29 21:18:52 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-05-28 21:47:28 +0200
commitca2fb9d4890b0fd58e071b0c7baae8bdeaf9fcd4 (patch)
tree703e8f4be720635fa219ee034a5f16e7d22005e6 /src/dotty/tools/dotc/core/SymDenotations.scala
parent5d6cc456564d54c21da583ed425e73a99a014a9c (diff)
downloaddotty-ca2fb9d4890b0fd58e071b0c7baae8bdeaf9fcd4.tar.gz
dotty-ca2fb9d4890b0fd58e071b0c7baae8bdeaf9fcd4.tar.bz2
dotty-ca2fb9d4890b0fd58e071b0c7baae8bdeaf9fcd4.zip
Avoid issues when calling methods on root package symbol
SymDenotations#topLevelClass: don't throw an exception Symbols#associateFile: avoid infinite loop
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index 78acd8f1a..ff99f3b55 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -868,7 +868,7 @@ object SymDenotations {
*/
final def topLevelClass(implicit ctx: Context): Symbol = {
def topLevel(d: SymDenotation): Symbol = {
- if ((d is PackageClass) || (d.owner is PackageClass)) d.symbol
+ if (d.isEffectiveRoot || (d is PackageClass) || (d.owner is PackageClass)) d.symbol
else topLevel(d.owner)
}
val sym = topLevel(this)