File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,17 @@ void RewriteSystem::computeCandidateConformancePaths(
447
447
continue ;
448
448
}
449
449
450
+ // A concrete conformance rule (T.[concrete: C : P] => T) implies
451
+ // the existence of a conformance rule (V.[P] => V) where T == U.V.
452
+ //
453
+ // Record an equation allowing the concrete conformance to be
454
+ // expressed in terms of the abstract conformance:
455
+ //
456
+ // (T.[concrete: C : P]) := (U.[domain(V)])(V.[P])
457
+ //
458
+ // and also vice versa in the case |V| == 0:
459
+ //
460
+ // (T.[P]) := (T.[concrete: C : P])
450
461
if (lhs.isAnyConformanceRule () &&
451
462
lhs.getLHS ().back ().getKind () == Symbol::Kind::ConcreteConformance) {
452
463
MutableTerm t (lhs.getLHS ().begin (), lhs.getLHS ().end () - 1 );
Original file line number Diff line number Diff line change @@ -514,16 +514,15 @@ unsigned RewriteLoop::getDecomposeCount(
514
514
return DecomposeCount;
515
515
}
516
516
517
- // / Returns true if the loop contains at least one concrete protocol typealias rule,
518
- // / which have the form ([P].A.[concrete: C] => [P].A ).
517
+ // / Returns true if the loop contains at least one concrete protocol typealias rule.
518
+ // / See Rule::isDerivedFromConcreteProtocolTypeAliasRule( ).
519
519
bool RewriteLoop::hasConcreteTypeAliasRule (
520
520
const RewriteSystem &system) const {
521
521
const_cast <RewriteLoop *>(this )->recompute (system);
522
522
return HasConcreteTypeAliasRule;
523
523
}
524
524
525
- // / The number of Decompose steps, used by the elimination order to prioritize
526
- // / loops that are not concrete simplifications.
525
+ // / Returns true if the loop contains any rules in empty context.
527
526
bool RewriteLoop::isUseful (
528
527
const RewriteSystem &system) const {
529
528
const_cast <RewriteLoop *>(this )->recompute (system);
You can’t perform that action at this time.
0 commit comments