@samitouri / QOS-React-2 / commits / 8c24fc2be2

[pipeline] Type the result as t.FunctionDeclaration

A more narrower type as we only accept FunctionDeclaration as inputs

Sathya Gunasekaran committed Mar 6, 2023 at 19:53 UTC 8c24fc2be297aee75a0b478805b3bc7d88a8c573
1 file changed +2 -2
compiler/forget/src/CompilerPipeline.ts
+2 -2
@@ -51,7 +51,7 @@ export type CompilerPipelineValue =
51 export function* run(
52 func: NodePath<t.FunctionDeclaration>,
53 options?: Partial<EnvironmentOptions> | null
54 -): Generator<CompilerPipelineValue, t.Function> {
54 +): Generator<CompilerPipelineValue, t.FunctionDeclaration> {
55 const hir = lower(func, mergeOptions(options ?? null)).unwrap();
56 yield log({ kind: "hir", name: "HIR", value: hir });
57
@@ -196,7 +196,7 @@ export function* run(
196 export function compile(
197 func: NodePath<t.FunctionDeclaration>,
198 options?: Partial<EnvironmentOptions> | null
199 -): t.Function {
199 +): t.FunctionDeclaration {
200 let generator = run(func, options);
201 while (true) {
202 const next = generator.next();