From a875136b775a08118cf3f519473bdbe7751564fd Mon Sep 17 00:00:00 2001 From: nub31 Date: Mon, 7 Jul 2025 19:04:09 +0200 Subject: [PATCH] ... --- src/compiler/NubLang/Generation/QBE/QBEGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/NubLang/Generation/QBE/QBEGenerator.cs b/src/compiler/NubLang/Generation/QBE/QBEGenerator.cs index 6c02cd9..55fb85e 100644 --- a/src/compiler/NubLang/Generation/QBE/QBEGenerator.cs +++ b/src/compiler/NubLang/Generation/QBE/QBEGenerator.cs @@ -378,7 +378,8 @@ public partial class QBEGenerator EmitBlock(body, scope); - if (body.Statements.LastOrDefault() is not BoundReturn) + // Implicit return for void functions if no explicit return has been set + if (returnType is NubVoidType && body.Statements is [.., not BoundReturn]) { if (returnType is NubVoidType) {