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:
Robert Widmann
2017-05-22 09:32:44 -07:00
parent e92805f98d
commit 3b202c18d8
20 changed files with 38 additions and 39 deletions

View File

@@ -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)) {