Fix bad utility type definitions (#37662)

Reviewed By: panagosg7

Differential Revision: D46364595

fbshipit-source-id: 5dcd484cd292d5b83b0b114675ec3c8059aefe6b
This commit is contained in:
Sam Zhou
2023-06-01 14:41:00 -07:00
committed by Facebook GitHub Bot
parent d9b3339ef8
commit 0191d16712
2 changed files with 25 additions and 25 deletions
@@ -21,6 +21,7 @@ import type {
Int32TypeAnnotation,
PropTypeAnnotation,
MixedTypeAnnotation,
ArrayTypeAnnotation,
} from '../../../CodegenSchema';
const {capitalize} = require('../../Utils');
@@ -110,11 +111,8 @@ class PojoCollector {
}
case 'ArrayTypeAnnotation': {
const arrayTypeAnnotation = typeAnnotation;
// TODO: Flow assumes elementType can be any. Fix this.
const elementType: $PropertyType<
typeof arrayTypeAnnotation,
'elementType',
> = arrayTypeAnnotation.elementType;
const elementType: $PropertyType<ArrayTypeAnnotation, 'elementType'> =
arrayTypeAnnotation.elementType;
const pojoElementType = (() => {
switch (elementType.type) {