Skip to content

Skeleton recovery must keep class modifiers #876

Open

Description

@Firehed

Skeleton recovery reads a class's abstract, final, and readonly modifiers in its declaration pattern but builds every class with no modifiers. A tree that skeleton recovery builds therefore describes each class as neither abstract, final, nor read-only, and the properties of a readonly class lose their implied read-only status with it.

A property's own readonly keyword does survive, because the property pattern keeps it.

Reachability

As of this writing, no file is known where the user sees this. Skeleton recovery is the last resort: it runs only when the parser and end-of-file recovery both read nothing. Each broken file tried so far, with a modified class, was read by an earlier step with its modifiers intact:

  • a class ending in an unfinished call
  • a complete class followed by a bare class at the end of the file
  • a bare class inside an unfinished class body

The one known file shape that reaches skeleton recovery ends at a bare top-level class with no class declared before it, so there are no modifiers to lose.

If a file is found where this happens, it belongs in tests/EndToEnd/defects/ as a known-defect script.

Done when: a class that skeleton recovery builds carries the abstract, final, and readonly modifiers written on it, with tests for each.

Found while reviewing #875.


This issue was written by AI.

Activity

  1. added
    bug
    on Oct 28, 2026
  2. changed the title [-]Class modifiers must survive skeleton recovery[/-] [+]Skeleton recovery must keep class modifiers[/+] on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-authoredbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions