mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use 'hasAssociatedValues'
Use 'hasAssociatedValues' instead of computing and discarding the interface type of an enum element decl. This change has specifically not been made in conditions that use the presence or absence of the interface type, only conditions that depend on the presence or absence of associated values in the enum element decl.
This commit is contained in:
@@ -236,7 +236,7 @@ unsigned swift::getNaturalUncurryLevel(ValueDecl *vd) {
|
||||
} else if (isa<ConstructorDecl>(vd)) {
|
||||
return 1;
|
||||
} else if (auto *ed = dyn_cast<EnumElementDecl>(vd)) {
|
||||
return ed->getArgumentInterfaceType() ? 1 : 0;
|
||||
return ed->hasAssociatedValues() ? 1 : 0;
|
||||
} else if (isa<DestructorDecl>(vd)) {
|
||||
return 0;
|
||||
} else if (isa<ClassDecl>(vd)) {
|
||||
|
||||
Reference in New Issue
Block a user