Skip to content

Conversation

@DougGregor
Copy link
Member

@DougGregor DougGregor commented Apr 12, 2017

Delaying requirements that form new, recursively-defined types, providing an alternative to the current detect-recursion-complain-and-bail approach that bans recursive protocol requirements entirely. This is along the path toward recursive protocol conformances (which would require us to reprocess those requirements when we need to later), and eliminates some extraneous bookkeeping in the GenericSignatureBuilder.

@dabrahams
Copy link
Contributor

Go, Doug!

…vedType.

Teach addInheritedRequirements() to take an UnresolvedType, so the
requirements it adds can be delayed if needed. More importantly, teach
the primary caller (addConformanceRequirement) not to use
getNestedType directly; instead, form an appropriate Type and let the
type-resolution machinery handle it.
Rather than detecting recursion and bailing early, delay requirements
that would form recursive types. Note that we aren't actually
processing them later.
Recursive protocol conformances still aren't functional, so reinstate
some checking for recursive protocol conformances. It doesn't catch
everything that the previous version did---but we don't crash on such
cases anymore, either.
Now that we detect recursion based on repetition within the potential
archetypes, we no longer rely on passing down "visited" sets to
detect/diagnose recursion. Remove them.
@DougGregor DougGregor force-pushed the gsb-delay-recursive branch from 25b2476 to 54f132c Compare April 18, 2017 06:15
@DougGregor DougGregor changed the title [WIP] [GSB] Delay requirements on recursive types [GSB] Delay requirements on recursive types Apr 18, 2017
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

LLDB failure. Ugh.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor
Copy link
Member Author

patched up the LLDB issue...

@DougGregor
Copy link
Member Author

@swift-ci please smoke test Linux

@DougGregor DougGregor merged commit f304f63 into swiftlang:master Apr 18, 2017
@DougGregor DougGregor deleted the gsb-delay-recursive branch April 18, 2017 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants