Skip to content

Conversation

@bok-
Copy link
Contributor

@bok- bok- commented Dec 1, 2025

📒 Description

We currently skip generating Equatable conformance inside @FlagContainer if the declaration is empty (has no stored properties). This is different from the synthesised conformance to Equatable that the compiler generates, as described in SE-0185:

A struct T: Equatable that satisfies the conditions above will receive a synthesized implementation of static func == (lhs: T, rhs: T) -> Bool that returns true if and only if lhs.x == rhs.x for all stored properties x in T. If the struct has no stored properties, this operator simply returns true.

Currently, this means empty @FlagContainers that appear any where in a flag hierarchy breaks generated Equatable conformance for the entire hierarchy.

This PR updates @FlagContainer to generate Equatable conformance inline with the behaviour described in SE-0185.

🗳 Test Plan

Covered by unit tests and compilation tests.

@bok- bok- added patch A tiny change according to semver. vexil3 Part of the Vexil 3 alpha/beta development labels Dec 1, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

@bok- bok- merged commit f8a9179 into main Dec 1, 2025
27 checks passed
@bok- bok- deleted the fix/vexil3/empty-equatable branch December 1, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A tiny change according to semver. vexil3 Part of the Vexil 3 alpha/beta development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants