Skip to content

[minor]: enumeration macros - #31

Merged
tayloraswift merged 21 commits into
masterfrom
feature/scoped-union
Sep 10, 2026
Merged

tayloraswift merged 21 commits into
masterfrom
feature/scoped-union

Conversation

@tayloraswift

@tayloraswift tayloraswift commented Sep 10, 2026

Copy link
Copy Markdown
Member

why a lowercase name for @ambient?

because @ambient is languagey. @Discriminated and @Projection are not languagey, i just made them up myself.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces three new Swift macros: @ambient, @Discriminated, and @Projection, along with their implementations and comprehensive unit tests. The reviewer provided valuable feedback to make these macros more robust. Key recommendations include: safely handling enum modifiers (such as filtering out indirect and conditionally applying @inlinable based on access control), supporting non-optional associated values in @Projection by checking if the parameter type is syntactically optional, and improving optional flattening in @Projection to correctly detect unsugared optionals like Optional<T>.

Comment thread Sources/LexicMacros/Ambient/AmbientMacro.swift
Comment thread Sources/LexicMacros/Discriminated/DiscriminatedMacro.swift
Comment thread Sources/LexicMacros/Projection/ProjectionMacro.swift
Comment thread Sources/LexicMacros/Projection/ProjectionMacro.swift
Comment thread Sources/LexicMacros/Discriminated/DiscriminatedMacro.swift
Comment thread Sources/LexicMacros/Projection/ProjectionMacro.swift
Comment thread Sources/ProjectionTests/ProjectionTests.swift
@tayloraswift
tayloraswift merged commit e8f72fa into master Sep 10, 2026
12 checks passed
@tayloraswift
tayloraswift deleted the feature/scoped-union branch September 10, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant