File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -3417,7 +3417,7 @@ export class Parser extends DiagnosticEmitter {
34173417 startPos : i32
34183418 ) : TypeDeclaration | null {
34193419
3420- // at 'type': Identifier ('<' TypeParameters '>')? '=' Type ';'?
3420+ // at 'type': Identifier ('<' TypeParameters '>')? '=' '|'? Type ';'?
34213421
34223422 if ( tn . skipIdentifier ( ) ) {
34233423 let name = Node . createIdentifierExpression ( tn . readIdentifier ( ) , tn . range ( ) ) ;
@@ -3428,6 +3428,7 @@ export class Parser extends DiagnosticEmitter {
34283428 flags |= CommonFlags . GENERIC ;
34293429 }
34303430 if ( tn . skip ( Token . EQUALS ) ) {
3431+ tn . skip ( Token . BAR ) ;
34313432 let type = this . parseType ( tn ) ;
34323433 if ( ! type ) return null ;
34333434 let ret = Node . createTypeDeclaration (
Original file line number Diff line number Diff line change 11type int32_t = i32 ;
22@nonportable ( )
33export type uint64_t = u64 ;
4+
5+ // with leading `|`
6+ export type T1 = | int32_t ;
7+ export type T2 =
8+ | int32_t ;
Original file line number Diff line number Diff line change 11type int32_t = i32 ;
22@nonportable ( )
33export type uint64_t = u64 ;
4+ export type T1 = int32_t ;
5+ export type T2 = int32_t ;
You can’t perform that action at this time.
0 commit comments