Implement support for rewrite constraints (#2276)

Implements basic support for rewrite constraints as proposed in #2173.

Support for associated constants and complex constraints in general is also made more robust: argument deduction now properly computes and substitutes witnesses, and interface declarations track a more correct description of the constraint that they introduce than the one we previously built.
This commit is contained in:
Richard Smith
2022-10-12 12:55:55 -07:00
committed by GitHub
parent 9feff92f22
commit 9f534ae004
29 changed files with 1386 additions and 455 deletions
+5
View File
@@ -360,6 +360,11 @@ void WhereClause::Print(llvm::raw_ostream& out) const {
out << clause.lhs() << " == " << clause.rhs();
break;
}
case WhereClauseKind::RewriteWhereClause: {
auto& clause = cast<RewriteWhereClause>(*this);
out << "." << clause.member_name() << " = " << clause.replacement();
break;
}
}
}