Type t = MutateGenericType (method.DeclaringType);
if (t != method.DeclaringType) {
method = (MethodInfo) TypeManager.DropGenericMethodArguments (method);
- if (method.Module == CodeGen.Module.Builder)
+ if (method.Module == Module.Builder)
method = TypeBuilder.GetMethod (t, method);
else
method = (MethodInfo) MethodInfo.GetMethodFromHandle (method.MethodHandle, t.TypeHandle);
Type t = MutateGenericType (ctor.DeclaringType);
if (t != ctor.DeclaringType) {
ctor = (ConstructorInfo) TypeManager.DropGenericMethodArguments (ctor);
- if (ctor.Module == CodeGen.Module.Builder)
+ if (ctor.Module == Module.Builder)
return TypeBuilder.GetConstructor (t, ctor);
return (ConstructorInfo) ConstructorInfo.GetMethodFromHandle (ctor.MethodHandle, t.TypeHandle);
for (int i = 0; i < t_args.Length; ++i)
t_args [i] = MutateType (t_args [i]);
- return type.GetGenericTypeDefinition ().MakeGenericType (t_args);
+ return TypeManager.DropGenericTypeArguments (type).MakeGenericType (t_args);
}
#endif
if (TypeManager.IsDelegateType (delegate_type))
return delegate_type;
-#if GMCS_SOURCE
if (TypeManager.DropGenericTypeArguments (delegate_type) == TypeManager.expression_type) {
delegate_type = TypeManager.GetTypeArguments (delegate_type) [0];
if (TypeManager.IsDelegateType (delegate_type))
GetSignatureForError (), TypeManager.CSharpName (delegate_type));
return null;
}
-#endif
Report.Error (1660, loc, "Cannot convert `{0}' to non-delegate type `{1}'",
GetSignatureForError (), TypeManager.CSharpName (delegate_type));
return false;
if (!TypeManager.IsDelegateType (delegate_type)) {
-#if GMCS_SOURCE
if (TypeManager.DropGenericTypeArguments (delegate_type) != TypeManager.expression_type)
return false;
- delegate_type = delegate_type.GetGenericArguments () [0];
+ delegate_type = TypeManager.GetTypeArguments (delegate_type) [0];
if (!TypeManager.IsDelegateType (delegate_type))
return false;
-#else
- return false;
-#endif
}
AParametersCollection d_params = TypeManager.GetDelegateParameters (delegate_type);
compatibles.Add (type, am == null ? EmptyExpression.Null : am);
return am;
+ } catch (CompletionResult){
+ throw;
} catch (Exception e) {
throw new InternalErrorException (e, loc);
}
}
MethodInfo delegate_method = method.MethodBuilder;
-#if GMCS_SOURCE
if (storey != null && storey.MemberName.IsGeneric) {
Type t = storey.Instance.Type;
t = storey.GetGenericStorey ().MutateType (t);
}
+#if GMCS_SOURCE
delegate_method = TypeBuilder.GetMethod (t, delegate_method);
- }
+#else
+ throw new NotSupportedException ();
#endif
+ }
+
ig.Emit (OpCodes.Ldftn, delegate_method);
ConstructorInfo constructor_method = Delegate.GetConstructor (ec.ContainerType, type);
public static AnonymousTypeClass Create (TypeContainer parent, ArrayList parameters, Location loc)
{
- if (RootContext.Version <= LanguageVersion.ISO_2)
- Report.FeatureIsNotAvailable (loc, "anonymous types");
+ if (RootContext.MetadataCompatibilityVersion < MetadataVersion.v2)
+ Report.FeatureIsNotSupported (loc, "anonymous types");
string name = ClassNamePrefix + types_counter++;