Author: martin
Date: 2005-04-19 15:14:58 -0400 (Tue, 19 Apr 2005)
New Revision: 43287
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/class.cs
trunk/mcs/gmcs/codegen.cs
trunk/mcs/gmcs/typemanager.cs
Log:
**** Merged r43047 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-04-19 19:12:45 UTC (rev 43286)
+++ trunk/mcs/gmcs/ChangeLog 2005-04-19 19:14:58 UTC (rev 43287)
@@ -1,3 +1,15 @@
+2005-04-15 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix cs0208-7.cs and cs0208-8.cs.
+ * typemanager.cs (IsUnmanagedType): Arrays are not allowed
+ (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
+ error reporting to point out the reason a struct is not unmanaged.
+
+2005-04-13 Atsushi Enomoto <[EMAIL PROTECTED]>
+
+ * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
+ just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
+
2005-04-13 Raja R Harinath <[EMAIL PROTECTED]>
Fix #74528.
Modified: trunk/mcs/gmcs/class.cs
===================================================================
--- trunk/mcs/gmcs/class.cs 2005-04-19 19:12:45 UTC (rev 43286)
+++ trunk/mcs/gmcs/class.cs 2005-04-19 19:14:58 UTC (rev 43287)
@@ -5796,12 +5796,10 @@
}
}
-#if NET_2_0
if (a.Type == TypeManager.fixed_buffer_attr_type) {
Report.Error (1716, Location, "Do not use
'System.Runtime.CompilerServices.FixedBuffer' attribute. Use the 'fixed' field
modifier instead");
return;
}
-#endif
base.ApplyAttributeBuilder (a, cb);
}
Modified: trunk/mcs/gmcs/codegen.cs
===================================================================
--- trunk/mcs/gmcs/codegen.cs 2005-04-19 19:12:45 UTC (rev 43286)
+++ trunk/mcs/gmcs/codegen.cs 2005-04-19 19:14:58 UTC (rev 43287)
@@ -1385,7 +1385,6 @@
/// </summary>
public void ResolveAttributes ()
{
-#if NET_2_0
Attribute a = ResolveAttribute
(TypeManager.default_charset_type);
if (a != null) {
DefaultCharSet = a.GetCharSetValue ();
@@ -1404,7 +1403,6 @@
break;
}
}
-#endif
}
public override string[] ValidAttributeTargets {
Modified: trunk/mcs/gmcs/typemanager.cs
===================================================================
--- trunk/mcs/gmcs/typemanager.cs 2005-04-19 19:12:45 UTC (rev 43286)
+++ trunk/mcs/gmcs/typemanager.cs 2005-04-19 19:14:58 UTC (rev 43287)
@@ -1655,11 +1655,13 @@
if (IsBuiltinOrEnum (t))
return true;
+ // Someone did the work of checking if the ElementType of t is
unmanaged. Let's not repeat it.
if (t.IsPointer)
return true;
+ // Arrays are disallowed, even if we mark them with
[MarshalAs(UnmanagedType.ByValArray, ...)]
if (t.IsArray)
- return IsUnmanagedType (t.GetElementType ());
+ return false;
if (!IsValueType (t))
return false;
@@ -1674,17 +1676,22 @@
continue;
if (f.MemberType == null)
continue;
- if (!IsUnmanagedType (f.MemberType))
+ if (!IsUnmanagedType (f.MemberType)){
+ Report.SymbolRelatedToPreviousError
(f.Location, CSharpName (t) + "." + f.Name);
return false;
+ }
}
return true;
}
FieldInfo [] fields = t.GetFields (BindingFlags.Public |
BindingFlags.NonPublic | BindingFlags.Instance);
- foreach (FieldInfo f in fields)
- if (!IsUnmanagedType (f.FieldType))
+ foreach (FieldInfo f in fields){
+ if (!IsUnmanagedType (f.FieldType)){
+ Report.SymbolRelatedToPreviousError (f);
return false;
+ }
+ }
return true;
}
@@ -2457,10 +2464,6 @@
if (IsUnmanagedType (t))
return true;
- // We need this explicit check here to make it work when
compiling corlib.
- if (!RootContext.StdLib && (t == TypeManager.decimal_type))
- return true;
-
Report.Error (
208, loc,
"Cannot take the address or size of a variable of a
managed type ('" +
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches