@samitouri / QOS-React / commits / 98b5740821

[compiler] Rename HIRFunction.returnType

Rename this field so we can use it for the actual return type. ghstack-source-id: 118d7dcfbbcc40911bf6d13f14e70053e436738d Pull Request resolved: https://github.com/facebook/react/pull/30789

Joe Savona committed Aug 22, 2024 at 09:06 UTC 98b57408216c80ec75723773524466657b4956b6
3 files changed +3 -3
compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts
+1 -1
@@ -219,7 +219,7 @@ export function lower(
219 id,
220 params,
221 fnType: parent == null ? env.fnType : 'Other',
222 - returnType: null, // TODO: extract the actual return type node if present
222 + returnTypeAnnotation: null, // TODO: extract the actual return type node if present
223 returnIdentifier,
224 body: builder.build(),
225 context,
compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts
+1 -1
@@ -285,7 +285,7 @@ export type HIRFunction = {
285 fnType: ReactFunctionType;
286 env: Environment;
287 params: Array<Place | SpreadPattern>;
288 - returnType: t.FlowType | t.TSType | null;
288 + returnTypeAnnotation: t.FlowType | t.TSType | null;
289 returnIdentifier: Identifier;
290 context: Array<Place>;
291 effects: Array<FunctionEffect> | null;
compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts
+1 -1
@@ -248,7 +248,7 @@ function emitSelectorFn(env: Environment, keys: Array<string>): Instruction {
248 fnType: 'Other',
249 env,
250 params: [obj],
251 - returnType: null,
251 + returnTypeAnnotation: null,
252 returnIdentifier,
253 context: [],
254 effects: null,