Emit function param and return type annotations
Joe Savona committed
Feb 5, 2024 at 21:51 UTC
9ec9331def3f740882038b5641db24e9b5aab98c
2 files changed
+2
compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts
+1
@@ -207,6 +207,7 @@ export function lower(
207
return Ok({
208
id,
209
params,
210
+ returnType: null, // TODO: extract the actual return type node if present
211
body: builder.build(),
212
context,
213
generator: func.node.generator === true,
compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts
+1
@@ -233,6 +233,7 @@ export type HIRFunction = {
233
id: string | null;
234
env: Environment;
235
params: Array<Place | SpreadPattern>;
236
+ returnType: t.FlowType | t.TSType | null;
237
context: Array<Place>;
238
body: HIR;
239
generator: boolean;