Mixing in a C# interface which declares generic return types

Hi,
I’m trying to mixin a C# interface into a ruby class, in order to use it
as
a mock.

My Ruby class :

class MockFoo
include IFoo
end

The C# interface :

public interface IFoo {
T Get(); // this is OK
IEnumerable GetAll(); // this fails
}

When calling MockFoo.new, I get the following error :

  Method

System.Runtime.CompilerServices.CallSite1[System.Func4[System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,System.Object,System.Collections.Generic.IEnumerable1[T]]] Create(System.Runtime.CompilerServices.CallSiteBinder) contains generic parameters (ArgumentError) System.Core:0:inValidateMethodInfo’
System.Core:0:in Call' System.Core:0:inBindCore’

./features/registration/send_verification_email/send_verification_email_steps.rb:18

features\registration\send_verification_email\send_verification_email.feature:9:in
`When I register’

Its OK for methods like :

T Get()
or
T DoStuff(T bla)

But whenever I try to return a collection of T :

IEnumerable GetAll();

it fails.

Any ideas ?

Cheers,
Ben


Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core