Support BooleanLiteralTypeAnnotation

master
Vitaliy Filippov 2019-05-23 23:52:55 +03:00
parent e24a73b03b
commit 84aface8eb
2 changed files with 3 additions and 0 deletions

View File

@ -550,6 +550,7 @@ declare module '@babel/types' {
declare class BooleanLiteralTypeAnnotation extends Node {
type: 'BooleanLiteralTypeAnnotation';
value: boolean;
}
declare class NullLiteralTypeAnnotation extends Node {

View File

@ -108,6 +108,8 @@ function makeType(ctx: Context, node: FlowTypeAnnotation): ?Type {
return t.createLiteral(null);
case 'BooleanTypeAnnotation':
return t.createBoolean();
case 'BooleanLiteralTypeAnnotation':
return t.createLiteral(node.value);
case 'NumberTypeAnnotation':
return t.createNumber('f64');
case 'StringTypeAnnotation':