[Mono-bugs] Using snapshot of Feb-24-02
FC AI
f_ai@hotmail.com
Tue, 26 Feb 2002 00:13:22 +0000
This is a multi-part message in MIME format.
------=_NextPart_000_6bb6_6431_3dd1
Content-Type: text/plain; format=flowed
And this is the last one.
I found a problem related to the type-lookup when using namespaces.
Attached is the C# code to reproduce the problem.
I changed the code as follow and it seem to work:
The current idea to search for type 'a' in a namespace 'x.y.z'
is ( at least this is what i understood):
-Try x.y.z.a
-Try a
-Try 'a' with all the using namespaces of x.y.z
-Try 'a' with all the ussing ns of x.y.z parent namespace (and so on)
I changed it by:
-Try a
-Try x.y.z+a
-try x.y.z.usings[]+a
-Try x.y(implicit parent of x.y.z) + a
-try x.y.usings +a
-Try all the explicit parents of x.y.z +a
-Try all the explicit parents of x.y.z usings +a
and so on
I changed with the same idea
RootContext.LookupType and
TypeContainer.GetInterfaceOrClass
let me know if i'm in a good track
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
------=_NextPart_000_6bb6_6431_3dd1
Content-Type: text/plain; name="Ns_Types.cs"; format=flowed
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="Ns_Types.cs"
/*
* Desciption:
* Inside 'N2', A is not defined
* a) The definition of 'member' fails
* b) The definition of 'method' fails
* c) The definition of class 'C' fails
*/
namespace N1
{
public enum A
{
A_1, A_2, A_3
}
namespace N2
{
public class B
{
A member;
void Method (ref A a)
{
}
}
public class C:A
{
}
}
}
/*
* N1.N3 is the same as
* namespace N1 {
* namespace N3 {
*
* }
* }
*
* Inside 'N3', A is not defined
* a) The definition of 'member' fails
* b) The definition of 'method' fails
* c) The definition of class 'C' fails
*
*/
namespace N1.N3
{
public class B
{
A member;
void Method (ref A a)
{
}
}
public class C:A
{
}
}
------=_NextPart_000_6bb6_6431_3dd1--