Merge pull request #22072 from jckarter/opaque-type-runtime

Opaque types with resilience
This commit is contained in:
Joe Groff
2019-04-18 14:52:31 -07:00
committed by GitHub
143 changed files with 4501 additions and 579 deletions

View File

@@ -1118,6 +1118,11 @@ ConstraintSystem::solveImpl(Expr *&expr,
// constraint.
if (convertType) {
auto constraintKind = ConstraintKind::Conversion;
if (getContextualTypePurpose() == CTP_ReturnStmt
&& Options.contains(ConstraintSystemFlags::UnderlyingTypeForOpaqueReturnType))
constraintKind = ConstraintKind::OpaqueUnderlyingType;
if (getContextualTypePurpose() == CTP_CallArgument)
constraintKind = ConstraintKind::ArgumentConversion;
@@ -1513,7 +1518,8 @@ void ConstraintSystem::ArgumentInfoCollector::walk(Type argType) {
case ConstraintKind::ArgumentConversion:
case ConstraintKind::Conversion:
case ConstraintKind::BridgingConversion:
case ConstraintKind::BindParam: {
case ConstraintKind::BindParam:
case ConstraintKind::OpaqueUnderlyingType: {
auto secondTy = constraint->getSecondType();
if (secondTy->is<TypeVariableType>()) {
auto otherRep =