Bug 312672 (MONO47187) - methods w/ "params" in interfaces being called from a dll
Summary: methods w/ "params" in interfaces being called from a dll
Status: RESOLVED MOVED
Alias: MONO47187
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Red Hat 9.0
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-31 20:44 UTC by Avi Herscovici
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:13:52 UTC


---- Reported by aherscovici@empirix.com 2003-07-31 13:44:53 MST ----

When you make an interface with a method that has "params object[] foo" in 
the parameter list, compile it to a dll then implement it in another 
place, the "params" keyword gets ignored!  Here is an example I used to 
reproduce this (if the interface exists in the same dll as its 
implementation or at least the same file, this works fine):


// FIRST FILE (compile after you have compiled the dll with the second 
file)

using System;

namespace foo {

using bar;

public class A {

static void Main () {

string moo = "moo";
C t = new B();
B s = new B();

t.test(3,moo);
t.test(3);
s.test(3,moo);
s.test(3);
}
}

public class B:C {
public void test (int c,params object[] args) {
Console.WriteLine(c);
}
}
}

// SECOND FILE (compile this to a DLL)

namespace bar {

public interface C {

void test (int c, params object[] args);

}
}

// ERROR!
file1.cs(18) error CS1503: Argument 1: Cannot convert from 'string' 
to 'object[]'
file1.cs(18) error CS1501: No overload for method `test' takes `2' 
arguments
file1.cs(18) error CS8006: Could not find any applicable function for this 
argument list
file1.cs(19) error CS1501: No overload for method `test' takes `1' 
arguments
file1.cs(19) error CS8006: Could not find any applicable function for this 
argument list



---- Additional Comments From ravi@ximian.com 2003-08-01 14:01:44 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO47030 ***


This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"