Skip to content

Commit 9275dd6

Browse files
committed
Sema: Open-code a usage of SubscriptDecl::getIndicesInterfaceType()
Also add a FIXME, since its wrong.
1 parent 40e49e5 commit 9275dd6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/Sema/CSApply.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4429,7 +4429,18 @@ namespace {
44294429
cs.TC.requestMemberLayout(subscript);
44304430

44314431
auto dc = subscript->getInnermostDeclContext();
4432-
auto indexType = subscript->getIndicesInterfaceType();
4432+
4433+
// FIXME: It's not correct to turn the subscript's parameter list
4434+
// into a single type here. Further down we pass it to coerceToType(),
4435+
// but the rules for argument list conversions are different than
4436+
// tuple conversions, and coerceToType() doesn't handle varargs or
4437+
// default arguments.
4438+
auto indexType = AnyFunctionType::composeInput(
4439+
cs.TC.Context,
4440+
subscript->getInterfaceType()
4441+
->castTo<AnyFunctionType>()
4442+
->getParams(),
4443+
/*canonicalVararg=*/false);
44334444

44344445
SubstitutionMap subs;
44354446
if (auto sig = dc->getGenericSignatureOfContext()) {

0 commit comments

Comments
 (0)