                 }
                 output.append("],\n")
             }
-        }
-        output.append("""
-                ]
-
+            output.append("    ]\n\n")
+        }
+        output.append("""
                 private func isSubtype(_ subtype: DeclarationType, _ type: DeclarationType) -> Bool {
                     if subtype == type { return true }
                     for supertype in supertypes[subtype, default: []] {

            }

            private class DecoderRuntime {
                private class Runtime<T> {
                    var results = [Int: T]()
                    let arguments: [T]
                    init(arguments: [T]) {
                        self.arguments = arguments
                    }
                }

                private class TypecheckRuntime: Runtime<DeclarationType> {
                    let function: Function
                    let returnType: DeclarationType
                    var releaseResult: [Int]
                    init(function: Function, arguments: [DeclarationType], returnType: DeclarationType) {
                        self.function = function
                        self.returnType = returnType
                        releaseResult = Array(0..<function.steps.count)
                        super.init(arguments: arguments)
                    }
                }


        }
        output.append("""
                        }
                        releaseResult[i]?.forEach { stack[last].results[$0] = nil }
                    }
                    if !function.hasReturnStep { return nil }
                    let returnValue = value(function.returnStep, in: stack)
