Skip to content

cssig: distinguish abstract vs default-implemented interface members - #41

Merged
agocke merged 1 commit into
mainfrom
agocke/interface-default-impl
Jun 29, 2026
Merged

cssig: distinguish abstract vs default-implemented interface members#41
agocke merged 1 commit into
mainfrom
agocke/interface-default-impl

Conversation

@agocke

@agocke agocke commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Problem

cssig normalized away virtuality for all interface members, so an abstract method and one with a default implementation were indistinguishable. Removing a default implementation — which re-breaks every implementer — went undetected, contrary to breaking-change requirements.

Changes

  • SignatureModel.csFlagsFrom no longer strips virtuality bits for interface members; abstract vs. default-implemented (virtual) is now part of the compared signature.
  • CsSigWriter.cs — emits virtual for default-implemented interface members and explicit abstract for static abstract members (static members aren't implicitly abstract) so signatures round-trip while preserving the distinction. Instance abstract members stay implicit.
  • GRAMMAR.md — documents the modifier rules.
  • Tests — added InterfaceDefaultImplementationRemovalReported (virtual→abstract flagged CSSIG005); updated RoundTripDefaultInterfaceMethods and the static-ness test. All 63 CsSig tests pass.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

A body-less .cssig collapsed abstract and default-implemented interface
members into the same virtuality, so removing a default implementation
(a source/binary break for every implementer) went undetected. Preserve
the distinction by emitting virtual for default implementations (and
explicit abstract for static abstract members) so it survives the round
trip and is compared.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@agocke
agocke merged commit d31a568 into main Jun 29, 2026
2 checks passed
@agocke
agocke deleted the agocke/interface-default-impl branch June 29, 2026 02:44
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