             case .function(let functionType):
                 output.append("            case .\(name)(let a):\n")
                 for (i, type) in ([name] + functionType.argumentTypes).enumerated() {
-                    output.append("                try check(a.o\(i + 1), with: .\(type)Type, function: function, stack: stack, stepStack: stepStack)\n")
+                    output.append("                try check(a.o\(i + 1), with: .\(type)Type, function: function, stack: stack, callStack: callStack)\n")
                 }
                 if let type = functionType.returnType {
                     output.append("                runtime.results[i] = .\(type)Type\n")


                @discardableResult
                func run(function: Function, symbols: Symbols, arguments: [Any]) -> Any? {
                    return run(function: function, symbols: symbols, stack: [Runtime(arguments: arguments)], stepStack: [])
                }
            }
            """)

        output.append("""
                }

                private func check(_ a: Function.A, with type: DeclarationType, function: Function, stack: [TypecheckRuntime], callStack: IndexPath) throws {
                    if a.step >= 0 {
                        guard a.level < stack.count else { throw DecodeError(cause: .stepMissing, stack: callStack) }
                        let runtime = stack[Int(a.level)]
                        if let t = runtime.results[Int(a.step)] {
                            if t != type { throw DecodeError(cause: .stepMismatch, stack: callStack) }
                            runtime.releaseResult[Int(a.step)] = callStack[Int(a.level)]
                        } else {
                            guard a.step < function.steps.count, case .functionRaw(let f)? = function.steps[Int(a.step)].producer else { throw DecodeError(cause: .stepMissing, stack: callStack) }
                            switch type {\n
            """)
        for (name, type) in parser.types {
