Add support for $FlowFixMe

master
Paul Loyd 2018-07-25 08:53:04 +03:00
parent 563789f555
commit cdc9304304
5 changed files with 34 additions and 1 deletions

View File

@ -198,6 +198,11 @@ function either(params: (?Type)[]): ?Type {
: t.createUnion(variants);
}
// $ FlowFixMe
function fixMe(): ?Type {
return t.createAny();
}
export default {
Object: object,
Buffer: buffer,
@ -214,4 +219,5 @@ export default {
$Diff: diff,
$All: all,
$Either: either,
$FlowFixMe: fixMe,
};

View File

@ -11,7 +11,8 @@ export type Query =
| Template
| Definition
| External
| Special;
| Special
;
export type Unknown = {
kind: 'unknown',

View File

@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-06/schema#",
"definitions": {
"fixMe::X": true,
"fixMe::Y": {
"type": "object",
"properties": {"y": true},
"required": ["y"]
}
}
}

View File

@ -0,0 +1,7 @@
type X = $FlowFixMe;
type Y = {
y: $FlowFixMe;
};
export {X, Y};

View File

@ -0,0 +1,8 @@
- kind: any
id: [fixMe, X]
- kind: record
fields:
- name: y
value: {kind: any}
required: true
id: [fixMe, Y]