forked from apple/swift
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge main 2023-05-26 #5475
Merged
Merged
Merge main 2023-05-26 #5475
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sema now diagnoses @objcImpl implementations with: • The wrong settability (i.e. a `let` used for a `readwrite` property) • The wrong kind (i.e. a method used for a property)
… without type parameter packs If function type of some declaration has a at least on type parameter pack it could mean that number of parameters in "applied" type could be different from that of "interface" type.
…ty matches This covers situations like `Pack{repeat each T1, repeat each T2}` vs. `Pack{repeat $T1, repeat $T2}` where type variables are allowed to bind to packs. Resolves: rdar://109539394
Introduce a new experimental feature `ASTGenTypes` that uses ASTGen to translate the Swift syntax tree (produced by the new Swift parser) into C++ `TypeRepr` nodes instead of having the C++ parser create the nodes. The approach here is to intercept the C++ parser's `parseType` operation to find the Swift syntax node at the given position (where the lexer currently is) and have ASTGen translate that into the corresponding C++ AST node. Then, we spin the lexer forward to the token immediately following the end of the syntax node and continue parsing.
The pointers we were vending to C++ had low bits set because they were AST node entries rather than the raw TypeReprs.
There is a modeling difference between the swift-syntax tree and the C++ type representation (TypeRepr) that is a little odd here, so we end up parsing the ellipsis on the C++ side rather than looking "up" the syntax tree to find it.
Bridge the simple type attributes like `@autoclosure` into an `AttributedTypeRepr`. We don't validate the arguments, and we don't handle more complicated attributes like `@convention(c)` just yet.
Protocol composition types such as `P & Q` are similar to nested types like `A.B` because the innermost type syntax node at the given position doesn't cover the whole type. Adjust by looking back up the tree. This all feels like a hack, and there should be a better way. While here, fix the source ranges passed in to create `CompositionTypeRepr`. We were tripping assertions due to missing source-location information.
Instead of "spinning" the C++ lexer, consuming tokens uptil we get past the point where ASTGen told us the end of the syntax node was, just reset the lexer to exactly that position. This is more efficient, but also fixes problems where we would end up skipping past a `>` that had been split.
When `-unavailable-decl-optimization=complete` is specified, exclude unavailable enum cases from the runtime layout of enums with payloads. Without this, the type metadata for unavailable types may be referenced by enum cases with unavailable payloads and cause linker failures. Resolves rdar://107483852
apple#65253 (79e2697) made it so that the async and completion-handler variants of a member would both be matched by the same implementation, but the technique used composes poorly with typechecking work later in this series of commits. Reimplement it so that async variants are filtered out of `ObjCImplementationChecker::unmatchedRequirements` and then async candidates are compared against async alternatives later, during matching.
Check the types of @objcImpl candidates against their requirements and diagnose *most* mismatches. Unlike typical type matching rules, @objcImpl allows an implementation’s parameter *and* result types to be an IUO when the requirement isn’t. This runs against the normal covariance rules in the case of the result type. It’s meant to allow an implementation to handle nils passed to it and return nils even if the declaration formally claims nils are not permitted; this is occasionally necessary to reimplement Objective-C APIs without breaking ABI compatibility. Fixes rdar://102063730.
The swift driver emits extra newlines because it applies the LF -> CRLF conversions again on the outpt from the child processes. Fix it by using the binary mode when outputting the output from the child processes. Fixes: apple#64413
This is needed short term to allow the test to pass when running on Python 3.11 and later and avoid errors like ``` <stdin>:44:1: note: non-matching line after previous match is here <string>:1: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13 ^ ``` Long term we want to replace uses of the obsolete `pipes.quotes` function with `shlex.quotes`. Addresses rdar://109664710
[lit] cleanup lit leaks target
apple#66088) * [ModuleInterface] Add mechanism to exclude experimental flags from the module interface rdar://109722548 * Separate filtered flags from the typical/unfiltered case
rdar://109281444
rdar://109281444
…yable binding rdar://109281444
- refer to a "consuming use" as simply a "consume", to reserve "use" for non-consuming uses. - refer to "non-consuming uses" as just a "use". - don't call it a "user defined deinit" and instead a "deinitializer" to match Sema - be specific about what binding a closure is capturing that is preventing consumption. rdar://109281444
…more consistent word tense sil_movekillscopyablevalue_* and sil_moveonlychecker_* can share diagnostics. rdar://109281444
this also fixes a bug where sometimes we simply emit 'consumed here' twice and other times we'd said 'other consume here' for the same "consumed more than once" message. so I went through and changed all of the 2nd consumes into "consumed again". rdar://109281444
…anup polish up the noncopyable diagnostics
…lings-go-faster [Runtime] Fast lookups of Concurrency types with standard manglings.
[Runtime] Skip metadata records search for classes in the __C module.
rdar://109790722 Layout strings are not guaranteed to be properly aligned, so we can't directly read from and write to it, but have to use memcpy instead.
[NFC] Use method for more @objcImpl diagnostics
[stdlib] don't copy array contents on `removeAll(keepingCapacity: true)`
Add ChangeLog entry for macros
Emit updated debug info when inout parameters are consumed and reinitialized.
…OF_PROCESSORS Support NUMBER_OF_PROCESSORS not being defined when running tests on Windows
Fix case mismatch in test error message expectation
[DiscardingTG] Undo pointer auth workaround; fix memory leaks
… Void closure Since apple#65613, DiscardingTG started to accept `() -> Void` instead of `() -> T`, but it also changed the number of arguments accepted by the closure from 3 to 2. So it should use `non_future_adapter` instead of `future_adapter` to avoid runtime signature mismatch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.