Skip to content

Leave public out of .api files - #100

Merged
Mpdreamz merged 1 commit into
mainfrom
implicit-public
Nov 14, 2026
Merged

Mpdreamz merged 1 commit into
mainfrom
implicit-public

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

Everything in a .api file is visible from outside, so public was noise on nearly every line. Declarations now carry an access modifier only when it says something: protected or protected internal. The parser still accepts a written public, and treats a missing modifier as public.

namespace Lib.Drawing
  class Dog : Animal
    Dog()
    override Dog Clone()

  sealed record Employee : Person, IEquatable<Employee>
    Employee(string Name, int Age, string Team)
    string Team { get; init; }
    override Employee <Clone>$()

One fix rides along. With public gone, a member line can start with delegate*, a function pointer field, and the parser would have taken that for a delegate declaration. The samples now include a function pointer field. Everything else in the diff is regenerated output: the snapshots, the committed api/, and the doc examples.

Checks: mise run ci passes locally, including verifyapi against the regenerated api/. The Roslyn oracle and the round-trip tests pass on the new format: 75 library tests and 630 tool tests.

🤖 Generated with Claude Code

Everything in a .api file is visible from outside, so public said nothing on nearly every line: declarations now
start with protected or protected internal when they are, and with nothing when they are public. The parser still
reads a public that is written.

A member line that starts with delegate* is a function pointer field, not a delegate declaration; the samples gain
one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the feature A new capability (minor bump) label Nov 14, 2026
@Mpdreamz
Mpdreamz merged commit 7019a8d into main Nov 14, 2026
6 of 7 checks passed
@Mpdreamz
Mpdreamz deleted the implicit-public branch November 14, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new capability (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant