Forum: IronRuby Implementing generic interface

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Arseny Sizov (Guest)
on 2010-11-09 09:59
(Received via mailing list)
Hi all,

I need to implement .NET generic interface and pass this implementation
.NET generic method. Is it possible in IronRuby?

What I have in .NET:

interface Subscriber {
        void Subscribe<TMessage>(IMessagesListener<TMessage> listener)
where TMessage : IBasicMessage;

    public interface IMessagesListener<in TMessage>
        where TMessage : IBasicMessage
        void Handle(TMessage message);

I need to rewrite this code in ironruby:

class MyMessageListener <TMyMessage> :
            void IMessagesListener<TMyMessage>.Handle(TMyMessage


subscriber.Subscribe<TMyMessage>(new MyMessageListener<TMyMessage>());

Is it possible?

Thanks in advance.

Best regards,
Arseny Sizov.


This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and delete this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.

Please refer to for
additional EU corporate and regulatory disclosures.
This topic is locked and can not be replied to.