Skip to content

Commit 40b585f

Browse files
committed
RequirementMachine: Use RewriteStep::AbstractTypeWitness in nested type concretization
1 parent 2bca132 commit 40b585f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/AST/RequirementMachine/PropertyUnification.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,15 @@ MutableTerm PropertyMap::computeConstraintTermForTypeWitness(
727727
//
728728
// Where S[n] is the nth substitution term.
729729

730-
// FIXME: Record a rewrite path.
731-
return Context.getRelativeTermForType(typeWitness, substitutions);
730+
auto result = Context.getRelativeTermForType(typeWitness, substitutions);
731+
732+
RewriteSystem::TypeWitness witness(Term::get(subjectType, Context),
733+
Term::get(result, Context));
734+
unsigned witnessID = System.recordTypeWitness(witness);
735+
path.add(RewriteStep::forAbstractTypeWitness(
736+
witnessID, /*inverse=*/false));
737+
738+
return result;
732739
}
733740

734741
// Otherwise the type witness is concrete, but may contain type

0 commit comments

Comments
 (0)