forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/issue 72662 bad diagnostic for force unwrapped p #3
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
Draft
iMostfa
wants to merge
260
commits into
main
Choose a base branch
from
feature/issue-72662-Bad-diagnostic-for-force-unwrapped-p
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Feature/issue 72662 bad diagnostic for force unwrapped p #3
iMostfa
wants to merge
260
commits into
main
from
feature/issue-72662-Bad-diagnostic-for-force-unwrapped-p
Conversation
This file contains hidden or 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
Utilize and expand the pre-existing peephole. rdar://127115078
Clang-imported superclass methods.
[Concurrency] Don't ignore mismatching isolation for overrides of Clang-imported superclass methods.
Distributed actors can be treated as actors by accessing the `asLocalActor` property. When lowering `#isolation` in a distributed actor initializer, use a separate builtin `flowSensitiveDistributedSelfIsolation` to capture the conformance to `DistributedActor`, and have Definite Initialization introduce the call to the `asLocalActor` getter when needed.
…or-init-isolation Teach `#isolation` to respect the flow-sensitive nature of actor initializers
…uest When doing solver-based completion, the request will fail, avoid falling back to a regular call expression in that case; we only care about whether we got the callback. rdar://129024996
If the extension does not match the protocol type that we're doing the lookup for, check whether the `Self` type conforms to the protocol; in that case we have e.g an extension for an inherited protocol. rdar://129024996
In Swift, we can have enum elements and methods with the same name, they are overloaded. Unfortunately, this feature is not supported by C++ interop at the moment. This patch avoids emitting the methods with name collisions to make sure the resulting header can be compiler. A proper fix should follow in a later PR. rdar://128162252
…cker. If a protocol provides a deprecated default implementation for a requirement that is not deprecated, the compiler should emit a warning so the programmer can provide an explicit implementation of the requirement. This is helpful for staging in new protocol requirements that should be implemented in conforming types.
Fixes a crash in case a lazy var is declared after a return statement swiftlang#73736
The Getting Started guide offers a build-script command that new contributors can use to quickly build a debug compiler on their local machine. The command already has `--skip-tvos` and `--skip-watchos` flags since most compiler contributors don't need to build for those platforms. This change adds `--skip-xros` flag to the command.
…guage-feature Make BorrowingSwitch a LANGUAGE_FEATURE.
… types Non-loadable types don't necessarily need metadata, for example, structs with `@_rawLayout` swiftlang#73951
…ft runtime Having a Swift array of C++ reference types without crashing at runtime only became possible recently (swiftlang#73615). When building against an older runtime, one would still see runtime crashes. This is expected because part of the fix is in the Swift runtime. This makes sure we don't try to run tests for C++ reference types with an older Swift runtime. rdar://128681137
Fix the cross-compiling Windows ARM64 build.
[MoveOnly] Call mutating methods on existentials.
…tion/20240606/1 [LifetimeCompletion] Removed "with leaks" mode.
Make it a bit clearer which function actually cares about the closure it's handed.
Unfortunately we've encountered another source
breaking case here:
```
class C {
func method() {}
func foo() {
Task { [weak self] in
Task {
method()
}
}
}
}
```
In 5.10 we'd only do the unqualified lookup for
`self` when directly in a `weak self` closure,
but with the implicit self rework, we'd start
using the `weak self` here, leading to a
type-checker error.
At this point, adding more edge cases to the
existing logic is going to make things much more
complicated. Instead, reinstate the 5.10 implicit
self lookup behavior and diagnostic logic,
switching over to the new logic only under Swift 6
mode.
rdar://129475277
…hod-name-clash [cxx-interop] Avoid emitting methods that cause name clash
…decl SILGen: ignore unreachable var decls
rdar://128424443
We now may have constrained existentials that have no primary associated types, so there won't be any arguments for the parameterized protocol type. Because the "constrained" part is that there's an inverse. resolves rdar://128695929
…31d7649c1005be9c49d771c [region-isolation] Implement function sub typing rules
PR swiftlang#74394 removed a field from `struct MetadataSections` whose layout is ABI. So restore that field as an unused padding field to preserve the layout of all the other fields in that struct.
…g-in-dump [ASTDumper] Avoid parsing decl members
[SwiftCompilerSources] add unknown default case for bridged function serializedkind.
Update the SDK deployment to include the static libraries as well. This is primarily needed for the C++ interop libraries.
…e-only-test [cxx-interop] Fix a test for move-only types
Demangler: edge case in existential demangling
…ilds. The implementation of this experimental feature is not complete and it's not ready to be enabled in production.
…removal-fix Fix an ABI break
Drop old comment that's very dated and very unnecessary
The parser is supposed to avoid looking inside unmatched `#if` compiler (et al) blocks. This usually means that the following code builds fine #if compiler(>=100) foo bar #endif however, a logical bug meant that if the check was nested inside an already-inactive `#if` block, it would not adhere to this evaluation-skipping behavior #if false #if compiler(>=100) foo bar // error! #endif #endif This PR fixes this specific case.
…-throws [Features] `FullTypedThrows` should only be enable-able in asserts builds.
utils: copy static libraries for Android SDK
…agnoses from better choices.
…ocols Delete binary file commited by mistake.
[Sema] Score non-settable overload choices higher in RValueToLValue fix
…ormances Tests: fixup "report public conformances to non-publicly imported protocols"
[Sema] Add validation test for issue swiftlang#46000
71d3c4f to
9e3e2aa
Compare
…force_unwrapped_any
iMostfa
pushed a commit
that referenced
this pull request
Jul 19, 2024
This inserts a suitably named function into the stack trace whenever a dynamic cast failure involves a NULL source or target type. Very often, crash logs include backtraces with function names but no log output; with this change, such a backtrace might look like the following -- note `TARGET_TYPE_NULL` in the function name here to mark the missing type information: ``` frame #0: __pthread_kill + 8 frame #1: pthread_kill + 288 frame #2: abort + 128 frame #3: swift::fatalErrorv() frame #4: swift::fatalError() frame #5: swift_dynamicCastFailure_TARGET_TYPE_NULL() frame #6: swift::swift_dynamicCastFailure() frame swiftlang#7: ::swift_dynamicCast() ``` Resolves rdar://130630157
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.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves #NNNNN, fix apple/llvm-project#MMMMM.