mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 11:24:49 -05:00
Fix errors on type assertions in erasableSyntaxOnly (#61452)
This commit is contained in:
committed by
GitHub
parent
ee3dd7264b
commit
4dc677b292
@@ -37316,8 +37316,8 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
|
||||
}
|
||||
if (compilerOptions.erasableSyntaxOnly) {
|
||||
const start = node.type.pos - "<".length;
|
||||
const end = skipTrivia(file.text, node.type.end) + ">".length;
|
||||
const start = skipTrivia(file.text, node.pos);
|
||||
const end = node.expression.pos;
|
||||
diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user