From 740dbc746c1efe6981963748e1e59c893dee92e4 Mon Sep 17 00:00:00 2001 From: TetzkatLipHoka Date: Sat, 11 Jul 2026 11:27:42 +0200 Subject: [PATCH] Raise instead of silently dropping a property with an unresolved type TPSCompileTimeClass.RegisterProperty freed the half-built property and returned silently when its type string referenced a type that was not (yet) registered. Scripts using the property then failed with a bare 'Unknown identifier' - very hard to trace back to a wrong registration order in an import unit. This is the actual root cause behind reports like issue #255 ('Delphi 11 case sensitive'). Raise EPSCompilerException naming the property and its type string instead, matching how AddTypeS and the other registration APIs report bad input. Inside OnUses the exception surfaces as a regular compiler error message. Co-Authored-By: Claude Fable 5 --- Source/uPSCompiler.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/uPSCompiler.pas b/Source/uPSCompiler.pas index f13307e2..784bf1a6 100644 --- a/Source/uPSCompiler.pas +++ b/Source/uPSCompiler.pas @@ -15678,7 +15678,10 @@ procedure TPSCompileTimeClass.RegisterProperty(const PropertyName, if FType = nil then begin p.Free; - Exit; + // dropping the property silently leads to hard-to-diagnose 'Unknown + // identifier' errors in scripts; report the unresolved type instead + raise EPSCompilerException.CreateFmt(RPS_UnableToRegisterType, + [PropertyName + ': ' + PropertyType]); end; if p.Decl.Result = nil then p.Decl.Result := FType else begin