Commit Graph

28 Commits

Author SHA1 Message Date
Slava Pestov 2349b5f6cf docs: Update generics book for 2025
- Revised "Substitution Maps" chapter:
  - New "Subclassing" section
  - New "SIL Type Lowering" section
- New "Opaque Result Types" chapter
- Various smaller edits

New PDF will be available shortly at https://download.swift.org/docs/assets/generics.pdf.
2025-11-11 08:34:36 -05:00
Valeriy Van 5e098ff3af Fix typos in docs/Generics 2025-10-05 12:24:02 +02:00
Slava Pestov 7ad160a971 docs: Update generics.tex
Overhaul the "Conformance Paths" chapter to use the new notation
for derived requirements.
2024-11-16 22:05:52 -05:00
Slava Pestov 3b76bc44cc docs: Update generics.tex 2024-10-21 22:08:52 -04:00
Slava Pestov b769332c56 docs: Update generics.tex 2024-08-30 15:58:01 -04:00
Slava Pestov c4d9e42fa9 docs: Update generics.tex 2024-07-15 22:30:56 -04:00
Slava Pestov 6176e02aa3 docs: Update generics.tex 2024-06-23 09:30:05 -04:00
Slava Pestov d489ad364d docs: Update generics.tex 2024-05-21 11:00:28 -04:00
Slava Pestov 8ab4ee9774 generics.tex: Protocol component graph, Tarjan's algorithm, etc 2023-09-19 23:16:22 -04:00
Slava Pestov a14175b37d Updates to generics.tex 2023-08-21 14:22:55 -04:00
Slava Pestov f9f0ea2fe5 Work-in-progress second edition of generics.tex
This is not ready for review yet so I'm not updating the PDF on Swift.org.
2023-07-10 23:39:47 -04:00
Anthony Latsis ad5d55c36e [NFC] AST: Rename IdentTypeReprDeclRefTypeRepr 2023-01-07 07:14:44 +03:00
omochimetaru 66a02b5980 Fix typo: complexAlgorithm -> myAlgorithm 2022-11-10 01:12:37 +09:00
omochimetaru 3c8f1cccfe Merge remote-tracking branch 'origin/main' into fix-typo 2022-11-10 01:12:18 +09:00
omochimetaru 40233024fc fix typo: "can can" 2022-11-09 09:21:37 +09:00
omochimetaru b08d2612aa fix typo: "of of" 2022-11-09 09:20:19 +09:00
Valeriy Van a8da90d3fb Fix wrong variable type 2022-11-02 16:58:47 +02:00
Valeriy Van 17f70c9626 Fix typo 2022-11-02 14:27:54 +02:00
Valeriy Van ddbefc55ea Fix punctuation: use commas before and after 'for example' 2022-11-02 14:26:20 +02:00
Valeriy Van f89947b0e0 Fix typo: were -> was 2022-11-02 14:11:59 +02:00
Doug Gregor 0f9a70601a Parse and record top-level "items" rather than always forcing declarations.
In the Swift grammar, the top-level of a source file is a mix of three
different kinds of "items": declarations, statements, and expressions.
However, the existing parser forces all of these into declarations at
parse time, wrapping statements and expressions in TopLevelCodeDecls,
so the primary API for getting the top-level entities in source files
is based on getting declarations.

Start generalizing the representation by storing ASTNode instances at
the top level, rather than declaration pointers, updating many (but
not all!) uses of this API. The walk over declarations is a (cached)
filter to pick out all of the declarations. Existing parsed files are
unaffected (the parser still creates top-level code declarations), but
the new "macro expansion" source file kind skips creating top-level
code declarations so we get the pure parse tree. Additionally, some
generalized clients (like ASTScope lookup) will now look at the list
of items, so they'll be able to walk into statements and expressions
without the intervening TopLevelCodeDecl.

Over time, I'd like to phase out `getTopLevelDecls()` entirely,
relying on the new `getTopLevelItems()` for parsed content. We can
introduce TopLevelCodeDecls more lazily for semantic walks.
2022-11-01 08:04:15 -07:00
swift-ci 02e537ffad Merge pull request #61790 from valeriyvan/generics-fixes
Fix typos in Compiling Swift Generics documentation
2022-10-29 11:39:53 -07:00
Valeriy Van 2bb34e3aa7 Fix typo 2022-10-28 19:41:38 +03:00
Valeriy Van afb0249d58 Fix typo 2022-10-28 19:00:11 +03:00
Valeriy Van 563bf20d81 Fix typo 2022-10-28 18:56:55 +03:00
Alex Kladov f5f8fa888b Correct typo in generics.tex
I am not sure what is wrong: the text or my understanding of upstream/downstream terminology, but it seems that nameres happens before generics, and nameres results *flow* into generics, so it must be upstream, right?
2022-10-25 10:26:29 +01:00
Slava Pestov 86fac9ab70 docs: Compiling Swift Generics, Part I 2022-10-16 19:37:02 -04:00
Slava Pestov 10cc835d11 docs: Work-in-progress generics implementation documentation 2022-09-22 14:24:58 -04:00