# \#diagnostics

**URL:** https://forums.swift.org/tag/diagnostics/583.md

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

---

## [Annotating Reflection APIs Unavailable in Embedded](https://forums.swift.org/t/annotating-reflection-apis-unavailable-in-embedded/90307)

<div class="topic-metadata">

**Author:** [@filip-sakel](https://forums.swift.org/u/filip-sakel)\
**Replies:** 2\
**Last updated:** [November 2, 2026, 5:14pm UTC](https://forums.swift.org/t/annotating-reflection-apis-unavailable-in-embedded/90307 "2026-11-02T17:14:28Z")

</div>

While I was trying to add Embedded support to SwiftSyntax, I ran into a bit of a rough edge in terms of Embedded support. I noticed that reflection APIs are conditionalized behind SWIFT\_ENABLE\_REFLECTION, which doesn't c…

---

## [\[Pitch\] SARIF Support for Swift Diagnostics](https://forums.swift.org/t/pitch-sarif-support-for-swift-diagnostics/85513)

<div class="topic-metadata">

**Author:** [@aviralgoel](https://forums.swift.org/u/aviralgoel)\
**Replies:** 2\
**Last updated:** [July 6, 2026, 8:18pm UTC](https://forums.swift.org/t/pitch-sarif-support-for-swift-diagnostics/85513 "2026-07-06T20:18:12Z")

</div>

Hello Swift Forums! :waving\_hand: This is a pitch for introducing support in the Swift compiler for serializing Swift diagnostics to the Static Analysis Results Interchange Format (SARIF) v2.1.0, a standardized JSON-bas…

---

## [Decoupling -verify tests from diagnostic wording](https://forums.swift.org/t/decoupling-verify-tests-from-diagnostic-wording/86751)

<div class="topic-metadata">

**Author:** [@broken-circle](https://forums.swift.org/u/broken-circle)\
**Replies:** 5\
**Last updated:** [June 9, 2026, 10:41pm UTC](https://forums.swift.org/t/decoupling-verify-tests-from-diagnostic-wording/86751 "2026-06-09T22:41:14Z")

</div>

DiagnosticVerifier currently supports expecting diagnostics only by matching the message text. This means that when diagnostic wording is improved, every test that references the old wording must be updated, even if the …

---

## [Pitch: Warn on near-miss protocol witness when a default implementation is chosen](https://forums.swift.org/t/pitch-warn-on-near-miss-protocol-witness-when-a-default-implementation-is-chosen/85098)

<div class="topic-metadata">

**Author:** [@azarovalex](https://forums.swift.org/u/azarovalex)\
**Replies:** 4\
**Last updated:** [April 25, 2026, 8:37pm UTC](https://forums.swift.org/t/pitch-warn-on-near-miss-protocol-witness-when-a-default-implementation-is-chosen/85098 "2026-04-25T20:37:12Z")

</div>

When a type declares a same-named property whose type is a refinement of a protocol requirement’s type, and the protocol provides a default implementation in an extension, Swift silently uses the default as the witness. …

---

## [Request for feedback: emitting warnings when weak capture list items cause strong captures](https://forums.swift.org/t/request-for-feedback-emitting-warnings-when-weak-capture-list-items-cause-strong-captures/78390)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 7\
**Last updated:** [January 28, 2026, 2:59pm UTC](https://forums.swift.org/t/request-for-feedback-emitting-warnings-when-weak-capture-list-items-cause-strong-captures/78390 "2026-01-28T14:59:05Z")

</div>

i have an outstanding draft PR that i've been trying to progress recently in which i'm looking to add diagnostics for situations like the following (example copied from this issue): class ClosureWrapper { var closur…

---

## [RBI: missing data race diagnostics in actor-context-inheriting closure](https://forums.swift.org/t/rbi-missing-data-race-diagnostics-in-actor-context-inheriting-closure/80266)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 2\
**Last updated:** [November 7, 2025, 6:30pm UTC](https://forums.swift.org/t/rbi-missing-data-race-diagnostics-in-actor-context-inheriting-closure/80266 "2025-11-07T18:30:51Z")

</div>

there is another outstanding issue with RBI diagnostics that has been lingering in the back of my mind for a while. a prior thread on it can be found here, and the corresponding bug report here. the reproduction takes th…

---

## [\[Pitch\] Improve diagnostic when attempting to send "task-isolated" value](https://forums.swift.org/t/pitch-improve-diagnostic-when-attempting-to-send-task-isolated-value/82915)

<div class="topic-metadata">

**Author:** [@jeremyabannister](https://forums.swift.org/u/jeremyabannister)\
**Replies:** 3\
**Last updated:** [November 5, 2025, 2:32am UTC](https://forums.swift.org/t/pitch-improve-diagnostic-when-attempting-to-send-task-isolated-value/82915 "2025-11-05T02:32:08Z")

</div>

It can be very surprising when code which was previously compiling is suddenly failing with an error like: Task-isolated 'foo' is passed as a 'sending' parameter; Uses in callee may race with later task-isolated uses o…

---

## [Thoughts on enabling explicit warnings-as-errors control over 'ungrouped' diagnostics?](https://forums.swift.org/t/thoughts-on-enabling-explicit-warnings-as-errors-control-over-ungrouped-diagnostics/81888)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 0\
**Last updated:** [August 30, 2025, 3:50pm UTC](https://forums.swift.org/t/thoughts-on-enabling-explicit-warnings-as-errors-control-over-ungrouped-diagnostics/81888 "2025-08-30T15:50:52Z")

</div>

with the implementation of SE-443 we've gained the ability to conditionally promote/demote warnings to errors in a much more granular way than was previously possible\[1\]. IIUC the long term goal is that all diagnostics t…

---

## [Naming warnings group for variable mutability](https://forums.swift.org/t/naming-warnings-group-for-variable-mutability/81356)

<div class="topic-metadata">

**Author:** [@Nickolas\_Pohilets](https://forums.swift.org/u/Nickolas_Pohilets)\
**Replies:** 1\
**Last updated:** [August 13, 2025, 5:31pm UTC](https://forums.swift.org/t/naming-warnings-group-for-variable-mutability/81356 "2025-08-13T17:31:44Z")

</div>

SE-0481: weak let makes weak var redundant if weak let is sufficient, with a corresponding diagnostic. Effectively this change removes special treatment of the weak declarations, and existing warnings variable\_never\_muta…

---

## [Emitting warning when creating instance of type conforming to protocol](https://forums.swift.org/t/emitting-warning-when-creating-instance-of-type-conforming-to-protocol/79298)

<div class="topic-metadata">

**Author:** [@erithacus](https://forums.swift.org/u/erithacus)\
**Replies:** 3\
**Last updated:** [May 12, 2025, 4:34pm UTC](https://forums.swift.org/t/emitting-warning-when-creating-instance-of-type-conforming-to-protocol/79298 "2025-05-12T16:34:05Z")

</div>

Hi all I've been looking at whether it is possible to emit a warning into Xcode when instantiating a type that conforms to a specific protocol. I can see that using SwiftSyntax, I could emit a warning when declaring th…

---

## [What is your workflow for updating failed diagnostic expectations in tests?](https://forums.swift.org/t/what-is-your-workflow-for-updating-failed-diagnostic-expectations-in-tests/79488)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 0\
**Last updated:** [April 24, 2025, 12:22pm UTC](https://forums.swift.org/t/what-is-your-workflow-for-updating-failed-diagnostic-expectations-in-tests/79488 "2025-04-24T12:22:21Z")

</div>

a workflow question regarding testing and diagnostics: when i'm adding new tests to the compiler which are expected to produce diagnostics, or change something that alters existing such tests, i generally find that i hav…

---

## [Let's debug: missing RBI data race diagnostics](https://forums.swift.org/t/lets-debug-missing-rbi-data-race-diagnostics/78910)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 10\
**Last updated:** [April 16, 2025, 7:54pm UTC](https://forums.swift.org/t/lets-debug-missing-rbi-data-race-diagnostics/78910 "2025-04-16T19:54:10Z")

</div>

the following is a compilation of notes and thoughts from researching code that should produce RBI diagnostics, but is not currently doing so. it is somewhat long and meandering, but can hopefully serve as documentation …

---

## [Surfacing educational notes for compiler errors](https://forums.swift.org/t/surfacing-educational-notes-for-compiler-errors/78023)

<div class="topic-metadata">

**Author:** [@hborla](https://forums.swift.org/u/hborla)\
**Replies:** 16\
**Last updated:** [March 4, 2025, 5:41pm UTC](https://forums.swift.org/t/surfacing-educational-notes-for-compiler-errors/78023 "2025-03-04T17:41:44Z")

</div>

@Joseph\_Heck had some good questions about surfacing educational notes in another thread. I thought I'd answer them in a new discussion thread because it's a slightly different topic from the original one. The educatio…

---

## [RFC: Educational notes for data-race safety errors](https://forums.swift.org/t/rfc-educational-notes-for-data-race-safety-errors/78003)

<div class="topic-metadata">

**Author:** [@hborla](https://forums.swift.org/u/hborla)\
**Replies:** 7\
**Last updated:** [February 26, 2025, 5:06pm UTC](https://forums.swift.org/t/rfc-educational-notes-for-data-race-safety-errors/78003 "2025-02-26T17:06:38Z")

</div>

I've started to add educational notes for data-race safety errors in \[Educational Notes\] Start adding educational notes for data-race safety. by hborla · Pull Request #79509 · swiftlang/swift · GitHub This initial PR co…

---

## [\[question\] is reading \`hasErrors()\` on \`DiagnosticTransaction\` supposed to have side effects?](https://forums.swift.org/t/question-is-reading-haserrors-on-diagnostictransaction-supposed-to-have-side-effects/72264)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 0\
**Last updated:** [June 5, 2024, 1:05pm UTC](https://forums.swift.org/t/question-is-reading-haserrors-on-diagnostictransaction-supposed-to-have-side-effects/72264 "2024-06-05T13:05:29Z")

</div>

i was looking at some code in the compiler like: DiagnosticTransaction txn(ctx.Diags); ctx.Diags.diagnose(/\*some error\*/); assert(!ctx.Diags.hadAnyError()); txn.abort(); assert(!ctx.Diags.hadAnyError()); and to my surp…

---

## [How to preserve 'tentative' diagnostics recorded during a \`DiagnosticTransaction\`?](https://forums.swift.org/t/how-to-preserve-tentative-diagnostics-recorded-during-a-diagnostictransaction/72244)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 0\
**Last updated:** [June 4, 2024, 4:25pm UTC](https://forums.swift.org/t/how-to-preserve-tentative-diagnostics-recorded-during-a-diagnostictransaction/72244 "2024-06-04T16:25:50Z")

</div>

i've been looking into this issue recently which i believe is due to error diagnostics being produced but effectively ignored when they should not be. as such, i've been searching for prior art that will allow the 'tenta…

---

## [\[Pitch\] Lazy ClangImporter Diagnostics Enabled by Default](https://forums.swift.org/t/pitch-lazy-clangimporter-diagnostics-enabled-by-default/54651)

<div class="topic-metadata">

**Author:** [@NuriAmari](https://forums.swift.org/u/NuriAmari)\
**Replies:** 2\
**Last updated:** [February 4, 2022, 8:31pm UTC](https://forums.swift.org/t/pitch-lazy-clangimporter-diagnostics-enabled-by-default/54651 "2022-02-04T20:31:24Z")

</div>

Hi all, A couple weeks ago, a change to improve the diagnostics of the ClangImporter was landed. The new diagnostics are hidden behind two flags, enabling lazily and eagerly triggered diagnostics respectively. I am prop…

---

## [Pitch: Improved ClangImporter Diagnostics](https://forums.swift.org/t/pitch-improved-clangimporter-diagnostics/52687)

<div class="topic-metadata">

**Author:** [@NuriAmari](https://forums.swift.org/u/NuriAmari)\
**Replies:** 16\
**Last updated:** [January 7, 2022, 3:02pm UTC](https://forums.swift.org/t/pitch-improved-clangimporter-diagnostics/52687 "2022-01-07T15:02:24Z")

</div>

Hi everyone, We would like to propose improvements to the ClangImporter to provide more detailed diagnostics when an entity cannot be imported from C or Objective-C. As it stands, when the ClangImporter fails to import …
