Rename GenericPromiseTypeAnnotation to PromiseTypeAnnotation

Summary:
We have first class support for Promises in our codegen. So, it's more appropriate to just call this PromiseTypeAnnotation, as opposed to GenericPromiseTypeAnnotation.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23645209

fbshipit-source-id: bfc0b909750e221e18be33acf197f342a2918aa9
This commit is contained in:
Ramanpreet Nara
2020-09-29 14:33:06 -07:00
committed by Facebook GitHub Bot
parent 92a6722bf2
commit 4927de6011
11 changed files with 27 additions and 33 deletions
@@ -130,7 +130,7 @@ function translateFunctionReturnTypeToJavaType(
throw new Error(createErrorMessage(returnTypeAnnotation.name));
}
case 'VoidTypeAnnotation':
case 'GenericPromiseTypeAnnotation':
case 'PromiseTypeAnnotation':
return 'void';
case 'StringTypeAnnotation':
return wrapIntoNullableIfNeeded('String');
@@ -279,7 +279,7 @@ module.exports = {
);
const returningPromise =
method.typeAnnotation.returnTypeAnnotation.type ===
'GenericPromiseTypeAnnotation';
'PromiseTypeAnnotation';
const isSyncMethod =
method.typeAnnotation.returnTypeAnnotation.type !==
'VoidTypeAnnotation' && !returningPromise;