Skip to content

Commit

Permalink
[AST] Correct set implicit for enum element patterns.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkcsgexi committed Apr 7, 2016
1 parent 4586af0 commit 26b71a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/swift/AST/Pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ class EnumElementPattern : public Pattern {
: Pattern(PatternKind::EnumElement),
ParentType(ParentType), DotLoc(DotLoc), NameLoc(NameLoc), Name(Name),
ElementDecl(Element), SubPattern(SubPattern) {
if (Implicit.hasValue() ? *Implicit : !ParentType.hasLocation())
if (Implicit.hasValue() && *Implicit)
setImplicit();
}

Expand All @@ -579,6 +579,10 @@ class EnumElementPattern : public Pattern {
Pattern *getSubPattern() {
return SubPattern;
}

bool isParentTypeImplicit() {
return !ParentType.hasLocation();
}

void setSubPattern(Pattern *p) { SubPattern = p; }

Expand Down

0 comments on commit 26b71a7

Please sign in to comment.