You have applied the TypeInfo standard procedure to a type identifier which does not have any run-time type information associated with it.
program Produce; type Data = record end; var v : Pointer; begin v := TypeInfo(Data); end.
Record types do not generate type information, so this use of TypeInfo is illegal.
program Solve; type Base = class end; var v : Pointer; begin v := TypeInfo(Base); end.
A class does generate RTTI, so the use of TypeInfo here is perfectly legal.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!