Browse Source

2002-08-05 Martin Baulig <[email protected]>

	* expression.cs (Binary.ResolveOperator): When combining delegates,
	they must have the same type.

svn path=/trunk/mcs/; revision=6417
Martin Baulig 23 years ago
parent
commit
700a35e242
2 changed files with 11 additions and 1 deletions
  1. 5 0
      mcs/mcs/ChangeLog
  2. 6 1
      mcs/mcs/expression.cs

+ 5 - 0
mcs/mcs/ChangeLog

@@ -1,3 +1,8 @@
+2002-08-05  Martin Baulig  <[email protected]>
+
+	* expression.cs (Binary.ResolveOperator): When combining delegates,
+	they must have the same type.
+
 2002-08-05  Martin Baulig  <[email protected]>
 
 	* typemanager.cs (TypeManager.GetArgumentTypes): Don't call

+ 6 - 1
mcs/mcs/expression.cs

@@ -2044,7 +2044,12 @@ namespace Mono.CSharp {
 						method = TypeManager.delegate_combine_delegate_delegate;
 					else
 						method = TypeManager.delegate_remove_delegate_delegate;
-					
+
+					if (l != r) {
+						Error_OperatorCannotBeApplied ();
+						return null;
+					}
+
 					DelegateOperation = true;
 					type = l;
 					return this;