Replace resolveCustomAttrType with a Request

This commit is contained in:
Robert Widmann
2020-06-10 16:04:03 -07:00
parent 426d930d10
commit fb8fdd9644
23 changed files with 153 additions and 82 deletions

View File

@@ -4389,9 +4389,12 @@ void SolutionApplicationTarget::maybeApplyPropertyWrapper() {
isImplicit = true;
}
auto typeExpr = TypeExpr::createImplicitHack(
outermostWrapperAttr->getTypeLoc().getLoc(),
outermostWrapperType, ctx);
SourceLoc typeLoc;
if (auto *repr = outermostWrapperAttr->getTypeRepr()) {
typeLoc = repr->getLoc();
}
auto typeExpr =
TypeExpr::createImplicitHack(typeLoc, outermostWrapperType, ctx);
backingInitializer = CallExpr::create(
ctx, typeExpr, outermostArg,
outermostWrapperAttr->getArgumentLabels(),
@@ -4405,7 +4408,8 @@ void SolutionApplicationTarget::maybeApplyPropertyWrapper() {
// the initializer type later.
expression.wrappedVar = singleVar;
expression.expression = backingInitializer;
expression.convertType = outermostWrapperAttr->getTypeLoc();
expression.convertType = {outermostWrapperAttr->getTypeRepr(),
outermostWrapperAttr->getType()};
}
SolutionApplicationTarget SolutionApplicationTarget::forInitialization(