Delphi Compiler Error
E2560 $OBJTYPENAME not allowed for ‘%s’; only global and non-alias type symbol
Reason for the Error & Solution
This occurs when defining an object type name on an aliased object or an object defined inside a scope.
program E2560;
{$APPTYPE CONSOLE}
uses
SysUtils;
type
TAliasedObject = TObject;
{$OBJTYPENAME TAliasedObject 'TAliasedObject'}
begin
{E2560 $OBJTYPENAME not allowed for '%s'; only global and non-alias type symbol}
end.