Skip to content

Fix outstanding issues. - #603

Open
MatyasKriz wants to merge 4 commits into
masterfrom
matty/fix/outstanding-issues
Open

MatyasKriz wants to merge 4 commits into
masterfrom
matty/fix/outstanding-issues

Conversation

@MatyasKriz

Copy link
Copy Markdown
Collaborator

No description provided.

Matty Cross and others added 4 commits July 29, 2026 22:36
The crawler recognized `static` and `final` modifiers but not the
`class` keyword, so `class func`/`class var` members leaked into
generated mocks as instance-level overrides that failed to compile.
Skip them with a verbose log message, matching static member handling.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Cuckoo 1.x wrapped mocks of @available(..., unavailable) members in
platform checks (PR #423); the 2.x templates lost them in three places:
MockTemplate never emitted the guards, VerificationProxyTemplate missed
them for properties, and Initializer.serialize() never exposed the
unavailablePlatformsCheck keys so NopImplStubTemplate rendered empty.

Adds a protocol fixture covering single/multi-platform unavailable
properties, methods, and an initializer requirement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Protocols inheriting Actor/AnyActor (directly or transitively) now
produce `actor` mocks and stubs instead of classes. Detection mirrors
the isNSObjectProtocol mechanism but always runs. Actor mocks declare
cuckoo_manager and __defaultImplStub as nonisolated(unsafe) and
enableDefaultImplementation as nonisolated to satisfy the non-isolated
protocol requirements.

Limitation: non-async members of actor mocks cannot forward to a
default implementation (would require synchronous cross-actor access),
so their defaultCall crashes like protocol superclass calls; async
members forward correctly via await.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Inout arguments are boxed in a new Cuckoo.InoutContainer reference type
inside the mock's method body: the box flows through matching and the
stub's action, superclass/default calls route through &box.value, and a
defer writes the final value back to the caller's variable. Matchers
and verify() see the initial (pre-mutation) value via an independent
snapshot box in escapingParameters, mirroring by-value semantics.

Single-inout methods get an ergonomic overload so stubs can write
`.then { value in value = 999 }`; methods mixing inout with other
parameters expose the container in the tuple (`params.0.value = ...`).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MatyasKriz
MatyasKriz force-pushed the matty/fix/outstanding-issues branch 2 times, most recently from dee1f81 to 521dd7e Compare September 5, 2026 14:49
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