diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-04 13:49:45 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-03-04 13:49:50 +0100 |
commit | f196e074c41f7ccde118dcf6764898a2c26fda3a (patch) | |
tree | 7427249f21c5879dff53d9dbaf1f17736944e9fb /src/dotty/tools/dotc/core/Denotations.scala | |
parent | 340ec6150b205287e1c0f5a0422d2186c29bc086 (diff) | |
download | dotty-f196e074c41f7ccde118dcf6764898a2c26fda3a.tar.gz dotty-f196e074c41f7ccde118dcf6764898a2c26fda3a.tar.bz2 dotty-f196e074c41f7ccde118dcf6764898a2c26fda3a.zip |
Fix of #39
Two fixes:
1) Avoid the infinite recursion in checkAccessible if the accessibility check fails.
2) Make accessibility succeed for the test, and in general if the target denotation does not have a symbol.
Added original test in pos and a negative test which makes accessibility fail.
Diffstat (limited to 'src/dotty/tools/dotc/core/Denotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Denotations.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Denotations.scala b/src/dotty/tools/dotc/core/Denotations.scala index 9c8de3829..00b6815e7 100644 --- a/src/dotty/tools/dotc/core/Denotations.scala +++ b/src/dotty/tools/dotc/core/Denotations.scala @@ -393,7 +393,7 @@ object Denotations { exists && p(this) def accessibleFrom(pre: Type, superAccess: Boolean)(implicit ctx: Context): Denotation = - if (symbol isAccessibleFrom (pre, superAccess)) this else NoDenotation + if (!symbol.exists || symbol.isAccessibleFrom(pre, superAccess)) this else NoDenotation def atSignature(sig: Signature)(implicit ctx: Context): SingleDenotation = if (sig matches signature) this else NoDenotation |