Forum: IronRuby mixing in a C# interface which declares generic return types

Posted by Ben Keeping (Guest)
on 2012-04-03 17:24
(Received via mailing list)
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<T>();   // this is OK
  IEnumerable<T> GetAll(); // this fails
}

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

      Method
System.Runtime.CompilerServices.CallSite`1[System.Func`4[System.Runtime.CompilerServices.CallSite,IronRuby.Runtime.RubyContext,System.Object,System.Collections.Generic.IEnumerable`1[T]]]
Create(System.Runtime.CompilerServices.CallSiteBinder) contains generic
parameters (ArgumentError)
      System.Core:0:in `ValidateMethodInfo'
      System.Core:0:in `Call'
      System.Core:0:in `BindCore'

./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<T> GetAll();

it fails.

Any ideas ?

Cheers,
Ben
Posted by Orion Edwards (Guest)
on 2012-04-03 23:20
(Received via mailing list)
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.