remove 'EnumDeclaration' as a type expected to throw error in module generators

Summary:
Handling of `EnumDeclaration` was introduced in D38967241 (https://github.com/facebook/react-native/commit/745f3ee8c571560406629bc7af3cf4914ef1b211) so it is no longer a type expected to fail generators.

Changelog: [Internal] remove 'EnumDeclaration' as a type expected to throw error in module generators

Reviewed By: cipolleschi

Differential Revision: D42917947

fbshipit-source-id: 16fcb915ccd42c613ca4d30b815d6365681f5fa1
This commit is contained in:
Vitali Zaidman
2023-02-03 03:03:41 -08:00
committed by Facebook GitHub Bot
parent 209d019055
commit 53c9786b71
3 changed files with 8 additions and 8 deletions
@@ -184,7 +184,7 @@ function translateFunctionParamToJavaType(
imports.add('com.facebook.react.bridge.Callback');
return wrapNullable('Callback');
default:
(realTypeAnnotation.type: 'EnumDeclaration' | 'MixedTypeAnnotation');
(realTypeAnnotation.type: 'MixedTypeAnnotation');
throw new Error(createErrorMessage(realTypeAnnotation.type));
}
}
@@ -272,7 +272,7 @@ function translateFunctionReturnTypeToJavaType(
imports.add('com.facebook.react.bridge.WritableArray');
return wrapNullable('WritableArray');
default:
(realTypeAnnotation.type: 'EnumDeclaration' | 'MixedTypeAnnotation');
(realTypeAnnotation.type: 'MixedTypeAnnotation');
throw new Error(createErrorMessage(realTypeAnnotation.type));
}
}
@@ -346,7 +346,7 @@ function getFalsyReturnStatementFromReturnType(
case 'ArrayTypeAnnotation':
return 'return null;';
default:
(realTypeAnnotation.type: 'EnumDeclaration' | 'MixedTypeAnnotation');
(realTypeAnnotation.type: 'MixedTypeAnnotation');
throw new Error(createErrorMessage(realTypeAnnotation.type));
}
}