[ts] Throw a syntax error for index signature with declare (#12111)
This commit is contained in:
@@ -80,6 +80,8 @@ const TSErrors = Object.freeze({
|
||||
IndexSignatureHasAccessibility:
|
||||
"Index signatures cannot have an accessibility modifier ('%0')",
|
||||
IndexSignatureHasStatic: "Index signatures cannot have the 'static' modifier",
|
||||
IndexSignatureHasDeclare:
|
||||
"Index signatures cannot have the 'declare' modifier",
|
||||
InvalidTupleMemberLabel:
|
||||
"Tuple members must be labeled with a simple identifier.",
|
||||
MixedLabeledAndUnlabeledElements:
|
||||
@@ -2108,6 +2110,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
(member: any).accessibility,
|
||||
);
|
||||
}
|
||||
if ((member: any).declare) {
|
||||
this.raise(member.start, TSErrors.IndexSignatureHasDeclare);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user