# \#bug

**URL:** https://forums.swift.org/tag/bug/15.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Potential bug in protocol extensions](https://forums.swift.org/t/potential-bug-in-protocol-extensions/89446)

<div class="topic-metadata">

**Author:** [@tera](https://forums.swift.org/u/tera)\
**Replies:** 0\
**Last updated:** [September 9, 2026, 12:42pm UTC](https://forums.swift.org/t/potential-bug-in-protocol-extensions/89446 "2026-09-09T12:42:13Z")

</div>

This fragment compiles fine: protocol P { func instanceReq(\_ v: String) -\> Int func instanceReq(\_ v: String?) -\> Int? static func staticReq(\_ v: String) -\> Int static func staticReq(\_ v: String?) -\> Int?…

---

## [Variadic ~Escapable arguments crash the compiler](https://forums.swift.org/t/variadic-escapable-arguments-crash-the-compiler/86727)

<div class="topic-metadata">

**Author:** [@snej](https://forums.swift.org/u/snej)\
**Replies:** 3\
**Last updated:** [May 15, 2026, 2:23pm UTC](https://forums.swift.org/t/variadic-escapable-arguments-crash-the-compiler/86727 "2026-05-15T14:23:11Z")

</div>

It appears to be impossible for a function to take a variable number of arguments of types that are (or may be) non-Escapable. In fact this one-liner crashes the compiler (Swift 6.3.1, macOS 26) func takesSpans(spans: R…

---

## [Task: Is order of task execution deterministic?](https://forums.swift.org/t/task-is-order-of-task-execution-deterministic/51553)

<div class="topic-metadata">

**Author:** [@tourultimate](https://forums.swift.org/u/tourultimate)\
**Replies:** 60\
**Last updated:** [March 17, 2026, 4:36pm UTC](https://forums.swift.org/t/task-is-order-of-task-execution-deterministic/51553 "2026-03-17T16:36:31Z")

</div>

I have some code that helps with awaiting emitted values from a Publisher. The glue code uses an actor to synchronize state. I have some code that looks like this: ... subscription = publisher …

---

## [Nonisolated(nonsending) causes crash](https://forums.swift.org/t/nonisolated-nonsending-causes-crash/85335)

<div class="topic-metadata">

**Author:** [@waldemarhorwat](https://forums.swift.org/u/waldemarhorwat)\
**Replies:** 3\
**Last updated:** [March 13, 2026, 9:44pm UTC](https://forums.swift.org/t/nonisolated-nonsending-causes-crash/85335 "2026-03-13T21:44:01Z")

</div>

Calling publishTest in the following program causes an EXC\_BAD\_INSTRUCTION crash in the attempt to run publishTest's closure. The program is compiled in Swift 6 mode with “nonisolated(nonsending) by Default” set to true …

---

## [Possible double-destruction bug for ~Copyable type when targeting WASM](https://forums.swift.org/t/possible-double-destruction-bug-for-copyable-type-when-targeting-wasm/85078)

<div class="topic-metadata">

**Author:** [@joehink](https://forums.swift.org/u/joehink)\
**Replies:** 6\
**Last updated:** [March 8, 2026, 11:25am UTC](https://forums.swift.org/t/possible-double-destruction-bug-for-copyable-type-when-targeting-wasm/85078 "2026-03-08T11:25:32Z")

</div>

I’m seeing different destruction behavior for a move-only type (~Copyable) when compiling for native vs WebAssembly. Native behavior matches expectations, but the WASM build appears to destroy the value twice. struct S…

---

## [Two convenience initializers can call each other forever](https://forums.swift.org/t/two-convenience-initializers-can-call-each-other-forever/85020)

<div class="topic-metadata">

**Author:** [@nevan](https://forums.swift.org/u/nevan)\
**Replies:** 5\
**Last updated:** [February 26, 2026, 10:09pm UTC](https://forums.swift.org/t/two-convenience-initializers-can-call-each-other-forever/85020 "2026-02-26T22:09:33Z")

</div>

I saw this other discussion, where a convenience init was allowed to call itself: I’m not sure if this is the same issue. Two convenience inits calling each other wasn’t flagged by the compiler, despite the init chain…

---

## [How do you get files into simulator?](https://forums.swift.org/t/how-do-you-get-files-into-simulator/85026)

<div class="topic-metadata">

**Author:** [@ak2466](https://forums.swift.org/u/ak2466)\
**Replies:** 2\
**Last updated:** [February 26, 2026, 6:21pm UTC](https://forums.swift.org/t/how-do-you-get-files-into-simulator/85026 "2026-02-26T18:21:47Z")

</div>

I have been trying for over an hour now. When I try to drag a file into the files app in the simulator from my Mac, it opens it in iMessage. Same thing happens when I share the file to the simulator from my Mac’s share s…

---

## [Incorrect text mirroring when switching .layoutDirection](https://forums.swift.org/t/incorrect-text-mirroring-when-switching-layoutdirection/84940)

<div class="topic-metadata">

**Author:** [@AlessianAU](https://forums.swift.org/u/AlessianAU)\
**Replies:** 1\
**Last updated:** [February 24, 2026, 2:55pm UTC](https://forums.swift.org/t/incorrect-text-mirroring-when-switching-layoutdirection/84940 "2026-02-24T14:55:56Z")

</div>

I’m trying to localise my project for an RTL language, and including an in app language switcher, but I’m encountering an issue where after switching to the RTL language, and switching back to English the English text is…

---

## ["Copy of noncopyable typed value" bug](https://forums.swift.org/t/copy-of-noncopyable-typed-value-bug/84873)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 4\
**Last updated:** [February 22, 2026, 1:10am UTC](https://forums.swift.org/t/copy-of-noncopyable-typed-value-bug/84873 "2026-02-22T01:10:05Z")

</div>

The following code hits a compiler bug: struct A: ~Copyable {} struct B: ~Copyable { var a: A? } func make() -\> sending B { B(a: nil) } func f() { let b = make().a // Error: Copy of noncopyable typed valu…

---

## [Created task unable to inherit actor isolation](https://forums.swift.org/t/created-task-unable-to-inherit-actor-isolation/84734)

<div class="topic-metadata">

**Author:** [@soumyamahunt](https://forums.swift.org/u/soumyamahunt)\
**Replies:** 1\
**Last updated:** [February 14, 2026, 11:39am UTC](https://forums.swift.org/t/created-task-unable-to-inherit-actor-isolation/84734 "2026-02-14T11:39:07Z")

</div>

I have an use-case for actor which matches following snippet: actor SomeActor { let executor = DispatchSerialQueue(label: "serial") var counter = 0 nonisolated var unownedExecutor: UnownedSerialExecutor { ex…

---

## [Swift-frontend crash switching over (any Error)?](https://forums.swift.org/t/swift-frontend-crash-switching-over-any-error/84670)

<div class="topic-metadata">

**Author:** [@bbrk24](https://forums.swift.org/u/bbrk24)\
**Replies:** 4\
**Last updated:** [February 11, 2026, 2:38am UTC](https://forums.swift.org/t/swift-frontend-crash-switching-over-any-error/84670 "2026-02-11T02:38:53Z")

</div>

Here's the code: var error: Error? // ... something which may or may not set error ... switch error { case AFError.explicitlyCancelled: // Task was cancelled, don't continue return case let e?: debugPrint(e…

---

## [Swift-UI unpredictable behavior](https://forums.swift.org/t/swift-ui-unpredictable-behavior/84610)

<div class="topic-metadata">

**Author:** [@vanjo](https://forums.swift.org/u/vanjo)\
**Replies:** 2\
**Last updated:** [February 7, 2026, 10:22am UTC](https://forums.swift.org/t/swift-ui-unpredictable-behavior/84610 "2026-02-07T10:22:21Z")

</div>

Why in this case when we tap the button and sheet comes in we go to the branch else even though we set title before isSheetPresented but it still somehow nil Does it somehow related to under the hood stuff like View Tre…

---

## [SE-0422 proposal. Potential bugs discovered 🚨](https://forums.swift.org/t/se-0422-proposal-potential-bugs-discovered/84365)

<div class="topic-metadata">

**Author:** [@RoBo-Inc](https://forums.swift.org/u/RoBo-Inc)\
**Replies:** 7\
**Last updated:** [February 2, 2026, 7:37am UTC](https://forums.swift.org/t/se-0422-proposal-potential-bugs-discovered/84365 "2026-02-02T07:37:46Z")

</div>

SE-0422: "Expression macro as caller-side default argument". TL;DR: Freestanding macros in a default argument position expend at a caller side (not in-place, as usual). Two potential bugs are discovered: - In a case o…

---

## [Misleading "Never be executed" warning](https://forums.swift.org/t/misleading-never-be-executed-warning/84472)

<div class="topic-metadata">

**Author:** [@nikolai.ruhe](https://forums.swift.org/u/nikolai.ruhe)\
**Replies:** 10\
**Last updated:** [January 30, 2026, 4:40pm UTC](https://forums.swift.org/t/misleading-never-be-executed-warning/84472 "2026-01-30T16:40:28Z")

</div>

In the following minimal example, the Swift compiler emits a warning Will never be executed pointing to the await in line 2. func wait(for task: Task\<Never, any Error\>) async throws -\> Never { try await task.value }…

---

## [Array element inclusion test compiles but crashes with EXC\_BAD\_ACCESS](https://forums.swift.org/t/array-element-inclusion-test-compiles-but-crashes-with-exc-bad-access/84223)

<div class="topic-metadata">

**Author:** [@nazariyg](https://forums.swift.org/u/nazariyg)\
**Replies:** 4\
**Last updated:** [January 19, 2026, 10:28pm UTC](https://forums.swift.org/t/array-element-inclusion-test-compiles-but-crashes-with-exc-bad-access/84223 "2026-01-19T22:28:51Z")

</div>

import Foundation \[String.self\].contains(where: { $0 == String.self }) swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1) Xcode 26.1 Call stack: \* thread #1, queue = 'c…

---

## [Let's debug: over-release of actors involving unowned self captures](https://forums.swift.org/t/lets-debug-over-release-of-actors-involving-unowned-self-captures/83897)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 16\
**Last updated:** [January 18, 2026, 8:05pm UTC](https://forums.swift.org/t/lets-debug-over-release-of-actors-involving-unowned-self-captures/83897 "2026-01-18T20:05:21Z")

</div>

there's this strange bug (and related thread) that was reported some time ago in which a closure that is actor-isolated and involves an unowned capture of the actor instance can seemingly lead to an over-release of the a…

---

## [Function parameter isolation not respected](https://forums.swift.org/t/function-parameter-isolation-not-respected/83260)

<div class="topic-metadata">

**Author:** [@NotTheNHK](https://forums.swift.org/u/NotTheNHK)\
**Replies:** 3\
**Last updated:** [November 18, 2025, 2:22am UTC](https://forums.swift.org/t/function-parameter-isolation-not-respected/83260 "2025-11-18T02:22:57Z")

</div>

Good Day everyone, Why does the function parameter work despite being @MainActor isolated, run on the global concurrent executor when passed a non-isolated function directly as an argument instead of as a trailing closu…

---

## [Swift 6.2 can't verify usage of a noncopyable type (and wants me to report this bug)](https://forums.swift.org/t/swift-6-2-cant-verify-usage-of-a-noncopyable-type-and-wants-me-to-report-this-bug/82532)

<div class="topic-metadata">

**Author:** [@ctietze](https://forums.swift.org/u/ctietze)\
**Replies:** 4\
**Last updated:** [October 28, 2025, 2:09pm UTC](https://forums.swift.org/t/swift-6-2-cant-verify-usage-of-a-noncopyable-type-and-wants-me-to-report-this-bug/82532 "2025-10-28T14:09:11Z")

</div>

With $ swift --version swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1) Target: arm64-apple-macosx15.0 And this file: import Foundation struct Foo: ~Copyable { i…

---

## [Mysterious Default Value for un-assigned variable](https://forums.swift.org/t/mysterious-default-value-for-un-assigned-variable/82670)

<div class="topic-metadata">

**Author:** [@MojtabaHs](https://forums.swift.org/u/MojtabaHs)\
**Replies:** 22\
**Last updated:** [October 16, 2025, 11:23am UTC](https://forums.swift.org/t/mysterious-default-value-for-un-assigned-variable/82670 "2025-10-16T11:23:26Z")

</div>

Hello everyone :waving\_hand: I came across a real mind-twist in Swift, and I’d love to hear your thoughts. Take a look at this code (no escaping, no concurrency involved): func foo(date: Date, action: () -\> Void) -\> D…

---

## [Decoding with and without configuration handles \`container.currentIndex\` differently in case of errors](https://forums.swift.org/t/decoding-with-and-without-configuration-handles-container-currentindex-differently-in-case-of-errors/82329)

<div class="topic-metadata">

**Author:** [@m4p](https://forums.swift.org/u/m4p)\
**Replies:** 0\
**Last updated:** [September 24, 2025, 10:35am UTC](https://forums.swift.org/t/decoding-with-and-without-configuration-handles-container-currentindex-differently-in-case-of-errors/82329 "2025-09-24T10:35:09Z")

</div>

According to documentation, if an error occurs during try container.decode(T.self) container.currentIndex is not incremented. That seems to be the case. However, if I use try container.decode(T.self, configuration: c…

---

## [Lexical context doesn't exist when using the macro as a default value](https://forums.swift.org/t/lexical-context-doesnt-exist-when-using-the-macro-as-a-default-value/82317)

<div class="topic-metadata">

**Author:** [@atifdev10](https://forums.swift.org/u/atifdev10)\
**Replies:** 0\
**Last updated:** [September 23, 2025, 5:46pm UTC](https://forums.swift.org/t/lexical-context-doesnt-exist-when-using-the-macro-as-a-default-value/82317 "2025-09-23T17:46:44Z")

</div>

When I was developing a macro, I ran into this issue. When I use a macro as a default value, there aren't any lexical contexts. The macro for testing: struct LexCountMacro: ExpressionMacro { static func expansion( …

---

## [Swift 6.2 hidden actor race condition](https://forums.swift.org/t/swift-6-2-hidden-actor-race-condition/82187)

<div class="topic-metadata">

**Author:** [@waldemarhorwat](https://forums.swift.org/u/waldemarhorwat)\
**Replies:** 8\
**Last updated:** [September 23, 2025, 5:14am UTC](https://forums.swift.org/t/swift-6-2-hidden-actor-race-condition/82187 "2025-09-23T05:14:02Z")

</div>

The following program compiles and runs using the Xcode Swift 6.2 compiler in Swift 6 mode with no warnings or errors: import Foundation class Stateful { var x: Int init() { x = 0 } } class Entry { let id: Int …

---

## [Regression: Xcode 15 can't build Swift for macOS earlier than 10.15](https://forums.swift.org/t/regression-xcode-15-cant-build-swift-for-macos-earlier-than-10-15/66986)

<div class="topic-metadata">

**Author:** [@CharlesS](https://forums.swift.org/u/CharlesS)\
**Replies:** 8\
**Last updated:** [September 20, 2025, 8:55am UTC](https://forums.swift.org/t/regression-xcode-15-cant-build-swift-for-macos-earlier-than-10-15/66986 "2025-09-20T08:55:59Z")

</div>

According to the documentation, Xcode is supposed to be able to build for macOS 10.13 and up. However, this does not seem to be the case in practice; my testers on 10.14.6 have reported random crashes when trying to test…

---

## [Broken image links in https://www.swift.org/blog/swift-5-exclusivity/ post](https://forums.swift.org/t/broken-image-links-in-https-www-swift-org-blog-swift-5-exclusivity-post/81819)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 0\
**Last updated:** [August 26, 2025, 12:36pm UTC](https://forums.swift.org/t/broken-image-links-in-https-www-swift-org-blog-swift-5-exclusivity-post/81819 "2025-08-26T12:36:03Z")

</div>

mostly an FYI, but the image links in the 'swift-5-exclusivity' blog post appear to have been broken during the site redesign changes – they look like this at the moment: here is a proposed fix: \[fix\]: resolve broken…

---

## [Swift compiler crashes by generics / missing conformance](https://forums.swift.org/t/swift-compiler-crashes-by-generics-missing-conformance/81677)

<div class="topic-metadata">

**Author:** [@nesrve](https://forums.swift.org/u/nesrve)\
**Replies:** 1\
**Last updated:** [August 17, 2025, 1:15am UTC](https://forums.swift.org/t/swift-compiler-crashes-by-generics-missing-conformance/81677 "2025-08-17T01:15:09Z")

</div>

struct Foo\<T\> {} struct Bar {} let foo = Foo\<Bar\>() let foos: Set\<Foo\> = \[foo\] trying to run this crashes the compiler. the code snippet above is an attempt from me to get a minimal reproduction of the code that cause…

---

## [MemberAttributeMacro produces Command SwiftCompile failed with a nonzero exit code](https://forums.swift.org/t/memberattributemacro-produces-command-swiftcompile-failed-with-a-nonzero-exit-code/81306)

<div class="topic-metadata">

**Author:** [@patryk](https://forums.swift.org/u/patryk)\
**Replies:** 0\
**Last updated:** [July 25, 2025, 6:17pm UTC](https://forums.swift.org/t/memberattributemacro-produces-command-swiftcompile-failed-with-a-nonzero-exit-code/81306 "2025-07-25T18:17:12Z")

</div>

Hello, While developing a macros package, I have encountered an error that I'm still trying to fully understand. The problem appears to affect only MemberAttributeMacro, although it might also stem from conditional conf…

---

## [Expected a compiler error](https://forums.swift.org/t/expected-a-compiler-error/80913)

<div class="topic-metadata">

**Author:** [@couchdeveloper](https://forums.swift.org/u/couchdeveloper)\
**Replies:** 8\
**Last updated:** [July 5, 2025, 5:32pm UTC](https://forums.swift.org/t/expected-a-compiler-error/80913 "2025-07-05T17:32:16Z")

</div>

The following code allows the use of a non-sendable value after being passed as a sending parameter: class NonSendable { var value: Int = 0 } func isolatedSend( \_ value: sending NonSendable, isolated: isol…

---

## [Possible compiler issue with typed Error](https://forums.swift.org/t/possible-compiler-issue-with-typed-error/80531)

<div class="topic-metadata">

**Author:** [@theo](https://forums.swift.org/u/theo)\
**Replies:** 2\
**Last updated:** [June 18, 2025, 2:30am UTC](https://forums.swift.org/t/possible-compiler-issue-with-typed-error/80531 "2025-06-18T02:30:14Z")

</div>

I expose the following in a local package in a Xcode project: extension TaskSchedule { public enum ValidationError: Error { case endDateBeforeStartDate case endDateInPast } public func v…

---

## [Passing a Collection to Set.contains(\_:) leads to confusing results](https://forums.swift.org/t/passing-a-collection-to-set-contains-leads-to-confusing-results/76393)

<div class="topic-metadata">

**Author:** [@marco.masser](https://forums.swift.org/u/marco.masser)\
**Replies:** 4\
**Last updated:** [June 17, 2025, 8:24pm UTC](https://forums.swift.org/t/passing-a-collection-to-set-contains-leads-to-confusing-results/76393 "2025-06-17T20:24:19Z")

</div>

There is a confusing behavior of Set.contains(\_:) when passing a collection that contains more than one element: let s: Set = \[1, 2, 3\] s.contains(\[1\]) // true s.contains(\[1\] as Set) // true s.contains(\[1, 2\]) // false …

---

## [Compiler emits misleading 'Binding' error on \`ForEach\` when its content accesses an optional property inside a complex View](https://forums.swift.org/t/compiler-emits-misleading-binding-error-on-foreach-when-its-content-accesses-an-optional-property-inside-a-complex-view/80502)

<div class="topic-metadata">

**Author:** [@EdwinZhanCN](https://forums.swift.org/u/EdwinZhanCN)\
**Replies:** 0\
**Last updated:** [June 16, 2025, 10:07pm UTC](https://forums.swift.org/t/compiler-emits-misleading-binding-error-on-foreach-when-its-content-accesses-an-optional-property-inside-a-complex-view/80502 "2025-06-16T22:07:21Z")

</div>

1. Description The Swift compiler fails to type-check a SwiftUI view when a ForEach loop's content includes conditional logic to unwrap an optional property. The code is incorrect, the Ingredient struct does not own a q…

[Next page](https://forums.swift.org/tag/bug/15.md?match_all_tags=true&page=1&tags%5B%5D=bug)
