Registry Mirror
Skip to content

Conversation

@christophwille

Copy link
Copy Markdown
Member

Follow-up to #4247, which fixed items 1-3 of #4244. The remaining "Related observation" there turned out to be a bug: -il and --il-sequence-points disassembled the whole module and silently ignored -t / -m, while the C# output applies them.

The IL path now resolves the selection through the same TryResolveType / TryResolveMembers helpers as the C# path and behaves the same way:

  • -t disassembles only that type, -m only that member (an overload group named in short form prints every overload with the same names N members header).
  • A property or event is followed by its accessor methods, as in the UI's IL view.
  • -t together with -m exits with EX_USAGE, an unknown type or member with EX_DATAERR.
  • With -o, the output file is named after the selected type, as the C# output already did.

Without -t / -m the whole module is still written, so existing scripts are unaffected.

Tests: new ILOptionTests.cs (8 cases, red before the fix); the whole ICSharpCode.ILSpyCmd.Tests project passes (81 tests).

#4244

Assisted-by: Claude:claude-fable-5-1:Claude Code

-il and --il-sequence-points disassembled the whole module and silently
ignored -t and -m, while the C# output applies them. The two outputs are
meant to select the same thing, so the IL path now resolves the selection
through the same TryResolveType/TryResolveMembers helpers, reports the same
usage and data errors, and names the -o output file after the selected type
the way the C# path does. A property or event is followed by its accessor
methods, as in the UI's IL view, since the definition alone carries no code.

#4244

Assisted-by: Claude:claude-fable-5-1:Claude Code
@christophwille
christophwille merged commit 00339cf into master Oct 18, 2026
18 checks passed
@christophwille
christophwille deleted the fix/4244-il-honors-selection branch October 18, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants