mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
A type's leading field assignments are extracted to field declarations only when every constructor that does not chain with this() agrees on them. When they disagree, the analyzer gave up on the whole type, so the remaining constructors' this()/base() calls were never lifted into initializers -- a struct with two divergent constructors plus a chaining one rendered the chain as `this = new TSelf(...)` instead of `: this(...)`. Chain lifting does not depend on the shared-initializer extraction, so a mismatch now just skips the extraction (the assignments stay in the bodies) and the transform continues. Primary constructors still bail, since their parameters drive the initializers that must be extracted. Assisted-by: Claude:claude-opus-4-8:Claude Codepull/3863/head
2 changed files with 41 additions and 2 deletions
Loading…
Reference in new issue