aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/TypeApplications.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-07-12 14:22:10 +0200
committerMartin Odersky <odersky@gmail.com>2015-09-18 18:05:14 +0200
commite2e71dcbb2343d28be0f5311c1cb0094db8cdb05 (patch)
treec11fbd92c2777c0c1a1801c49d3f6638fc699dc1 /src/dotty/tools/dotc/core/TypeApplications.scala
parent8e1f0da3a22fb282e7bbde728c488d417aff5358 (diff)
downloaddotty-e2e71dcbb2343d28be0f5311c1cb0094db8cdb05.tar.gz
dotty-e2e71dcbb2343d28be0f5311c1cb0094db8cdb05.tar.bz2
dotty-e2e71dcbb2343d28be0f5311c1cb0094db8cdb05.zip
Avoid cyclic references in containsRefinedThis
Avoid forcing info if the reference goes to a class. This avoided a CyclicReference when reading Scala's standard library form pos/collections when fiddling with the hk logic.
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r--src/dotty/tools/dotc/core/TypeApplications.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala
index 617e4eb71..f4f14101d 100644
--- a/src/dotty/tools/dotc/core/TypeApplications.scala
+++ b/src/dotty/tools/dotc/core/TypeApplications.scala
@@ -416,9 +416,10 @@ class TypeApplications(val self: Type) extends AnyVal {
case RefinedThis(tp) =>
tp eq target
case tp: NamedType =>
- tp.info match {
+ if (tp.symbol.isClass) !tp.symbol.isStatic && recur(tp.prefix)
+ else tp.info match {
case TypeAlias(alias) => recur(alias)
- case _ => !tp.symbol.isStatic && recur(tp.prefix)
+ case _ => recur(tp.prefix)
}
case tp: RefinedType =>
recur(tp.refinedInfo) || recur(tp.parent)