dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]<PNET> parameter passing bug ?


From: Rhys Weatherley
Subject: Re: [DotGNU]<PNET> parameter passing bug ?
Date: Sat, 26 Jan 2002 08:21:42 +1000

"Gopal.V" wrote:

>           The problem is with passing parameters to functions. Calling
>           the function in concern with the parameter throws a
>           MissingMethodException.

This one is actually a bug in your test case as well as
a bug in the compiler.  You are calling an instance method
from a static method, without an object.  An excerpt:

public void test1(int a)
{
    Console.Write(a);
}
public static void Main()
{
    int b=12;
    test1(b);
}

This should have given an error, but didn't (I'll chase down
why this is the case).  Add "static" to the declaration of
"test1" and it will work.  Either that or create an instance
of the class using "new" and call "test1" on that.

Cheers,

Rhys.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]