Skip to content

Commit 9502391

Browse files
Suyash SrijanSuyash Srijan
authored andcommitted
[typechecker] update the comment to mention that recursion is used when the optional is nested
1 parent 407c38e commit 9502391

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Sema/TypeCheckPattern.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,9 @@ bool TypeChecker::coercePatternToType(Pattern *&P, TypeResolution resolution,
13901390

13911391
// If we have an optional type, let's try to see if the case
13921392
// exists in its base type and if it does then synthesize an
1393-
// OptionalSomePattern that wraps the case.
1393+
// OptionalSomePattern that wraps the case. This uses recursion
1394+
// to add multiple levels of OptionalSomePattern if the optional
1395+
// is nested.
13941396
if (type->getOptionalObjectType()) {
13951397
if (lookupEnumMemberElement(*this, dc,
13961398
type->lookThroughAllOptionalTypes(),

0 commit comments

Comments
 (0)