mail-archives/mono-bugs/2002-February/000015.html

162 строки
3.7 KiB
HTML
Исходник Ответственный История

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] Using snapshot of Feb-24-02
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:f_ai%40hotmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="000013.html">
<LINK REL="Next" HREF="000016.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] Using snapshot of Feb-24-02
</H1>
<B>FC AI
</B>
<A HREF="mailto:f_ai%40hotmail.com"
TITLE="[Mono-bugs] Using snapshot of Feb-24-02">f_ai@hotmail.com
</A><BR>
<I>Tue, 26 Feb 2002 00:13:22 +0000</I>
<P><UL>
<LI> Previous message: <A HREF="000013.html">[Mono-bugs] Using snapshot of Feb-24-02
</A></li>
<LI> Next message: <A HREF="000016.html">[Mono-bugs] [Bug 21042] New - Missing parameter names in PInvoke methods.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#15">[ date ]</a>
<a href="thread.html#15">[ thread ]</a>
<a href="subject.html#15">[ subject ]</a>
<a href="author.html#15">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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<6C>s largest e-mail service with MSN Hotmail.
<A HREF="http://www.hotmail.com">http://www.hotmail.com</A>
------=_NextPart_000_6bb6_6431_3dd1
Content-Type: text/plain; name=&quot;Ns_Types.cs&quot;; format=flowed
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename=&quot;Ns_Types.cs&quot;
/*
* 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--
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="000013.html">[Mono-bugs] Using snapshot of Feb-24-02
</A></li>
<LI> Next message: <A HREF="000016.html">[Mono-bugs] [Bug 21042] New - Missing parameter names in PInvoke methods.
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#15">[ date ]</a>
<a href="thread.html#15">[ thread ]</a>
<a href="subject.html#15">[ subject ]</a>
<a href="author.html#15">[ author ]</a>
</LI>
</UL>
</body></html>