mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Remove ArgumentTupleConversion constraint now that its no longer used
This commit is contained in:
@@ -907,14 +907,6 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
|
||||
assert(kind >= ConstraintKind::Conversion);
|
||||
ConstraintKind subKind;
|
||||
switch (kind) {
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
subKind = ConstraintKind::ArgumentConversion;
|
||||
break;
|
||||
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
subKind = ConstraintKind::OperatorArgumentConversion;
|
||||
break;
|
||||
|
||||
case ConstraintKind::OperatorArgumentConversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::Conversion:
|
||||
@@ -1018,8 +1010,6 @@ static bool matchFunctionRepresentations(FunctionTypeRepresentation rep1,
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::BridgingConversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentConversion:
|
||||
case ConstraintKind::ApplicableFunction:
|
||||
case ConstraintKind::BindOverload:
|
||||
@@ -1094,8 +1084,6 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
|
||||
case ConstraintKind::Subtype:
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentConversion:
|
||||
subKind = ConstraintKind::Subtype;
|
||||
break;
|
||||
@@ -1590,15 +1578,9 @@ ConstraintSystem::TypeMatchResult
|
||||
ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
TypeMatchOptions flags,
|
||||
ConstraintLocatorBuilder locator) {
|
||||
bool isArgumentTupleConversion
|
||||
= kind == ConstraintKind::ArgumentTupleConversion ||
|
||||
kind == ConstraintKind::OperatorArgumentTupleConversion;
|
||||
|
||||
// If we're doing an argument tuple conversion, or just matching the input
|
||||
// types of two function types, we have to be careful to preserve
|
||||
// ParenType sugar.
|
||||
bool isArgumentTupleMatch = isArgumentTupleConversion;
|
||||
|
||||
// If we're matching the input types of two function types, we have to be
|
||||
// careful to preserve ParenType sugar.
|
||||
bool isArgumentTupleMatch = false;
|
||||
if (auto elt = locator.last())
|
||||
if (elt->getKind() == ConstraintLocator::FunctionArgument)
|
||||
isArgumentTupleMatch = true;
|
||||
@@ -1752,13 +1734,9 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
return formUnsolvedResult();
|
||||
}
|
||||
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
case ConstraintKind::Conversion:
|
||||
LLVM_FALLTHROUGH;
|
||||
|
||||
case ConstraintKind::Subtype:
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentConversion:
|
||||
// We couldn't solve this constraint. If only one of the types is a type
|
||||
// variable, perhaps we can do something with it below.
|
||||
@@ -1789,18 +1767,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
}
|
||||
}
|
||||
|
||||
// If this is an argument conversion, handle it directly. The rules are
|
||||
// different from normal conversions.
|
||||
if (kind == ConstraintKind::ArgumentTupleConversion ||
|
||||
kind == ConstraintKind::OperatorArgumentTupleConversion) {
|
||||
if (!typeVar2) {
|
||||
bool isOperator = (kind == ConstraintKind::OperatorArgumentTupleConversion);
|
||||
return ::matchCallArguments(*this, isOperator, type1, type2, locator);
|
||||
}
|
||||
|
||||
return formUnsolvedResult();
|
||||
}
|
||||
|
||||
if (isArgumentTupleMatch) {
|
||||
if (!typeVar1 && !typeVar2) {
|
||||
if (type1->hasParenSugar() != type2->hasParenSugar()) {
|
||||
@@ -2196,8 +2162,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
auto inoutBaseType = inoutType1->getInOutObjectType();
|
||||
|
||||
Type simplifiedInoutBaseType = getFixedTypeRecursive(
|
||||
inoutBaseType, kind == ConstraintKind::Equal,
|
||||
isArgumentTupleConversion);
|
||||
inoutBaseType, kind == ConstraintKind::Equal);
|
||||
|
||||
// FIXME: If the base is still a type variable, we can't tell
|
||||
// what to do here. Might have to try \c ArrayToPointer and make
|
||||
@@ -2213,8 +2178,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
|
||||
|
||||
if (!flags.contains(TMF_ApplyingOperatorParameter) &&
|
||||
// Operators cannot use these implicit conversions.
|
||||
(kind == ConstraintKind::ArgumentConversion ||
|
||||
kind == ConstraintKind::ArgumentTupleConversion)) {
|
||||
kind == ConstraintKind::ArgumentConversion) {
|
||||
|
||||
// We can potentially convert from an UnsafeMutablePointer
|
||||
// of a different type, if we're a void pointer.
|
||||
@@ -5085,8 +5049,6 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
|
||||
case ConstraintKind::Subtype:
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentConversion:
|
||||
return matchTypes(first, second, kind, subflags, locator);
|
||||
|
||||
@@ -5338,8 +5300,6 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
|
||||
case ConstraintKind::Subtype:
|
||||
case ConstraintKind::Conversion:
|
||||
case ConstraintKind::ArgumentConversion:
|
||||
case ConstraintKind::ArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentTupleConversion:
|
||||
case ConstraintKind::OperatorArgumentConversion: {
|
||||
// Relational constraints.
|
||||
auto matchKind = constraint.getKind();
|
||||
|
||||
Reference in New Issue
Block a user