if (type2.data_type != data_type) {
return false;
}
- if (type2.type_parameter != null || type_parameter != null) {
- if (type2.type_parameter == null || type_parameter == null) {
+ if (type2 is GenericType || this is GenericType) {
+ if (!(type2 is GenericType) || !(this is GenericType)) {
return false;
}
- if (!type2.type_parameter.equals (type_parameter)) {
+ if (!((GenericType) type2).type_parameter.equals (((GenericType) this).type_parameter)) {
return false;
}
}
}
/* temporarily ignore type parameters */
- if (type_parameter != null || type2.type_parameter != null) {
+ if (this is GenericType || type2 is GenericType) {
return true;
}
if (target_type is PointerType) {
/* any reference or array type or pointer type can be cast to a generic pointer */
- if (type_parameter != null ||
+ if (this is GenericType ||
(data_type != null && (
data_type.is_reference_type () ||
this is DelegateType))) {
}
/* temporarily ignore type parameters */
- if (target_type.type_parameter != null) {
+ if (target_type is GenericType) {
return true;
}
public virtual bool is_reference_type_or_type_parameter () {
return (data_type != null &&
data_type.is_reference_type ()) ||
- type_parameter != null;
+ this is GenericType;
}
public virtual bool is_array () {
// parameter types must refer to the delegate type parameters
// instead of to the class type parameters
foreach (var param in generated_delegate.get_parameters ()) {
- if (param.variable_type is GenericType) {
- param.variable_type.type_parameter = generated_delegate.get_type_parameters ().get (generated_delegate.get_type_parameter_index (param.variable_type.type_parameter.name));
+ var generic_type = param.variable_type as GenericType;
+ if (generic_type != null) {
+ generic_type.type_parameter = generated_delegate.get_type_parameters ().get (generated_delegate.get_type_parameter_index (generic_type.type_parameter.name));
}
}
}