[CSClosure] Teach syntactic element constraint generator about result builders

Closures and functions that have result builder transform applied have to be
handled specially by the constraint generator because transformed body is
associated with the context (function or closure) only during solution application.
This commit is contained in:
Pavel Yaskevich
2022-05-05 13:28:55 -07:00
parent 432ce1cf4e
commit 96e6952104
2 changed files with 45 additions and 14 deletions

View File

@@ -3734,6 +3734,14 @@ public:
return known->second;
}
Optional<AppliedBuilderTransform>
getAppliedResultBuilderTransform(AnyFunctionRef fn) const {
auto transformed = resultBuilderTransformed.find(fn);
if (transformed != resultBuilderTransformed.end())
return transformed->second;
return None;
}
void setCaseLabelItemInfo(const CaseLabelItem *item, CaseLabelItemInfo info) {
assert(item != nullptr);
assert(caseLabelItems.count(item) == 0);