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
{{ message }}
Repository navigation
Compiler accepts abstract declare class as well as declare abstract class #65356
Both declarations compile without diagnostics. The TypeScript conformance suite exercises declare abstract class. We couldn’t find a corresponding test or design note for abstract declare class. Conformance test
🙂 Expected behavior
We’d like to confirm whether placing abstract before declare is intentional. If both orders are supported, we can accept both in swc-next. If only declare abstract is intended, a diagnostic for the reverse order would be helpful. That clarification would settle the parser question in swc-project/swc-next-issues#149.
Additional information about the issue
On November 6, 2026, GitHub Code Search returned 73,344 files for "declare abstract class" language:TypeScript and 18 for "abstract declare class" language:TypeScript. We inspected all 18 reverse-order hits. After deduplicating identical files, 12 remained. Nine were test or example files containing declarations, two contained the text in test strings, and one was an invalid example with a repeated modifier. These counts cover indexed files matching the exact phrases. Example from OpenHarmony’s parser tests
Normally we enforce an ordering whenever multiple erased keywords appear consecutively, but this was an oversight (abstract is a CodePlex-era feature so I don't have notes at hand). Seems like we got very lucky in this case and can safely ban the "wrong" order.
Activity
RyanCavanaugh commentedon Nov 6, 2026
Normally we enforce an ordering whenever multiple erased keywords appear consecutively, but this was an oversight (
abstractis a CodePlex-era feature so I don't have notes at hand). Seems like we got very lucky in this case and can safely ban the "wrong" order.