From f196e074c41f7ccde118dcf6764898a2c26fda3a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 4 Mar 2014 13:49:45 +0100 Subject: 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. --- src/dotty/tools/dotc/core/Denotations.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Denotations.scala') 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 -- cgit v1.2.3