We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e14028 commit d1677c6Copy full SHA for d1677c6
include/swift/AST/Stmt.h
@@ -545,11 +545,17 @@ class alignas(1 << PatternAlignInBits) StmtConditionElement {
545
assert(getKind() == CK_PatternBinding && "Not a pattern binding condition");
546
ThePattern = P;
547
}
548
+
549
+ /// Pattern Binding Accessors.
550
+ Expr *getInitializerOrNull() const {
551
+ return getKind() == CK_PatternBinding ? Condition.get<Expr *>() : nullptr;
552
+ }
553
554
Expr *getInitializer() const {
555
556
return Condition.get<Expr *>();
557
558
559
void setInitializer(Expr *E) {
560
561
Condition = E;
0 commit comments