Is it impossible to re-export generic interfaces in Delphi? The code below won't compile:
Is it impossible to re-export generic interfaces in Delphi? The code below won't compile:
//Unit1.pas
unit Unit1;
interface
type
MyInterface = interface
end;
implementation
end.
//Unit2.pas
unit Unit2;
interface
uses
Unit1;
type
MyInterface = Unit1.MyInterface;
implementation
end.
When compiling it gives the following errors:
[dcc32 Error] Unit2.pas(9): E2508 Type parameters not allowed on this type
[dcc32 Error] Unit2.pas(9): E2029 Declaration expected but ';' found
My googling has failed me here. It doesn't seem to work for generic classes either.
//Unit1.pas
unit Unit1;
interface
type
MyInterface
end;
implementation
end.
//Unit2.pas
unit Unit2;
interface
uses
Unit1;
type
MyInterface
implementation
end.
When compiling it gives the following errors:
[dcc32 Error] Unit2.pas(9): E2508 Type parameters not allowed on this type
[dcc32 Error] Unit2.pas(9): E2029 Declaration expected but ';' found
My googling has failed me here. It doesn't seem to work for generic classes either.
Good catch!
ReplyDeleteDear Allen Bauer ... (:
You cannot have an alias to a generic type - maybe Allen Bauer knows the technical reason behind this.
ReplyDeleteStefan Glienke OK, thanks. Not happy about that, though.
ReplyDelete