Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Function doesn't want to be duck-casted. #4

Open
jbtule opened this issue May 10, 2013 · 0 comments
Open

Generic Function doesn't want to be duck-casted. #4

jbtule opened this issue May 10, 2013 · 0 comments

Comments

@jbtule
Copy link
Member

jbtule commented May 10, 2013

Reported by theajp01, Aug 27, 2012
What steps will reproduce the problem?

I don't know if it's supposed to work but I though it'd mention it.

  1. create an interface to duck-cast to:
    public class Thing {}

public interface ITest
{
List GetThings (Guid test) where T: Thing;
}

  1. make a dynamic object to duckcast.
    public class OtherThing : DynamicObject
    {
    }
  2. duck-cast it.
    dynamic ot = new OtherThing();
    ITest test = Impromptu.ActLike();

test.GetThings(Guid.Empty);

What is the expected output? What do you see instead?

I'd expect test to be of Type ITest.

Instead of that I Get a MissingMemberException.

What version of the product are you using? On what operating system?

Last version

Please provide any additional information below.

I love your work on ImpromptuInterface an awsome tool :)

Oct 16, 2012 comment remilavoie
Your OtherThing class needs to have the
List GetThings(Guid test)
function in order to act like an ITest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant