Built-in / RTL Exception base class
- Type: feature (compiler / RTL)
- Status: DONE 2026-06-21 (RTL
Exceptionbase inlib/rtl/sysutils.pas; chess compiles pastclass(Exception), now blocks further down onfeature-local-typed-constantatchess.pas:846) - Owner: Track B
- Resolved-in: ee5e568 (RTL
Exceptionin lib/rtl/sysutils.pas) +feature-empty-class-shorthand; closed 0ceee3c. - Opened: 2026-06-20 (demo dashboard against pinned v14)
- Relation: blocks
feature-demo-chessand any FPC-style code that declares exception classes as descendants ofException.
Symptom
examples/chess/chess.pas fails to compile against pinned stable v14:
pascal26:85: error: base type not found: Exception ()
The source declares:
EChess = class(Exception);
PXX already supports raising class instances and typed on E: TClass do
handlers (test/test_exception_typed.pas), but there is no canonical
Exception class in the default scope / RTL.
Scope
- Provide a minimal FPC-style
Exceptionbase class usable asclass(Exception). - Keep existing class-object exception behavior working.
- Decide whether the class lives in the builtin namespace,
sysutils, or both via compiler prelude / default import rules.
Acceptance
examples/chess/chess.pasgets pastEChess = class(Exception).- Existing exception tests still pass, especially
test/test_exception_typed.pas. - A small regression test can declare, raise, and catch
class(Exception).
Log
- 2026-06-20 — Opened after
make demoson pinned v14 failed on chess. - 2026-06-20 — Added to
make library-suite-discoveryasdemo_chess. Current pinned v18 output remainsbase type not found: Exception; the suite tags it as Track B if a minimal RTLExceptionclass is sufficient, Track A if default-scope / exception-runtime behavior needs compiler support. - 2026-06-20 — Track B slice implemented in
lib/rtl/sysutils.pas, matching FPC's home for the base class:Exception = classwithMessage,HelpContext, andCreate(const msg).test/lib_sysutils.pasnow verifies inherited construction, property access,raise, and typed catch via a local descendant. - 2026-06-20 — Verified
make library-suitegreen with the SysUtils base class.demo_chessnow gets past the missing base class and fails on the next FPC syntax gap,EChess = class(Exception);as an empty descendant shorthand. Tracked separately infeature-empty-class-shorthand. - 2026-06-21 — CLOSED.
feature-empty-class-shorthandlanded (in done/), soEChess = class(Exception);now parses. Reconfirmed:./compiler/pascal26 -Fulib/rtl -Fulib/pcl examples/chess/chess.pasno longer errors onException— it advances tochess.pas:846(local typed constant not supported), tracked infeature-local-typed-constant. Acceptance met: chess past the base class; raise/catchclass(Exception)covered bytest/lib_sysutils.pas;make testgreen. → done/.