Author: martin
Date: 2005-04-15 04:52:09 -0400 (Fri, 15 Apr 2005)
New Revision: 43028
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/cs-tokenizer.cs
trunk/mcs/gmcs/decl.cs
trunk/mcs/gmcs/doc.cs
trunk/mcs/gmcs/ecore.cs
trunk/mcs/gmcs/expression.cs
Log:
**** Merged r41386-41393 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-15 08:52:09 UTC (rev 43028)
@@ -1,5 +1,22 @@
2005-03-03 Raja R Harinath <[EMAIL PROTECTED]>
+ Fix compile with MCS 1.0.0.0.
+ * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
+ w_restore to not depend on string constant folding.
+
+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/gmcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/gmcs/cs-tokenizer.cs 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/cs-tokenizer.cs 2005-04-15 08:52:09 UTC (rev 43028)
@@ -1471,8 +1471,8 @@
void PreProcessPragma (string arg)
{
const string warning = "warning";
- const string w_disable = warning + " disable";
- const string w_restore = warning + " restore";
+ const string w_disable = "warning disable";
+ const string w_restore = "warning restore";
if (arg == w_disable) {
Report.RegisterWarningRegion
(Location).WarningDisable (line);
@@ -1502,7 +1502,7 @@
}
if (arg.StartsWith (warning)) {
- Report.Warning (1634, 1, Location , "Expected
disable or restore");
+ Report.Warning (1634, 1, Location, "Expected
disable or restore");
return;
}
}
Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/decl.cs 2005-04-15 08:52:09 UTC (rev 43028)
@@ -953,12 +953,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;
@@ -1010,9 +1009,6 @@
Cache [name] = e;
}
- if (e == null && !silent)
- Report.Error (246, loc, "Cannot find type
`"+name+"'");
-
return e;
}
Modified: trunk/mcs/gmcs/doc.cs
===================================================================
--- trunk/mcs/gmcs/doc.cs 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/doc.cs 2005-04-15 08:52:09 UTC (rev 43028)
@@ -315,7 +315,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/gmcs/ecore.cs
===================================================================
--- trunk/mcs/gmcs/ecore.cs 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/ecore.cs 2005-04-15 08:52:09 UTC (rev 43028)
@@ -2186,7 +2186,7 @@
return dt.ResolveAsTypeStep (ec);
int errors = Report.Errors;
- dt = ec.DeclSpace.LookupType (Name, loc, /*silent=*/
true, /*ignore_cs0104=*/ false);
+ dt = ec.DeclSpace.LookupType (Name, loc,
/*ignore_cs0104=*/ false);
if (Report.Errors != errors)
return null;
@@ -2542,12 +2542,17 @@
protected 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/gmcs/expression.cs
===================================================================
--- trunk/mcs/gmcs/expression.cs 2005-04-15 08:51:20 UTC (rev 43027)
+++ trunk/mcs/gmcs/expression.cs 2005-04-15 08:52:09 UTC (rev 43028)
@@ -7366,7 +7366,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
@@ -9039,7 +9039,11 @@
// For now, fall back to the full
lookup in that case.
//
FullNamedExpression e =
ec.DeclSpace.LookupType (
- cname, loc, /*silent=*/ false,
/*ignore_cs0104=*/ false);
+ 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