Author: marek
Date: 2006-09-26 19:13:31 -0400 (Tue, 26 Sep 2006)
New Revision: 65942
Modified:
trunk/mcs/gmcs/cs-tokenizer.cs
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/class.cs
trunk/mcs/mcs/codegen.cs
trunk/mcs/mcs/const.cs
trunk/mcs/mcs/cs-tokenizer.cs
trunk/mcs/mcs/driver.cs
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/report.cs
Log:
2006-09-26 Marek Safar <[EMAIL PROTECTED]>
* class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
Fixed the cases when same error was reported twice.
* report.cs (SymbolRelatedToPreviousError): Simplified as all our
messages
now report symbol information.
Modified: trunk/mcs/gmcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/gmcs/cs-tokenizer.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/gmcs/cs-tokenizer.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -1773,7 +1773,6 @@
bool v = pp_expr (ref s);
s = s.Trim ();
if (s.Length != 0){
- Error_InvalidDirective ();
return false;
}
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/ChangeLog 2006-09-26 23:13:31 UTC (rev 65942)
@@ -1,3 +1,11 @@
+2006-09-26 Marek Safar <[EMAIL PROTECTED]>
+
+ * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
+ Fixed the cases when same error was reported twice.
+
+ * report.cs (SymbolRelatedToPreviousError): Simplified as all our
messages
+ now report symbol information.
+
2006-09-25 Martin Baulig <[EMAIL PROTECTED]>
* class.cs: Completely unified with the gmcs version.
Modified: trunk/mcs/mcs/class.cs
===================================================================
--- trunk/mcs/mcs/class.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/class.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -4890,10 +4890,6 @@
// but it wont get cleared
//
if (member.IsExplicitImpl){
- if ((modifiers & (Modifiers.PUBLIC |
Modifiers.ABSTRACT | Modifiers.VIRTUAL)) != 0){
- Modifiers.Error_InvalidModifier
(method.Location, "public, virtual or abstract");
- implementing = null;
- }
if (method.ParameterInfo.HasParams &&
!TypeManager.GetParameterData (implementing).HasParams) {
Report.SymbolRelatedToPreviousError (implementing);
Report.Error (466,
method.Location, "`{0}': the explicit interface implementation cannot introduce
the params modifier",
@@ -5335,7 +5331,6 @@
if (!Parent.PartialContainer.VerifyImplements
(this))
return false;
- Modifiers.Check
(Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location);
}
return true;
@@ -6886,8 +6881,10 @@
}
if (a.Target == AttributeTargets.Method) {
+ int errors = Report.Errors;
Add.ApplyAttributeBuilder (a, cb);
- Remove.ApplyAttributeBuilder (a, cb);
+ if (errors == Report.Errors)
+ Remove.ApplyAttributeBuilder (a, cb);
return;
}
Modified: trunk/mcs/mcs/codegen.cs
===================================================================
--- trunk/mcs/mcs/codegen.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/codegen.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -1097,13 +1097,6 @@
protected Attribute ResolveAttribute (Type a_type)
{
- if (OptAttributes == null)
- return null;
-
- // Ensure that we only have GlobalAttributes, since the
Search below isn't safe with other types.
- if (!OptAttributes.CheckTargets ())
- return null;
-
Attribute a = OptAttributes.Search (a_type);
if (a != null) {
a.Resolve ();
@@ -1183,6 +1176,13 @@
public void Resolve ()
{
+ if (OptAttributes == null)
+ return;
+
+ // Ensure that we only have GlobalAttributes, since the
Search isn't safe with other types.
+ if (!OptAttributes.CheckTargets())
+ return;
+
ClsCompliantAttribute = ResolveAttribute
(TypeManager.cls_compliant_attribute_type);
if (ClsCompliantAttribute != null) {
is_cls_compliant =
ClsCompliantAttribute.GetClsCompliantAttributeValue ();
@@ -1558,9 +1558,15 @@
/// <summary>
/// It is called very early therefore can resolve only
predefined attributes
/// </summary>
- public void ResolveAttributes ()
+ public void Resolve ()
{
#if GMCS_SOURCE
+ if (OptAttributes == null)
+ return;
+
+ if (!OptAttributes.CheckTargets())
+ return;
+
Attribute a = ResolveAttribute
(TypeManager.default_charset_type);
if (a != null) {
DefaultCharSet = a.GetCharSetValue ();
Modified: trunk/mcs/mcs/const.cs
===================================================================
--- trunk/mcs/mcs/const.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/const.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -26,6 +26,7 @@
public class Const : FieldMember, IConstant {
Constant value;
bool in_transit;
+ bool define_called;
public const int AllowedModifiers =
Modifiers.NEW |
@@ -58,10 +59,14 @@
/// </summary>
public override bool Define ()
{
- // Make Define () idempotent, but ensure that the error
check happens.
- if (FieldBuilder != null)
- return base.CheckBase ();
+ // Because constant define can be called from other
class
+ if (define_called) {
+ CheckBase ();
+ return FieldBuilder != null;
+ }
+ define_called = true;
+
if (!base.Define ())
return false;
Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/cs-tokenizer.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -1565,7 +1565,6 @@
bool v = pp_expr (ref s);
s = s.Trim ();
if (s.Length != 0){
- Error_InvalidDirective ();
return false;
}
@@ -2318,10 +2317,9 @@
int state = (int) ifstack.Pop ();
if ((state & REGION) != 0)
Report.Error (1038, Location,
"#endregion directive expected");
- else
- Report.Error (1027, Location, "Expected
`#endif' directive");
+// else
+// Report.Error (1027, Location, "Expected
`#endif' directive");
}
-
}
}
Modified: trunk/mcs/mcs/driver.cs
===================================================================
--- trunk/mcs/mcs/driver.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/driver.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -1653,7 +1653,7 @@
if (timestamps)
ShowTime (" Core Types done");
- CodeGen.Module.ResolveAttributes ();
+ CodeGen.Module.Resolve ();
//
// The second pass of the compiler
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/ecore.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -239,9 +239,11 @@
if (te == null)
return null;
- ObsoleteAttribute obsolete_attr =
AttributeTester.GetObsoleteAttribute (te.Type);
- if (obsolete_attr != null && !ec.IsInObsoleteScope) {
- AttributeTester.Report_ObsoleteMessage
(obsolete_attr, te.GetSignatureForError (), Location);
+ if (!silent) {
+ ObsoleteAttribute obsolete_attr =
AttributeTester.GetObsoleteAttribute (te.Type);
+ if (obsolete_attr != null &&
!ec.IsInObsoleteScope) {
+ AttributeTester.Report_ObsoleteMessage
(obsolete_attr, te.GetSignatureForError (), Location);
+ }
}
// Constrains don't need to be checked for overrides
Modified: trunk/mcs/mcs/report.cs
===================================================================
--- trunk/mcs/mcs/report.cs 2006-09-26 22:02:38 UTC (rev 65941)
+++ trunk/mcs/mcs/report.cs 2006-09-26 23:13:31 UTC (rev 65942)
@@ -131,7 +131,7 @@
Stderr.WriteLine (msg.ToString ());
foreach (string s in extra_information)
- Stderr.WriteLine (s + MessageType);
+ Stderr.WriteLine (s + MessageType +
")");
extra_information.Clear ();
@@ -354,7 +354,7 @@
static void SymbolRelatedToPreviousError (string loc, string
symbol)
{
- extra_information.Add (String.Format ("{0}: `{1}', name
of symbol related to previous ", loc, symbol));
+ extra_information.Add (String.Format ("{0} (Location of
the symbol related to previous ", loc));
}
public static void ExtraInformation (Location loc, string msg)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches