Flow opaque type aliases (#5990)
This commit is contained in:
@@ -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)
|
||||
;
|
||||
@@ -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)
|
||||
;*/
|
||||
Reference in New Issue
Block a user