diff --git a/src/config.nim b/src/config.nim index 218807b..12c2291 100644 --- a/src/config.nim +++ b/src/config.nim @@ -27,7 +27,7 @@ when len(PEON_COMMIT_HASH) != 40: const PEON_BRANCH* = "master" when len(PEON_BRANCH) > 255: {.fatal: "The git branch name's length must be less than or equal to 255 characters".} -const DEBUG_TRACE_VM* = true # Traces VM execution +const DEBUG_TRACE_VM* = false # Traces VM execution const DEBUG_TRACE_GC* = false # Traces the garbage collector (TODO) const DEBUG_TRACE_ALLOCATION* = false # Traces memory allocation/deallocation const DEBUG_TRACE_COMPILER* = false # Traces the compiler diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index 938a565..a004cc6 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -1464,7 +1464,7 @@ proc returnStmt(self: Compiler, node: ReturnStmt) = self.error(&"call to undeclared function '{CallExpr(node.value).callee.token.lexeme}'") self.error(&"expected return value of type '{self.typeToStr(expected)}', but expression has no type") elif expected.isNil() and not actual.isNil(): - self.error("empty return statement is only allowed in void functions") + self.error("void function cannot return any value") elif not self.compareTypes(actual, expected): self.error(&"expected return value of type '{self.typeToStr(expected)}', got '{self.typeToStr(actual)}' instead") if not node.value.isNil():