+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()
return;
if (!is_static){
- if (decl_type.IsValueType)
+ if (TypeManager.IsValueType (decl_type))
struct_call = true;
//
// If this is ourselves, push "this"
//
// 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