Author: raja
Date: 2005-03-03 03:41:58 -0500 (Thu, 03 Mar 2005)
New Revision: 41386
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/decl.cs
trunk/mcs/mcs/doc.cs
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/expression.cs
Log:
* decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
CS0246 check to users who passed 'silent = false'.
* ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
check.
(SimpleName.SimpleNameResolve): Update.
* expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
(MemberAccess.IdenticalNameAndTypeName): Update.
* doc.cs (FindDocumentedTypeNonArray): Update.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2005-03-03 08:19:31 UTC (rev 41385)
+++ trunk/mcs/mcs/ChangeLog 2005-03-03 08:41:58 UTC (rev 41386)
@@ -1,5 +1,16 @@
2005-03-03 Raja R Harinath <[EMAIL PROTECTED]>
+ * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
+ CS0246 check to users who passed 'silent = false'.
+ * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
+ check.
+ (SimpleName.SimpleNameResolve): Update.
+ * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
+ (MemberAccess.IdenticalNameAndTypeName): Update.
+ * doc.cs (FindDocumentedTypeNonArray): Update.
+
+2005-03-03 Raja R Harinath <[EMAIL PROTECTED]>
+
* codegen.cs (EmitContext): Remove ResolvingTypeTree.
* parameters.cs (ComputeAndDefineParameters): Remove.
* decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
Modified: trunk/mcs/mcs/decl.cs
===================================================================
--- trunk/mcs/mcs/decl.cs 2005-03-03 08:19:31 UTC (rev 41385)
+++ trunk/mcs/mcs/decl.cs 2005-03-03 08:41:58 UTC (rev 41386)
@@ -808,12 +808,11 @@
// Public function used to locate types, this can only
// be used after the ResolveTree function has been invoked.
//
- // Set 'silent' to true if you want to suppress "type not
found" errors.
// Set 'ignore_cs0104' to true if you want to ignore cs0104
errors.
//
// Returns: Type or null if they type can not be found.
//
- public FullNamedExpression LookupType (string name, Location
loc, bool silent, bool ignore_cs0104)
+ public FullNamedExpression LookupType (string name, Location
loc, bool ignore_cs0104)
{
FullNamedExpression e;
@@ -865,9 +864,6 @@
Cache [name] = e;
}
- if (e == null && !silent)
- Report.Error (246, loc, "Cannot find type
`"+name+"'");
-
return e;
}
Modified: trunk/mcs/mcs/doc.cs
===================================================================
--- trunk/mcs/mcs/doc.cs 2005-03-03 08:19:31 UTC (rev 41385)
+++ trunk/mcs/mcs/doc.cs 2005-03-03 08:41:58 UTC (rev 41386)
@@ -317,7 +317,7 @@
case "void":
return typeof (void);
}
- FullNamedExpression e = ds.LookupType (identifier,
mc.Location, true, false);
+ FullNamedExpression e = ds.LookupType (identifier,
mc.Location, false);
if (e != null) {
if (!(e is TypeExpr))
return null;
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2005-03-03 08:19:31 UTC (rev 41385)
+++ trunk/mcs/mcs/ecore.cs 2005-03-03 08:41:58 UTC (rev 41386)
@@ -2051,8 +2051,7 @@
public override FullNamedExpression ResolveAsTypeStep
(EmitContext ec)
{
int errors = Report.Errors;
- FullNamedExpression dt = ec.DeclSpace.LookupType (
- Name, loc, /*silent=*/ true,
/*ignore_cs0104=*/ false);
+ FullNamedExpression dt = ec.DeclSpace.LookupType (Name,
loc, /*ignore_cs0104=*/ false);
if (Report.Errors != errors)
return null;
@@ -2383,12 +2382,17 @@
public override TypeExpr DoResolveAsTypeStep (EmitContext ec)
{
if (type == null) {
- FullNamedExpression t = ec.DeclSpace.LookupType
(
- name, Location.Null, /*silent=*/ false,
/*ignore_cs0104=*/ false);
- if (t == null)
+ FullNamedExpression t = ec.DeclSpace.LookupType
(name, Location.Null, /*ignore_cs0104=*/ false);
+ if (t == null) {
+ Report.Error (246, loc, "Cannot find
type `" + name + "'");
return null;
- if (!(t is TypeExpr))
+ }
+ if (!(t is TypeExpr)) {
+ Report.Error (118, Location, "'{0}'
denotes a '{1}', where a type was expected",
+ t.FullName,
t.ExprClassName ());
+
return null;
+ }
type = ((TypeExpr) t).ResolveType (ec);
}
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2005-03-03 08:19:31 UTC (rev 41385)
+++ trunk/mcs/mcs/expression.cs 2005-03-03 08:41:58 UTC (rev 41386)
@@ -7195,7 +7195,7 @@
if (sn == null || left == null || left.Type.Name !=
sn.Name)
return false;
- return ec.DeclSpace.LookupType (sn.Name, loc,
/*silent=*/ true, /*ignore_cs0104*/ true) != null;
+ return ec.DeclSpace.LookupType (sn.Name, loc,
/*ignore_cs0104*/ true) != null;
}
// TODO: possible optimalization
@@ -8746,8 +8746,11 @@
//
// For now, fall back to the full lookup in
that case.
//
- FullNamedExpression e = ec.DeclSpace.LookupType
(
- cname, loc, /*silent=*/ false,
/*ignore_cs0104=*/ false);
+ FullNamedExpression e = ec.DeclSpace.LookupType
(cname, loc, /*ignore_cs0104=*/ false);
+ if (e == null) {
+ Report.Error (246, loc, "Cannot find
type `" + cname + "'");
+ return null;
+ }
if (e is TypeExpr)
type = ((TypeExpr) e).ResolveType (ec);
if (type == null)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches