mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
A DEBUG-only structural check, the analog of ILInstruction.CheckInvariant, run after every AST transform in RunTransforms. It recursively asserts that each required (non-optional) single slot holds a child, every child's Parent points back, the stored flattened index matches the slot position, and the runtime type fits the slot, so a transform that corrupts the tree fails at that transform instead of as a downstream output diff. CSharpSlotInfo gains an IsOptional flag (emitted by the generator) so the check can tell required from optional slots. Assisted-by: Claude:claude-opus-4-8:Claude Codepull/3807/head
5 changed files with 55 additions and 22 deletions
Loading…
Reference in new issue