Flow opaque type 6.x backport (#6081)

* Flow opaque type backport

* Add tests for strip types, comments, and babel-generator

* Fix failing tests, run scripts

* Bump babylon to 6.18.0
This commit is contained in:
jbrown215
2017-08-15 16:44:15 -04:00
committed by Henry Zhu
parent 2dba910b9e
commit c28465e03e
16 changed files with 353 additions and 78 deletions

View File

@@ -0,0 +1,15 @@
function a() {}
opaque type A = number;
opaque type B = {
name: string;
};
opaque type union =
| {type: "A"}
| {type: "B"}
;
opaque type overloads =
& ((x: string) => number)
& ((x: number) => string)
;

View File

@@ -0,0 +1,13 @@
function a() {}
/*:: opaque type A = number;*/
/*:: opaque type B = {
name: string;
};*/
/*:: opaque type union =
| {type: "A"}
| {type: "B"}
;*/
/*:: opaque type overloads =
& ((x: string) => number)
& ((x: number) => string)
;*/