Skip to content

Commit

Permalink
*** merged revisions from mcs: 57916, 58040, 58050, 58115
Browse files Browse the repository at this point in the history
svn path=/trunk/mcs/; revision=58577
  • Loading branch information
harinath committed Mar 27, 2006
1 parent 71b1164 commit 9c2c8ab
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 18 deletions.
2 changes: 0 additions & 2 deletions mcs/errors/known-issues-gmcs
Expand Up @@ -24,7 +24,6 @@ cs0560.cs
cs0567.cs
cs0612-2.cs NO ERROR
cs0619-42.cs
cs0625-3.cs NO ERROR
cs0631-2.cs
cs0647-3.cs
cs1035.cs
Expand All @@ -51,7 +50,6 @@ gcs0146.cs
gcs0305-2.cs
gcs0305.cs
gcs0308.cs
cs0553-2.cs
cs1669-2.cs NO ERROR
cs1677.cs
cs0134-2.cs NO ERROR
Expand Down
20 changes: 20 additions & 0 deletions mcs/gmcs/ChangeLog
@@ -1,3 +1,23 @@
2006-03-17 Marek Safar <marek.safar@seznam.cz>

* typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.

2006-03-15 Marek Safar <marek.safar@seznam.cz>

* class.cs (FieldMember.Emit): ParentContainer is real parent for partial
classes.

2006-03-15 Marek Safar <marek.safar@seznam.cz>

* class.cs (Operator.Define): An error for base conversion was not
reported correctly.

2006-03-13 Marek Safar <marek.safar@seznam.cz>

A fix for #77593, #77574.

* class.cs (MethodCore.CheckBase): Another if for operator.

2006-03-18 Marek Safar <marek.safar@seznam.cz>

A fix for #77822.
Expand Down
19 changes: 5 additions & 14 deletions mcs/gmcs/class.cs
Expand Up @@ -3157,7 +3157,8 @@ protected override bool CheckBase ()
}

Type base_ret_type = null;
base_method = FindOutBaseMethod (ref base_ret_type);
if (IsOperator == null)
base_method = FindOutBaseMethod (ref base_ret_type);

// method is override
if (base_method != null) {
Expand Down Expand Up @@ -5453,7 +5454,7 @@ public override void Emit ()
OptAttributes.Emit ();
}

if (Parent.HasExplicitLayout && ((status & Status.HAS_OFFSET) == 0) && (ModFlags & Modifiers.STATIC) == 0) {
if (((status & Status.HAS_OFFSET) == 0) && (ModFlags & Modifiers.STATIC) == 0 && ParentContainer.HasExplicitLayout) {
Report.Error (625, Location, "`{0}': Instance field types marked with StructLayout(LayoutKind.Explicit) must have a FieldOffset attribute.", GetSignatureForError ());
}

Expand Down Expand Up @@ -7428,25 +7429,15 @@ public override bool Define ()
"enclosing type");
return false;
}

if (first_arg_type == TypeManager.object_type ||
return_type == TypeManager.object_type){
Report.Error (
-8, Location,
"User-defined conversion cannot convert to or from " +
"object type");
return false;
}

if (first_arg_type.IsInterface || return_type.IsInterface){
Report.Error (552, Location, "User-defined conversion `{0}' cannot convert to or from an interface type",
GetSignatureForError ());
return false;
}

if (first_arg_type.IsSubclassOf (return_type)
|| return_type.IsSubclassOf (first_arg_type)){
if (declaring_type.IsSubclassOf (return_type)) {
if (first_arg_type.IsSubclassOf (return_type) || return_type.IsSubclassOf (first_arg_type)) {
if (declaring_type.IsSubclassOf (return_type) || declaring_type.IsSubclassOf (first_arg_type)) {
Report.Error (553, Location, "User-defined conversion `{0}' cannot convert to or from base class",
GetSignatureForError ());
return false;
Expand Down
2 changes: 1 addition & 1 deletion mcs/gmcs/typemanager.cs
Expand Up @@ -2134,7 +2134,7 @@ public static Type[] ExpandInterfaces (Type [] base_interfaces)
return result;
} else if (t is GenericTypeParameterBuilder){
Type[] type_ifaces = (Type []) builder_to_ifaces [t];
if (type_ifaces == null)
if (type_ifaces == null || type_ifaces.Length == 0)
type_ifaces = Type.EmptyTypes;

iface_cache [t] = type_ifaces;
Expand Down
1 change: 0 additions & 1 deletion mcs/tests/known-issues-gmcs
Expand Up @@ -10,7 +10,6 @@ test-anon-27.cs
test-xml-027.cs
test-465.cs IGNORE # need to fix the path separator to work both on Unix and Windows
test-476.cs
test-495.cs
test-anon-11.cs
test-anon-36.cs
test-498.cs
Expand Down

0 comments on commit 9c2c8ab

Please sign in to comment.