Flow opaque type aliases (#5990)

This commit is contained in:
jbrown215
2017-08-02 17:30:19 -04:00
committed by Brian Ng
parent 0f823beeb1
commit 4e9a25e34a
14 changed files with 193 additions and 6 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,16 @@
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)
;*/