Negative header ids should be valid
[mono.git] / mcs / mcs / field.cs
index a311e0af0a08589651ff7e166bf4e9e8fdfec925..46ca117aa42d80d473808aa27124d603a9f60090 100644 (file)
@@ -636,13 +636,12 @@ namespace Mono.CSharp
                        }
 
                        if (initializer != null) {
-                               Parent.RegisterFieldForInitialization (this,
-                                       new FieldInitializer (spec, initializer, this));
+                               Parent.RegisterFieldForInitialization (this, new FieldInitializer (this, initializer, TypeExpression.Location));
                        }
 
                        if (declarators != null) {
-                               var t = new TypeExpression (MemberType, TypeExpression.Location);
                                foreach (var d in declarators) {
+                                       var t = new TypeExpression (MemberType, d.Name.Location);
                                        var f = new Field (Parent, t, ModFlags, new MemberName (d.Name.Value, d.Name.Location), OptAttributes);
                                        if (d.Initializer != null)
                                                f.initializer = d.Initializer;