Skip to content

Commit e9be067

Browse files
committed
move caseAccessors from TypeUtils
They are in SymUtils
1 parent cf5999c commit e9be067

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
13911391
val accessors =
13921392
if (defn.isProductSubType(binder.info))
13931393
productSelectors(binder.info)
1394-
else binder.info.caseAccessors
1394+
else binder.caseAccessors
13951395
val res =
13961396
if (accessors.isDefinedAt(i - 1)) ref(binder).select(accessors(i - 1).name)
13971397
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
14801480
* when `binderKnownNonNull` is `true`, `ProductExtractorTreeMaker` does not do a (redundant) null check on binder
14811481
*/
14821482
def treeMaker(binder: Symbol, binderKnownNonNull: Boolean, pos: Position, binderTypeTested: Type): TreeMaker = {
1483-
val paramAccessors = binder.info.caseAccessors
1483+
val paramAccessors = binder.caseAccessors
14841484
// binders corresponding to mutable fields should be stored (SI-5158, SI-6070)
14851485
// make an exception for classes under the scala package as they should be well-behaved,
14861486
// to optimize matching on List

src/dotty/tools/dotc/transform/TypeUtils.scala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,4 @@ class TypeUtils(val self: Type) extends AnyVal {
2626

2727
def isPrimitiveValueType(implicit ctx: Context): Boolean =
2828
self.classSymbol.isPrimitiveValueClass
29-
30-
def caseAccessors(implicit ctx:Context) = self.decls.filter(x => x.is(Flags.CaseAccessor) && x.is(Flags.Method)).toList
31-
}
29+
}

0 commit comments

Comments
 (0)