Start a new topic

passing 'params object[] args'

When trying to pass 'params object[] args' to another function expecting

params arguments give error. The following code show work


public static JQuery jquery(params Element[] elements)

 {

            return JQuerySelector.select(elements);

 }


public static JQuerySelector select(params Element[] elements)

 {

            return ...;

 }


gives this compiler error


Error 1 Internal error or unsupported syntax. Please submit a bug at: http://support.duoco.de/support/tickets/new


C:\Projects\AJAX\ASP\AjaxDuo\AjaxRoot.cs 1366 20 AjaxGateway.Duo


Same thing when trying to wrap something like String.Format(formart, args)


if args was a 'params args object[]' should just proxy all the arguments to the string format function.


But fails


We can't reproduce this bug.

There are two cases: 

1) Regarding params T[] args, in pure C# it's always passed as an array to the caller function.

2) Only if mehtod is extern [Js(Extern = true)], than DuoCode passes it as an argument list.


Can you please reproduce this bug on: try.duoco.de and send us the full URL.

Yes... it is extern. Consider this extern defination:


[Js(Name = "jQuery", Extern = true)]

 public static class JQueryInit

 {

        [Js(Name = "fn.init")]

        public static extern JQuery init(params Element[] elements);

}



No i need to use a wrapper function like so:


public static JQuery jquery(this System.Plugins source, params Element[] elements)

{

    return JQueryTools.initElements(elements);

}



gives error: Error 1 Internal error or unsupported syntax. Please submit a bug at: http://support.duoco.de/support/tickets/new C:\Projects\AJAX\ASP\AjaxDuo\AjaxQuery.cs 6211 14 AjaxGateway.Duo



How can i pass wrapped params T[] args to an extern=true function like described above


Login or Signup to post a comment