From bc0485285fdfae6fedf2e5c519cd521f879f3eeb Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 18 Jun 2026 12:17:06 +0100 Subject: [PATCH] cleanup: revert KI-3 exception-handler var renames to plain E MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The KI-3 ARC triple-release bug — multiple `on E: TYPE do` handlers in one except block colliding on a single QBE slot — is fixed, so the workaround of giving each handler a distinct variable name can be reverted. Handler vars are now the natural `E` again in: - blaise.testing.pas: the runner's 4-handler dispatch block (EAF/EIT/E/ETO -> E) — the exact KI-3 scenario, in the test framework's own outcome classifier. - cp.test.attributes.pas: ETO -> E. - cp.test.sets.pas: ESE/EEx -> E. (There were no {$IFDEF FPC} blocks left to remove — the KI-2 .Free guards and all other FPC conditionals were already gone from the source tree as part of the FPC-independence migration; verified by a full-tree directive scan.) All three fixpoints green; 3501 tests pass, including the framework's own FAIL/IGNORED/ERROR outcome paths. --- compiler/src/main/pascal/blaise.testing.pas | 12 ++++++------ compiler/src/test/pascal/cp.test.attributes.pas | 4 ++-- compiler/src/test/pascal/cp.test.sets.pas | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/compiler/src/main/pascal/blaise.testing.pas b/compiler/src/main/pascal/blaise.testing.pas index f2f8008..c00369c 100644 --- a/compiler/src/main/pascal/blaise.testing.pas +++ b/compiler/src/main/pascal/blaise.testing.pas @@ -522,25 +522,25 @@ begin try Self.RunTest(); except - on EAF: EAssertionFailed do + on E: EAssertionFailed do begin Outcome := 'FAIL'; - AResult.AddFailure(Self.FName, EAF.ToString()); + AResult.AddFailure(Self.FName, E.ToString()); end; - on EIT: EIgnoredTest do + on E: EIgnoredTest do begin Outcome := 'IGNORED'; - AResult.AddIgnored(Self.FName, EIT.FMessage); + AResult.AddIgnored(Self.FName, E.FMessage); end; on E: Exception do begin Outcome := 'ERROR'; AResult.AddError(Self.FName, E.ClassName + ': ' + E.Message); end; - on ETO: TObject do + on E: TObject do begin Outcome := 'ERROR'; - AResult.AddError(Self.FName, 'Unhandled exception: ' + ETO.ClassName); + AResult.AddError(Self.FName, 'Unhandled exception: ' + E.ClassName); end; end; finally diff --git a/compiler/src/test/pascal/cp.test.attributes.pas b/compiler/src/test/pascal/cp.test.attributes.pas index 101ea0f..016832d 100644 --- a/compiler/src/test/pascal/cp.test.attributes.pas +++ b/compiler/src/test/pascal/cp.test.attributes.pas @@ -405,8 +405,8 @@ begin on E: Exception do if Pos('Unknown attribute', E.Message) >= 0 then OK := True; - on ETO: TObject do - if Pos('Unknown attribute', ETO.ClassName) >= 0 then + on E: TObject do + if Pos('Unknown attribute', E.ClassName) >= 0 then OK := True; end; AssertTrue('unknown attribute raises semantic error', OK); diff --git a/compiler/src/test/pascal/cp.test.sets.pas b/compiler/src/test/pascal/cp.test.sets.pas index 976cd90..dfbf5fe 100644 --- a/compiler/src/test/pascal/cp.test.sets.pas +++ b/compiler/src/test/pascal/cp.test.sets.pas @@ -720,11 +720,11 @@ begin Prog.Free(); Fail('Expected ESemanticError but none was raised'); except - on ESE: ESemanticError do + on E: ESemanticError do begin Prog.Free(); end; - on EEx: Exception do + on E: Exception do begin Prog.Free(); raise;