+ if (resolved == null) {
+ //
+ // Field initializers are tricky for partial classes. They have to
+ // share same costructor (block) but they have they own resolve scope.
+ //
+
+ // TODO: Use ResolveContext only
+ EmitContext f_ec = new EmitContext (rc, rc.DeclContainer, loc, null, TypeManager.void_type, 0, true);
+ f_ec.IsStatic = ec.IsStatic;
+ f_ec.CurrentBlock = ec.CurrentBlock;
+
+ EmitContext.Flags flags = EmitContext.Flags.InFieldInitializer;
+ if (ec.IsInUnsafeScope)
+ flags |= EmitContext.Flags.InUnsafe;
+
+ f_ec.Set (flags);
+
+ resolved = base.DoResolve (f_ec) as ExpressionStatement;
+ }