         if let type = functionType.returnType {
             output.append("], returnType: .\(type)Type)\n    return {")
         } else {
-            output.append("], returnType: nil)\n    return {")
+            output.append("], returnType: .none)\n    return {")
         }
         if let type = functionType.returnType, case .function? = parser.typesMap[type] {
             output.append("\n        let result = decoderRuntime.run(function: function, symbols: symbols, arguments: [")

                    }
                }
                
                private func typecheck(function: Function, stack: [Runtime<DeclarationType>], stepStack: IndexPath) throws {
                    let runtime = stack.last!
                    for (i, step) in function.steps.enumerated() {
                        let stepStack = stepStack.appending(i)

            """)
        for (name, type) in parser.types {
            if case .function(let functionType) = type {
                output.append("                case .\(name)Type:\n                    let nextRuntime = TypecheckRuntime(arguments: [")
                writeCommaSeparated(functionType.argumentTypes, to: &output) {
                    output.append(".\($0)Type")
                }
                if let type = functionType.returnType {
                    output.append("], returnType: .\(type)Type")
                } else {
                    output.append("], returnType: .none")
                }
                output.append(", count: f.steps.count)\n                    try typecheck(function: f, stack: stack + [nextRuntime], stepStack: stepStack)\n")
            }
        }
        output.append("""
