Skip to content

Commit 18e604a

Browse files
[Sema] Removing check for argument locator at subtype validation at matchFunctionRepresentations
1 parent ac8897c commit 18e604a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,8 +1560,7 @@ isSubtypeOf(FunctionTypeRepresentation potentialSubRepr,
15601560
/// Returns true if `constraint rep1 rep2` is satisfied.
15611561
static bool matchFunctionRepresentations(FunctionTypeRepresentation rep1,
15621562
FunctionTypeRepresentation rep2,
1563-
ConstraintKind kind,
1564-
ConstraintLocatorBuilder locator) {
1563+
ConstraintKind kind) {
15651564
switch (kind) {
15661565
case ConstraintKind::Bind:
15671566
case ConstraintKind::BindParam:
@@ -1570,14 +1569,9 @@ static bool matchFunctionRepresentations(FunctionTypeRepresentation rep1,
15701569
return rep1 == rep2;
15711570

15721571
case ConstraintKind::Subtype: {
1573-
auto last = locator.last();
1574-
if (!(last && last->is<LocatorPathElt::FunctionArgument>()))
1575-
return true;
1576-
15771572
return isSubtypeOf(rep1, rep2);
15781573
}
15791574

1580-
15811575
// [NOTE: diagnose-swift-to-c-convention-change]: @convention(swift) ->
15821576
// @convention(c) conversions are permitted only in certain cases.
15831577
//
@@ -1916,7 +1910,7 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
19161910

19171911
if (!matchFunctionRepresentations(func1->getExtInfo().getRepresentation(),
19181912
func2->getExtInfo().getRepresentation(),
1919-
kind, locator)) {
1913+
kind)) {
19201914
return getTypeMatchFailure(locator);
19211915
}
19221916

0 commit comments

Comments
 (0)