From 0c9d287e235f7cba3b2620efc978e2cf27028075 Mon Sep 17 00:00:00 2001 From: Joe Savona Date: Thu, 22 Aug 2024 09:06:53 -0700 Subject: [PATCH] [compiler] Rename HIRFunction.returnType Rename this field so we can use it for the actual return type. [ghstack-poisoned] --- .../packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts | 2 +- compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts | 2 +- .../src/Optimization/LowerContextAccess.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts b/compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts index cf2c113d8c418..1b0d9f455900d 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/HIR/BuildHIR.ts @@ -219,7 +219,7 @@ export function lower( id, params, fnType: parent == null ? env.fnType : 'Other', - returnType: null, // TODO: extract the actual return type node if present + returnTypeAnnotation: null, // TODO: extract the actual return type node if present returnIdentifier, body: builder.build(), context, diff --git a/compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts b/compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts index 8c8682aa8cc2b..1b866bb4c38a7 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/HIR/HIR.ts @@ -285,7 +285,7 @@ export type HIRFunction = { fnType: ReactFunctionType; env: Environment; params: Array; - returnType: t.FlowType | t.TSType | null; + returnTypeAnnotation: t.FlowType | t.TSType | null; returnIdentifier: Identifier; context: Array; effects: Array | null; diff --git a/compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts b/compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts index 5c6d19a0f2cfa..7ae39d695ad53 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/Optimization/LowerContextAccess.ts @@ -248,7 +248,7 @@ function emitSelectorFn(env: Environment, keys: Array): Instruction { fnType: 'Other', env, params: [obj], - returnType: null, + returnTypeAnnotation: null, returnIdentifier, context: [], effects: null,