Click here to Skip to main content
15,914,452 members
Home / Discussions / C#
   

C#

 
QuestionAre parameter arrays CLS compliant? Pin
Nish Nishant6-Dec-05 1:02
sitebuilderNish Nishant6-Dec-05 1:02 
AnswerRe: Are parameter arrays CLS compliant? Pin
S. Senthil Kumar6-Dec-05 1:22
S. Senthil Kumar6-Dec-05 1:22 
Yes, if the VC# compiler is to be believed. This code compiles fine on my machine
[assembly:CLSCompliant(true)]
namespace ConsoleApplication1
{
    [CLSCompliantAttribute(true)]
    public class Program
    {
        public void Method(params object[] x)
        {
        }

        static void Main(string[] args) { }
    }
}


[EDIT]
Brad Abrams[^] has this to say when discussing params,

"Do not use the VarArgs calling convention, otherwise known as the ellipsis (…), exclusively because the Common Language Specification does not support it[3]."

So yes, params is CLS compliant. Interestingly, the params keyword simply seems to make the C# compiler wrap the arguments in an object array and pass it to the callee. In fact, the params thing just seems to generate an attribute for that parameter in IL, probably for use in reflection.

Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro

-- modified at 7:44 Tuesday 6th December, 2005
GeneralRe: Are parameter arrays CLS compliant? Pin
Nish Nishant6-Dec-05 2:32
sitebuilderNish Nishant6-Dec-05 2:32 
QuestionDataTime Pin
papa19806-Dec-05 0:55
papa19806-Dec-05 0:55 
AnswerRe: DataTime Pin
Colin Angus Mackay6-Dec-05 1:17
Colin Angus Mackay6-Dec-05 1:17 
GeneralRe: DataTime Pin
papa19806-Dec-05 1:23
papa19806-Dec-05 1:23 
GeneralRe: DataTime Pin
papa19806-Dec-05 1:27
papa19806-Dec-05 1:27 
GeneralRe: DataTime Pin
Colin Angus Mackay6-Dec-05 1:44
Colin Angus Mackay6-Dec-05 1:44 
GeneralRe: DataTime Pin
papa19806-Dec-05 1:56
papa19806-Dec-05 1:56 
GeneralRe: DataTime Pin
Colin Angus Mackay6-Dec-05 2:11
Colin Angus Mackay6-Dec-05 2:11 
GeneralRe: DataTime Pin
papa19806-Dec-05 3:48
papa19806-Dec-05 3:48 
AnswerRe: DataTime Pin
albCode14-Dec-05 5:07
albCode14-Dec-05 5:07 
QuestionLogin page Pin
ambedkar6-Dec-05 0:32
ambedkar6-Dec-05 0:32 
AnswerRe: Login page Pin
MudkiSekhon6-Dec-05 0:58
MudkiSekhon6-Dec-05 0:58 
GeneralRe: Login page Pin
Colin Angus Mackay6-Dec-05 1:08
Colin Angus Mackay6-Dec-05 1:08 
GeneralRe: Login page Pin
MudkiSekhon6-Dec-05 1:21
MudkiSekhon6-Dec-05 1:21 
GeneralRe: Login page Pin
Colin Angus Mackay6-Dec-05 1:34
Colin Angus Mackay6-Dec-05 1:34 
QuestionLogin page Pin
ambedkar6-Dec-05 0:32
ambedkar6-Dec-05 0:32 
QuestionFTP events in c# Help help Pin
CRASH726-Dec-05 0:14
CRASH726-Dec-05 0:14 
AnswerRe: FTP events in c# Help help Pin
lmoelleb6-Dec-05 20:50
lmoelleb6-Dec-05 20:50 
Questionmath library in c#? Pin
Hiral Patel5-Dec-05 23:16
Hiral Patel5-Dec-05 23:16 
AnswerRe: math library in c#? Pin
Guffa5-Dec-05 23:26
Guffa5-Dec-05 23:26 
QuestionC# Exposing to COM Pin
TheManFran5-Dec-05 22:32
TheManFran5-Dec-05 22:32 
GeneralC# Exposing to COM Pin
TheManFran5-Dec-05 22:14
TheManFran5-Dec-05 22:14 
AnswerRe: C# Exposing to COM Pin
leppie5-Dec-05 22:25
leppie5-Dec-05 22:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.