aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-12 11:12:01 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-10-12 11:12:01 +0200
commite9be067cd1f46f0ba0fbabaefd31716e85fefc47 (patch)
treecbf42f60c7e727f138601842d04af6565d18e776
parentcf5999c497635cc891fbff65671479467e42bc5a (diff)
downloaddotty-e9be067cd1f46f0ba0fbabaefd31716e85fefc47.tar.gz
dotty-e9be067cd1f46f0ba0fbabaefd31716e85fefc47.tar.bz2
dotty-e9be067cd1f46f0ba0fbabaefd31716e85fefc47.zip
move caseAccessors from TypeUtils
They are in SymUtils
-rw-r--r--src/dotty/tools/dotc/transform/PatternMatcher.scala4
-rw-r--r--src/dotty/tools/dotc/transform/TypeUtils.scala4
2 files changed, 3 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala
index 9c8e16386..29c05ca61 100644
--- a/src/dotty/tools/dotc/transform/PatternMatcher.scala
+++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -1391,7 +1391,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
val accessors =
if (defn.isProductSubType(binder.info))
productSelectors(binder.info)
- else binder.info.caseAccessors
+ else binder.caseAccessors
val res =
if (accessors.isDefinedAt(i - 1)) ref(binder).select(accessors(i - 1).name)
else codegen.tupleSel(binder)(i) // this won't type check for case classes, as they do not inherit ProductN
@@ -1480,7 +1480,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
* when `binderKnownNonNull` is `true`, `ProductExtractorTreeMaker` does not do a (redundant) null check on binder
*/
def treeMaker(binder: Symbol, binderKnownNonNull: Boolean, pos: Position, binderTypeTested: Type): TreeMaker = {
- val paramAccessors = binder.info.caseAccessors
+ val paramAccessors = binder.caseAccessors
// binders corresponding to mutable fields should be stored (SI-5158, SI-6070)
// make an exception for classes under the scala package as they should be well-behaved,
// to optimize matching on List
diff --git a/src/dotty/tools/dotc/transform/TypeUtils.scala b/src/dotty/tools/dotc/transform/TypeUtils.scala
index ceb4048a7..e510fcc88 100644
--- a/src/dotty/tools/dotc/transform/TypeUtils.scala
+++ b/src/dotty/tools/dotc/transform/TypeUtils.scala
@@ -26,6 +26,4 @@ class TypeUtils(val self: Type) extends AnyVal {
def isPrimitiveValueType(implicit ctx: Context): Boolean =
self.classSymbol.isPrimitiveValueClass
-
- def caseAccessors(implicit ctx:Context) = self.decls.filter(x => x.is(Flags.CaseAccessor) && x.is(Flags.Method)).toList
-} \ No newline at end of file
+}