diff --git a/compiler/forget/src/HIR/Codegen.ts b/compiler/forget/src/HIR/Codegen.ts index 24ed547639..ca3d62f412 100644 --- a/compiler/forget/src/HIR/Codegen.ts +++ b/compiler/forget/src/HIR/Codegen.ts @@ -91,12 +91,7 @@ type Temporaries = Map; class CodegenVisitor implements - Visitor< - Array, - t.Expression | t.Statement | t.JSXFragment, - t.Statement, - t.SwitchCase - > + Visitor, t.Expression, t.Statement, t.SwitchCase> { depth: number = 0; temp: Map = new Map(); @@ -105,15 +100,10 @@ class CodegenVisitor this.depth++; return []; } - visitValue( - value: InstructionValue - ): t.Expression | t.Statement | t.JSXFragment { + visitValue(value: InstructionValue): t.Expression { return codegenInstructionValue(this.temp, value); } - visitInstruction( - instr: Instruction, - value: t.Expression | t.Statement | t.JSXFragment - ): t.Statement { + visitInstruction(instr: Instruction, value: t.Expression): t.Statement { if (t.isStatement(value)) { return value; } @@ -256,7 +246,7 @@ function codegenLabel(id: BlockId): string { function codegenInstructionValue( temp: Temporaries, instrValue: InstructionValue -): t.Expression | t.JSXFragment | t.Statement { +): t.Expression { let value: t.Expression; switch (instrValue.kind) { case "ArrayExpression": {