File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -457,6 +457,7 @@ Type casts
457
457
458
458
foo as any as Array<number>
459
459
bar satisfies number[]
460
+ "foobar" as const
460
461
461
462
---
462
463
@@ -466,7 +467,11 @@ bar satisfies number[]
466
467
(as_expression (identifier) (predefined_type))
467
468
(generic_type (type_identifier) (type_arguments (predefined_type)))))
468
469
(expression_statement
469
- (satisfies_expression (identifier) (array_type (predefined_type)))))
470
+ (satisfies_expression (identifier) (array_type (predefined_type))))
471
+ (expression_statement
472
+ (as_expression
473
+ (string
474
+ (string_fragment)))))
470
475
471
476
=================================
472
477
Ambient export function declarations
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ module.exports = function defineGrammar(dialect) {
438
438
as_expression : $ => prec . left ( 'binary' , seq (
439
439
$ . expression ,
440
440
'as' ,
441
- $ . _type
441
+ choice ( 'const' , $ . _type )
442
442
) ) ,
443
443
444
444
satisfies_expression : $ => prec . left ( 'binary' , seq (
You can’t perform that action at this time.
0 commit comments