}
if (init != null) {
- new_storey = new NewInitialize (storey_type_expr, new ArrayList (0),
+ new_storey = new NewInitialize (storey_type_expr, null,
new CollectionOrObjectInitializers (init, loc), loc);
} else {
- new_storey = new New (storey_type_expr, new ArrayList (0), loc);
+ new_storey = new New (storey_type_expr, null, loc);
}
new_storey = new_storey.Resolve (ec);
TypeExpr enumerator_type;
TypeExpr enumerable_type;
-#if GMCS_SOURCE
TypeArguments generic_args;
TypeExpr generic_enumerator_type;
TypeExpr generic_enumerable_type;
-#else
- const TypeArguments generic_args = null;
-#endif
ArrayList hoisted_params_copy;
int local_name_idx;
protected override TypeExpr [] ResolveBaseTypes (out TypeExpr base_class)
{
iterator_type_expr = new TypeExpression (MutateType (Iterator.OriginalIteratorType), Location);
-
-#if GMCS_SOURCE
generic_args = new TypeArguments (iterator_type_expr);
-#endif
ArrayList list = new ArrayList ();
if (Iterator.IsEnumerable) {
TypeManager.ienumerable_type, Location);
list.Add (enumerable_type);
-#if GMCS_SOURCE
- generic_enumerable_type = new GenericTypeExpr (
- TypeManager.generic_ienumerable_type,
- generic_args, Location);
- list.Add (generic_enumerable_type);
-#endif
+ if (TypeManager.generic_ienumerable_type != null) {
+ generic_enumerable_type = new GenericTypeExpr (
+ TypeManager.generic_ienumerable_type,
+ generic_args, Location);
+ list.Add (generic_enumerable_type);
+ }
}
enumerator_type = new TypeExpression (
list.Add (new TypeExpression (TypeManager.idisposable_type, Location));
-#if GMCS_SOURCE
- generic_enumerator_type = new GenericTypeExpr (
- TypeManager.generic_ienumerator_type,
- generic_args, Location);
- list.Add (generic_enumerator_type);
-#endif
+ if (TypeManager.generic_ienumerator_type != null) {
+ generic_enumerator_type = new GenericTypeExpr (
+ TypeManager.generic_ienumerator_type,
+ generic_args, Location);
+ list.Add (generic_enumerator_type);
+ }
type_bases = list;
}
}
-#if GMCS_SOURCE
- Define_Current (true);
-#endif
+ if (generic_enumerator_type != null)
+ Define_Current (true);
+
Define_Current (false);
new DisposeMethod (this);
Define_Reset ();
if (Iterator.IsEnumerable) {
- MemberName name = new MemberName ("System");
+ MemberName name = new MemberName (QualifiedAliasMember.GlobalAlias, "System", null, Location);
name = new MemberName (name, "Collections", Location);
name = new MemberName (name, "IEnumerable", Location);
name = new MemberName (name, "GetEnumerator", Location);
-#if GMCS_SOURCE
- Method get_enumerator = new IteratorMethod (this, enumerator_type, 0, name);
+ if (generic_enumerator_type != null) {
+ Method get_enumerator = new IteratorMethod (this, enumerator_type, 0, name);
- name = new MemberName (name.Left.Left, "Generic", Location);
- name = new MemberName (name, "IEnumerable", generic_args, Location);
- name = new MemberName (name, "GetEnumerator", Location);
- Method gget_enumerator = new GetEnumeratorMethod (this, generic_enumerator_type, name);
+ name = new MemberName (name.Left.Left, "Generic", Location);
+ name = new MemberName (name, "IEnumerable", generic_args, Location);
+ name = new MemberName (name, "GetEnumerator", Location);
+ Method gget_enumerator = new GetEnumeratorMethod (this, generic_enumerator_type, name);
- //
- // Just call generic GetEnumerator implementation
- //
- get_enumerator.Block.AddStatement (
- new Return (new Invocation (new DynamicMethodGroupExpr (gget_enumerator, Location), new ArrayList (0)), Location));
+ //
+ // Just call generic GetEnumerator implementation
+ //
+ get_enumerator.Block.AddStatement (
+ new Return (new Invocation (new DynamicMethodGroupExpr (gget_enumerator, Location), null), Location));
- AddMethod (get_enumerator);
- AddMethod (gget_enumerator);
-#else
- AddMethod (new GetEnumeratorMethod (this, enumerator_type, name));
-#endif
+ AddMethod (get_enumerator);
+ AddMethod (gget_enumerator);
+ } else {
+ AddMethod (new GetEnumeratorMethod (this, enumerator_type, name));
+ }
}
}
void Define_Current (bool is_generic)
{
- MemberName name;
TypeExpr type;
- name = new MemberName ("System");
+ MemberName name = new MemberName (QualifiedAliasMember.GlobalAlias, "System", null, Location);
name = new MemberName (name, "Collections", Location);
if (is_generic) {
return;
}
- if ((mod & Parameter.Modifier.ARGLIST) != 0) {
+ if (p is ArglistParameter) {
Report.Error (1636, method.Location,
"__arglist is not allowed in parameter list of iterators");
return;
Type gt = TypeManager.DropGenericTypeArguments (ret);
if (gt == TypeManager.generic_ienumerable_type) {
- original_iterator_type = args [0];
+ original_iterator_type = TypeManager.TypeToCoreType (args [0]);
is_enumerable = true;
return true;
}
if (gt == TypeManager.generic_ienumerator_type) {
- original_iterator_type = args [0];
+ original_iterator_type = TypeManager.TypeToCoreType (args [0]);
is_enumerable = false;
return true;
}