dmitrybv 3 Posted Tuesday at 01:45 AM Is it possible to declare an identical type for a generic class? I can't do it. TTypedListFieldLinkEh = EhLib.TableLink.TypedLists.TTypedListFieldLinkEh; TListFieldLinkListEh = EhLib.TableLink.TypedLists.TListFieldLinkListEh; TTypedListItemLinkEh = EhLib.TableLink.TypedLists.TTypedListItemLinkEh; TListRecLinkListEh = EhLib.TableLink.TypedLists.TListRecLinkListEh; TListTableLinkEh = EhLib.TableLink.TypedLists.TListTableLinkEh; TListFieldLinkListEh<T: class, constructor> = EhLib.TableLink.TypedLists.TListFieldLinkListEh<T: class, constructor>; //Compile Error TTypedListItemLinkEh<T: class, constructor> = EhLib.TableLink.TypedLists.TTypedListItemLinkEh<T: class, constructor>; TListRecLinkListEh<T: class, constructor> = EhLib.TableLink.TypedLists.TListRecLinkListEh<T: class, constructor>; TListTableLinkEh<T: class, constructor> = EhLib.TableLink.TypedLists.TListTableLinkEh<T: class, constructor>; Share this post Link to post
Remy Lebeau 1545 Posted Tuesday at 02:58 PM https://stackoverflow.com/questions/16150218/is-it-possible-to-create-a-type-alias-to-a-generic-record-in-delphi https://stackoverflow.com/questions/10060009/is-it-possible-to-create-a-type-alias-to-a-generic-class 1 Share this post Link to post
dmitrybv 3 Posted Tuesday at 06:04 PM Thank you. This code works: TListFieldLinkListEh<T: class, constructor> = class(EhLib.TableLink.TypedLists.TListFieldLinkListEh<T>); TTypedListItemLinkEh<T: class, constructor> = class(EhLib.TableLink.TypedLists.TTypedListItemLinkEh<T>); TListRecLinkListEh<T: class, constructor> = class(EhLib.TableLink.TypedLists.TListRecLinkListEh<T>); TListTableLinkEh<T: class, constructor> = class(EhLib.TableLink.TypedLists.TListTableLinkEh<T>); In this case, however, a new type is created. But for types created through generics this is not a very big problem. Share this post Link to post