Closed
Description
Currently we have the following AST properties declared:
These all represent bad code that would cause errors if one attempted to build in TS:
public enum Foo {}
// 'public' modifier cannot appear on a module or namespace element.(1044)
abstract namespace Bar {}
// 'abstract' modifier can only appear on a class, method, or property declaration.(1242)
interface Baz implements Bam {}
// Interface declaration cannot have 'implements' clause.(1176)
abstract interface Bam {}
// 'abstract' modifier can only appear on a class, method, or property declaration.
TS parses these fine and emits a semantic error, not a syntactic error.
Our parser currently does not error on syntactically bad code, thus we also don't error on it (#1852).
We should remove these properties from the AST as it is non-sensical to include them - nobody should ever be inspecting the code that is produced on them.