Sorry, but that is not correct. Since the events themselves are generic the T correctly gets specified there.
Example:
program Project11;
{$APPTYPE CONSOLE}
uses
Spring.Collections,
Spring.Collections.Lists,
SysUtils;
type
ISomeIntf = interface
end;
TSomeClass = class(TList<ISomeIntf>, IList<ISomeIntf>)
public
procedure DoOnChanged(Sender: TObject; const Item: ISomeIntf;
Action: TCollectionChangedAction);
end;
procedure TSomeClass.DoOnChanged(Sender: TObject; const Item: ISomeIntf;
Action: TCollectionChangedAction);
begin
Writeln('changed');
end;
var
some: TSomeClass;
begin
some := TSomeClass.Create;
some.OnChanged.Add(some.DoOnChanged);
some.Add(nil);
Readln;
end.
Von:
spri...@googlegroups.com [mailto:spri...@googlegroups.com] Im Auftrag von Atle
Smelvær
Gesendet: Mittwoch, 20. Juni 2012 13:33
An: spri...@googlegroups.com
Betreff: Re: WG: [spring4d] Registering anonymous methods directly to
interfaces
They are used by the IList<T> interface, and I cannot define a TSomeClass = class(..TList<Intf>,IList<Intf>) without this.
--
You received this message because you are subscribed to the Google Groups
"Spring Framework for Delphi" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spring4d/-/HqpIOX8zvEsJ.
To post to this group, send email to spri...@googlegroups.com.
To unsubscribe from this group, send email to
spring4d+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spring4d?hl=en-US.
“as long as it works properly, I'm happy”
Me too J
Von:
spri...@googlegroups.com [mailto:spri...@googlegroups.com] Im Auftrag von Atle
Smelvær
Gesendet: Mittwoch, 20. Juni 2012 14:37
An: spri...@googlegroups.com
Betreff: Re: WG: [spring4d] Registering anonymous methods directly to
interfaces
The compiler crashed with missing implementation here, that's why I moved it. Then it compiled. I found it odd that it did not work since IList<T> was already defined. Anyway, I updated to the latest and it just works now. Not sure what happened (maybe a bug in the compiler), but as long as it works properly, I'm happy.
-Atle
--
You received this message because you are subscribed to the Google Groups
"Spring Framework for Delphi" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spring4d/-/I_V1PEDBmZEJ.