[IronPython] How do you call a generic method that requires more than one generic argument?

Curt Hagenlocher curt at hagenlocher.org
Tue Dec 30 17:07:56 CET 2008


Did you AddReference System.Core.dll?

On Tue, Dec 30, 2008 at 7:54 AM, Dan Eloff <dan.eloff at gmail.com> wrote:

> >>> from System import Action
> >>> f = lambda x, y: x+y
> >>> Action[object, object](f)
> ValueError: The type or method has 1 generic parameter(s), but 2
> generic argument(s) were provided. A generic argument must be provided
> for each generic parameter.
> >>> Action[(object, object)](f)
> ValueError: The type or method has 1 generic parameter(s), but 2
> generic argument(s) were provided. A generic argument must be provided
> for each generic parameter.
> >>> Action[[object,object]](f)
> TypeError: expected Array[Type], got list
> >>> from System import Array, Type
> >>> Action[Array[Type]([object, object])](f)
> ValueError: The type or method has 1 generic parameter(s), but 2
> generic argument(s) were provided. A generic argument must be provided
> for each generic parameter.
>
> Is this a bug?
>
> Thanks,
> -Dan
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081230/51d16c1b/attachment.html>


More information about the Ironpython-users mailing list