Rename ReservedFunctionValueTypeAnnotation to ReservedTypeAnnotation

Summary:
Reserved type annotations can appear in three different contexts: commands, props, and NativeModules. For now, commands and NativeModules share the same reserved type annotations. In the future, we may want to merge these reserved type annotations with the props reserved type annotations.

**Motivation:** The meaning of FunctionValue in FunctionValueTypeAnnotation isn't clear - in fact, it's downright confusing. Therefore, this diff renames this Flow type to ReservedTypeAnnotation, which I believe sufficiently captures the intent of the type annotation.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24701322

fbshipit-source-id: bde0273b4a89c9e7175c60ed3468ed870b320044
This commit is contained in:
Ramanpreet Nara
2020-11-05 18:30:08 -08:00
committed by Facebook GitHub Bot
parent 856bc2978c
commit 1231db0d7f
19 changed files with 53 additions and 82 deletions
@@ -118,7 +118,7 @@ function translateFunctionParamToJavaType(
}
switch (realTypeAnnotation.type) {
case 'ReservedFunctionValueTypeAnnotation':
case 'ReservedTypeAnnotation':
switch (realTypeAnnotation.name) {
case 'RootTag':
return !isRequired ? 'Double' : 'double';
@@ -188,7 +188,7 @@ function translateFunctionReturnTypeToJavaType(
}
switch (realTypeAnnotation.type) {
case 'ReservedFunctionValueTypeAnnotation':
case 'ReservedTypeAnnotation':
switch (realTypeAnnotation.name) {
case 'RootTag':
return nullable ? 'Double' : 'double';
@@ -245,7 +245,7 @@ function getFalsyReturnStatementFromReturnType(
}
switch (realTypeAnnotation.type) {
case 'ReservedFunctionValueTypeAnnotation':
case 'ReservedTypeAnnotation':
switch (realTypeAnnotation.name) {
case 'RootTag':
return 'return 0.0;';