aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-20 10:27:57 +0200
committerMartin Odersky <odersky@gmail.com>2016-05-23 12:01:39 +0200
commit67d5660e0be6f0ae411b8fea030acd92a7b27cbf (patch)
treef74edb62b060d18b4cc9feeaf9952f6ad982cf95 /src/dotty/tools/dotc
parent1ab71ca9b2db9d2219b23837df4c27723773738b (diff)
downloaddotty-67d5660e0be6f0ae411b8fea030acd92a7b27cbf.tar.gz
dotty-67d5660e0be6f0ae411b8fea030acd92a7b27cbf.tar.bz2
dotty-67d5660e0be6f0ae411b8fea030acd92a7b27cbf.zip
Don't force a symbol's denotation for isTerm/isType
Forcing it led to CyclicReferences involving RefChecks.OptLevelInfo when compiling dotc/*.scala against Tasty files. The problem was that when transforming OptLevelInfo the backend forced a transformInfo of RefChecks in TypeErasure which filtered RefCheck's scope to eliminate non-class type definitions. Without the tweak in this commit this tried to make all symbols current, and so came back to OptLevelInfo.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala4
-rw-r--r--src/dotty/tools/dotc/core/TypeErasure.scala2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index d40acdfa7..b9458b133 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -398,10 +398,10 @@ object Symbols {
/** Subclass tests and casts */
final def isTerm(implicit ctx: Context): Boolean =
- (if(isDefinedInCurrentRun) lastDenot else denot).isTerm
+ (if (defRunId == ctx.runId) lastDenot else denot).isTerm
final def isType(implicit ctx: Context): Boolean =
- (if(isDefinedInCurrentRun) lastDenot else denot).isType
+ (if (defRunId == ctx.runId) lastDenot else denot).isType
final def isClass: Boolean = isInstanceOf[ClassSymbol]
diff --git a/src/dotty/tools/dotc/core/TypeErasure.scala b/src/dotty/tools/dotc/core/TypeErasure.scala
index 89077897a..39d02e069 100644
--- a/src/dotty/tools/dotc/core/TypeErasure.scala
+++ b/src/dotty/tools/dotc/core/TypeErasure.scala
@@ -374,7 +374,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
tr1 :: trs1.filterNot(_ isRef defn.ObjectClass)
case nil => nil
}
- val erasedDecls = decls.filteredScope(d => !d.isType || d.isClass)
+ val erasedDecls = decls.filteredScope(sym => !sym.isType || sym.isClass)
tp.derivedClassInfo(NoPrefix, parents, erasedDecls, erasedRef(tp.selfType))
// can't replace selftype by NoType because this would lose the sourceModule link
}