Skip to content

Commit 41d099b

Browse files
committed
Remove the argument to setInvalid()
1 parent a5b8c64 commit 41d099b

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ class alignas(1 << DeclAlignInBits) Decl {
810810
bool isInvalid() const { return Bits.Decl.Invalid; }
811811

812812
/// Mark this declaration invalid.
813-
void setInvalid(bool isInvalid = true) { Bits.Decl.Invalid = isInvalid; }
813+
void setInvalid() { Bits.Decl.Invalid = true; }
814814

815815
/// Determine whether this declaration was implicitly generated by the
816816
/// compiler (rather than explicitly written in source code).

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4840,7 +4840,7 @@ Parser::parseDeclVarGetSet(Pattern *pattern, ParseDeclOptions Flags,
48404840
VarLoc, Identifier(),
48414841
CurDeclContext);
48424842
storage->setImplicit(true);
4843-
storage->setInvalid(true);
4843+
storage->setInvalid();
48444844

48454845
Pattern *pattern =
48464846
TypedPattern::createImplicit(Context, new (Context) NamedPattern(storage),
@@ -4850,7 +4850,7 @@ Parser::parseDeclVarGetSet(Pattern *pattern, ParseDeclOptions Flags,
48504850
auto binding = PatternBindingDecl::create(Context, StaticLoc,
48514851
StaticSpelling,
48524852
VarLoc, entry, CurDeclContext);
4853-
binding->setInvalid(true);
4853+
binding->setInvalid();
48544854
storage->setParentPatternBinding(binding);
48554855

48564856
Decls.push_back(binding);

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -910,9 +910,6 @@ namespace {
910910
P->setInterfaceType(Type());
911911
}
912912
TS->PossiblyInvalidDecls.insert(P);
913-
914-
if (P->isInvalid())
915-
P->setInvalid(false);
916913
}
917914

918915
expr->setType(nullptr);

0 commit comments

Comments
 (0)