Skip to content

Commit 19d3b0d

Browse files
committed
Add a check whether a parameter has a type and remove extra request for accessors
This seems to be handled by typeCheckAbstractFunctionBody
1 parent 2f98bb1 commit 19d3b0d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5341,10 +5341,6 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
53415341
case AccessorKind::IsMaterializeForSet:
53425342
break;
53435343
}
5344-
// Request nominal layout for any types that could be sources of
5345-
// typemetadata or conformances.
5346-
if (accessor->hasBody())
5347-
TC.requestRequiredNominalTypeLayoutForParameters(valueParams);
53485344
}
53495345

53505346
// Before anything else, set up the 'self' argument correctly if present.

lib/Sema/TypeCheckPattern.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,9 @@ static bool validateParameterType(ParamDecl *decl, DeclContext *DC,
780780
void TypeChecker::requestRequiredNominalTypeLayoutForParameters(
781781
ParameterList *PL) {
782782
for (auto param : *PL) {
783+
if (!param->hasType())
784+
continue;
785+
783786
// Generic types are sources for typemetadata and conformances. If a
784787
// parameter is of dependent type then the body of a function with said
785788
// parameter could potentially require the generic type's layout to

0 commit comments

Comments
 (0)