2003-11-02 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sun, 2 Nov 2003 05:45:00 +0000 (05:45 -0000)
committerMartin Baulig <martin@novell.com>
Sun, 2 Nov 2003 05:45:00 +0000 (05:45 -0000)
* expression.cs (Invocation.EmitCall): Use
`TypeManager.IsValueType()' to check whether it's a value type.
Don't set `struct_call' when calling a method on a type parameter.

svn path=/trunk/mcs/; revision=19541

mcs/gmcs/ChangeLog
mcs/gmcs/expression.cs

index 6c307dd9941c15c7279f9a729d17cd69f88f7aa4..7660dc9db2f94a0183804ecef6c0466a18687eeb 100755 (executable)
@@ -1,3 +1,9 @@
+2003-11-02  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (Invocation.EmitCall): Use
+       `TypeManager.IsValueType()' to check whether it's a value type.
+       Don't set `struct_call' when calling a method on a type parameter.
+
 2003-11-02  Martin Baulig  <martin@ximian.com>
 
        * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
index ad4104772d99ace514581c199b6461b9e118bad6..bbdcd46ef068436d6bce1fa737482efc571ee13e 100755 (executable)
@@ -5047,7 +5047,7 @@ namespace Mono.CSharp {
                                return;
                        
                        if (!is_static){
-                               if (decl_type.IsValueType)
+                               if (TypeManager.IsValueType (decl_type))
                                        struct_call = true;
                                //
                                // If this is ourselves, push "this"
@@ -5058,14 +5058,15 @@ namespace Mono.CSharp {
                                        //
                                        // Push the instance expression
                                        //
-                                       if (instance_expr.Type.IsValueType){
+                                       if (TypeManager.IsValueType (instance_expr.Type)){
                                                //
                                                // Special case: calls to a function declared in a 
                                                // reference-type with a value-type argument need
                                                // to have their value boxed.  
 
-                                               struct_call = true;
-                                               if (decl_type.IsValueType){
+                                               if (!instance_expr.Type.IsGenericParameter)
+                                                       struct_call = true;
+                                               if (TypeManager.IsValueType (decl_type)){
                                                        //
                                                        // If the expression implements IMemoryLocation, then
                                                        // we can optimize and use AddressOf on the