You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Activity
[-]Class modifiers must survive skeleton recovery[/-][+]Skeleton recovery must keep class modifiers[/+]Report properties of a readonly class as read-only (#875)