# \#swift-syntax

**URL:** https://forums.swift.org/tag/swift-syntax/216.md

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

---

## [Proposing AND, OR as alternative syntax for the &&, || logical operators?](https://forums.swift.org/t/proposing-and-or-as-alternative-syntax-for-the-logical-operators/89660)

<div class="topic-metadata">

**Author:** [@gregh](https://forums.swift.org/u/gregh)\
**Replies:** 2\
**Last updated:** [September 20, 2026, 8:32pm UTC](https://forums.swift.org/t/proposing-and-or-as-alternative-syntax-for-the-logical-operators/89660 "2026-09-20T20:32:39Z")

</div>

I performed a cursory search of past Swift proposals, and I did not find any that proposed that Swift recognize and and or as alternative tokens for the current logical && and || operators. So, I am posting here to try a…

---

## [\[GSoC 2026\] Qualified Name Lookup for swift-syntax](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/89331)

<div class="topic-metadata">

**Author:** [@filip-sakel](https://forums.swift.org/u/filip-sakel)\
**Replies:** 0\
**Last updated:** [September 1, 2026, 10:04pm UTC](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/89331 "2026-09-01T22:04:32Z")

</div>

Introduction As part of Google Summer of Code 2026, I implemented a preliminary version of qualified name lookup in swift-syntax under the mentorship of Pavel Yaskevich (@xedin). Building on Jakub Florek’s GSoC 2024 unq…

---

## [Demo of my Swift Interpreter that uses SwiftSyntax](https://forums.swift.org/t/demo-of-my-swift-interpreter-that-uses-swiftsyntax/44379)

<div class="topic-metadata">

**Author:** [@joehink](https://forums.swift.org/u/joehink)\
**Replies:** 28\
**Last updated:** [August 16, 2026, 6:30pm UTC](https://forums.swift.org/t/demo-of-my-swift-interpreter-that-uses-swiftsyntax/44379 "2026-08-16T18:30:53Z")

</div>

Hey guys, I've been working on a Swift Interpreter for a while, and the results are starting to look good. It works by parsing the Swift code using SwiftSyntax then then traversing the AST tree. Here's a demo of it worki…

---

## [What's the difference between SimpleStringLiteralExprSyntax and StringLiteralExprSyntax?](https://forums.swift.org/t/whats-the-difference-between-simplestringliteralexprsyntax-and-stringliteralexprsyntax/87721)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 1\
**Last updated:** [June 27, 2026, 10:24pm UTC](https://forums.swift.org/t/whats-the-difference-between-simplestringliteralexprsyntax-and-stringliteralexprsyntax/87721 "2026-06-27T22:24:38Z")

</div>

The latter seems a lot more supported publicly than the former. What was its inspiration? What are their differences? Is the simple variant meant for general use? Or should we conditionalize string processing only with S…

---

## [\[Pitch\] Associated Type Disambiguation](https://forums.swift.org/t/pitch-associated-type-disambiguation/87170)

<div class="topic-metadata">

**Author:** [@vitamin](https://forums.swift.org/u/vitamin)\
**Replies:** 9\
**Last updated:** [June 9, 2026, 4:49pm UTC](https://forums.swift.org/t/pitch-associated-type-disambiguation/87170 "2026-06-09T16:49:48Z")

</div>

Associated Type Disambiguation Proposal: SE-NNNN Authors: Jonathan Gilbert Review Manager: TBD Status: Draft / experimental (-enable-experimental-feature AssociatedTypeDisambiguation) Implementation: swiftlang/swift#897…

---

## [Best way to support multiple swiftsyntax versions](https://forums.swift.org/t/best-way-to-support-multiple-swiftsyntax-versions/86961)

<div class="topic-metadata">

**Author:** [@floormatgen](https://forums.swift.org/u/floormatgen)\
**Replies:** 3\
**Last updated:** [May 29, 2026, 3:06pm UTC](https://forums.swift.org/t/best-way-to-support-multiple-swiftsyntax-versions/86961 "2026-05-29T15:06:14Z")

</div>

I was writing a utility package for one of my projects for the swift standard library, but got a major version conflict for swift-syntax (603 & 602) with one of my dependencies. As SwiftPM doesn't support multiple versio…

---

## [CMake, Swift-Syntax and Windows](https://forums.swift.org/t/cmake-swift-syntax-and-windows/85027)

<div class="topic-metadata">

**Author:** [@zaph](https://forums.swift.org/u/zaph)\
**Replies:** 4\
**Last updated:** [March 4, 2026, 12:03am UTC](https://forums.swift.org/t/cmake-swift-syntax-and-windows/85027 "2026-03-04T00:03:15Z")

</div>

I've been adding cmake support to qtbridge-swift with this commit. It works perfectly fine on macOS and linux. I suspect it'd be relatively trivial to get it to work on other platforms that support c++ interop. Apart fro…

---

## [\[GSoC 2026\] Qualified Name Lookup for swift-syntax](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/85055)

<div class="topic-metadata">

**Author:** [@ronitsabhaya75](https://forums.swift.org/u/ronitsabhaya75)\
**Replies:** 1\
**Last updated:** [March 1, 2026, 9:17pm UTC](https://forums.swift.org/t/gsoc-2026-qualified-name-lookup-for-swift-syntax/85055 "2026-03-01T21:17:46Z")

</div>

Hi everyone! My name is Ronit, and I'm a Computer Science student in my final year at the University of North Texas. I've been working with Swift for several years and have developed a strong interest in how programming …

---

## [\[GSoC 2026\] Interest in "Qualified name lookup for swift-syntax" Project](https://forums.swift.org/t/gsoc-2026-interest-in-qualified-name-lookup-for-swift-syntax-project/84995)

<div class="topic-metadata">

**Author:** [@ronitsabhaya75](https://forums.swift.org/u/ronitsabhaya75)\
**Replies:** 1\
**Last updated:** [February 26, 2026, 1:34am UTC](https://forums.swift.org/t/gsoc-2026-interest-in-qualified-name-lookup-for-swift-syntax-project/84995 "2026-02-26T01:34:17Z")

</div>

Hi everyone, I'm Ronit, a Computer Science student at UNT, and I'm very interested in working on the "Qualified name lookup for swift-syntax" project this GSoC. I've been following the progress of SwiftLexicalLookup fr…

---

## [Suppressing Inline Method Expansion to Avoid Dependency Leakage](https://forums.swift.org/t/suppressing-inline-method-expansion-to-avoid-dependency-leakage/83812)

<div class="topic-metadata">

**Author:** [@mystic-mandrill](https://forums.swift.org/u/mystic-mandrill)\
**Replies:** 0\
**Last updated:** [December 22, 2025, 8:17pm UTC](https://forums.swift.org/t/suppressing-inline-method-expansion-to-avoid-dependency-leakage/83812 "2025-12-22T20:17:34Z")

</div>

I'm trying to use @inline(never) to solve a problem with leaky dependencies. For context, I have a large, multi-module codebase. I have a “DataDefinition” module that defines all the public/shared type across the codeba…

---

## [Macros and XCFrameworks](https://forums.swift.org/t/macros-and-xcframeworks/68122)

<div class="topic-metadata">

**Author:** [@sjavora](https://forums.swift.org/u/sjavora)\
**Replies:** 43\
**Last updated:** [November 7, 2025, 9:09pm UTC](https://forums.swift.org/t/macros-and-xcframeworks/68122 "2025-11-07T21:09:24Z")

</div>

As those who have started adopting macros have found out, swift-syntax takes a while to build. On my M1 Pro, that's around 15 - 18 seconds. For smaller apps, I feel like this is an unacceptable wait - it's the vast major…

---

## [Announcing SyntaxKit](https://forums.swift.org/t/announcing-syntaxkit/80560)

<div class="topic-metadata">

**Author:** [@leogdion](https://forums.swift.org/u/leogdion)\
**Replies:** 1\
**Last updated:** [August 12, 2025, 11:23am UTC](https://forums.swift.org/t/announcing-syntaxkit/80560 "2025-08-12T11:23:05Z")

</div>

I love the work the community has done to use DSLs to create convenient ways of expressing ideas. I've done my own work with Swift Packages and have always felt SwiftSyntax could be simplified with a DSL. Unfortunately S…

---

## [Should Accessor Macros declarations require a names argument to synthesize getters and setters?](https://forums.swift.org/t/should-accessor-macros-declarations-require-a-names-argument-to-synthesize-getters-and-setters/70847)

<div class="topic-metadata">

**Author:** [@vanvoorden](https://forums.swift.org/u/vanvoorden)\
**Replies:** 5\
**Last updated:** [July 4, 2025, 12:31am UTC](https://forums.swift.org/t/should-accessor-macros-declarations-require-a-names-argument-to-synthesize-getters-and-setters/70847 "2025-07-04T00:31:11Z")

</div>

Hi! I've been experimenting with an accessor macro to synthesize a getter and setter on an arbitrary property. Things are working fine for me with this declaration: @attached(accessor) public macro PropertyMacroGetter…

---

## [Update Tutorial screenshots for Xcode16](https://forums.swift.org/t/update-tutorial-screenshots-for-xcode16/80425)

<div class="topic-metadata">

**Author:** [@Josephcursio](https://forums.swift.org/u/Josephcursio)\
**Replies:** 3\
**Last updated:** [June 14, 2025, 6:01pm UTC](https://forums.swift.org/t/update-tutorial-screenshots-for-xcode16/80425 "2025-06-14T18:01:28Z")

</div>

The SwiftSyntax Tutorial contains screenshots from xcode 15, and its user interface has since changed. https://swiftpackageindex.com/swiftlang/swift-syntax/601.0.1/tutorials/swiftsyntax/swiftsyntax-by-example Step 1: p…

---

## [Attached macro support for enum case arguments](https://forums.swift.org/t/attached-macro-support-for-enum-case-arguments/67952)

<div class="topic-metadata">

**Author:** [@soumyamahunt](https://forums.swift.org/u/soumyamahunt)\
**Replies:** 1\
**Last updated:** [May 27, 2025, 2:35am UTC](https://forums.swift.org/t/attached-macro-support-for-enum-case-arguments/67952 "2025-05-27T02:35:45Z")

</div>

Currently macros are not supported to be attached to enum case arguments. While there are no macro-roles that specify usage in such a way but using existing macro roles gives error: Unknown attribute 'Macro' for enum…

---

## [Macro Adoption Concerns around SwiftSyntax](https://forums.swift.org/t/macro-adoption-concerns-around-swiftsyntax/66588)

<div class="topic-metadata">

**Author:** [@stephencelis](https://forums.swift.org/u/stephencelis)\
**Replies:** 104\
**Last updated:** [April 28, 2025, 9:00pm UTC](https://forums.swift.org/t/macro-adoption-concerns-around-swiftsyntax/66588 "2025-04-28T21:00:01Z")

</div>

Macros are one of the most celebrated new features of Swift, and many of us are excited to adopt them in our projects. Many members of the core team are also excited to suggest macros as a solution to many problems. We’d…

---

## [Preprocessor-like transformations in swift-syntax?](https://forums.swift.org/t/preprocessor-like-transformations-in-swift-syntax/79210)

<div class="topic-metadata">

**Author:** [@zienag](https://forums.swift.org/u/zienag)\
**Replies:** 2\
**Last updated:** [April 10, 2025, 4:13pm UTC](https://forums.swift.org/t/preprocessor-like-transformations-in-swift-syntax/79210 "2025-04-10T16:13:52Z")

</div>

It looks like it's possible to perform preprocessor-like transformations on the syntax tree, given a list of compilation conditions and a target triple. Is there any open-source project that implements this, or somethin…

---

## [How to add a protocol with a macro if it is not added yet?](https://forums.swift.org/t/how-to-add-a-protocol-with-a-macro-if-it-is-not-added-yet/78626)

<div class="topic-metadata">

**Author:** [@RussBaz](https://forums.swift.org/u/RussBaz)\
**Replies:** 4\
**Last updated:** [March 26, 2025, 11:15am UTC](https://forums.swift.org/t/how-to-add-a-protocol-with-a-macro-if-it-is-not-added-yet/78626 "2025-03-26T11:15:10Z")

</div>

Hi. I just wrote my first Member Macro that adds a couple of properties to the struct/class that require a certain protocol to be applied. Now, I would like to automatically add this protocol to that class as well if it…

---

## [Parsing question about the #whatever expressions](https://forums.swift.org/t/parsing-question-about-the-whatever-expressions/72313)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 3\
**Last updated:** [June 9, 2024, 11:09am UTC](https://forums.swift.org/t/parsing-question-about-the-whatever-expressions/72313 "2024-06-09T11:09:11Z")

</div>

Just took a very brief look through Swift Syntax. I recall there have been special expressions like "#file" that let you get out-of-band information. Looking through the various "...Syntax" protocols, I saw one about mac…

---

## [RFC process for public API changes in swift-syntax](https://forums.swift.org/t/rfc-process-for-public-api-changes-in-swift-syntax/76447)

<div class="topic-metadata">

**Author:** [@ahoppen](https://forums.swift.org/u/ahoppen)\
**Replies:** 2\
**Last updated:** [January 9, 2025, 7:57pm UTC](https://forums.swift.org/t/rfc-process-for-public-api-changes-in-swift-syntax/76447 "2025-01-09T19:57:17Z")

</div>

swift-syntax is a widely used library, and any changes to its public API have a significant impact on its users. So far, we have evaluated this impact during PR reviews. While this has worked for us so far, it has the ri…

---

## [\[Mini-Vision\] Rethinking expectation capture in Swift Testing](https://forums.swift.org/t/mini-vision-rethinking-expectation-capture-in-swift-testing/77075)

<div class="topic-metadata">

**Author:** [@grynspan](https://forums.swift.org/u/grynspan)\
**Replies:** 0\
**Last updated:** [January 8, 2025, 8:16pm UTC](https://forums.swift.org/t/mini-vision-rethinking-expectation-capture-in-swift-testing/77075 "2025-01-08T20:16:58Z")

</div>

Happy New Year, my festive Swifty fellows! Have I got a late Hanukkah present\[1\] for you! Since we announced Swift Testing and shipped it to developers with the Swift 6 toolchain, we've been looking at how we could impr…

---

## [Sequencing Swift Components](https://forums.swift.org/t/sequencing-swift-components/76121)

<div class="topic-metadata">

**Author:** [@AzibMazhar](https://forums.swift.org/u/AzibMazhar)\
**Replies:** 1\
**Last updated:** [November 19, 2024, 9:51pm UTC](https://forums.swift.org/t/sequencing-swift-components/76121 "2024-11-19T21:51:13Z")

</div>

Understanding the Swift language based on what syntactic components are already acceptable by Xcode is the reason for creating this topic. For example, the word for is already acceptable and it can be used inside a nesti…

---

## [SwiftSyntax Builds for x86 on ARM](https://forums.swift.org/t/swiftsyntax-builds-for-x86-on-arm/76067)

<div class="topic-metadata">

**Author:** [@gestrich](https://forums.swift.org/u/gestrich)\
**Replies:** 1\
**Last updated:** [November 18, 2024, 12:56pm UTC](https://forums.swift.org/t/swiftsyntax-builds-for-x86-on-arm/76067 "2024-11-18T12:56:55Z")

</div>

I have an iOS project that uses Swift macros. On my new MacBook Pro (ARM), I notice that it builds for both x86 and ARM. There is no need for x86 in this process. You can reproduce this issue with a new simple project t…

---

## [\[GSoC-2024\] SwiftLexicalLookup - a new lexical name lookup library](https://forums.swift.org/t/gsoc-2024-swiftlexicallookup-a-new-lexical-name-lookup-library/75889)

<div class="topic-metadata">

**Author:** [@MAJKFL](https://forums.swift.org/u/MAJKFL)\
**Replies:** 4\
**Last updated:** [November 15, 2024, 9:52pm UTC](https://forums.swift.org/t/gsoc-2024-swiftlexicallookup-a-new-lexical-name-lookup-library/75889 "2024-11-15T21:52:19Z")

</div>

Hi everyone, I'm Jakub, and this summer during GSoC, I've worked with @Douglas\_Gregor on a new swift-syntax library: SwiftLexicalLookup. It consists of various lexical queries, answering questions like "Where is an erro…

---

## [How do I test generated syntax against expected string in swift-syntax version 600?](https://forums.swift.org/t/how-do-i-test-generated-syntax-against-expected-string-in-swift-syntax-version-600/75450)

<div class="topic-metadata">

**Author:** [@DJBen](https://forums.swift.org/u/DJBen)\
**Replies:** 3\
**Last updated:** [October 25, 2024, 6:49pm UTC](https://forums.swift.org/t/how-do-i-test-generated-syntax-against-expected-string-in-swift-syntax-version-600/75450 "2024-10-25T18:49:38Z")

</div>

I have CLI that codegen using swift-syntax. In swift-syntax 509 version, one can import the internal testing helper library and do this - it ought to generated a pretty-printed diff, nicer to compare large amount of stri…

---

## [Discrepancy between swift-ast-explorer and swift-syntax](https://forums.swift.org/t/discrepancy-between-swift-ast-explorer-and-swift-syntax/75103)

<div class="topic-metadata">

**Author:** [@soumyamahunt](https://forums.swift.org/u/soumyamahunt)\
**Replies:** 4\
**Last updated:** [October 2, 2024, 11:07am UTC](https://forums.swift.org/t/discrepancy-between-swift-ast-explorer-and-swift-syntax/75103 "2024-10-02T11:07:55Z")

</div>

While I understand the swift-ast-explorer is independent of swift-syntax, but the swift-syntax README links this tool for interactive exploration. Most of the use-cases have similar structure when parsed in swift-syntax …

---

## [Xcode unable to expand macro when macro name matches name of existing type?](https://forums.swift.org/t/xcode-unable-to-expand-macro-when-macro-name-matches-name-of-existing-type/69997)

<div class="topic-metadata">

**Author:** [@vanvoorden](https://forums.swift.org/u/vanvoorden)\
**Replies:** 3\
**Last updated:** [September 10, 2024, 7:07pm UTC](https://forums.swift.org/t/xcode-unable-to-expand-macro-when-macro-name-matches-name-of-existing-type/69997 "2024-09-10T19:07:25Z")

</div>

Hi! I'm running into problems expanding a macro when that macro name matches the name of an existing type. It's possible this is an Xcode issue (not a swift-syntax issue)… but I don't see anyway to expand a macro outside…

---

## [Multiple SwiftPM modules with macros triggers build failure "Multiple command produce …"](https://forums.swift.org/t/multiple-swiftpm-modules-with-macros-triggers-build-failure-multiple-command-produce/74127)

<div class="topic-metadata">

**Author:** [@Drekka](https://forums.swift.org/u/Drekka)\
**Replies:** 0\
**Last updated:** [August 23, 2024, 8:54am UTC](https://forums.swift.org/t/multiple-swiftpm-modules-with-macros-triggers-build-failure-multiple-command-produce/74127 "2024-08-23T08:54:49Z")

</div>

I've added macros to 3 SPM modules in our project. Setting them up with swift-syntax as a dedendency and adding .macro(…) targets which each modules sources depend on. The modules and their macros all work fine individua…

---

## [Xcode Refactor Actions and VS Code Code Actions](https://forums.swift.org/t/xcode-refactor-actions-and-vs-code-code-actions/74073)

<div class="topic-metadata">

**Author:** [@mtsrodrigues](https://forums.swift.org/u/mtsrodrigues)\
**Replies:** 2\
**Last updated:** [August 20, 2024, 9:44pm UTC](https://forums.swift.org/t/xcode-refactor-actions-and-vs-code-code-actions/74073 "2024-08-20T21:44:01Z")

</div>

Digging the swiftlang repositories I've found two different groups of refactors actions: swift: swift/lib/Refactoring at main · swiftlang/swift · GitHub swift-syntax: swift-syntax/Sources/SwiftRefactor at main · swiftl…

---

## [Macro protocols in swift-syntax lack async from expansion function requirements despite proposals stating they should have it](https://forums.swift.org/t/macro-protocols-in-swift-syntax-lack-async-from-expansion-function-requirements-despite-proposals-stating-they-should-have-it/73750)

<div class="topic-metadata">

**Author:** [@roopekv](https://forums.swift.org/u/roopekv)\
**Replies:** 1\
**Last updated:** [August 13, 2024, 6:47pm UTC](https://forums.swift.org/t/macro-protocols-in-swift-syntax-lack-async-from-expansion-function-requirements-despite-proposals-stating-they-should-have-it/73750 "2024-08-13T18:47:08Z")

</div>

Swift's concurrency features cannot be fully utilized in macros without being able to implement macro expansion functions as async. The Swift Evolution proposals clearly state that the expansion functions that the diffe…

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