File tree 3 files changed +9
-1
lines changed
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 {
3417
3417
startPos : i32
3418
3418
) : TypeDeclaration | null {
3419
3419
3420
- // at 'type': Identifier ('<' TypeParameters '>')? '=' Type ';'?
3420
+ // at 'type': Identifier ('<' TypeParameters '>')? '=' '|'? Type ';'?
3421
3421
3422
3422
if ( tn . skipIdentifier ( ) ) {
3423
3423
let name = Node . createIdentifierExpression ( tn . readIdentifier ( ) , tn . range ( ) ) ;
@@ -3428,6 +3428,7 @@ export class Parser extends DiagnosticEmitter {
3428
3428
flags |= CommonFlags . GENERIC ;
3429
3429
}
3430
3430
if ( tn . skip ( Token . EQUALS ) ) {
3431
+ tn . skip ( Token . BAR ) ;
3431
3432
let type = this . parseType ( tn ) ;
3432
3433
if ( ! type ) return null ;
3433
3434
let ret = Node . createTypeDeclaration (
Original file line number Diff line number Diff line change 1
1
type int32_t = i32 ;
2
2
@nonportable ( )
3
3
export 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 1
1
type int32_t = i32 ;
2
2
@nonportable ( )
3
3
export 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