Skip to content

Conversation

@ileitch
Copy link
Contributor

@ileitch ileitch commented Dec 19, 2025

When a subclass inherits an initializer from its superclass, calling the initializer on the subclass (e.g., Child(param: "foo")) was not marking the superclass initializer as used, causing a false-positive.

The index store records a relationship from the superclass initializer to the subclass implicit initializer, but not the inverse. Added a new mutator (InheritedImplicitInitializerReferenceBuilder) that creates the inverse reference so that when the implicit initializer is used, the superclass initializer is also marked as used.

Fixes #957

When a subclass inherits an initializer from its superclass, calling the
initializer on the subclass (e.g., `Child(param: "foo")`) was not marking
the superclass initializer as used, causing a false-positive.

The index store records a relationship from the superclass initializer to
the subclass implicit initializer, but not the inverse. Added a new mutator
(InheritedImplicitInitializerReferenceBuilder) that creates the inverse
reference so that when the implicit initializer is used, the superclass
initializer is also marked as used.

Fixes #957
@ileitch ileitch merged commit 2c89ad1 into master Dec 19, 2025
8 of 10 checks passed
@ileitch ileitch deleted the issue-957 branch December 19, 2025 09:12
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.

Superclass initializer false-positive

2 participants