Skip to content

[2.0.x] Fix never type for dynamic container service IDs - #1016

Merged
mglaman merged 3 commits into
2.0.xfrom
fix-1012-2.0.x
Jul 17, 2026
Merged

[2.0.x] Fix never type for dynamic container service IDs#1016
mglaman merged 3 commits into
2.0.xfrom
fix-1012-2.0.x

Conversation

@mglaman

@mglaman mglaman commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Cherry-pick of #1014 (70c804d) to 2.0.x. Fixes #1012 for the 2.0.x line.

Clean pick, no conflicts. Full suite, targeted type and rule tests pass on 2.0.x.

🤖 Generated with Claude Code

fix(type): avoid never type for dynamic container service IDs

Container get()/has() built their return type by unioning the types of
each constant string argument. A variable service ID has none, so the
union of zero types collapsed to never — a subtype of everything —
triggering entityStoragePropertyAssignment on core-generated proxy
classes. Fall back to the declared return type instead.

Closes #1012

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@mglaman
mglaman merged commit a35b047 into 2.0.x Jul 17, 2026
11 of 12 checks passed
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