Remove ProgramReturn (#3382)

`ProgramReturn::Arguments` variant is never instantiated and should go away. This would make `ProgramReturn` an unnecessary wrapper around `KclValue`, so the whole type should go away.

Part of https://github.com/KittyCAD/modeling-app/issues/3379
This commit is contained in:
Adam Chalmers
2024-08-12 17:55:05 -05:00
committed by GitHub
parent 3dabab2c74
commit 6f1d7138c0
5 changed files with 22 additions and 61 deletions

View File

@ -21,7 +21,6 @@ import init, {
import { KCLError } from './errors'
import { KclError as RustKclError } from '../wasm-lib/kcl/bindings/KclError'
import { EngineCommandManager } from './std/engineConnection'
import { ProgramReturn } from '../wasm-lib/kcl/bindings/ProgramReturn'
import { Discovered } from '../wasm-lib/kcl/bindings/Discovered'
import { KclValue } from '../wasm-lib/kcl/bindings/KclValue'
import type { Program } from '../wasm-lib/kcl/bindings/Program'
@ -159,7 +158,7 @@ function emptyEnvironment(): Environment {
interface RawProgramMemory {
environments: Environment[]
currentEnv: EnvironmentRef
return: ProgramReturn | null
return: KclValue | null
}
/**
@ -170,7 +169,7 @@ interface RawProgramMemory {
export class ProgramMemory {
private environments: Environment[]
private currentEnv: EnvironmentRef
private return: ProgramReturn | null
private return: KclValue | null
/**
* Empty memory doesn't include prelude definitions.
@ -186,7 +185,7 @@ export class ProgramMemory {
constructor(
environments: Environment[] = [emptyEnvironment()],
currentEnv: EnvironmentRef = ROOT_ENVIRONMENT_REF,
returnVal: ProgramReturn | null = null
returnVal: KclValue | null = null
) {
this.environments = environments
this.currentEnv = currentEnv