dotgnu-general
[Top][All Lists]
Advanced

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

[DotGNU]Another compiler question (namespace)


From: Gopal V
Subject: [DotGNU]Another compiler question (namespace)
Date: Mon, 21 Oct 2002 21:59:28 +0530
User-agent: Mutt/1.2.5i

Code:

using ThisDoesNotExist.Foo;
public class XYZ
{
.....
}

Should the compiler complain that it cannot find a ThisDoesNotExist.Foo
namespace ?.

For example 

using System.IO;

adds the System.IO as a SUBSCOPE of System into the RBTree via 
FindNamespaceScope() without any further checks or verification.
(hmm...)

This introduces a potential bug that 

using System.String;

will destroy the type System.String and replace it with a namespace
decl, even though System.String does not exist :-(

This is the source of the fully qualified name bug ... the Namespace
entry is absent from the RBTree if the 'using' is omitted...

If namespaces were checked, we could try creating a new one , just
to see if it gave a valid namespace ... But otherwise we're crippled 
about differentiating System.Console and System.Net :-)

Having said all that , I must confess that "how" to do it still
baffles me (guidance please , rhys :)

Gopal

PS: this is a minor irritation to those compiling System.dll , but
    retained in HttpWebRequest.cs as a permanent check for this.
-- 
The difference between insanity and genius is measured by success


reply via email to

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