Commit Graph

48 Commits

Author SHA1 Message Date
Hamish Knight efeab4171c [Sema] NFC: Make some type resolution functions members on TypeResolver
Move a bunch of static functions onto the `TypeResolver`.
2026-03-22 19:01:50 +00:00
Hamish Knight b4d0f12e0a [Sema] NFC: Rename TypeResolutionFlags::SilenceErrors -> SilenceDiagnostics
This better describes the intention for the flag.
2026-03-22 19:01:50 +00:00
Slava Pestov 82b3c0060f docs: Fix indentation in generics.bib 2026-01-10 10:44:19 -05:00
Jamie cab5c62ef4 [docs]: typo fix in Opaque abstraction patterns section 2026-01-05 18:03:04 -06:00
Jamie a62b052428 [docs]: minor typo fixes in substitution-maps.tex 2026-01-05 13:42:58 -06:00
Kavon Farvardin c9d2f522c0 Sema: introduce ProtocolInversesRequest
We need special handling for protocols whose requirement
signature exists but is in a serialized state, as we
cannot run the StructuralRequirementsRequest on such
a protocol as there's no work to be done, effectively.
2025-12-02 21:09:54 -08:00
Anthony Latsis 8992ea82a2 Merge pull request #85433 from swiftlang/jepa-main4
AST: Rename `GenericContext::isGeneric` to `hasGenericParamList`
2025-11-11 21:12:34 +00:00
Anthony Latsis bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
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
Mishal Shah ee04cb84b2 Merge pull request #84696 from valeriyvan/Generics-typos 2025-10-06 07:57:15 -07:00
Valeriy Van 5e098ff3af Fix typos in docs/Generics 2025-10-05 12:24:02 +02:00
Jamie feead0cb22 [docs]: minor edits to 'existential types' chapter of generics book
fixed a couple typos encountered
2025-10-04 05:43:42 -05:00
Erik Eckstein d225c47d25 AST: rename OpenArchetypeType -> ExistentialArchetypeType
NFC
2025-03-11 20:21:46 +01:00
Alex Martini 633f101e0a Fix double 'the the' in various places 2025-02-14 17:27:51 -08:00
Jamie e9b131af81 [docs]: fix typo in compilation-model.tex 2024-11-26 04:43:37 -06: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
Hunhee Lee 46fbbb6c78 [docs] Fix typos 2024-07-08 20:49:13 +09:00
Alexander Cyon ae0e94a555 [docs] Fix typos 2024-07-06 13:16:16 +02: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
Takumi Muraishi 59b25c4b7d Fix typo fierst to first 2024-03-20 08:42:16 +09:00
cui fliter 127077b3aa chore: fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 17:23:22 +08:00
Ikko Eltociear Ashimine 05d5833e38 generics.tex: fix typo in generic-environments.tex
accomodates -> accommodates
2024-01-23 16:36:30 +09:00
SooHwanCho 6c6026ffb9 fix syntax error in generics.bib 2023-12-30 21:13:43 +09:00
Slava Pestov 9f6029dd7d generics.tex: Mention SE-0404 2023-10-16 09:57:24 -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