Skip to content

Fix concurrency isolation for Generable macro expansion#28

Merged
mattt merged 4 commits into
mainfrom
mattt/fix-generable
Nov 11, 2025
Merged

Fix concurrency isolation for Generable macro expansion#28
mattt merged 4 commits into
mainfrom
mattt/fix-generable

Conversation

@mattt

@mattt mattt commented Nov 11, 2025

Copy link
Copy Markdown
Collaborator

Follow-up to #26

Resolves #24

Copilot AI 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.

Pull Request Overview

This PR fixes concurrency isolation issues in the Generable macro expansion by adding nonisolated modifiers to generated code and introduces a memberwise initializer for natural Swift initialization patterns.

  • Adds nonisolated modifier to the protocol conformance extension to prevent concurrency isolation conflicts
  • Implements a new memberwise initializer that accepts property values directly and automatically populates _rawGeneratedContent
  • Adds comprehensive test coverage for the memberwise initializer and verifies proper GeneratedContent population

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Sources/AnyLanguageModelMacros/GenerableMacro.swift Adds nonisolated modifier to extension declaration and implements new memberwise initializer generation logic
Tests/AnyLanguageModelTests/GenerableMacroTests.swift Adds TestArguments struct and new test cases for memberwise initialization, plus adds descriptive names to existing tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/AnyLanguageModelMacros/GenerableMacro.swift Outdated
@mattt
mattt merged commit 4339a61 into main Nov 11, 2025
3 checks passed
@mattt
mattt deleted the mattt/fix-generable branch November 11, 2025 16:40
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.

Example doesn't compile with default MainActor isolation

2 participants