Unrestrict flow union comments check (#1040)
I was being very careful by checking all the surrounding types but it actually turns out we want this behavior all the time. Fixes #931master
parent
a9185cb30e
commit
82d6e0b4ab
|
@ -580,11 +580,7 @@ function handleUnionTypeComments(
|
|||
) {
|
||||
if (
|
||||
enclosingNode &&
|
||||
enclosingNode.type === "UnionTypeAnnotation" &&
|
||||
precedingNode &&
|
||||
precedingNode.type === "ObjectTypeAnnotation" &&
|
||||
followingNode &&
|
||||
followingNode.type === "ObjectTypeAnnotation"
|
||||
enclosingNode.type === "UnionTypeAnnotation"
|
||||
) {
|
||||
addTrailingComment(precedingNode, comment);
|
||||
return true;
|
||||
|
|
|
@ -352,6 +352,16 @@ exports[`flow_union.js 1`] = `
|
|||
| {type: \\"Failed\\", error: E, errorMsg: EM}
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| {type: \\"Success\\", data: D};
|
||||
|
||||
type UploadState<E, EM, D>
|
||||
// The upload hasnt begun yet
|
||||
= A
|
||||
// The upload timed out
|
||||
| B
|
||||
// Failed somewhere on the line
|
||||
| C
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| D;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type UploadState<E, EM, D> =
|
||||
// The upload hasnt begun yet
|
||||
|
@ -362,6 +372,16 @@ type UploadState<E, EM, D> =
|
|||
| { type: \\"Failed\\", error: E, errorMsg: EM }
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| { type: \\"Success\\", data: D };
|
||||
|
||||
type UploadState<E, EM, D> =
|
||||
// The upload hasnt begun yet
|
||||
| A
|
||||
// The upload timed out
|
||||
| B
|
||||
// Failed somewhere on the line
|
||||
| C
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| D;
|
||||
"
|
||||
`;
|
||||
|
||||
|
@ -375,6 +395,16 @@ exports[`flow_union.js 2`] = `
|
|||
| {type: \\"Failed\\", error: E, errorMsg: EM}
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| {type: \\"Success\\", data: D};
|
||||
|
||||
type UploadState<E, EM, D>
|
||||
// The upload hasnt begun yet
|
||||
= A
|
||||
// The upload timed out
|
||||
| B
|
||||
// Failed somewhere on the line
|
||||
| C
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| D;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
type UploadState<E, EM, D> =
|
||||
// The upload hasnt begun yet
|
||||
|
@ -385,6 +415,16 @@ type UploadState<E, EM, D> =
|
|||
| { type: \\"Failed\\", error: E, errorMsg: EM }
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| { type: \\"Success\\", data: D };
|
||||
|
||||
type UploadState<E, EM, D> =
|
||||
// The upload hasnt begun yet
|
||||
| A
|
||||
// The upload timed out
|
||||
| B
|
||||
// Failed somewhere on the line
|
||||
| C
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| D;
|
||||
"
|
||||
`;
|
||||
|
||||
|
|
|
@ -7,3 +7,13 @@ type UploadState<E, EM, D>
|
|||
| {type: "Failed", error: E, errorMsg: EM}
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| {type: "Success", data: D};
|
||||
|
||||
type UploadState<E, EM, D>
|
||||
// The upload hasnt begun yet
|
||||
= A
|
||||
// The upload timed out
|
||||
| B
|
||||
// Failed somewhere on the line
|
||||
| C
|
||||
// Uploading to aws3 and CreatePostMutation succeeded
|
||||
| D;
|
||||
|
|
Loading…
Reference in New Issue