+2004-11-18 Martin Baulig <martin@ximian.com>
+
+ * decl.cs
+ (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
+
+ * delegate.cs (Delegate.DefineType): Always create the EmitContext.
+
2004-11-18 Martin Baulig <martin@ximian.com>
* ecore.cs (TypeExpr.ResolveType): Removed.
}
if (current_type != null) {
- CurrentType = current_type.ResolveAsTypeTerminal (ec);
- if (CurrentType == null) {
+ current_type = current_type.ResolveAsTypeTerminal (ec);
+ if (current_type == null) {
error = true;
return null;
}
+
+ CurrentType = current_type.Type;
}
//
DefineContainerMembers (delegates);
if (CurrentType != null) {
- GenericType = CurrentType.Type;
+ GenericType = CurrentType;
ec.ContainerType = GenericType;
}
return false;
if (container.CurrentType != null)
- declaring_type = container.CurrentType.Type;
+ declaring_type = container.CurrentType;
else
declaring_type = container.TypeBuilder;
/// currently defining. We need to lookup members on this
/// instead of the TypeBuilder.
/// </summary>
- public TypeExpr CurrentType;
+ public Type CurrentType;
//
// This is the namespace in which this typecontainer
throw new InvalidOperationException ();
if (CurrentType != null)
- return CurrentType;
-
- return new TypeExpression (TypeBuilder, Location);
+ return new TypeExpression (CurrentType, Location);
+ else
+ return new TypeExpression (TypeBuilder, Location);
}
public override string[] ValidAttributeTargets {
if (TypeBuilder != null)
return TypeBuilder;
+ ec = new EmitContext (this, this, Location, null, null, ModFlags, false);
+
if (IsGeneric) {
foreach (TypeParameter type_param in TypeParameters)
if (!type_param.Resolve (this))
TypeManager.AddDelegateType (Name, TypeBuilder, this);
if (IsGeneric) {
- CurrentType = new ConstructedType (
- Name, TypeParameters, Location);
-
- EmitContext ec = new EmitContext (
- this, this, Location, null, null, ModFlags, false);
-
string[] param_names = new string [TypeParameters.Length];
for (int i = 0; i < TypeParameters.Length; i++)
param_names [i] = TypeParameters [i].Name;
if (!type_param.DefineType (ec))
return null;
}
+
+ TypeExpr current = new ConstructedType (Name, TypeParameters, Location);
+ current = current.ResolveAsTypeTerminal (ec);
+ if (current == null)
+ return null;
+
+ CurrentType = current.Type;
}
return TypeBuilder;
Type ctype;
if (!is_field_initializer &&
(ec.TypeContainer.CurrentType != null))
- ctype = ec.TypeContainer.CurrentType.Type;
+ ctype = ec.TypeContainer.CurrentType;
else
ctype = ec.ContainerType;
eclass = ExprClass.Variable;
if (ec.TypeContainer.CurrentType != null)
- type = ec.TypeContainer.CurrentType.Type;
+ type = ec.TypeContainer.CurrentType;
else
type = ec.ContainerType;
}
if (container.CurrentType != null)
- this_type = container.CurrentType.Type;
+ this_type = container.CurrentType;
else
this_type = container.TypeBuilder;
protected override bool DefineNestedTypes ()
{
if (CurrentType != null)
- current_type = CurrentType;
+ current_type = new TypeExpression (CurrentType, Location);
else
current_type = new TypeExpression (TypeBuilder, Location);