summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-09-27 09:40:17 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-09-27 09:50:39 +1000
commite07585c256b3dd2ab4d197c5480d1d962607879e (patch)
tree85330593fbecbb6f5810eb2b7415b27ebf3035dd /src/compiler/scala/tools/nsc/transform
parentc0450f0c12f265674bc657cfb469778cd35d1c40 (diff)
downloadscala-e07585c256b3dd2ab4d197c5480d1d962607879e.tar.gz
scala-e07585c256b3dd2ab4d197c5480d1d962607879e.tar.bz2
scala-e07585c256b3dd2ab4d197c5480d1d962607879e.zip
Make isSeparateCompiled... robust against rogue phase time travel
We don't hit this code path during bootstrapping, but we could conceivably hit it with macros or compiler plugins peering into the future through atPhase before refchecks as run. Also rename a method to reflect the generality of the info transform (it does more than mixin, now.)
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform')
-rw-r--r--src/compiler/scala/tools/nsc/transform/Fields.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Fields.scala b/src/compiler/scala/tools/nsc/transform/Fields.scala
index c39491cf9e..b8b2b64fb8 100644
--- a/src/compiler/scala/tools/nsc/transform/Fields.scala
+++ b/src/compiler/scala/tools/nsc/transform/Fields.scala
@@ -305,7 +305,7 @@ abstract class Fields extends InfoTransform with ast.TreeDSL with TypingTransfor
lazyCallingSuper setInfo tp
}
- private def needsMixin(cls: Symbol): Boolean = {
+ private def classNeedsInfoTransform(cls: Symbol): Boolean = {
!(cls.isPackageClass || cls.isJavaDefined) && (currentRun.compiles(cls) || refChecks.isSeparatelyCompiledScalaSuperclass(cls))
}
@@ -365,7 +365,7 @@ abstract class Fields extends InfoTransform with ast.TreeDSL with TypingTransfor
} else tp
- case tp@ClassInfoType(parents, oldDecls, clazz) if !needsMixin(clazz) => tp
+ case tp@ClassInfoType(parents, oldDecls, clazz) if !classNeedsInfoTransform(clazz) => tp
// mix in fields & accessors for all mixed in traits
case tp@ClassInfoType(parents, oldDecls, clazz) =>