What problem does it solve?
F# programs that compile cleanly can crash at runtime under --realsig+ with MethodAccessException, FieldAccessException, or TypeAccessException because compiler-synthesized closures and state machines are emitted as sibling types instead of nested types, losing access to private members. This Skill provides the mental model, code locations, repro methodology, and instrumentation patterns to find and fix these IlxGen codegen bugs.
Core Features & Use Cases
- Root-cause model: Explains how --realsig+ maps source private to IL private, why ECMA-335 nested-type access rules matter, and how eenv.cloc decides where closures are nested.
- Repro methodology: Shows how to build minimal repros that survive the optimizer (non-inlinable private members, --optimize+), compare --realsig+ vs --realsig- with a shipped SDK fsc, and read IL nesting via ildasm indentation.
- Instrumentation and fixes: Provides eprintfn-based logging patterns for GenMethodForBinding, the worked fix from PR #19955 (normalizing cloc to the member's DeclaringTypeRef), and test conventions for EmittedIL.RealInternalSignature baselines.
- Use Case: A contributor sees a test crash only under --realsig+; use this Skill to build a faithful repro, trace where the closure's cloc diverges, renest it under the declaring type, and add a theory test covering both realsig settings.
Quick Start
Ask the AI to diagnose why an F# program with a private member called from an inner let rec crashes with MethodAccessException only when compiled with --realsig+.