d18ed5af6acc020f8804b7198d289fe7ea9f29b9
[mono.git] / mcs / gmcs / ChangeLog
1 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2
3         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4         InstanceExpression.
5         (PropertyExpr.EmitCall): Likewise.
6         * expression.cs (Invocation.EmitArguments): Handle case where
7         arguments == null.
8         (Invocation.EmitCall): Avoid allocating temporary variable if
9         there are no arguments.
10
11 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
12
13         Fix #76370.
14         * convert.cs (ExplicitConversionCore): Fixed object->enum
15         conversion.
16
17 2005-10-07  Raja R Harinath  <rharinath@novell.com>
18
19         Fix #76323.
20         * convert.cs (ImplicitConversionStandard): Move conversion of
21         void* to arbitrary pointer types ...
22         (ExplicitConversionStandard): .. here.
23         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
24         error to always print typenames.
25
26 2005-10-07  Raja R Harinath  <rharinath@novell.com>
27
28         * convert.cs (GetConversionOperator): Rename from
29         GetConversionOperators.  Move operator selection code from ...
30         (UserDefinedConversion): ... here.
31
32 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
33
34         * convert.cs (ExplicitConversionCore): Removed duplicate enum
35         conversion.
36
37 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
38
39         * assign.cs (Assign.DoResolve): Error method changed.
40
41         * cfold.cs (DoConstantNumericPromotions): Error method changed.
42         
43         * const.cs (ResolveValue): Reset in_transit immediately.
44         
45         * constant.cs: Error method changed.
46         
47         * convert.cs: Removed useless location parameter.
48         (ExplicitNumericConversion): Don't do double enum check.
49         (ExplicitConversionCore): Renamed from ExplicitConversion.
50         (ExplicitUnsafe): Extracted from ExplicitConversion.
51         (ExplicitConversion): Uses for error reporting.
52         
53         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
54         error messages.
55         (ResolveBoolean): Uses common error method.
56         (CastToDecimal): Get rid of ec.
57         (CastFromDecimal): Optimized.
58         (ConvCast): Get rid of ec.
59         
60         * enum.cs (ResolveValue): Reset in_transit immediately.
61         (Emit): Return after first error.
62         
63         * expression.cs: Convert changes.
64         
65         * literal.cs: Error method changed.
66         
67         * statement.cs: Error method changed.
68
69 2005-10-06  Raja R Harinath  <rharinath@novell.com>
70
71         Fix gtest-131.cs and gtest-211.cs.
72         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
73         Only emit code for a label if it is used.  Unreachable code can
74         violate ECMA evaluation stack invariants.
75
76 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
77
78         * anonymous.cs: Implemented ExprClassName.
79         
80         * assign.cs (Assign.DoResolve): Don't chrash when type is not
81         delegate.
82         
83         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
84         check.
85         
86         * class.cs (StaticClass.DefineContainerMembers): Report protected
87         members as error.
88         
89         * codegen.cs: if(ed) PRODUCTION.
90         
91         * convert.cs (Error_CannotImplicitConversion): Better error
92         distinction.
93         
94         * cs-parser.jay: More error checks.
95         
96         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
97         
98         * driver.cs (CSCParseOption): Enabled wrong option check.
99         
100         * ecore.cs (Expression.ExprClassName): Turned to property.
101         (MemberExpr.CheckIntermediateModification): For checking boxed
102         value types     modification.
103         
104         * statement.cs (Fixed.Resolve): Expression type must be
105         convertible to fixed type.
106         (CollectionForeach.GetEnumeratorFilter,TryType):
107         Small refactoring for easier error checking.
108
109 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
110
111         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
112         attributes.
113         
114         * class.cs (GeneratedBaseInitializer): New class for customization
115         compiler generated initializers.
116         (MemberBase.DoDefine): Check Obsolete attribute here.
117         (FieldMember.DoDefine): Ditto.
118         
119         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
120         constants.
121         
122         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
123         (MemberCore.GetObsoleteAttribute): Removed argument.
124         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
125         (MemberCore.CheckObsoleteType): New helper.
126         
127         * delegate.cs,
128         * enum.cs,
129         * statement.cs: Updates after MemberCore changes.
130         
131         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
132         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
133         
134         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
135         obsolete attribute for compiler construct.
136         (As.DoResolve): Cache result.
137         
138         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
139
140 2005-10-01  Miguel de Icaza  <miguel@novell.com>
141
142         * expression.cs (Probe): instead of having a "Type probe_type"
143         keep the extra information as a TypeExpr probe_type_expr since the
144         "As" operator needs to perform some type checks.
145
146         * (As.DoResolve): If the type is a type parameter, ensure that it
147         is constrained by a class.
148
149 2005-09-22  Miguel de Icaza  <miguel@novell.com>
150
151         * statement.cs (Lock): Use the TemporaryVariable class instead of
152         manually using local variables as those do not work when variables
153         are captured.
154
155         * ecore.cs: Moved the TemporaryVariable class from being a nested
156         class inside Foreach to be a public class that can be employed in
157         other places. 
158
159 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
160
161         * cs-parser.jay: interface_accessors replaced by
162         accessor_declarations.
163
164         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
165         location.
166         
167         * statement.cs (GotoCase.Resolve): Convert null constant to
168         null case.
169         (SwitchLabel.ResolveAndReduce): Ditto.
170         (SwitchLabel.NullStringCase): Custom null stamp.
171         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
172         
173         typemanager.cs (CSharpSignature): Don't skip first argument
174         for full names.
175
176 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
177
178         * cfold.cs, constant.cs, convert.cs, ecore.cs,
179         expression.cs, iterators.cs, literal.cs: Store constants and
180         literals location.
181         
182         * class.cs (MemberBase.ShortName): Pass location.
183         
184         * cs-parser.jay: Some location fixes.
185         
186         * ecore.cs (Expression.Location): Made virtual.
187
188 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
189
190         Fix #72930.
191         * const.cs (Const.ResolveValue): Check for assigning non-null
192         value to reference type.
193
194 2005-09-26  Raja R Harinath  <rharinath@novell.com>
195
196         Fix #76133.
197         * expression.cs (This.VerifyFixed): In a value type T, the type of
198         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
199         value type R, 'this' is treated as a value parameter.
200
201 2005-09-05  Miguel de Icaza  <miguel@novell.com>
202
203         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
204         if the underlying types are the same, otherwise we need to produce
205         code that will do the proper cast.
206
207         This was exposed by Marek's constant rewrite which produced
208         invalid code for the call site:
209
210         enum X : long { a }
211         void Method (X v) {}
212
213         Method ((X) 5)
214
215         This fixes test-49.cs
216
217 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
218
219         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
220           Type/Object should be allowed as well. Fixed bug #75968.
221
222 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
223
224         * expression.cs : (Binary.DoResolve): when one is enum constant and
225           another is constant 0, then return enum one *as enum type*.
226           Fixed bug 74846.
227
228 2005-10-04  Martin Baulig  <martin@ximian.com>
229
230         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
231         `SetMemberIsUsed()' work for generics, too.
232
233 2005-10-04  Martin Baulig  <martin@ximian.com>
234
235         * expression.cs (DelegateInvocation.EmitStatement): Make this work
236         for corlib.  Fixes #75691.
237
238 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
239
240         Fix #76255.
241         * driver.cs: Fix compilation files with full root path.
242
243 2005-09-25  Miguel de Icaza  <miguel@novell.com>
244
245         * report.cs (SymbolRelatedToPreviousError): Format the output so
246         it does not use an open parenthesis that is never closed. 
247
248         * driver.cs: Follow coding guidelines
249
250 2005-09-18  Miguel de Icaza  <miguel@novell.com>
251
252         * driver.cs: Set InEmacs based on the environment variable EMACS. 
253
254         * location.cs (InEmacs): in this mode, do not report column
255         location as it confuses Emacs.
256
257 2005-10-03  Raja R Harinath  <rharinath@novell.com>
258
259         * support.cs (SeekableStreamReader.Position): Don't error out when
260         the requested position is just beyond the end of the current
261         buffered data.
262
263 2005-09-28  Raja R Harinath  <rharinath@novell.com>
264
265         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
266         try to keep in sync with the byte count of the underlying Stream.
267         However, this limits us to a window size of 2048 characters: i.e.,
268         the maximum lookahead of our lexer/parser can be 2048 characters.
269
270 2005-09-22  Martin Baulig  <martin@ximian.com>
271
272         * driver.cs: Removed a debugging FIXME.
273
274 2005-09-21  Raja R Harinath  <rharinath@novell.com>
275
276         * cs-parser.jay (type_arguments): Add CS1644 check.
277         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
278
279 2005-09-15  Raja R Harinath  <rharinath@novell.com>
280
281         * Makefile (PROGRAM): Make profile specific.
282         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
283         the current directory.
284
285         Fix test-455.cs.
286         * expression.cs (Invocation.EmitCall): Remove optimization on
287         this_call since it doesn't handle 'this' being a value type.
288
289 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
290
291         * driver.cs: Ensure file handles are closed after parsing
292
293 2005-09-05  Miguel de Icaza  <miguel@novell.com>
294
295         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
296         if the underlying types are the same, otherwise we need to produce
297         code that will do the proper cast.
298
299         This was exposed by Marek's constant rewrite which produced
300         invalid code for the call site:
301
302         enum X : long { a }
303         void Method (X v) {}
304
305         Method ((X) 5)
306
307         This fixes test-49.cs
308
309 2005-09-05  Martin Baulig  <martin@ximian.com>
310
311         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
312         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
313
314         * cs-parser.jay (delegate_declaration): Small fix for #75852.
315
316 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
317
318         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
319           to be a pointer type due to the spec 25.2, so check if declaring
320           type is generic type definition. Fixed bug #75772.
321
322 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
323
324         Fixed bug #75957.
325         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
326           both types are not defined by methods.
327         * expression.cs : (Invocation.IsApplicable): it should work when
328           the argument type is equal to the parameter type, not only when
329           ImplicitConversionExists() returns true.
330
331 2005-09-02  Raja R Harinath  <rharinath@novell.com>
332
333         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
334         internal.
335
336         Fix #75941.
337         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
338         flow-branching for LocalVariableReferences in case we were invoked
339         from a MemberAccess.
340         * expression.cs (LocalVariableReference.VerifyAssigned): New.
341         Carved out of ...
342         (LocalVariableReference.DoResolveBase): ... this.
343         (MemberAccess.Resolve): Do the check that was disabled during
344         SimpleNameResolve.
345
346 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
347
348         * class.cs :
349           (PartialContainer.Create): check abstract/sealed/static strictly
350           but abstract/sealed can exist only at one side. Fixed bug #75883.
351
352 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
353
354         Fix #75945.
355         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
356         specified, don't default to UnmanagedType.I4.
357
358 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
359
360         * expression.cs : conditional operator should check possibly
361           incorrect assign expression. Fixed bug #75946.
362
363 2005-08-30  Raja R Harinath  <rharinath@novell.com>
364
365         Fix #75934.
366         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
367         (ScopeInfo.EmitScopeType): Use it to construct field names from
368         names of captured locals.
369
370         Fix #75929.
371         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
372         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
373         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
374         (ExplicitConversion): Remove enum cases already handled by
375         implicit conversion.  Move implicit conversion check to the beginning.
376         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
377         * expression.cs (ArrayCreation.EmitDynamicInitializers):
378         Don't treat System.Enum as a struct.
379
380 2005-08-30  Jb Evain  <jbevain@gmail.com>
381
382         * attribute.cs: handles as expression in parameters.
383
384 2005-08-30  Raja R Harinath  <rharinath@novell.com>
385
386         Fix #75802.
387         * class.cs (TypeContainer.VerifyClsName): Don't use a
388         PartialContainer when verifying CLS compliance.
389         (AbstractPropertyEventMethod): Set Parent here, ...
390         (PropertyMethod): ... not here.
391
392 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
393
394         * attribute.cs : escaped attribute name should not be allowed to be
395           resolved (e.g. @class as classAttribute). Fixed bug #75930.
396
397 2005-08-29  Raja R Harinath  <rharinath@novell.com>
398
399         Fix #75927.
400         * convert.cs (ImplicitStandardConversionExists): Allow zero also
401         when converting a long constant to unsigned long.
402         * expression.cs (Invocation.OverloadResolve): Add sanity check to
403         detect where IsApplicable and VerifyArgumentsCompat disagree.
404
405 2005-08-29  Raja R Harinath  <rharinath@novell.com>
406         and Carlos Alberto Cortez  <carlos@unixmexico.org>
407
408         Fix #75848.
409         * class.cs (TypeContainer.CanElideInitializer): New helper.
410         (TypeContainer.EmitFieldInitializers): Use it to determine if we
411         can safely emitting the initializer of a field.
412
413 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
414
415         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
416           allowed inside a switch (without loop). Fixed bug #75433.
417
418 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
419
420         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
421         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
422
423 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
424
425         * driver.cs : kinda reverting the default encoding changes (not exact 
426           revert since I noticed that "codepage:reset" might not work fine).
427
428 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
429
430         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
431           Location. Now getter and setter store location correctly.
432           (errors/cs0111-12.cs now reports the expected location.)
433
434 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
435
436         * driver.cs : Use default encoding on the environment.
437           Removed (now that) extra parameter for SeekableStreamReader.
438         * support.cs : (SeekableStreamReader) third .ctor() argument for
439           StreamReader is not required (always true). preamble size could
440           be acquired in simpler and safe way.
441
442 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
443
444         * cs-parser.jay: report CS0642 at warning level 3
445           and report CS0642 for an if else statement also
446           fixes bug #74745. Patch by John Luke (and a bit
447           modified by me).
448           Removed extra CS0642 warning check for "while",
449           "for" and "fixed".
450         * statement.cs: In Block.Resolve(), CS0642 check
451           is reimplemented to check a sequence of an empty
452           statement and a block.
453
454           Both fix bug #66777.
455
456 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
457
458         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
459         detection until I fix it.
460         
461         * cs-tokenizer.cs: Changed error message.
462         
463         * cs-parser.jay: Fixed 2 error locations.
464         
465         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
466         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
467         properties.
468         
469         * enum.cs (GetSignatureForError): Fixed.
470         
471         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
472         method detection.
473         
474         * class.cs,
475         * typemanager.cs (RegisterProperty): Removed.
476         
477         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
478
479 2005-08-24  Raja R Harinath  <rharinath@novell.com>
480
481         Fix #75874.
482         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
483         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
484
485 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
486
487         * expression.cs : tiny fix is required for not warning positive ulong.
488           See test-441.cs.
489
490 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
491
492         * expression.cs : add CS0652 check for constant and integral
493           expression. Fixed bug #53974.
494
495 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
496
497         * expression.cs : in DoNumericPromotions(), check if there is implicit
498           conversion overload for string (to check CS0034). Fixed bug #52492.
499
500 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
501
502         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
503
504 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
505
506         * ecore.cs : report location when it is *not* Null.
507
508 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
509
510         * codegen.cs,
511           ecore.cs,
512           flowanalysis.cs,
513           expression.cs:
514           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
515           correctly. Fixed bug #75721.
516
517 2005-08-23  Raja R Harinath  <rharinath@novell.com>
518
519         * support.cs (SeekableStreamReader.Position): Avoid an expensive
520         loop that performs 'min (pos, char_count)'.
521
522         Fix #75862.
523         * expression.cs (Unary.ResolveOperator): Don't discard implicit
524         converted value in Operator.OnesComplement.
525
526 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
527
528         * anonymous.cs: If the anon method is pulled into a helper class,
529         it needs to be `internal' not `private'. Fixes runtime behavior on
530         msft. bug #75704
531
532 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
533
534         Fix #75803
535         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
536         is a partial class.
537
538 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
539
540         The big constants rewrite
541         Fix #75746, #75685 and more
542         As a side effect saved 1MB for MWF ;-)
543         
544         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
545         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
546         enum based for corlib compilation.
547         
548         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
549         subtractions.
550         
551         * class.cs (FixedField.Define): Use ResolveAsConstant.
552         
553         * const.cs (IConstant): Interface constants and enums.
554         (Const.ResolveValue): New method for constant resolvning.
555         (ExternalConstant): Constants from imported assemblies.
556         
557         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
558         conversion; like enums.
559         (Constant.ToType): Converts this constant to different type.
560         (Constant.Increment): Adds 1.
561         
562         * convert.cs (ImplicitConversionRequired): Simplified.
563         
564         * cs-parser.jay: Create EnumMember directly.
565         
566         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
567         
568         * doc.cs (GenerateEnumDocComment): Removed.
569         
570         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
571         (ConvertIntLiteral): Removed.
572         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
573         
574         * enum.cs (EnumMember): Implement IConstant.
575         (Enum.IsValidEnumConstant): Removed.
576         (Enum.GetNextDefaultValue): Removed.
577         (Enum.FindMembers): Updated.
578         (Enum.GenerateDocComment): Iterate enum members.
579         
580         * expression.cs (Cast.TryReduce): Handle enums correctly.
581         (New.Constantify): Made public.
582         (MemberAccess.DoResolve): Removed contant specific if(s).
583         
584         * literal.cs (NullLiteral): Implement new abstract methods.
585         
586         * statement.cs (GotoCase.Resolve): Use new constant methods.
587         (SwitchLabel.ResolveAndReduce): Use new constant methods.
588         
589         * typemanager.cs (LookupEnum): Removed.
590         (IsEnumType): Fixed to work with corlib.
591         (RegisterConstant): Removed.
592         (LookupConstant): Removed.
593         (GetConstant): Changed to work with IConstant.
594
595 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
596
597         * location.cs : Fixed overflown (>255) column number.
598
599 2005-08-03  Raja R Harinath  <rharinath@novell.com>
600
601         First cut of the qualified-alias-member feature.
602         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
603         token.
604         * cs-parser.jay (DOUBLE_COLON): New token.
605         (namespace_or_type_name): Add rule for recognizing
606         qualified-alias-members.
607         (primary_expression): Likewise.
608         (element_access): Allow QualifiedAliasMember as a possible
609         type-bearing expression.
610         (local_variable_type, local_variable_pointer_type): Likewise.
611         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
612         aliases in the current and enclosing namespace declarations.
613         (NamespaceEntry.UsingAlias): Add CS0440 warning.
614         * decl.cs (MemberName.is_double_colon): New.
615         (MemberName.MemberName): Add new constructor for alias-member.
616         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
617         * expression.cs (QualifiedAliasMember): New expression type.
618
619 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
620
621         * location.cs : it borked when no argument was specified.
622
623 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
624
625         * location.cs : tiny ToString() format fix.
626
627 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
628
629         * statement.cs : oops, it was missing.
630
631 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
632
633         A set of fixes for precise line/column location.
634
635         * location.cs :
636           "token" field now holds a file/line "delta", a line number offset 
637           from the segment, and a column number. See also:
638           http://lists.ximian.com/pipermail/mono-devel-list/2004-
639           December/009508.html
640           Removed static IsNull. Use instance IsNull property instead.
641         * cs-tokenizer.cs :
642           For some tokens it stores Location. For Identifier it stores
643           LocatedToken which is a pair of string name and location.
644           Column numbers are adjusted only at getChar().
645         * report.cs :
646           Use Location.ToString() for reporting (it now contains column).
647         * cs-parser.jay :
648           Largely modified to use LocatedToken instead of
649           string (IDENTIFIER), and to acquire Location from some tokens.
650         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
651           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
652           codegen.cs :
653           Now MemberName holds Location. DeclSpace.ctor() receives Location
654           as a parameter. Removed extra parameters to all derived classes.
655           Replaced Location.IsNull() with instance property.
656         * assign.cs, expression.cs :
657           Added .ctor() overload that omits Location.
658         * attribute.cs :
659           Added "nameEscaped" flag that indicates the identifier was escaped
660           in the source file. This fixes bug #57047.
661
662 2005-09-02  Martin Baulig  <martin@ximian.com>
663
664         * class.cs: Make CS3005 a warning, not an error.
665
666 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
667
668         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
669         New method, looking for lo-case imported cls type.
670
671         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
672         here.
673
674         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
675
676         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
677
678         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
679         all_imported_types.
680         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
681
682         Optimized to save 3.5 MB for SWF compilation.
683
684 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
685
686         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
687         (PartialContainer.Create): Moved logic AddToContainer.
688         (PartialContainer.MarkForDuplicationCheck): Shares name.
689         
690         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
691         place.
692         
693         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
694         initialization.
695         (Namespace.GetSignatureForError): New method.
696         
697         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
698         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
699
700 2005-08-01  Raja R Harinath  <rharinath@novell.com>
701
702         Fix #75669.
703         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
704         member lookup rather than qualifier_type, since qualifier_type can
705         be null.
706
707 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
708
709         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
710         enum member.
711
712 2005-07-31  Miguel de Icaza  <miguel@novell.com>
713
714         * statement.cs: Copy the local exception into the exception
715         captured local.  Fixes 75674
716
717 2005-07-31  Raja R Harinath  <harinath@gmail.com>
718
719         Fix #75658.
720         * expression.cs (Invocation.OverloadResolve): Don't report error
721         CS1501 if error CS1502 has been reported.
722         (New.DoResolve): Delegate CS1501 reporting to
723         Invocation.OverloadResolve.
724
725         Fix #75656.
726         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
727         invariant-meaning-in-block property in an enclosing block if
728         necessary.
729
730 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
731
732         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
733         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
734         (Switch.CheckSwitch): Just save 50kb for SWF.
735
736 2005-07-27  Martin Baulig  <martin@ximian.com>
737
738         * anonymous.cs (CaptureContext.AddField): Added
739         `AnonymousContainer am' argument; compute its toplevel scope if
740         it's not already computed.  Fixes #75649.
741
742 2005-07-26  Raja R Harinath  <rharinath@novell.com>
743
744         Fix #75628.
745         * class.cs (Constructor.Emit): Reset block to null if the block
746         resolve fails.
747
748 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
749
750         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
751
752 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
753
754         * class.cs (MethodData.Define): Check whether accessor implementing
755         interface is public.
756
757         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
758
759 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
760
761         Fix #57245
762         * namespace.cs (LookupType): Moved same type check to...
763         
764         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
765         with the same name.
766
767 2005-07-21  Raja R Harinath  <rharinath@novell.com>
768
769         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
770         already found a typebuilder.
771         * class.cs (MethodCore.IsDuplicateImplementation): Compare
772         MemberNames, not strings.
773
774         * const.cs (Error_ExpressionMustBeConst): 
775         Rename from Error_EpressionMustBeConst.
776         * const.cs, class.cs, statement.cd: Update.
777
778 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
779
780         Fix #65573
781
782         * const.cs (Const.LookupConstantValue): Report missing contant expression
783         everytime.
784         (Error_EpressionMustBeConstant): Only one error method.
785
786         * class.cs, statement.c: Updated.
787
788 2005-07-20  Raja R Harinath  <rharinath@novell.com>
789
790         * statement.cs (Block.Flags): Add back HasVarargs.
791         (Block.flags): Make protected.
792         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
793
794         * typemanager.cs (types, typecontainers, user_types): Remove.
795         (UserTypes, TypeContainers): Likewise.
796         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
797         (CleanUp, Reset): Update.
798         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
799         (GetNestedType): Use Type.GetNestedType.
800         (CoreLookupType): Take two arguments, the namespace and the
801         basename of the type.  Update to use the Namespace.Lookup
802         mechanism.
803         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
804         (RealMemberLookup): Use IsNestedChildOf instead of playing with
805         string concatenation and substring matches.
806         * class.cs, enum.cs, delegate.cs: Update to changes.
807
808 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
809
810         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
811         Expression and made virtual.
812
813         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
814         (ImplicitStandardConversionExists): Fixed `byte' typo ?
815
816         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
817
818         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
819         error message.
820
821         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
822         change.
823
824 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
825
826         Fix #57707
827         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
828         AssemblyCultureAttribute is not used on executable.
829
830         * rootcontext.cs,
831         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
832
833 2005-07-16  Raja R Harinath  <rharinath@novell.com>
834
835         Fix #60638.
836         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
837         New.  Reports CS0252/CS0253.
838         Mostly taken from preliminary patch by Duncak Mak.
839         (Binary.DoResolveOperator): Store results of operator lookup.
840         Use them to detect if we need to warn about unintended reference
841         comparisons.
842
843 2005-07-15  Raja R Harinath  <rharinath@novell.com>
844
845         Fix #72969.
846         * namespace.cs (Namespace.Lookup): Add back location parameter.
847         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
848         * delegate.cs, ecore.cs, expression.cs: Update to changes.
849
850         * codegen.cs (EmitContext.DeclSpace): Make readonly.
851         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
852         (Namespace.LookupType): ... this.
853         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
854         of namespaces.
855         * typemanager.cs (LookupTypeReflection): Remove buggy code that
856         purported to handle pointers.
857         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
858         CoreLookupType.
859
860 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
861
862         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
863         type as namespace.
864
865 2005-07-15  Raja R Harinath  <rharinath@novell.com>
866
867         * namespace.cs (Namespace.Lookup): Drop location parameter.
868         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
869         (NamespaceEntry.Lookup): ... this.
870         (NamespaceEntry.Error_AmbiguousTypeReference):
871         Move here from DeclSpace.
872         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
873         names ...
874         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
875         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
876         Move to NamespaceEntry.
877         * delegate.cs, expression.cs: Update to changes.
878
879 2005-08-31  Martin Baulig  <martin@ximian.com>
880
881         Committing a patch from Atsushi Enomoto for #75850.
882
883         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
884         Prefer a generic enumerator over a non-generic one.
885
886 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
887
888         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
889         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
890
891 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
892
893         * driver.cs : reverting default encoding change as well as mcs.
894
895 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
896
897         * driver.cs, support.cs : merged r48826.
898           Marek Safer wrote:
899           > could you integrate your mcs changes to gmcs otherwise
900           > gmcs cannot compile some files.
901
902 2005-08-20  Martin Baulig  <martin@ximian.com>
903
904         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
905         scope if we don't already have it.
906
907         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
908         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
909         fixes #75867.
910
911 2005-07-31  Miguel de Icaza  <miguel@novell.com>
912
913         * statement.cs: Copy the local exception into the exception
914         captured local.  Fixes 75674
915
916 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
917
918         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
919         type as namespace.
920
921 2005-08-12  Martin Baulig  <martin@ximian.com>
922
923         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
924         for nested types here to avoid hitting the cache too early.
925
926 2005-08-09  Miguel de Icaza  <miguel@novell.com>
927
928         * enum.cs: On the new compiler CLS error 3005 is now a warning not
929         an error. 
930
931 2005-08-03  Martin Baulig  <martin@ximian.com>
932
933         Make iterators in generic methods work; see gtest-191.cs.
934
935         * generic.cs
936         (Constraints.Resolve): Protect against being called twice.
937
938         * class.cs
939         (TypeContainer.GetClassBases): Make this `protected virtual'.
940
941         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
942         (Iterator.GetClassBases): Override this and compute the base
943         classes here.
944         (Iterator.DefineNestedTypes): If we're a generic method, all our
945         method type parameters become class type parameters on the proxy
946         class.
947
948         * statement.cs
949         (ToplevelBlock.Parameters): Make this a property, not a field.
950         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
951
952 2005-08-03  Martin Baulig  <martin@ximian.com>
953
954         * typemanager.cs (TypeManager.IsSubclassOf): Use
955         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
956         (TypeManager.GetFullName_recursed): Improved.
957
958 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
959
960         Fix #75417
961         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
962         Private accessor case, using TypeManager.IsPrivateAccessible instead of
963         invocation_type == mi.DeclaringType, since the first one also checks
964         other condition used by generic instances.
965         
966 2005-07-27  Martin Baulig  <martin@ximian.com>
967
968         * anonymous.cs (CaptureContext.AddField): Added
969         `AnonymousContainer am' argument; compute its toplevel scope if
970         it's not already computed.  Fixes #75649.
971
972 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
973
974         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
975         CheckAttributeType and refactored.
976         (Attribute.ResolvePossibleAttributeType): Changed to reuse
977         ResolveAsTypeTerminal error handling.
978         (ResolveAsTypeTerminal): Introduced because of global attributes extra
979         handling.
980         (GetSignatureForError): Print errors in same way.
981
982         * class.cs,
983         * codegen.cs: Reflect attribute GetSignatureForError change.
984
985         * ecore.cs,
986         * expression.cs: Add silent parameter to ResolveAsTypeStep.
987
988         * namespace.cs (UsingEntry): Refactored to make fields private.
989
990         * assign.cs,
991         statement.cs: Error_UnexpectedKind has extra parameter.
992
993 2005-07-14  Raja R Harinath  <rharinath@novell.com>
994
995         * ecore.cs (IAlias): Remove.
996         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
997         that implement the interface.
998         * namespace.cs (Namespace): Likewise.
999         (Namespace.declspaces): Renamed from 'defined_names'.
1000         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1001         DeclSpace instead of an IAlias.
1002         * tree.cs (Tree.AddDecl): Update.
1003
1004 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1005
1006         * statement.cs (Block.Flags); Remove HasVarargs.
1007         (Block.HasVarargs): Move to ToplevelBlock.
1008         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1009         (Block.Variables): Make protected.  Initialize variable hashtable
1010         if necessary.
1011         (Block.AddVariable): Update.
1012         (Block.Resolve): Update to changes.
1013         (ToplevelBlock.HasVarargs): New boolean.
1014         (ToplevelBlock.ThisVariable): Move here from Block.
1015         (ToplevelBlock.AddThisVariable): Likewise.
1016         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1017         * expression.cs (This.ResolveBase): Update to changes.
1018         (ArglistAccess.DoResolve): Likewise.
1019
1020 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1021
1022         Fix #75321
1023         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1024
1025         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1026         not used and not used & assigned.
1027         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1028
1029 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1030
1031         Fix #75053
1032         * expression.cs (Is.DoResolve): null is never provided type.
1033
1034 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1035
1036         Fix #52496
1037         * cs-parser.jay: Less strict event error rule to catch more errors.
1038
1039 2005-07-11  Martin Baulig  <martin@ximian.com>
1040
1041         * generic.cs (ConstructedType.CheckConstraints): Improve the check
1042         for the constructor constraint: we do not only have to check
1043         whether the class has a public constructor, but also ensure that
1044         it's parameterless.  Fixes #75492.
1045
1046 2005-07-11  Martin Baulig  <martin@ximian.com>
1047
1048         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
1049         between type parameters if they either have the reference type
1050         constraint or the class constraint.
1051
1052 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
1053
1054         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
1055
1056 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1057
1058         Fix #74975
1059         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1060         (ExtractSecurityPermissionSet): Cope with self referencing security
1061         attributes properly.
1062
1063         * driver.cs (SetOutputFile): Made public property OutputFile.
1064
1065 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1066
1067         Fix #75486.
1068         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1069         has_nonstatic_fields.  Make into a FieldBase pointer.
1070         (TypeContainer.AddField): Add CS0282 check.
1071         (TypeContainer.EmitType): Update.
1072
1073 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1074
1075         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1076         compare if they start with __.
1077
1078 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1079
1080         * statement.cs (Switch.SwitchGoverningType): Only look at
1081         UserCasts that don't need implicit standard conversions to one of
1082         the allowed switch types (Fixes test-322.cs).
1083         (LocalInfo.Resolve): Re-enable sanity-test.
1084
1085 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1086
1087         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1088         
1089         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1090         
1091         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1092
1093 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1094
1095         Fix #75472.
1096         * ecore.cs (SimpleName.GetSignatureForError): Add.
1097         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1098         (MemberAccess.GetSignatureForError): Add.
1099
1100 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1101  
1102         The big error and warning messages review.
1103         
1104         * anonymous.cs,
1105         * assign.cs,
1106         * attribute.cs,
1107         * class.cs,
1108         * codegen.cs,
1109         * convert.cs,
1110         * cs-parser.jay,
1111         * cs-tokenizer.cs,
1112         * decl.cs,
1113         * delegate.cs,
1114         * doc.cs,
1115         * driver.cs,
1116         * ecore.cs,
1117         * enum.cs,
1118         * expression.cs,
1119         * flowanalysis.cs,
1120         * iterators.cs,
1121         * literal.cs,
1122         * location.cs,
1123         * modifiers.cs,
1124         * namespace.cs,
1125         * parameter.cs,
1126         * pending.cs,
1127         * report.cs,
1128         * rootcontext.cs,
1129         * statement.cs,
1130         * support.cs,
1131         * tree.cs,
1132         * typemanager.cs: Updated.
1133         
1134         * class.cs: (MethodCore.SetYields): Moved here to share.
1135         (PropertyMethod.Define): Moved iterator setup here.
1136         
1137         * iterators.cs: Add orig_method to have full access to parent
1138         container.
1139
1140 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1141
1142         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1143         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1144         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1145         variable of struct type.
1146         * expression.cs (Unary.ResolveOperator): Update to change.
1147         (Indirection.VerifyFixed): Likewise.
1148         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1149         (ParameterReference.VerifyFixed): Value parameters are fixed.
1150         (This.VerifyFixed): Treat 'this' as a value parameter.
1151         * statement.cs (LocalInfo.IsFixed): Remove.
1152
1153 2005-07-01  Martin Baulig  <martin@ximian.com>
1154
1155         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1156         `ec.EmitThis ()' to get the correct scope.
1157
1158 2005-07-01  Martin Baulig  <martin@ximian.com>
1159
1160         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1161         instance is a ParameterReference; fixes #75299.
1162
1163 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1164
1165         Fix #75412.
1166         * expression.cs (Indexers.map): Remove.
1167         (Indexers.Append): Filter out inaccessible setters and getters.
1168         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1169
1170         Fix #75283.
1171         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1172         Refactored from ...
1173         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1174         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1175         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1176         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1177
1178 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1179
1180         Fix #75322
1181         * class.cs (FieldBase.GetInitializerExpression): One more field
1182         for backup.
1183
1184 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1185
1186         * pending.cs: Do not define a proxy if the base method is virtual,
1187         it will be picked up by the runtime (bug 75270).
1188
1189 2005-07-08  Martin Baulig  <martin@ximian.com>
1190
1191         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1192         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1193
1194 2005-07-07  Martin Baulig  <martin@ximian.com>
1195
1196         * generic.cs (ConstructedType.CheckConstraint): Use
1197         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
1198         called recursively; fixes #75329.
1199
1200 2005-07-06  Martin Baulig  <martin@ximian.com>
1201
1202         * generic.cs (TypeManager.InferTypeArguments): Added support for
1203         anonymous methods; fixes #75461.
1204
1205 2005-07-01  Martin Baulig  <martin@ximian.com>
1206
1207         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1208         `ec.EmitThis ()' to get the correct scope.
1209
1210 2005-07-01  Martin Baulig  <martin@ximian.com>
1211
1212         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
1213         instance is `This'; fixes #75299.
1214
1215 2005-06-30  Martin Baulig  <martin@ximian.com>
1216
1217         * class.cs (Indexer): Implement IIteratorContainer; added support
1218         for iterators in indexers.
1219
1220         * codegen.cs
1221         (EmitContext.CurrentIterator): Make this a property, not a field.
1222
1223         * anonymous.cs (AnonymousContainer.Iterator): New public property.
1224
1225 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1226
1227         * pending.cs: Do not define a proxy if the base method is virtual,
1228         it will be picked up by the runtime (bug 75270).
1229
1230 2005-06-28  Martin Baulig  <martin@ximian.com>
1231
1232         * cs-parser.jay (interface_method_declaration): Avoid a
1233         reduce/reduce conflict by moving some of the code into a separate
1234         `interface_method_declaration_body' rule; fixes #75368.
1235
1236 2005-06-28  Martin Baulig  <martin@ximian.com>
1237
1238         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
1239         array check after the check for TypeBuilder's.
1240
1241 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1242
1243         * convert.cs (FindMostEncompassedType): Add two trivial special
1244         cases (number_of_types == 0 || number_of_types == 1).
1245         (FindMostEncompasingType): Likewise.
1246
1247 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1248
1249         Some cleanups preparing for the fix of #75283.
1250         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1251         error testing.
1252         (EventExpr.InstanceResolve): Likewise.
1253         (EventExpr.DoResolve): Remove redundant checks.
1254
1255 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1256
1257         * class.cs: Small fix.
1258
1259 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1260
1261         Fix #75160.
1262         * class.cs (GetPartialBases): Fix return value check of
1263         part.GetClassBases.
1264
1265 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1266
1267         Ensure that partial classes are registered in their enclosing
1268         namespace.  Initial part of fix of #75160.
1269         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1270         Register declspace with namespace here, not in
1271         DeclSpace.RecordDecl.
1272         * cs-parser.jay: Pass namespace to RecordDecl.
1273         * class.cs (PartialContainer.Create): Likewise.
1274         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1275         called.
1276         * decl.cs (Declspace.RecordDecl): Remove.
1277         * namespace.cs (NamespaceEntry.DefineName): Remove.
1278
1279 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1280
1281         * rootcontext.cs: Reset TargetExt as well.
1282
1283 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1284
1285         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1286         -langversion:ISO-1.
1287
1288 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1289
1290         Fix #75080, cs0119.cs.
1291         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1292         of ...
1293         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1294         allowing ExprClass.Type and ExprClass.Namespace for
1295         ResolveFlags.VariableOrValue.
1296         (Expression.Resolve) [1-argument variant]: Change default resolve
1297         flags based on language version.
1298         (Expression.Error_UnexpectedKind): Use a simple string array
1299         rather than an ArrayList.
1300         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1301         not ExprClass.Type.
1302         (TypeOfVoid.DoResolve): Likewise.
1303         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1304         flags argument -- it always has the same value.
1305
1306 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1307
1308         Fix #75081.
1309         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1310         Use it in the error message.
1311         * assign.cs, expression.cs, statement.cs: Update.
1312
1313 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1314
1315         Fix #75088.
1316         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1317         the "almostMatchedMember" case too.
1318         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1319         that failed the accessibility checks to 'almost_match'.
1320
1321 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1322
1323         * attribute.cs: Use internal MethodBuilder methods to set
1324         ExactSpelling and SetLastError on PInvoke methods, instead
1325         of passing them via charset.  Fixes #75060.
1326
1327 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1328
1329         * parameter.cs (Parameter): Remove TODO comment.
1330         (Parameter.DefineParameter): Remove Location parameter.
1331         (Parameters.LabelParameters): Likewise.
1332         * class.cs (Constructor.Emit): Update to change.
1333         (MethodData.Emit): Likewise.
1334         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1335         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1336
1337 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1338
1339         * parameter.cs,
1340           Removed Parameters.Location and added Parameter.Location instead.
1341           Removed Location parameter from Emit() and GetSignature().
1342         * anonymous.cs,
1343           class.cs,
1344           cs-parser.jay,
1345           delegate.cs,
1346           iterators.cs,
1347           statement.cs :
1348           Modified all related calls.
1349
1350 2005-06-21  Martin Baulig  <martin@ximian.com>
1351
1352         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
1353         left-hand side is not a nullable type; fixes #75328.
1354
1355 2005-06-21  Martin Baulig  <martin@ximian.com>
1356
1357         * typemanager.cs
1358         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
1359         (TypeManager.GetFullNameSignature): Likewise.
1360
1361         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
1362         `source.FullName' and `target.FullName' to check whether there are
1363         two conflicting definitions.
1364
1365 2005-06-21  Martin Baulig  <martin@ximian.com>
1366
1367         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
1368         a BoxedCast - also for reference types - to be compatible with csc.
1369
1370 2005-06-21  Martin Baulig  <martin@ximian.com>
1371
1372         * expression.cs (MemberAccess.DoResolve): Add support for nested
1373         types in a generic instance; fixes #75320.
1374
1375 2005-06-20  Martin Baulig  <martin@ximian.com>
1376
1377         * generic.cs (TypeManager.InferType): Also walk the class
1378         hierarchy for generic instances; fixes #75261.
1379
1380 2005-06-17  Martin Baulig  <martin@ximian.com>
1381
1382         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
1383         to make things work for corlib.
1384
1385 2005-06-15  Martin Baulig  <martin@ximian.com>
1386
1387         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
1388         obsolete `SecurityAction' values.
1389
1390 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1391
1392         * rootcontext.cs: Reset TargetExt as well.
1393         
1394 2005-06-09  Martin Baulig  <martin@ximian.com>
1395
1396         * delegate.cs (Delegate.VerifyMethod): Added
1397         `MethodGroupExpr old_mg' argument; inherit its
1398         `HasTypeParameters'; fix #75085.
1399
1400 2005-06-09  Martin Baulig  <martin@ximian.com>
1401
1402         * expression.cs (Invocation.OverloadResolve): Correctly handle
1403         generic methods for the SetMemberIsUsed(); fix #75064.
1404
1405 2005-06-09  Martin Baulig  <martin@ximian.com>
1406
1407         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
1408         fixes #75062.
1409
1410 2005-06-08  Martin Baulig  <martin@ximian.com>
1411
1412         * cs-parser.jay (nullable_type_or_conditional): If we put the
1413         nullable back and our `type' is a `ComposedCast', remove the
1414         nullable from it.  Fixes #75156.
1415
1416         * expression.cs (ComposedCast.RemoveNullable): New public method.
1417
1418 2005-06-08  Martin Baulig  <martin@ximian.com>
1419
1420         The big Iterators rewrite :-)
1421
1422         * iterators.cs: Rewrite this to use the anonymous methods framework.
1423
1424         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1425         before the TypeContainers; see 2test-21.cs.
1426
1427         * class.cs
1428         (TypeContainer.DefineType): Don't create a new EmitContext if we
1429         already have one (this only happens if we're an Iterator).
1430         (TypeContainer.Define): Also call Define() on all our iterators.
1431         (Method.CreateEmitContext): Added support for iterators.
1432
1433         * anonymous.cs
1434         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1435         (AnonymousContainer.CreateMethodHost): Moved here from
1436         AnonymousMethod and made abstract.
1437         (AnonymousContainer.CreateScopeType): New abstract method.
1438         (AnonymousContainer.IsIterator): New public property.
1439         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1440         get the ScopeTypeBuilder rather than manually defining it here. 
1441         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1442         iterators here.
1443
1444         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1445         before RootContext.DefineTypes().
1446
1447         * codegen.cs (EmitContext.RemapToProxy): Removed.
1448         (EmitContext.CurrentAnonymousMethod): Changed type from
1449         AnonymousMethod -> AnonymousContainer.
1450         (EmitContext.ResolveTopBlock): Protect from being called twice.
1451         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1452         (EmitContext.EmitThis): Removed the iterators hacks; use the
1453         anonymous methods framework for that.
1454
1455         * statement.cs
1456         (ToplevelBlock.Container): Make this a property, not a field.
1457         (ToplevelBlock.ReParent): New public method; move the
1458         ToplevelBlock into a new container.
1459         (Foreach.TemporaryVariable): Simplify.
1460
1461 2005-06-05  Martin Baulig  <martin@ximian.com>
1462
1463         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1464         (Block.AddTemporaryVariable): New public method; creates a new
1465         `LocalInfo' for a temporary variable.
1466         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1467         variables here.
1468         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1469         non-iterator variables.
1470
1471 2005-06-05  Martin Baulig  <martin@ximian.com>
1472
1473         * statement.cs (Foreach.TemporaryVariable): Create the
1474         LocalBuilder in the Emit phase and not in Resolve since in some
1475         situations, we don't have an ILGenerator during Resolve; see
1476         2test-19.cs for an example.
1477
1478 2005-06-04  Martin Baulig  <martin@ximian.com>
1479
1480         The big Foreach rewrite - Part II.
1481
1482         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1483         with `PropertyInfo ienumerator_getcurrent'.
1484
1485         * codegen.cs (VariableStorage): Removed.
1486
1487         * statement.cs
1488         (Foreach): Derive from Statement, not ExceptionStatement.
1489         (Foreach.CollectionForeach): New nested class.  Moved all the code
1490         dealing with collection foreach here.
1491         (Foreach.ForeachHelperMethods): Removed.
1492         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1493
1494 2005-05-23  Martin Baulig  <martin@ximian.com>
1495
1496         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1497         don't need to.  Fix #75014.
1498
1499 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1500
1501         Improve user-defined conversion handling.
1502         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1503         applicable operators.
1504         (AddConversionOperators): New.  Helper for GetConversionOperators.
1505         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1506         there is only one most encompassed/encompassing type.
1507         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1508         "applicable operator" handling.
1509         (UserConversion): Move cache here from GetConversionOperators.
1510         Directly cache the chosen operator, rather than the whole
1511         MethodGroup.
1512         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1513         case.  Allow conversion of decimal to sbyte and byte too.
1514         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1515         New static methods.  Used to avoid allocating EmptyExpressions in
1516         convert.cs.
1517
1518 2005-05-24  Duncan Mak  <duncan@novell.com>
1519
1520         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1521         another class, used in Convert.ExplicitNumericConversion.
1522         (CastToDecimal): New class, similar to above, but casts to
1523         System.Decimal, used in Convert.ImplicitNumericConversion and also
1524         in explicit convesion from double/float to decimal.
1525
1526         * convert.cs (ImplicitNumericConversion): Handle implicit
1527         conversions to System.Decimal.
1528         (ExplicitNumericConversion): handle explicit conversions to
1529         System.Decimal.
1530
1531         This fixes #68711.
1532         
1533 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1534
1535         * typemanager.cs: Do not throw an exception in the TypeBuilder
1536         case, we take care of it on the TypeCode.
1537
1538 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1539         
1540         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1541         is back.
1542         
1543         * cs-parser.jay: Catch more lexical errors.
1544         
1545         * report.cs: Add one more Error method.
1546         
1547         * rootcontext.cs,
1548         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1549
1550 2005-05-20  Martin Baulig  <martin@ximian.com>
1551
1552         * class.cs (TypeContainer.CircularDepException): Removed.
1553         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1554         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1555         (CS0146) and interface (CS0529) dependencies here.
1556
1557 2005-05-20  Martin Baulig  <martin@ximian.com>
1558
1559         * expression.cs (New.DoResolve): Move the CS0712 check above the
1560         CS0144 check; otherwise it can never be reached.
1561
1562 2005-05-20  Martin Baulig  <martin@ximian.com>
1563
1564         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
1565
1566 2005-05-20  Martin Baulig  <martin@ximian.com>
1567
1568         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
1569
1570         * typemanager.cs (TypeManager.IsAttributeType): New public method.
1571
1572 2005-05-19  Martin Baulig  <martin@ximian.com>
1573
1574         * delegate.cs
1575         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1576         to disable error reporting.
1577
1578         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1579         here since we don't want to report an error; see the new test-336.cs.
1580
1581 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1582
1583         * statement.cs (ToplevelBlock.GetParameterReference)
1584         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1585         Move here from class Block.
1586         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1587         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1588
1589 2005-05-18  Martin Baulig  <martin@ximian.com>
1590
1591         Fix #74978.
1592
1593         * flowanalysis.cs
1594         (FlowBranching.Reachability): Add non-static public And() and Or()
1595         methods.
1596         (FlowBranchingSwitch): New class; do the `break_origins' thing
1597         like in FlowBranchingLoop.
1598         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1599         reachability, not just locals and parameters.
1600         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1601         switch; MergeBreakOrigins() now takes care of that.
1602
1603 2005-05-18  Martin Baulig  <martin@ximian.com>
1604
1605         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1606         a loop and may leave it, reset the barrier; fixes #74974.
1607
1608 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1609
1610         Fix test-382.cs.  Emit values of decimal constants.
1611         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1612         Carved out of ...
1613         (TypeContainer.AddField): ... this.
1614         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1615         with initializers to include 'Const's.
1616         (ClassPart.RegisterFieldForInitialization): Forward to
1617         PartialContainer.
1618         * const.cs (Const.Const): Pass initializer to base class.
1619         (Const.Define): In case of decimal constants, register them for
1620         initialization in a static constructor.
1621
1622 2005-05-14  Martin Baulig  <martin@ximian.com>
1623
1624         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1625         do not call ResolveUnreachable() on unreachable statements in
1626         here, see the comment in the source code.
1627
1628 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1629
1630         Fix #74934.
1631         * expression.cs (BinaryResolveOperator): If one of the operands of
1632         an equality comparison is 'null' and the other is a pointer type,
1633         convert the null to a NullPointer.
1634         * convert.cs (ImplicitReferenceConversion): If the expression is a
1635         NullLiteral and the target type is a pointer type, return a
1636         NullPointer instead.
1637         (ImplicitConversionStandard): Likewise.
1638
1639 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1640         
1641         * cs-parser.jay: Set readonly context based on special constructs.
1642         
1643         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1644         readonly variable error handling.
1645         
1646         * rootcontext.cs (EmitCode): Don't verify members when error
1647         occurred.
1648         
1649         * statement.cs (LocalInfo): Add reaodnly context information.
1650         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1651
1652 2005-05-17  Martin Baulig  <martin@ximian.com>
1653
1654         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1655         #70970. 
1656
1657 2005-05-13  Martin Baulig  <martin@ximian.com>
1658
1659         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
1660         handle unreachable blocks.
1661
1662 2005-05-13  Martin Baulig  <martin@ximian.com>
1663
1664         * class.cs
1665         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
1666         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
1667         #74905. 
1668
1669 2005-05-13  Martin Baulig  <martin@ximian.com>
1670
1671         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1672         instance variable, not a local.  Fix #74873.
1673         (Block.ResolveUnreachable): Set it to true here.
1674
1675 2005-05-12  Martin Baulig  <martin@ximian.com>
1676
1677         * cs-parser.jay (property_declaration): Pass the `current_class',
1678         not the `current_container' to Property's .ctor.  Fixes #74912.
1679
1680 2005-05-11  Martin Baulig  <martin@ximian.com>
1681
1682         * typemanager.cs (Closure): Copy this from MCS and merge all the
1683         GMCS-specific changes into it.
1684
1685 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1686
1687         Fix #74920.
1688         * typemanager.cs (unmanaged_enclosing_types): New.
1689         (IsUnmanagedType): Avoid infloops by using
1690         'unmanaged_enclosing_types' to talk with recursive invocations.
1691
1692 2005-05-11  Duncan Mak  <duncan@novell.com>
1693
1694         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1695         continuing to process for 'arg'.
1696         (handle_preprocessing_directive): Check the argument of the #endif
1697         directive and report error CS1025 if there are any trailing
1698         characters.
1699
1700         According to the C# spec, having even whitespace after the #endif
1701         directive is illegal; however, because we call arg.TrimEnd ()
1702         beforehand, we have the same behavior as csc, allowing whitespace
1703         after the directive.
1704
1705         Fixes #74892.
1706
1707 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1708
1709         Fix #74863.
1710         
1711         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1712         (Constructor.GetObsoleteAttribute): Implemented correctly.
1713
1714 2005-05-10  Martin Baulig  <martin@ximian.com>
1715
1716         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
1717         resolve the type; fixes #74864.
1718         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
1719         in DoResolve(); fixes #74862.
1720
1721 2005-05-10  Martin Baulig  <martin@ximian.com>
1722
1723         * support.cs (ReflectionParameters.ParameterModifier): Use
1724         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1725         and `ParameterAttributes.In'.  Fixes #74884.
1726
1727 2005-05-10  Martin Baulig  <martin@ximian.com>
1728
1729         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
1730         the cache if we're just looking for `MemberTypes.NestedType' in a
1731         generic instance.
1732
1733         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1734         constraints if we're still resolving the type tree.
1735         (Expression.MemberLookup): If we're resolving the type tree, only
1736         look for `MemberTypes.NestedType' since we're only interested in
1737         getting types.
1738
1739         * class.cs (TypeContainer.DefineType): Don't resolve the type
1740         parameters here; do this later in ResolveType() after the type
1741         tree has been resolved.
1742         (TypeContainer.ResolveType): New public method; this is called
1743         after the type tree is resolved and before the types are being
1744         populated.  We resolve the generic constraints here.
1745         (TypeContainer.DoDefineMember): Check the constraints on our base
1746         class and interfaces.
1747
1748         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
1749         set the `ResolvingTypeTree' flag on the EmitContext.
1750
1751         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
1752
1753 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1754
1755         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1756         
1757         * expression.cs (Argument.GetParameterModifier): Turned to property.
1758         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1759         
1760         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1761         its C# equivalent.
1762         
1763 2005-05-09  Raja R Harinath  <rharinath@novell.com>
1764
1765         Fix #74852.
1766         * decl.cs (MemberCache.AddMethods): Register override methods,
1767         rather than non-override methods.
1768         * typemanager.cs (RegisterOverride): New.
1769         (IsOverride): Update.
1770
1771 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1772
1773         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
1774
1775 2005-05-06  Martin Baulig  <martin@ximian.com>
1776
1777         * attribute.cs
1778         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
1779         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
1780
1781 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
1782
1783         Fix #73105.
1784         
1785         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
1786         recursive declaration.
1787         
1788         * statement.cs (Block.ResolveMeta): Report any error in resolving.
1789         
1790 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
1791
1792         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
1793         
1794         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
1795
1796 2005-05-05  Raja R Harinath  <rharinath@novell.com>
1797
1798         Fix #74797.
1799         * decl.cs (DeclSpace.FamilyAccessible): 
1800         Use TypeManager.IsNestedFamilyAccessible.
1801
1802         Fix reopened #64812.
1803         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
1804         internal'.
1805
1806 2005-05-04  Raja R Harinath  <rharinath@novell.com>
1807             Abin Thomas  <projectmonokochi@rediffmail.com>
1808             Anoob V E  <projectmonokochi@rediffmail.com>
1809             Harilal P R  <projectmonokochi@rediffmail.com>
1810
1811         Fix #64812.
1812         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
1813         allow access to all static members.
1814
1815 2005-05-04  Martin Baulig  <martin@ximian.com>
1816
1817         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
1818
1819 2005-05-04  Martin Baulig  <martin@ximian.com>
1820
1821         Fix #74655.
1822
1823         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
1824         section at the end; make things work if `default' is not the last
1825         section.        
1826
1827 2005-05-04  Martin Baulig  <martin@ximian.com>
1828
1829         Fix #70400.
1830
1831         * statement.cs (Switch): Replaced the `got_default' field with a
1832         `default_section' one.
1833         (Switch.CheckSwitch): Set `default_section' here.
1834         (Switch.Resolve): If we're a constant switch and the constant is
1835         not found, use the default section.
1836
1837 2005-05-03  Martin Baulig  <martin@ximian.com>
1838
1839         * expression.cs (ArrayAccess.EmitGetLength): New public method.
1840
1841         * statement.cs (Foreach.ArrayForeach): New nested class.
1842         (Foreach.TemporaryVariable): New nested class.
1843         (Foreach.EmitArrayForeach): Removed; this is now in the new
1844         ArrayForeach class.
1845
1846 2005-05-03  Raja R Harinath  <rharinath@novell.com>
1847
1848         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
1849         more conservative.
1850         (VerifyPendingMethods): Revert change below.
1851
1852         * typemanager.cs (IsOverride, RegisterNonOverride): New.
1853         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
1854         that used to trigger warning -28.  Remove warning -28.
1855         * expression.cs (Invocation.OverloadResolve): Use
1856         TypeManager.IsOverride to distinguish override methods.
1857
1858         Fix #74773.
1859         * pending.cs (VerifyPendingMethods): If a base type implements the
1860         requested interface, don't bother checking individual methods of
1861         the base type.  As a side-effect, this prevents the creation of
1862         unnecessary proxies.
1863
1864 2005-05-02  Martin Baulig  <martin@ximian.com>
1865
1866         Fix #70182.
1867
1868         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
1869         Also `And' the locals if the old vector is null.
1870         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
1871         null; in this case we basically reset all the variables.        
1872
1873 2005-05-02  Martin Baulig  <martin@ximian.com>
1874
1875         Fix #74529.
1876
1877         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
1878         Added `FlowBranching branching' argument; always `and' the
1879         variables instead of `or'ing them unless we're an infinite loop.
1880
1881         * statement.cs (While.Resolve): Create a new sibling unless we're
1882         infinite.       
1883
1884 2005-05-02  Martin Baulig  <martin@ximian.com>
1885
1886         Fix #70140.
1887
1888         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
1889         arguments; use it instead of creating a new TopLevelBlock.
1890         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1891         our ConstructorInitializer.
1892
1893         * statement.cs
1894         (TopLevelBlock.TopLevelBranching): New public property.
1895         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1896         and create our `TopLevelBranching'.
1897
1898         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1899         anonymous method host, use `block.TopLevelBranching' rather than
1900         creating a new branching.
1901
1902 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1903
1904         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1905         a ScopeInfo, if any of the current children is a child of the new
1906         entry, move those children there.
1907
1908 2005-04-30  Martin Baulig  <martin@ximian.com>
1909
1910         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1911         at the beginning of a SwitchSection.  Fix #73335.
1912
1913 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1914
1915         Fix #74378
1916         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1917         
1918         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1919         (FieldExpr.DoResolve): Obsolete members are ignored for field
1920         initializers.
1921         
1922 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1923
1924         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1925         of arrays detection.
1926
1927         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1928         verification.
1929         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1930
1931         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1932         arrays report.
1933
1934 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1935
1936         * cs-parser.jay: Use the prefered version of -unsafe in error
1937         message.
1938
1939 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1940
1941         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1942         circumstances.
1943
1944 2005-04-20  John Luke  <john.luke@gmail.com>
1945
1946         * driver.cs: fix typo in error message, --outout to --output
1947
1948 2005-04-30  Martin Baulig  <martin@ximian.com>
1949
1950         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1951         handle the .NET 2.x security attributes.
1952
1953 2005-04-30  Martin Baulig  <martin@ximian.com>
1954
1955         * typemanager.cs
1956         (TypeManager.ExpandInterfaces): Don't add things twice.
1957
1958         * class.cs
1959         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1960
1961 2005-04-29  Martin Baulig  <martin@ximian.com>
1962
1963         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1964
1965         * anonymous.cs: Added support for anonymous generic methods.
1966
1967 2005-04-29  Martin Baulig  <martin@ximian.com>
1968
1969         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1970         generic instances.
1971
1972 2005-04-29  Martin Baulig  <martin@ximian.com>
1973
1974         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1975
1976         * expression.cs (New.DoResolve): Fix the CS0304 check.
1977
1978 2005-04-29  Martin Baulig  <martin@ximian.com>
1979
1980         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1981         naming schema.
1982
1983         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1984         explicit interface implementation, compare the interface types.
1985         (MethodData.Define): Use the new naming scheme from the latest
1986         .NET 2.x beta2.
1987         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1988
1989         * decl.cs (MemberName.GetMemberName): Removed.
1990         (MemberName.MethodName, FullName): New properties.
1991
1992 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1993
1994         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1995
1996 2005-04-22  Martin Baulig  <martin@ximian.com>
1997
1998         * generic.cs (GenericMethod): Create the EmitContext in the
1999         `Define()'; in `Define(MethodBuilder)', create the type parameters
2000         before calling `Define()'.  Fixes #73933.
2001
2002 2005-04-22  Martin Baulig  <martin@ximian.com>
2003
2004         * generic.cs
2005         (Constraints.Resolve): Make things work wrt. the new type lookup system.
2006         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
2007
2008         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
2009         ConstructedType, check its constraints.
2010
2011 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2012
2013         * codegen.cs (InRefOutArgumentResolving): New field.
2014         
2015         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2016         fields outside contructor.
2017         
2018         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2019         
2020 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2021
2022         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2023         parameter code was not completed ever, so it was not as up-to-date
2024         as local variables.  Must finish it.
2025
2026         The bug fix was to compare the Toplevel of the block, not the
2027         current block.  Thanks for Ben for pointing this out. 
2028
2029 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2030
2031         * decl.cs (AddMethods): Use the declaring type of the problem
2032         method to determine if we want to squash a warning.
2033
2034 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2035
2036         * attribute.cs: Removed debug output.
2037
2038         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2039         
2040         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2041         Report.Stderr.
2042         
2043 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2044
2045         Fix #74481.
2046         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2047         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2048         all null comparisons against reference types.
2049
2050 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2051
2052         Fix# 74565
2053         * class.cs (TypeContainer.CircularDepException) New nested
2054         exception class.
2055         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2056         (TypeContainer.DefineType): Removed error, reset InTransit before
2057         exit.
2058         (Class.DefineType): Throw exception when is in Transit.
2059         Catch exception and report error.
2060         (Struct.DefineType): Throw exception when is in Transit.
2061         Catch exception and report error.
2062         (Interface.DefineType): Throw exception when is in Transit.
2063         Catch exception and report error.
2064
2065         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2066         handle nested exception handlers.
2067
2068         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2069         a catch.
2070
2071         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2072         InFinally and InCatch storage.
2073
2074         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2075         (Catch.Resolve): Set and Restore ec.InCatch.
2076         (Try.Resolve): Set and Restore ec.InFinally.
2077         (Try.HasCatch): True when try has catch.
2078
2079 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2080
2081         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2082           for the same event member, so exclude such cases from warning 419.
2083           Fixed bug #74633.
2084
2085 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2086
2087         * expression.cs (Binary.ResolveOperator): Apply patch from John
2088         Luke to fix bug 59864: operators &, | and ^ on enumerations
2089         require that the same enum type on both sides.
2090
2091         * driver.cs: Add warnings to old flag usage, this is to assist
2092         people who produce Makefiles and hope that the Makefiles will be
2093         used on Windows.
2094
2095         * class.cs (TypeContainer.EmitType): Moved the definition of the
2096         special $PRIVATE$ field from the resolve phase to the Emit phase.
2097         During resolve we do not know if we are a struct with
2098         HasExplicitLayout, we know this only after the attributes for the
2099         type are emitted.
2100
2101         Set the FieldOffset to zero on the dummy field that we create for
2102         the class.   Fixes 74590.
2103
2104 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2105
2106         Fix #73834.
2107         * ecore.cs (PropertyExpr.resolved): New.
2108         (DoResolve): Use it to handle a case of double resolution here.
2109         Handle a case of identical-name-and-type-name.
2110         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2111         resolution by storing the results of expression resolution back
2112         into the "probes" array.
2113
2114 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2115
2116         Fix cs0208-7.cs and cs0208-8.cs.
2117         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2118         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2119         error reporting to point out the reason a struct is not unmanaged.
2120
2121 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2122
2123         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2124           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2125
2126 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2127
2128         Fix #74528.
2129         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2130         IdenticalNameAndTypeName here.
2131         (EventExpr.InstanceResolve): Likewise.
2132
2133 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2134
2135         C# 2.0 DefaultCharSetAttribute implementation
2136         
2137         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2138         which allows us to set GlobalNamespace for every resolve.
2139         (Attribute.ResolveArguments): Cut from Resolve.
2140         (Attribute.GetCharSetValue): Returns CharSet named argument.
2141         (Attribute.DefinePInvokeMethod): Gets default charset from
2142         module settings.
2143         (GlobalAttribute.ResolveAsTypeStep): Override.
2144         (GlobalAttribute.ResolveArguments): Override.
2145         
2146         * class.cs (TypeAttr): Is protected.
2147         
2148         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2149         (ModuleClass.DefaultCharSetType): New memeber.
2150         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2151         
2152         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2153         charset from module.
2154         
2155         * delegate.cs (TypeAttr): Override.
2156         (Delegate.DefineType): Use this TypeAttr.
2157         
2158         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2159         at very early stage (before types are defined) to resolve model
2160         module attributes. It will probably not work with corlib but it
2161         should be ok.
2162         
2163         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2164         charset from module.
2165         
2166         * typemanager.cs (default_charset_type): New type.
2167
2168 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2169
2170         * decl.cs (MemberCache.AddMethods): Don't warn if
2171         System.Object.Finalize has buggy MethodAttributes.
2172
2173         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2174         removed below.
2175
2176 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2177
2178         * doc.cs : detect ambiguous reference to overloaded members.
2179           Fixed bug #71603. MS 1.1 csc does not detect it.
2180
2181 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2182
2183         * doc.cs : delegates must not be referenced with parameters.
2184           Fixed bug #71605.
2185
2186 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2187
2188         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2189
2190 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2191
2192         * driver.cs (MainDriver): Stop processing if the CLS stage found
2193         errors. 
2194
2195         (CompilerCallableEntryPoint.InvokeCompiler): Always
2196         reset after execution;   Take a TextWriter argument for the
2197         output.
2198
2199         * report.cs: Use the error stream instead of hardcoding stderr. 
2200
2201 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2202
2203         * class.cs: Reduce code paths to test, too small of an
2204         optimization to make it worth the extra testing.  Always perform
2205         it. 
2206
2207 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2208
2209         Fix #74510.
2210         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2211         operators that had errors reported on them.
2212
2213 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2216         argument types.
2217         (Attribute.Resolve): Add named argument type checking.
2218         
2219         * class.cs (FixedField.Define): Use IsPrimitiveType
2220         
2221         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2222         
2223         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2224         unsafe parameter types.
2225         
2226         * statement.cs (Using.ResolveExpression): Add better error description.
2227         
2228         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2229         
2230 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2231
2232         Fix #74484.
2233         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2234         AttributeUsageAttribute in the emitcontext of the attribute class,
2235         not in the emitcontext of the attributable entity it was attached to.
2236         * cs-parser.jay: Use 'current_class', not 'current_container',
2237         when creating a GlobalAttribute.
2238
2239 2005-04-08  Alp Toker  <alp@atoker.com>
2240
2241         * pending.cs: The fix to #58413 failed to compile methods implementing
2242         interfaces with/without params modifiers and vice versa, even though
2243         params modifiers aren't part of the signature. Make the modifier check
2244         less strict as in csc.
2245
2246 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2247             Anoob V E  <projectmonokochi@rediffmail.com>
2248             Harilal P R  <projectmonokochi@rediffmail.com>
2249
2250         Fix #58413.
2251         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2252         modifiers of pending methods.
2253         (PendingImplementation.PendingImplementation): Initialize it.
2254         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2255         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2256         with ParameterData.  Add check for modifiers.
2257         * class.cs (MethodData.Define): Update to changes.
2258
2259 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2260
2261         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2262
2263 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2264
2265         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2266         property.
2267         
2268         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2269         
2270         * rootcontext.cs,
2271         * typemanager.cs: Registered RequiredAttributeAttribute.
2272         
2273 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2274
2275         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2276         Warning CS0169 is back at level 3.
2277         (IMethodData.SetMemberIsUsed): New method.
2278         
2279         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2280         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2281         
2282         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2283
2284         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2285         contants.
2286         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2287         is used.
2288         
2289         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2290         is used.
2291         
2292         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2293         to avoid the problems with nested types.
2294
2295 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2296             Anoob V.E  <projectmonokochi@rediffmail.com>
2297             Harilal P.R  <projectmonokochi@rediffmail.com>
2298             Raja R Harinath  <rharinath@novell.com>
2299
2300         Fix #73820.
2301         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2302         attribute.
2303         * typemanager (GetConstructor): Make public.
2304
2305 2005-04-05  John Luke  <john.luke@gmail.com>
2306             Raja R Harinath  <rharinath@novell.com>
2307
2308         Fix #62232.
2309         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2310         struct too.  Return false quicker in a few cases.
2311         (VerifyUnManaged): Use it.
2312
2313 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2314
2315         Fix #74041.
2316         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2317         not 'unreachable_seen'.
2318
2319 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2320
2321         * attribute.cs (Attribute.GetValue): Removed unused.
2322         
2323         * codegen.cs (CodeGen.TrimExt): Removed unused.
2324         
2325         * cs-parser.jay (output): Removed unused.
2326         
2327         * cs-tokenizer.cs (hex_digits): Removed unused.
2328         
2329         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2330         
2331         * expression.cs (Indirection.LoadExprValue): Removed unused.
2332         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2333         
2334         * iterators.cs (Iterator.param_types): Removed unused.
2335         
2336         * statement.cs (Goto.block): Removed unused.
2337         (ToplevelBlock.did): Removed unused.
2338         (Switch.ResolveConstantSwitch): Removed unused.
2339
2340 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2341
2342         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2343         resetting thingy.
2344
2345 2005-04-19  Martin Baulig  <martin@ximian.com>
2346
2347         Merged r42462 from MCS and made it work for GMCS.
2348
2349         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
2350
2351         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
2352
2353 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2354
2355         Fix #74232 and cs0208-3.cs.
2356         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2357         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2358         unmanaged type.  Don't use FieldBuilders when 't' is a
2359         TypeBuilder.  Use ModFlags and MemberType fields.
2360         * class.cs (MemberBase.member_type): Rename from MemberType.
2361         (MemberBase.MemberType): New property.  Determines member_type on
2362         demand.
2363         (MemberBase.DoDefine): Don't initialize MemberType here.
2364         (FieldMember.Define): Likewise.
2365
2366 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2367
2368         Fix #74241
2369         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2370         Attributes are emitted there.
2371         
2372 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2373
2374         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2375         keyword in 'partial enum' too.
2376         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2377         is not allowed).
2378         Report from Kamil Skalski <nazgul@omega.pl>.
2379
2380         Fix #74309.
2381         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2382         have partial containers too.
2383
2384         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2385         in block' checks to Block.CheckInvariantMeaningInBlock.
2386         * statement.cs (Block.GetKnownVariableInfo): Make private.
2387         (Block.IsVariableUsedInChildBlock): Remove.
2388         (Block.IsVariableUsedInBlock): Likewise.
2389         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2390         conflicting declaration.
2391         (Block.AddVariable): Make error messages less long-winded and more
2392         specific.  Show location of conflicting declaration.
2393         * parameter.cs (Parameters.Location): New readonly property.
2394
2395 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2396
2397         Clean up semantics of invoking ResolveMemberAccess.
2398         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2399         can have an instance, ensure that we pass in a non-TypeExpression
2400         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2401         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2402         argument.  Update to changes and simplify.
2403         (FieldExpr.Emitinstance): Remove CS0120 check.
2404         (PropertyExpr.EmitInstance): Likewise.
2405         * expression.cs (Argument.Resolve): Likewise.
2406         (Invocation.DoResolve): Update to changes in semantics of
2407         InstanceExpression.
2408
2409 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2410
2411         Fix #74241
2412         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2413         customization.
2414         
2415         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2416
2417 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2418
2419         Fix difference in behaviour with commandline invocation.
2420         * driver.cs (Driver.Reset): New.
2421         (CompilerCallableEntryPoint): Call it.
2422
2423         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2424         variable" warnings if the boolean expression failed to resolve.
2425
2426 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2427
2428         * attribute.cs: Fix the union of several permissions when some of them
2429         are unrestricted (so the result isn't an unrestricted permission set).
2430         Fix #74036.
2431
2432 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2433
2434         * ecore.cs (MemberExpr): New class.  Convert from interface
2435         IMemberExpr.
2436         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2437         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2438         error checks.
2439         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2440         (MethodGroupExpr.IsExplicitImpl): Remove.
2441         (Expression.GetFieldFromEvent): Remove.
2442         (SimpleName.MemberStaticCheck): Remove.
2443         (SimpleName.DoSimpleNameResolve): Update to changes.
2444         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2445         (MemberAccess.IdenticalNameAndTypeName): Remove.
2446         (MemberAccess.error176): Move to MemberExpr.
2447         (MemberAccess.DoResolve): Update to changes.
2448         (BaseAccess.DoResolve): Likewise.
2449
2450 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2451
2452         C# 2.0 Conditional attribute class implementation
2453         
2454         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2455         Analyzes class whether it has attribute which has ConditionalAttribute
2456         and its condition is not defined.
2457         
2458         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2459         (Class.IsExcluded): New method. Search for at least one defined
2460         condition in ConditionalAttribute of attribute class.
2461
2462 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2463
2464         * ecore.cs (PropertyExpr): Derive from Expression, not
2465         ExpressionStatement.
2466         (PropertyExpr.EmitStatement): Remove.
2467
2468 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2469
2470         Fix #74060.
2471         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2472         internal field "value__" of an enum be private.  The examples for
2473         "value__" that I found on MSDN all used FieldAttributes.Private.
2474
2475         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2476         Don't mention IL method attribute names.
2477
2478         Fix #47991.  Remove a TODO.
2479         * statement.cs (Block.Toplevel): Make into a field.
2480         (Block.Parameters): Move into ToplevelBlock.
2481         (Block.known_variables): Rename from child_variable_names.
2482         (Block.Block): Remove variants that take Parameters.  Initialize
2483         'Toplevel' with the immediately surrounding toplevel block.
2484         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2485         LocalInfo parameter.
2486         (Block.GetKnownVariableInfo): New.
2487         (Block.IsVariableNameUsedInChildBlock): Update.
2488         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2489         the block, even though it may not be in scope.
2490         (Block.AddVariable): Remove Parameters parameter.  Use
2491         Toplevel.Parameters instead.
2492         (Block.AddConstant): Remove Parameters parameter.
2493         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2494         (Block.IsParamaterReference): Likewise.
2495         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2496         (ToplevelBlock.Parameters): New.  Moved from Block.
2497         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2498         initialize Parameters to a non-null value.
2499         * cs-parser.jay: Update to changes.
2500         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2501         simple names that mean different things in the same block.  Use
2502         Block.IsVariableNameUsedInBlock.
2503
2504 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2505
2506         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2507
2508 2005-03-26  Raja R Harinath  <harinath@acm.org>
2509
2510         Fix #73038.
2511         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2512         fails to resolve, ensure that the LHS is still resolved as an
2513         lvalue.
2514
2515 2005-03-25  Raja R Harinath  <harinath@acm.org>
2516
2517         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2518         ec.ContainerType.
2519         (Enum.current_ec): Remove.
2520         (Enum.LookupEnumValue): Remove EmitContext argument.
2521         Just uses the one created during DefineType.
2522         (Enum.FindMembers): Update.
2523         * expression.cs (MemberAccess.DoResolve): Update.
2524
2525 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2526
2527         * assign.cs (Assign.DoResolve): Check for CS1717 when
2528         source and target are same (uses Equals).
2529
2530         * expression.cs (LocalVariableReference, ParameterReference,
2531         This): Implemented Equals, GetHashCode.
2532
2533         * statement.cs (Block.GetParameterReference): Removed useless
2534         local variable.
2535
2536 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2537
2538         Fix cs0128.cs
2539         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2540         blocks before deciding whether the error is cs0136 or cs0128.
2541
2542         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2543         (using_alias_directive, using_namespace_directive): Pass
2544         MemberName, not an expression to Namespace.UsingAlias and
2545         Namespace.Using.
2546         (MakeName): Use the MemberName of the namespace.
2547         * namespace.cs (Namespace.MemberName): New.
2548         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2549         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2550         Likewise.
2551         * decl.cs (MemberName.Name): Make readonly.
2552         (MemberName.FromDotted): New "constructor".
2553         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2554         (MemberCore.Name): Compute from MemberName on demand.
2555         (MemberCore.SetMemberName): Provide a way to change the
2556         MemberName.
2557         (MemberCore.AddToContainer): Don't take a fullname parameter.
2558         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2559         fully qualified name of the container to the member name.
2560         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2561         only if the type is a member of the root container.
2562         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2563         MemberName.Left rather than searching for an embedded ".".
2564         (PartialContainer.CreatePart): Update to changes in RootContext.
2565         (MemberBase.ShortName): Turn into a property.  Use
2566         MemberCore.SetMemberName.
2567         (MemberBase.ExplicitInterfaceName): Remove.
2568         (MemberBase.UpdateMemberName): Remove.
2569         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2570         (PropertyBase.SetMemberName): New override.
2571         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2572         (Tree.GetDecl): New.
2573         (Tree.AllDecls): Rename from Decls.
2574         * attribute.cs, enum.cs, report.cs: Update to changes.
2575         * driver.cs (MainDriver): Use MemberName.FromDotted on
2576         RootContext.MainClass.
2577
2578 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2579
2580         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2581         checks.
2582
2583         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2584
2585 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2586
2587         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2588         property accessor modifiers.
2589
2590         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2591         fixed buffer attribute (CS1716).
2592         (PropertyMethod.HasCustomAccessModifier): When property accessor
2593         has custom modifier.
2594
2595         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2596         modifiers.
2597         (PropertyExpr.DoResolveLValue): Add CS0272.
2598
2599 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2600
2601         * convert.cs: When converting to a pointer, use the proper Conv.U
2602         or Conv.I depending on the source data type.
2603
2604         * cs-tokenizer.cs: Make the size for large decimal constants,
2605         fixes #72957.
2606
2607 2005-03-17  Martin Baulig  <martin@ximian.com>
2608
2609         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2610         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2611
2612 2005-03-17  Martin Baulig  <martin@ximian.com>
2613
2614         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2615         to bool so we can return an error condition.
2616         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2617         returned an error.
2618
2619 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2620
2621         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2622         attributes.
2623
2624 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2625
2626         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2627         Refactor to avoid traversing the list of assemblies, and to avoid
2628         string concatenation.
2629         * typemanager.cs (guid_attr_type): Remove.
2630         (negative_hits, pointers, references): Remove hashes.
2631         (type_hash): New.
2632         (GetConstructedType): New.  Uses type_hash to handle constructed
2633         types (arrays, references, pointers).
2634         (GetReferenceType, GetPointerType): Use it.
2635         (GetNestedType): New.  Uses type_hash to handle nested types of
2636         reflected types.
2637         (LookupType, LookupTypeDirect): Remove.
2638         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2639         'types' hash and LookupTypeReflection directly.
2640         (params_string, params_object): Use GetConstructedType.
2641         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2642         top-level types.
2643         (Namespace.Lookup): Use cached_types.
2644         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2645         provided by old TypeManager.LookupType.
2646         * rootcontext.cs (MakeFQN): Remove.
2647         * decl.cs (DeclSpace.MakeFQN): Likewise.
2648         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2649         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2650         TypeManager.GetConstructedType.
2651         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2652
2653 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
2654
2655         * cs-parser.jay: Fix build.
2656
2657 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2658
2659         * class.cs (TypeContainer.CircularDepException) New nested
2660         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
2661
2662         * cs-parser.jay: Reports CS1527 for any namespace element.
2663
2664         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2665         Added CS0407.
2666
2667         * expression.cs (ParameterReference.IsAssigned): Changed error to
2668         CS0269.
2669         (Error_WrongNumArguments): Moved CS0245 detection here.
2670
2671         * statement.cs (Return.Resolve): Add CS1622 report.
2672
2673 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2674
2675         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2676
2677 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2678
2679         * attribute.cs expression.cs: Get rid of some allocations.
2680
2681 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2682
2683         * doc.cs : just eliminate the latest change.
2684
2685 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2686
2687         * doc.cs : commented out the latest change. It breaks xml-030.cs
2688
2689 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2690
2691         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2692           fail. So invoke CreateType() in FindDocumentedType().
2693
2694 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2695
2696         * cs-tokenizer.cs : added IsKeyword().
2697         * doc.cs : Detect keyword incorrectly used as identifier.
2698           Allow identifiers prefixed by @.
2699
2700 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2701
2702         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2703         It caused exception in namespace resolving (again!).
2704         
2705         * class.cs (Class.ctor): Removed exit.
2706         (PropertyMethod.ctor): ditto.
2707         
2708         * codegen.cs (Codegen.Reset): Reset static data.
2709         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2710         
2711         * cs-tokenizer.cs (Cleanup): Removed.
2712         
2713         * driver.cs (GetSystemDir): Rewrote to one line command.
2714         It caused problem with unloaded dynamic modules.
2715         (UnixParseOption): Removed Exit.
2716         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2717         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2718         Now can be mcs used as library.
2719         
2720         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2721         empty location.
2722         
2723         * location.cs (Reset): Reset static data.
2724         
2725         * namespace.cs (Reset): Reset static data.
2726         
2727         * report.cs (Report.Reset): Reset static data.
2728         
2729         * rootcontext.cs (RootContext.Reset): Reset static data.
2730         
2731         * tree.cs (RootTypes.ctor): Use Location.Null
2732         
2733         * typemanager.cs (TypeManager.Reset): Reset static data.
2734         (CoreLookupType): Removed Exit.
2735         (TypeHandle.Reset): Reset static data.
2736         
2737 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2738
2739         Fix #73516.
2740         * typemanager.cs (ComputeNamespaces): Import namespaces from
2741         referenced modules too.
2742
2743 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2744
2745         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2746         than '.'.
2747
2748 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2749
2750         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2751         enclosing DeclSpace.  This ensures that a name-lookup populates
2752         more caches and there are fewer 'TypeExpression's.  Carve out
2753         nested type lookup into ...
2754         (LookupNestedTypeInHierarchy): ... this.
2755
2756 2005-04-15  Martin Baulig  <martin@ximian.com>
2757
2758         Merged r41590 from MCS and make it work in the generics land.
2759
2760         * generic.cs (TypeParameter.UpdateConstraints): Removed the
2761         `check' argument.
2762
2763         * class.cs (PartialContainer.UpdateConstraints): Removed.
2764         (PartialContainer.CheckConstraints): Removed.
2765         (PartialContainer.SetParameterInfo): Store the constraints here.
2766         (PartialContainer.DefineTypeParameters): New public method;
2767         resolve the type parameter's constraints here.  Note that the
2768         PartialContainer doesn't have an EmitContext anymore, so we must
2769         do this in the ClassPart.
2770
2771 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2772
2773         Clean up a few partial-class semantics.  
2774         Fixes test-357.cs and cs1618-2.cs.
2775         * cs-parser.jay (struct_declaration): Use 'current_class' as
2776         parent of newly-created struct.  Remove call to Register ().
2777         Use 'pop_current_class' to complete handing the current struct.
2778         (interface_declaration): Likewise.
2779         (class_declaration): Likewise.
2780         (enum_declaration): Use 'current_class' as parent of newly created
2781         enum.
2782         (delegate_declaration): Likewise.
2783         (pop_current_class): New function.  This is used to handle closing
2784         up the 'current_class' and 'current_container', and pointing them
2785         to the enclosing class/container.
2786         (CSharpParser): Initialize 'current_class' too.
2787         * decl.cs (MemberCore): Add check for invariant: a partial
2788         container is not a parsed entity, and thus does not enclose any
2789         parsed members.
2790         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2791         (DeclSpace.BaseTypeExpr): Use it.
2792         (DeclSpace.LookupType): Add check for invariant.
2793         * class.cs (TypeContainer): Add check for invariant: a nested
2794         class should have the same NamespaceEntry as its enclosing class.
2795         (TypeContainer.EmitFieldInitializers): Make virtual.
2796         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2797         MemberCore.
2798         (TypeContainer.Register): Remove.
2799         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2800         null.  Use TypeResolveEmitContext for resolving base types and
2801         interfaces.  Move initialization of Parts.TypeBuilder here from
2802         ...
2803         (TypeContainer.DefineNestedTypes): ... here.
2804         (PartialContainer): Take a Namespace not a NamespaceEntry.
2805         (PartialContainer.Create): Don't use Register.  Call the
2806         appropriate Add... function directly.
2807         (ClassPart): Take both the PartialContainer and the enclosing
2808         class as constructor arguments.
2809         (ClassPart.EmitFieldInitializers): Override.
2810         (ClassPart.PartFindNestedTypes): Remove.
2811         (FieldBase.GetInitializerExpression): Resolve the initializer
2812         expression in the emit context of the enclosing class.
2813         * tree.cs (RootTypes): Remove Register ().
2814         
2815 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2816
2817         * cs-parser.jay: Removed CS0134.
2818         
2819         * driver.cs: Removed CS1901.
2820         
2821         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2822         for predefined types.
2823
2824 2005-03-07  Duncan Mak  <duncan@novell.com>
2825
2826         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2827         well. Fixes bug #73454.
2828
2829 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2830
2831         * cs-tokenizer.cs (xtoken): Add CS1035.
2832         
2833         * class.cs (MethodData.Define): Add CS0683.
2834         (FieldMember.ctor): Add CS0681.
2835
2836 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2837
2838         * ecore.cs (SimpleName.DoResolve): Rename from
2839         SimpleName.DoResolveAllowStatic.
2840         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2841         Pass 'intermediate' flag to MemberStaticCheck.
2842         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2843         of "intermediate" lookups via MemberAccess.
2844         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2845         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2846
2847 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2848
2849         Fix #73394.
2850         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
2851         slipped in because of variable names that are identical to a
2852         builtin type's BCL equivalent ('string String;', 'int Int32;').
2853         (PropertyExpr.EmitInstance): Likewise.
2854
2855 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
2856
2857         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
2858         
2859         * report.cs (warning_ignore_table): Made public.
2860
2861 2005-03-04  Raja R Harinath  <rharinath@novell.com>
2862
2863         Fix #73282.
2864         * class.cs (MethodData.Emit): Pass 'container' to
2865         container.GetObsoleteAttribute instead of 'container.Parent'.
2866
2867 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
2868
2869         * cs-parser.jay: Add 1534 error test.
2870
2871         * iterators.cs (Yield.CheckContext): Add error 1629.
2872         (Iterator.ctor): Save unsafe modifier.
2873         (MoveNextMethod.DoEmit): Restore unsafe context.
2874
2875         * namespace.cs (UsingAlias): Better error message.
2876
2877 2005-03-03  Dan Winship  <danw@novell.com>
2878
2879         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
2880         the warning message [#73219]
2881
2882 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2883
2884         Fix compile with MCS 1.0.0.0.
2885         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
2886         w_restore to not depend on string constant folding.
2887
2888 2005-03-03  Raja R Harinath  <rharinath@novell.com>
2889
2890         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2891         CS0246 check to users who passed 'silent = false'.
2892         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2893         check.
2894         (SimpleName.SimpleNameResolve): Update.
2895         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2896         (MemberAccess.IdenticalNameAndTypeName): Update.
2897         * doc.cs (FindDocumentedTypeNonArray): Update.
2898
2899 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2900
2901         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2902         * parameters.cs (ComputeAndDefineParameters): Remove.
2903         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2904         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2905         Use GetParameterInfo.
2906
2907 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2908
2909         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2910
2911 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2912
2913         Unify DeclSpace.LookupType and DeclSpace.FindType.
2914         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2915         is in charge of defining nested types on demand.
2916         (DeclSpace.LookupType): Use it when the current_type is a
2917         TypeBuilder.  Use LookupTypeDirect for reflected types.
2918         (DeclSpace.FindType): Remove.
2919         (DeclSpace.LookupInterfaceOrClass): Likewise.
2920         (DeclSpace.DefineTypeAndParents): Likewise.
2921         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2922         DeclSpace.LookupType.
2923         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2924         * typemanager.cs (LookupType): Simplify.
2925         (AddUserType): Remove type from negative_hits.
2926         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2927         * class.cs (TypeContainer.FindMembers): Move handling of nested
2928         types ...
2929         (TypeContainer.FindMembers_NestedTypes): ... here.
2930         (TypeContainer.FindNestedType): Implement override.
2931         (ClassPart.FindNestedType): Delegate to PartialContainer.
2932         (ClassPart.PartFindNestedType): Looks up the nested types of the
2933         part alone.
2934
2935 2005-04-14  Martin Baulig  <martin@ximian.com>
2936
2937         * generic.cs (ConstructedType): Moved all the type lookup and
2938         nested class logic into SimpleName.
2939         (ConstructedType.ResolveConstructedType): Our underlying type is
2940         already fully resolved; all the type lookup stuff is in
2941         SimpleName.
2942
2943         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2944         constructed types here instead of in ConstructedType.
2945
2946         * decl.cs (MemberName.GetTypeExpression): Always create a
2947         SimpleName, not a ConstructedType.
2948         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2949
2950 2005-03-02  Martin Baulig  <martin@ximian.com>
2951
2952         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2953         static constructor in static classes.
2954
2955 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2956
2957         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2958         sizeParamIndex is not specified.
2959
2960 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2961
2962         Fix #73117
2963         * report.cs (WarningMessage.IsEnabled): Missing null check.
2964
2965 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2966
2967         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2968         in the fields and not in the properties.
2969
2970 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2971
2972         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2973         fields as well.
2974
2975 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2976
2977         * attribute.cs: Small refactoring (improved robustness).
2978         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2979         (ValidateGuid): Removed.
2980         (Resolve): Removed referenced to above mentioned.
2981         (GetAttributeUsage): Made private and changed to work without
2982         class assistance.
2983         (GetIndexerAttributeValue): Don't crash.
2984         (GetConditionalAttributeValue): Ditto.
2985         (GetClsCompliantAttributeValue): Ditto.
2986         (ExtractSecurityPermissionSet): All attributes exceptions are
2987         error 648.
2988         (GetPropertyValue): New helper.
2989         (GetMethodImplOptions): New method.
2990         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2991         some missing properties.
2992         
2993         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2994         (Method.ApplyAttributeBuilder): Updated.
2995         
2996         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2997         exception.
2998
2999 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3000
3001         Fix #73052.
3002         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3003         non-simple types (array, pointer, reference).
3004
3005 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3006
3007         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3008
3009         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3010         for operators.
3011         (Method.CheckBase): Catch wrong destructor here.
3012         (MethodData.Define): Add errors 550, 668.
3013
3014         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3015
3016         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3017
3018         * pending.cs (VerifyPendingMethods): Add error 551.
3019
3020         * typemanager.cs (CSharpName): Next error report helper.
3021
3022 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3023
3024         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3025         attributes. Removed useless attribute double check.
3026         It saves almost 2MBs for corlib.
3027
3028 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3029
3030         Fix #72924.
3031         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3032         called twice in case of error.
3033
3034 2005-02-23  Chris Toshok  <toshok@ximian.com>
3035
3036         Fix compiler portions of #72827.
3037         * statement.cs (Block.Emit): call Begin/EndScope on the
3038         EmitContext instead of the ILGenerator.
3039
3040         * codegen.cs (EmitContext.BeginScope): new method, call
3041         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3042         we have one.)
3043         (EmitContext.BeginScope): same, but EndScope and CloseScope
3044
3045         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3046         offset and call the superclass's OpenScope(int) with it.
3047         (SymbolWriter.CloseScope): get the current il
3048         offset and call superclass's CloseScope(int) with it.
3049
3050 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3051
3052         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3053         CS1677 for out and ref as well.
3054
3055         * class.cs (Method.Define): Add error CS1599 detection.
3056         
3057         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3058         
3059         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3060         
3061         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3062         
3063         * support.cs.cs (ModifierDesc): New helper method.
3064
3065 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3066             Abin Thomas  <projectmonokochi@rediffmail.com>
3067             Anoob V E  <projectmonokochi@rediffmail.com>
3068             Harilal P R  <projectmonokochi@rediffmail.com>
3069
3070         Fix #57851, #72718.
3071         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3072         MemberLookup (used for error reporting) actually returns a result.
3073         Fix error report number (122, not 112).
3074
3075 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3076             Anoob V E  <projectmonokochi@rediffmail.com>
3077             Harilal P R  <projectmonokochi@rediffmail.com>
3078
3079         Fix #71134.
3080         * pending.cs (PendingImplementation.GetAbstractMethods):
3081         Find NonPublic members too.
3082
3083 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3086         Fixed error 217.
3087         
3088         * class.cs (MethodCore.CheckMethodAgainstBase):
3089         Add error 239 report.
3090
3091 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3092
3093         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3094         
3095         * class.cs (Operator.Define): Add error 217 report.
3096         
3097 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3098
3099         Fix #68955.
3100         * expression.cs (Invocation.IsApplicable): Make public.
3101         (Invocation.IsParamsMethodApplicable): Likewise.
3102         * delegate.cs (Delegate.VerifyApplicability): Don't use
3103         Invocation.VerifyArgumentCompat for parameter applicability
3104         testing.  Use Invocation.IsApplicable and
3105         Invocation.IsParamsMethodApplicable.
3106
3107 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3108
3109         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3110         
3111         * class.cs (Operator.Define): Add error 217 report.
3112         
3113 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3114
3115         * namespace.cs (UsingEntry.Resolve): Undo change below.
3116
3117 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3118
3119         Fix #72756.
3120         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3121         disable the error message when the extended MemberLookup also
3122         fails.
3123         (Expression.MemberLookupFinal): Update.
3124         (SimpleName.DoSimpleNameResolve): Update.
3125         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3126         Don't use MemberLookupFinal.
3127         (New.DoResolve): Update.
3128         (BaseAccess.CommonResolve): Update.
3129
3130 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3131
3132         Fix #72732.
3133         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3134         occured previously, don't resolve again.
3135
3136 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3137
3138         Fix #69949
3139         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3140         argument. Call ResolveAttributeUsage for unresolved.
3141         when types doesn't match ctor arguments.
3142         
3143         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3144         for nested attribute classes.
3145         (Class.attribute_usage): Removed.
3146         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3147         for attribute class.
3148         
3149         * ecore.cs (IsAttribute): Removed.
3150         
3151         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3152         
3153         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3154         now normal types.
3155         (attribute_types): Removed.
3156         (EmitCode): Global attributes are emited as the latest.
3157
3158 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3159
3160         * class.cs (EmitFieldInitializers): Don't emit field initializer
3161         for default values when optimilization is on.
3162         
3163         * constant.cs (Constant.IsDefaultValue): New property.
3164         
3165         * driver.cs: Add /optimize handling.
3166         
3167         * constant.cs,
3168         * ecore.cs,
3169         * literal.cs: Implement new IsDefaultValue property.
3170         
3171         * rootcontext.cs (Optimize): New field, holds /optimize option.
3172
3173 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3174
3175         Fix crasher in re-opened #72347.
3176         * namespace.cs (Namespace.Lookup): Return null if
3177         DeclSpace.DefineType returns null.
3178
3179         Fix #72678.
3180         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3181
3182 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3183
3184         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3185         now returns null if it cannot resolve to an lvalue.
3186         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3187         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3188         returned null.  Remove check for SimpleName.
3189         (EventExpr.DoResolveLValue): New.
3190         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3191         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3192         error from ...
3193         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3194         avoid CS0131 error.
3195         (Unary.ResolveOperator): Move CS0211 check ...
3196         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3197         CS0131 error.
3198         (Unary.DoResolveLValue): Simplify.
3199         (AddressOf.DoResolveLValue): New.
3200         (ArrayAccess.DoResolveLValue): New.
3201
3202 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3203
3204         * attribute.cs (Attribute.Resolve): Add arguments casting for
3205         when types doesn't match ctor arguments.
3206
3207 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3208
3209         Fix parts of #63202.
3210         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3211         lookup of operator in base type.  Ensure that all checks happen
3212         when the operator resolves to an "op_..." method.
3213
3214 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3215
3216         Fix #71992.
3217         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3218         'ignore_cs0104' parameter.  Pass it to ...
3219         (NamespaceEntry.Lookup): ... this.
3220         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3221         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3222         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3223         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3224         Update.  Request that cs0104 errors be ignored.
3225         (ComposedCast.ResolveAsTypeStep): Update.
3226
3227 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3228
3229         Fix #59209.
3230         * expression.cs (Invocation.BetterFunction): Remove support for
3231         comparing virtual functions and their overrides.
3232         (Invocation.IsOverride): New.
3233         (Invocation.OverloadResolve): Don't consider 'override' functions
3234         during candidate selection.  Store them in a lookaside list.
3235         If the selected method is a 'virtual' function, use the list to
3236         find any overrides that are closer to the LHS type.
3237
3238 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3239
3240         * expression.cs (New.DoResolve): Add complex core type reduction.
3241         (New.Constantify): Converts complex core type syntax like 'new int ()'
3242         to simple constant.
3243         
3244 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3245
3246         * decl.cs (EntryType.EntryType): New constructor to create an
3247         updated copy of a cache entry.
3248         (MemberCache.AddMethods): Use it.
3249         (MemberCache.ClearDeclaredOnly): Remove.
3250         (MemberCache.MemberCache): Update.
3251
3252 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3253
3254         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3255         variable.  This one is represents the actual low-level declaration
3256         of the method, as opposed to the semantic level `IsStatic'.   
3257
3258         An anonymous method which is hosted into a static method might be
3259         actually an instance method.  IsStatic would reflect the
3260         container, while MethodIsStatic represents the actual code
3261         generated.
3262
3263         * expression.cs (ParameterReference): Use the new MethodIsStatic
3264         instead of IsStatic.
3265
3266         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3267         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3268         set on the current EmitContext. 
3269
3270         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3271         resolve our casted expression as an LValue.  This triggers the
3272         proper LValue processing that is later required by Assign.
3273
3274         This fixes 72347.
3275
3276         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3277
3278 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3279
3280         C# 2.0 Fixed buffer implementation
3281
3282         * anonymous.cs: Update after RegisterHelperClass renaming.
3283
3284         * attribute.cs (AttributeTester.fixed_buffer_cache):
3285         Cache of external fixed buffers.
3286         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3287         implementation if field is fixed buffer else null.
3288
3289         * class.cs
3290         (TypeContainer.AddField): Accept FieldMember instead of Field.
3291         (FieldBase.IsFieldClsCompliant): Extracted code from
3292         VerifyClsCompliance descendant customization.
3293         (FixedField): New class handles fixed buffer fields.
3294         (FixedFieldExternal): Keeps information about imported fixed
3295         buffer.
3296         (IFixedField): Make access to internal or external fixed buffer
3297         same.
3298
3299         * cs-parser.jay: Add fixed buffer parsing.
3300
3301         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3302         buffer.
3303
3304         * expression.cs (Indirection): Extended implementation to accept
3305         fixed buffer field.
3306         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3307         (ElementAccess.MakePointerAccess): Get type as parameter.
3308         (DoResolve): Add fixed buffer field expression conversion.
3309         (DoResolveLValue): Ditto.
3310         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3311         (ArrayPtr): Derives from FixedBufferPtr.
3312         (ArrayPtr.Emit): Add extra emit for array elements.
3313
3314         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3315
3316         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3317         for compiler generated types.
3318         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3319
3320         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3321         and consume less memory.
3322         (Fixed.Resolve): Add fixed buffer case.
3323
3324         * typemanager.cs (compiler_generated_attr_ctor,
3325         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3326         (HasElementType): Add our own implementation to work on every
3327         runtime.
3328
3329 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3330
3331         * anonymous.cs (CaptureContext): Track whether `this' has been
3332         referenced.   
3333
3334         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3335         only captured `this' if it was implicitly done (instance
3336         methods/variables were used). 
3337
3338         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3339         `this' must be captured.
3340
3341 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3342  
3343         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3344         is null it means that there has been no need to capture anything,
3345         so we just create a sibling.
3346
3347         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3348
3349         Just a partial fix.  The other half is fairly elusive.
3350         
3351 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3352
3353         Fix #52586, cs0121-4.cs.
3354         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3355         and return a hashtable.
3356         (MemberCache.ClearDeclaredOnly): New.
3357         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3358         the method_hash of a base type too.
3359         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3360         type methods.  Overwrite entries with the same MethodHandle so
3361         that the ReflectedType is correct.  The process leaves in base
3362         virtual functions and their overrides as distinct entries.
3363         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3364         matters since it was boxed in a ArrayList before.
3365         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3366         modifier.
3367         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3368         case of a virtual function and its override (choose the overload
3369         as better).
3370         (Invocation.OverloadResolve): Avoid 'override' members during
3371         'applicable_type' calculation.
3372
3373 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3374
3375         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3376         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3377         GetTypeHandle.  It is possible for a reflected type to derive from
3378         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3379         System.Array during mscorlib compilation).
3380         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3381         contain a method_hash, don't create one either.  Don't create a
3382         deep copy of the base cache's method_hash.
3383         (MemberCache.SetupCache): Rename back from DeepCopy.
3384         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3385         already initialized.  If we see an override function, add its
3386         underlying base virtual function to the member_hash too.
3387
3388 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3389
3390         Combine two near-redundant caches.
3391         * typemanager.cs (method_params): Rename from method_internal_params.
3392         (TypeManager.GetParameterData): New.  Replace
3393         Invocation.GetParameterData.
3394         (TypeManager.LookupParametersByBuilder): Remove.
3395         * expression.cs (Invocation.method_parameter_cache): Remove.
3396         (Invocation.GetParameterData): Remove.
3397         Update to changes.
3398         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3399         Update to changes.
3400
3401 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3402
3403         Fix #72015.
3404         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3405         TypeManager.multicast_delegate_type is null, resolve it by looking
3406         up "System.MulticastDelegate".
3407         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3408
3409 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3410             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3411             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3412
3413         Fix cs0164.cs.
3414         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3415         (LabeledStatement.AddReference): New.  Set 'referenced'.
3416         (Goto.Resolve): Use it.
3417
3418 2005-02-05  John Luke  <john.luke@gmail.com>
3419
3420         * driver.cs: remove duplicate -doc line in Usage ()
3421
3422 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3423
3424         * location.cs (Location.AddFile): Fix CS2002 error report.
3425
3426 2005-02-02  Martin Baulig  <martin@ximian.com>
3427
3428         * delegate.cs (Delegate.DefineType): Report an internal error if
3429         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3430         details.        
3431
3432 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3433
3434         Fix a crasher in a variant of #31984.
3435         * const.cs (Constant.CheckBase): New override that defers the
3436         new-or-override check in case the base type hasn't been populated
3437         yet.
3438         (Constant.Define): Ensure the new-or-override check is performed.
3439
3440 2005-02-01  Duncan Mak  <duncan@ximian.com>
3441
3442         * const.cs (LookupConstantValue): Check that `ce' is not null
3443         before calling GetValue ().
3444
3445 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3446
3447         Fix test-334.cs (#69519).
3448         * cs-parser.jay (using_alias_directive): Pass in an expression to
3449         NamespaceEntry.UsingAlias.
3450         (using_namespace_directive): Pass in an expression to
3451         NamespaceEntry.Using.
3452         (namespace_name): Don't flatten to a string.
3453         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3454         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3455         ResolveAsTypeStep.
3456         (NamespaceEntry.UsingEntry): Likewise.
3457         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3458         changes.
3459         (NamespaceEntry.LookupForUsing): Remove.
3460         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3461         names.
3462         (NamespaceEntry.Lookup): Remove support for dotted names.
3463
3464 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3465
3466         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3467         split into two.
3468         (NamespaceEntry.ImplicitParent): Compute on demand.
3469         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3470         parallels the current.
3471         (NamespaceEntry.LookupForUsing): Use it.
3472         (NamespaceEntry.Lookup): If the current namespace-entry is
3473         implicit, don't search aliases and using tables.
3474
3475 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3476
3477         Fix #31984.
3478         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3479         BaseCache here.
3480         (TypeContainer.BaseCache): Compute on demand.
3481         (TypeContainer.FindMembers): Define constants and types if they're
3482         not already created.
3483         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3484         check.
3485         * const.cs (Constant.Define): Make idempotent.
3486
3487 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3488
3489         * pending.cs: Produce better code (no nops produced by using Ldarg
3490         + value).
3491         
3492         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3493         i - 1' it should be arg + 1.
3494
3495         Fixes bug #71819.
3496
3497 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3498
3499         * attribute.cs (Attribute.CheckAttributeType): Make private
3500         non-virtual.
3501         (Attribute.ResolveType): Make virtual.
3502         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3503         handling of RootContext.Tree.Types.
3504
3505 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3506
3507         Update attribute-handling to use the SimpleName/MemberAccess
3508         mechanisms.
3509         * cs-parser.jay (attribute): Pass in an expression to the
3510         constructors of Attribute and GlobalAttribute.
3511         * attribute.cs (Attribute): Take an expression for the name.
3512         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3513         passed in attribute name expression.
3514         (Attribute.CheckAttributeType): Use it.
3515         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3516         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3517         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3518         argument to prevent error messages if the lookup fails.
3519
3520 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3521
3522         * expression.cs (Indirection): Implemented IVariable interface
3523         to support indirection in AddressOf operator.
3524         (PointerArithmetic.Emit): Add optimalization for case where
3525         result can be precomputed.
3526
3527 2005-01-26  Martin Baulig  <martin@ximian.com>
3528
3529         * class.cs (TypeContainer.AttributeTargets): Return the correct
3530         AttributeTargets depending on our `Kind' instead of throwing an
3531         exception; fixes #71632.
3532
3533 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3534
3535         Fix #71257
3536         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3537         constant members.
3538
3539 2005-03-17  Martin Baulig  <martin@ximian.com>
3540
3541         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3542         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3543
3544 2005-03-17  Martin Baulig  <martin@ximian.com>
3545
3546         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3547         to bool so we can return an error condition.
3548         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3549         returned an error.
3550
3551 2005-03-17  Martin Baulig  <martin@ximian.com>
3552
3553         * generic.cs (TypeMananager.IsIEnumerable): New public method.
3554
3555         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
3556         converting from an array-type of T to `IEnumerable<T>'.
3557
3558 2005-03-16  Martin Baulig  <martin@ximian.com>
3559
3560         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
3561         (Nullable.LiftedUnaryMutator): New public class.
3562
3563         * expression.cs (UnaryMutator.DoResolve): Added support for
3564         Nullable Types.
3565
3566 2005-03-14  Martin Baulig  <martin@ximian.com>
3567
3568         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
3569
3570 2005-03-14  Martin Baulig  <martin@ximian.com>
3571
3572         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
3573         the comparision operators `<', `>', `<=' and `>='.
3574
3575 2005-03-13  Martin Baulig  <martin@ximian.com>
3576
3577         * generic.cs
3578         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
3579         avoid confusion with the `NullLiteral'.
3580         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
3581
3582 2005-03-13  Martin Baulig  <martin@ximian.com>
3583
3584         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
3585         comparing arbitrary types with the null literal.
3586
3587 2005-03-13  Martin Baulig  <martin@ximian.com>
3588
3589         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
3590         boolean operators '&&', '||', '&' and '|'.
3591         (Nullable.OperatorTrueOrFalse): New public class.
3592
3593         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
3594         instead of a `StaticCallExpr'; added support for nullables.
3595
3596 2005-03-10  Martin Baulig  <martin@ximian.com>
3597
3598         * expression.cs
3599         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
3600         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
3601
3602 2005-03-07  Martin Baulig  <martin@ximian.com>
3603
3604         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
3605         it work if `expr' is not an IMemoryLocation.
3606         (Nullable.Lifted): Implement IMemoryLocation.
3607         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
3608         target type.
3609
3610 2005-03-05  Martin Baulig  <martin@ximian.com>
3611
3612         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
3613         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
3614         (Nullable): Added support for lifted unary and binary operators.
3615
3616         * expression.cs (Unary.DoResolve): Added support for nullable types.
3617         (Binary.DoResolve): Likewise.
3618         (Conditional.DoResolve): Likewise.
3619
3620 2005-03-02  Martin Baulig  <martin@ximian.com>
3621
3622         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
3623
3624         * class.cs (ClassPart.SetParameterInfo): Override this.
3625         (PartialContainer.SetParameterInfo): Override this.
3626         (TypeContainer.CheckConstraints): New protected method.
3627         (PartialContainer.CheckConstraints): Override this and check
3628         whether the same contraints were specified in all parts of a
3629         partial generic type definition.
3630         (PartialContainer.UpdateConstraints): New public method.
3631
3632         * generic.cs (TypeParameter.UpdateConstraints): New public method.
3633
3634 2005-03-02  Martin Baulig  <martin@ximian.com>
3635
3636         Committing a patch from Carlos Alberto Cortez to fix #72887.
3637
3638         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
3639         casts from `T []' to `int []'.
3640
3641 2005-03-02  Martin Baulig  <martin@ximian.com>
3642
3643         * generic.cs (TypeManager.IsEqual): Make this symmetric.
3644
3645         * expression.cs (Binary.ResolveOperator): When resolving a
3646         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
3647         `=='.  Fixes #71866.  See gen-127.cs.
3648
3649 2005-03-02  Martin Baulig  <martin@ximian.com>
3650
3651         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3652         static constructor in static classes.
3653
3654 2005-03-02  Martin Baulig  <martin@ximian.com>
3655
3656         * generic.cs
3657         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
3658         (Nullable.LiftedConversion): Added support for user-defined
3659         conversions.
3660
3661         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
3662
3663         * cs-parser.jay: Use ComposedCast everywhere instead of
3664         NullableType, so we don't need to check for NullableType
3665         everywhere.
3666         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
3667         case where we'll be resolved into a `parenthesized_expression_0'
3668         afterwards.
3669
3670         * convert.cs
3671         (Convert.UserDefinedConversion): Added nullable conversions.
3672
3673 2005-02-28  Martin Baulig  <martin@ximian.com>
3674
3675         * generic.cs (TypeManager.IsNullableType): New static method.
3676         (Nullable): New abstract class.
3677         (Nullable.NullLiteral): New public class.
3678         (Nullable.LiftedConversion): New public class.
3679
3680         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
3681         `builtin_types opt_nullable'.
3682
3683         * convert.cs
3684         (Convert.ImplicitConversionStandard): Added nullable conversions.
3685         (Convert.ExplicitConversionStandard): Likewise.
3686         (Convert.ExplicitConversion): Likewise.
3687
3688 2005-02-26  Martin Baulig  <martin@ximian.com>
3689
3690         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
3691         begin with a "?", for instance "?[]".  Don't do a type lookup if
3692         `dim' is empty.
3693
3694 2005-02-25  Martin Baulig  <martin@ximian.com>
3695
3696         The first part of Nullable Types :-)
3697
3698         * generic.cs (NullableType): New public class.
3699         (NullCoalescingOperator): New public class.
3700         (TypeArguments.Resolve): Add a CS0306 check.
3701
3702         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
3703         (opt_nullable): New rule.
3704         (type): Added `opt_nullable' to `namespace_or_type_name',
3705         `builtin_types' and `pointer_type'.
3706         (array_type): Added `opt_nullable'.
3707         (opt_rank_specifier_or_nullable): New rule; this is the
3708         combination of `opt_rank_specifier' and `opt_nullable'.
3709         (opt_error): New rule; catch errors here.
3710         (nullable_type_or_conditional): New rule; we use this to check for
3711         nullable and still detect the conditional operator.
3712         (local_variable_type): Use `opt_rank_specifier_or_nullable'
3713         instead `opt_rank_specifier'.
3714
3715         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
3716         for nullables.
3717
3718 2005-02-24  Martin Baulig  <martin@ximian.com>
3719
3720         * README, README.Changes: Removed; they're old and obsolete.
3721
3722 2005-02-22  Martin Baulig  <martin@ximian.com>
3723
3724         * generic.cs (TypeParameter.Resolve): If resolving the constraints
3725         returned an error, set `constraints' to null to avoid a crash
3726         later on.
3727         (TypeParameter.ResolveType): Likewise.
3728
3729 2005-02-22  Martin Baulig  <martin@ximian.com>
3730
3731         * generic.cs
3732         (Constraints.ResolveTypes): Protect against being called twice.
3733         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
3734         (TypeParameter.ResolveType): New public method; calls
3735         constraints.ResolveTypes().
3736         (TypeParameter.DefineType): Moved constraints.ResolveType() out
3737         into the new ResolveType().
3738         (GenericMethod.Define): Call ResolveType() on all our
3739         TypeParameter's.        
3740
3741 2005-02-21  Martin Baulig  <martin@ximian.com>
3742
3743         * generic.cs
3744         (TypeManager.generic_nullable_type): New static public field.
3745         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
3746
3747         * rootcontext.cs
3748         (RootContext.ResolveCore): Resolve "System.Nullable`1".
3749
3750 2005-02-15  Martin Baulig  <martin@ximian.com>
3751
3752         * generic.cs (ConstructedType.Constraints): Correctly check
3753         constraints if the argument type is a type parameter; fixes
3754         #72326. 
3755
3756 2005-02-02  Martin Baulig  <martin@ximian.com>
3757
3758         * delegate.cs (Delegate.DefineType): Report an internal error if
3759         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3760         details.        
3761
3762 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3763
3764         * pending.cs: Produce better code (no nops produced by using Ldarg
3765         + value).
3766         
3767         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3768         i - 1' it should be arg + 1.
3769
3770         Fixes bug #71819.
3771         
3772 2005-01-26  Martin Baulig  <martin@ximian.com>
3773
3774         * cs-parser.jay (indexer_declarator): Don't report an error if we
3775         have type parameters since we can be an explicit interface
3776         implementation; fixes #71449.
3777
3778 2005-01-26  Martin Baulig  <martin@ximian.com>
3779
3780         * class.cs (TypeContainer.AttributeTargets): Return the correct
3781         AttributeTargets depending on our `Kind' instead of throwing an
3782         exception; fixes #71632.
3783
3784 2005-01-26  Martin Baulig  <martin@ximian.com>
3785
3786         * delegate.cs (Delegate.DefineType): Correctly define our type
3787         parameters.  Fixes #71483.
3788
3789 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3790
3791         Fix #71602.
3792         * expression.cs (MemberAccess.DoResolve): Don't complain with
3793         cs0572 when the LHS of a member access has identical name and type
3794         name.
3795
3796 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3797
3798         Fix #71651, #71675
3799         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3800         CreatePermission.
3801         Create custom PermissionSet only for PermissionSetAttribute.
3802
3803 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3804
3805         Fix #71649
3806         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3807         delegates in static class.
3808
3809 2005-01-24  Martin Baulig  <martin@ximian.com>
3810
3811         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3812         merging an implicit block, just use its reachability.
3813
3814         * statement.cs (Block.Resolve): Make the unreachable code check
3815         work wrt. implicit blocks; see test-337 from #63842.
3816
3817 2005-01-21  Alp Toker  <alp@atoker.com>
3818  
3819         * cs-parser.jay: destructor_declaration's container is PartialContainer
3820         not Class when partial types are used, so use Kind prop instead of
3821         'is'.
3822         
3823 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3824
3825         * cs-parser.jay: Improve error reporting when an interface
3826         declares new types.
3827
3828 2005-01-20  Dick Porter  <dick@ximian.com>
3829
3830         * support.cs: SeekableStreamReader fix from Sandor Dobos
3831         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3832         chars are read.  Fixes bug 70369.
3833
3834 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3835
3836         * cs-parser.jay (catch_clause): Simplify current_block handling
3837         somewhat.
3838
3839 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3840
3841         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3842         code with ImplicitStandardConversion to handle the implicit
3843         conversion of method groups into valid delegate invocations. 
3844
3845         The problem is that in parameter handling we were using this code
3846         path.  Fixes bug #64698
3847
3848 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3849
3850         * cs-parser.jay: Fix several infelicities.
3851         - Avoid assigning to the parser value stack.  Code like 
3852           '$3 = null' is unclean.  Synthesize a value for the code block
3853           instead. 
3854         - Avoid using oob_stack for storing location information.  Use ...
3855         (_mark_): ... this.  New (empty) rule.  Saves the current location
3856         in $$.
3857         (foreach_statement): Avoid using oob_stack for current_block
3858         handling.  Use technique used in for_statement and
3859         using_statement.  Synthesize a value for the code block to store
3860         additional intermediate information.
3861
3862 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3863
3864         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3865         of a different type is only allowed to private fields of a
3866         containing type, not on fields of a base class.
3867
3868         See test-174.cs and error cs0122-9.cs
3869
3870 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3871
3872         Fix test-335.cs (bug #58126).
3873         * cs-parser.jay (argument): Split out non-expression parts of the
3874         rule into 'non_simple_argument'.
3875         (invocation_expression): Support parenthesized invocations with
3876         multiple arguments, and with single non-simple arguments.
3877
3878 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3879
3880         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3881         places.
3882
3883 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3884
3885         Fix cs0038-1.cs, cs1640-6.cs.
3886         * ecore.cs (Expression.Resolve): Remove special-case for
3887         SimpleName in error-handling.
3888         (Expression.almostMatchedMembers): Relax access permission to
3889         protected.
3890         (Expression.MemberLookupFailed): Handle duplicates in
3891         almostMatchedMembers list.
3892         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3893         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3894         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3895         overload if the passed in MemberInfo is a MethodBase.
3896
3897 2005-01-25  Martin Baulig  <martin@ximian.com>
3898
3899         * doc.cs
3900         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3901
3902 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3903
3904         Fix #70749
3905         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3906         for non-CAS & merge permission sets properly.
3907
3908 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3909
3910         Improve standard-compliance of simple name and member access 
3911         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3912         * ecore.cs (FullNamedExpression): New abstract base class 
3913         for Namespaces and TypeExpressions.
3914         (ResolveFlags.SimpleName): Remove.
3915         (SimpleName): Remove support for dotted names.
3916         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3917         DeclSpace.FindType and DeclSpace.LookupType.
3918         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3919         (Expression.ExprClassName): Make member function.
3920         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3921         a namespace.  Remove creation of dotted "SimpleName"s.
3922         (MemberAccess.DoResolve): Likewise.
3923         * decl.cs (DeclSpace.Cache): Make private.
3924         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3925         (DeclSpace.FindType): Update.
3926         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3927         FullNamedExpression.
3928         * namespace.cs (Namespace): Derive from FullNamedExpression
3929         so that it can be part of expression resolution.
3930         (Namespace.Lookup): Return an FullNamedExpression.
3931         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3932         namespace.
3933         * rootcontext.cs (NamespaceLookup): Remove.
3934         (LookupType): Move to DeclSpace.
3935         * attribute.cs (CheckAttributeType): Update.
3936         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3937         (FindDocumentedTypeNonArray): Likewise.
3938
3939 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3940
3941         Fix cs0509.cs, cs1632.cs.
3942         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3943         is the same as IsInterface.
3944         (TypeContainer.GetClassBases): Likewise.
3945         * statement.cs (LabeledStatement.ig): New field.
3946         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3947         label.
3948         (LabeledStatement.DoEmit): Check that the label was created with
3949         the same ILGenerator.
3950
3951 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3952
3953         Fix #71058
3954         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3955         accessors to its properties.
3956
3957         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3958         from accessors to property.
3959         
3960 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3961
3962         Fix #70722
3963         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3964         only for overrides.
3965         
3966 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3967
3968         * attribute.cs: Check for null and empty strings.  
3969
3970         I have lost another battle to Paolo.
3971
3972 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3973
3974         Fix #70942
3975         * class.cs (PropertyMethod): Set Parent field in ctors.
3976         (SetMethod.InternalParameters): Add unsafe switch hack.
3977         Override MarkForDuplicationCheck where it is appropriate.
3978
3979         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3980         It says whether container allows members with the same name.
3981         Base default is no.
3982         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3983         Removed is_method parameter.
3984
3985 2005-01-06  Duncan Mak  <duncan@ximian.com>
3986
3987         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3988         because the previous change led to incorrect reporting of CS1032
3989         ("Cannot define/undefine preprocessor symbols after first token in
3990         file"). Instead of using `tokens_seen' as the only flag that
3991         triggers CS1040, introduce `comments_seen'. This new flag is used
3992         to signify having seen comments on the current line, so it is
3993         unset after a newline.
3994
3995 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3996
3997         * doc.cs : When searching for a type, find nested type too.
3998           This fixes bug #71040.
3999
4000 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4001
4002         * doc.cs :
4003           - Warn missing member comment on those classes which also does not
4004             have doc comments. Fixed bug #71041.
4005           - Don't warn missing doc comment on default constructor.
4006             Fixed bug #71042.
4007
4008 2005-01-06  Duncan Mak  <duncan@ximian.com>
4009
4010         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4011         comments, set `tokens_seen' to true. This allows us to detect
4012         misplaced preprocessor directives (i.e. not at the beginning of
4013         the a line, nor after whitespaces). In that case, report error
4014         CS1040. This fixes bug #56460.
4015
4016         * cs-parser.jay (interface_member_declaration): Add checks for
4017         IsExplicitImpl, and report CS0541 error if an interface member is
4018         defined as an explicit interface declaration.
4019
4020 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4021
4022         Fix #70817
4023         * class.cs (PropertyMethod): Set Parent field in ctors.
4024         (SetMethod.InternalParameters): Add unsafe switch hack.
4025         
4026         * decl.cs (MemberCore.Parent): Cannot be readonly.
4027
4028 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4029
4030         * decl.cs (DeclSpace.ResolveType): Remove.
4031         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4032         Merge in code from ...
4033         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4034         * class.cs, enum.cs: Update to changes.
4035
4036 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4037
4038         * anonymous.cs: Ensure that we init the scope of our parent if it
4039         has not been initialized yet.
4040
4041 2004-12-30  Duncan Mak  <duncan@ximian.com>
4042
4043         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
4044         if field.FieldBuilder is null. Fixes #70758.
4045
4046         * convert.cs: Fixed some typos and updated some of the comments.
4047         (ImplicitStandardConversionExists):
4048         (TryImplicitIntConversion): If `target_type' is an interface and
4049         the type of `ic' implements this interface, return true or a new
4050         BoxedCast instead of null. This fixes #70468.
4051
4052 2004-12-29  Duncan Mak  <duncan@ximian.com>
4053
4054         * expression.cs (Argument.Emit): Check that Expr is
4055         IMemoryLocation before casting to it, and report CS1510 otherwise.
4056
4057         This fixes #70402.
4058
4059 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
4060
4061         * statement.cs (Block.ThisVariable): remove the recursion here, to
4062         make the --profile more sane.
4063
4064 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
4065
4066         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
4067         assembly, by JB Evain.
4068
4069 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4070
4071         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
4072           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
4073         "parent" refers to enclosing type/class.  "base" refers to superclass.
4074
4075 2004-12-17  Raja R Harinath  <rharinath@novell.com>
4076
4077         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4078         Ensure that we only have GlobalAttributes.
4079         * attribute.cs (Attribute.Emit): Make non-virtual.
4080         (GlobalAttribute.Emit): Remove.
4081         (Attribute.Resolve): Make virtual.
4082         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
4083         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
4084         the argument. Don't create one.
4085         (Attribute.GetObsoleteAttribute): Likewise.
4086         (Attribute.GetClsCompliantAttributeValue): Likewise.
4087         * class.cs, decl.cs: Update to changes.
4088
4089 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
4090
4091         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
4092         
4093         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
4094         
4095         * statement.cs (Foreach.Resolve): Add error 186 report.
4096
4097 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
4098
4099         * expression.cs (Conditional.DoResolve): Add warning 429.
4100         
4101         * statement.cs (If.Resolve): Add warning 665.
4102
4103 2004-12-16  Raja R Harinath  <rharinath@novell.com>
4104
4105         New invariant: RootContext.Tree.Types.NamespaceEntry == null
4106         except when in the parser, and in GlobalAttribute.
4107         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
4108         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
4109         RootContext.Tree.Types.NamespaceEntry once work is done.
4110         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
4111         and resets RootContext.Tree.Types.NamespaceEntry.
4112
4113 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
4114
4115         * cs-parser.jay: Don't create a block for every variable.
4116
4117 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
4118
4119         * location.cs: Provide extra information.
4120
4121         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
4122         variables from the captured environment, it is the ldarg_0.
4123
4124 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4125
4126         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
4127         find a conclusion.
4128         
4129         * class.cs: Changed warning level for 169 to avoid developer
4130         displeasure from warning flooding. It will be changed back when they
4131         fix most of current BCL warnings.
4132         
4133         * RootContext.cs: Pushed default WarningLevel to 3.
4134         
4135         * statement.cs: Removed unused variable.
4136
4137 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
4140         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4141         Add error 502 report.
4142         (StaticClass.DefineType): Add error 441 report.
4143         (Class.AllowedModifiersProp): New virtual property as temporary
4144         extension to AllowedModifiers.
4145         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4146         to share implementation with StaticClass and don't call virtual
4147         methods from ctor.
4148         
4149         * driver.cs (MainDriver): Add error 1558 test.
4150
4151         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4152         report. Moved error 36 test here.
4153
4154         * statement.cs (Throw.Resolve): Add error 724 report.
4155
4156         * typemanager.cs: Add out_attribute_type core type.
4157         
4158 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4159
4160         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4161         3018 report.
4162         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4163
4164         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4165         3017 report.
4166         
4167         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4168
4169         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4170         Add error 3023 report.
4171         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4172
4173         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4174         implementation.
4175
4176 2004-12-12  John Luke  <john.luke@gmail.com>
4177
4178         * driver.cs (AddArgs): take -- into account when
4179         adding arguments, fixes bug 65710 
4180
4181 2004-12-12  Martin Baulig  <martin@ximian.com>
4182
4183         * expression.cs (Unary.TryReduceNegative): Added support for
4184         SByteConstant and ByteConstant.
4185         (Unary.Reduce): Check error values from TryReduceNegative().
4186
4187 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4188
4189         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4190         and report exception as error 182.
4191
4192 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4193
4194         * driver.cs (Main): Fix message when there are warnings.
4195
4196 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4197
4198         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4199
4200 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4201
4202         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4203         Reduced number of warnings.
4204         
4205         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4206
4207 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4208
4209         * driver.cs: Removed message.
4210
4211         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4212
4213 2004-12-08    <vargaz@freemail.hu>
4214
4215         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4216
4217 2004-12-08  Martin Baulig  <martin@ximian.com>
4218
4219         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4220         instead of a CS3002 for properties and indexer.
4221
4222 2004-12-08  Martin Baulig  <martin@ximian.com>
4223
4224         * decl.cs (MemberName.ToString): Make this work again.
4225
4226 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4227
4228         * attribute.cs (Resolve): Add error 591 detection.
4229
4230         * class.cs (FieldMember.Define): Add error 1547 detection.
4231         (Indexer.Define): Add error 620 detection.
4232         (Operator.Define): Add error 590 detection.
4233
4234         * ecore.cs: Missing argument for error 79.
4235
4236         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4237         detection.
4238
4239 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4240
4241         Fix #70106
4242         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4243         only.
4244
4245 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4246
4247         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4248           Some operator comments were suppressed.
4249         * doc.cs : Implicit/explicit operator name in doc comments are like
4250           "op_Explicit(type)~returnType", so added suffix handling.
4251
4252 2005-01-21  Alp Toker  <alp@atoker.com>
4253
4254         * cs-parser.jay: destructor_declaration's container is PartialContainer
4255         not Class when partial types are used, so use Kind prop instead of 'is'.
4256
4257 2004-12-12  Martin Baulig  <martin@ximian.com>
4258
4259         * expression.cs (Unary.TryReduceNegative): Added support for
4260         SByteConstant and ByteConstant.
4261         (Unary.Reduce): Check error values from TryReduceNegative().
4262
4263 2004-12-11  Martin Baulig  <martin@ximian.com>
4264
4265         * support.cs (ReflectionParameters.ParameterName): If we have a
4266         `gpd', call `ParameterName' on it.
4267
4268         * parameter.cs (Parameter.GetParameterAttributes): New static method.
4269
4270         * pending.cs (PendingImplementation.DefineProxy): Call
4271         DefineParameter() for all of the MethodBuilder's arguments.
4272
4273 2004-12-09  Martin Baulig  <martin@ximian.com>
4274
4275         * doc.cs (DocUtil): Make this a static class.
4276
4277 2004-12-09  Martin Baulig  <martin@ximian.com>
4278
4279         * expression.cs (Invocation.InferType): Moved the type inference
4280         implementation into TypeManager.
4281
4282         * generics.cs (TypeManager): Moved the type inference
4283         implementation here.
4284
4285 2004-12-09  Martin Baulig  <martin@ximian.com>
4286
4287         * typemanager.cs (TypeManager): Make this a partial class.
4288
4289         * generics.cs
4290         (TypeManager): Move the generics part of `TypeManager' here.
4291
4292 2004-12-08  Martin Baulig  <martin@ximian.com>
4293
4294         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4295         instead of a CS3002 for properties and indexer.  Added CS3024
4296         check for generic interfaces.
4297
4298         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
4299         instances are not CLS-compliant.
4300
4301 2004-12-08  Martin Baulig  <martin@ximian.com>
4302
4303         * cs-parser.jay
4304         (void_pointer_expression): New rule for `void*', `void**' etc.
4305         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
4306
4307 2004-12-08  Martin Baulig  <martin@ximian.com>
4308
4309         * expression.cs (Invocation.InferType): Removed the hack for
4310         MethodCore.MayUnify().  
4311
4312         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4313         this actually work.
4314
4315         * class.cs (MethodCore.MayUnify): Use
4316         TypeManager.MayBecomeEqualGenericTypes().       
4317
4318 2004-12-08  Martin Baulig  <martin@ximian.com>
4319
4320         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
4321         parameter, box it.  Fixes #69233.
4322
4323 2004-12-08  Martin Baulig  <martin@ximian.com>
4324
4325         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
4326         have the ctor constraint.  Fixes #68326.
4327
4328 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4329
4330         * cs-parser.jay : interface comment was not consumed because of
4331           extra opt_semicolon before doc handling.
4332
4333 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4334
4335         Fix test-327.cs, test-328.cs, and put in early infrastructure
4336         for eventually fixing #52697.
4337         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4338         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4339         from other methods.
4340         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4341         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4342         (VerifyUsing, error246): Update.
4343         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4344         'NamespaceEntry.LookupNamespaceOrType'.
4345
4346 2004-12-07  Martin Baulig  <martin@ximian.com>
4347
4348         * driver.cs: Call it "BETA SOFTWARE" :-)
4349
4350 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4351
4352         Fix crash on cs0657-17.cs.
4353         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4354         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4355         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4356         the case where the NamespaceEntry gets overwritten.
4357
4358 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4359
4360         Fixed #69195, #56821
4361         * ecore.cs (ResolveBoolean): Tiny refactoring.
4362
4363         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4364         of right expression resolving when left is false constant and
4365         operator is LogicalAnd OR true constant and operator is LogicalOr.
4366
4367         * statement.cs (ResolveUnreachable): Always reports warning.
4368
4369 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4370
4371         * class.cs: Distinguish between 1721 and 1722 (just a little help
4372         for the programmer).
4373
4374 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4375
4376         * delegate.cs: Only allow this on new versions of the language. 
4377
4378 2004-12-02  Duncan Mak  <duncan@ximian.com>
4379
4380         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4381         Expression class.
4382         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4383         here as a static method. Take an additional bool out parameter
4384         `must_do_cs1540_check' for signaling to InstanceResolve.
4385         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4386         member field from PropertyExpr class and made it an argument of
4387         the method instead.
4388         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4389         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4390         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4391         and `remove_accessor' as well as InstanceResolve: report CS0122
4392         where applicable.
4393
4394         Fixes #70129.
4395
4396 2004-12-07  Martin Baulig  <martin@ximian.com>
4397
4398         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
4399         and CS0692 where appropriate.
4400
4401 2004-12-06  Martin Baulig  <martin@ximian.com>
4402
4403         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
4404         IsDuplicateImplementation() and improved it.
4405
4406         * expression.cs (Invocation.InferTypeArguments): Added
4407         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
4408         and removed the "ref" modifier from `infered_types'.
4409
4410         * decl.cs (MemberName.ToString): Removed the exception.
4411
4412 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4413
4414         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4415           comments are allowed.
4416
4417 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4418
4419         * delegate.cs: Add checks for subtypes in paramaters and return values
4420         in VerifyMethod () to add support for Covariance/Contravariance
4421         in delegates.
4422         
4423 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4424
4425         * report.cs: Remove extra closing parenthesis.
4426
4427         * convert.cs (Error_CannotImplicitConversion): If the name of the
4428         types are the same, provide some extra information.
4429
4430 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4431
4432         Fix bug #70102
4433         * attribute.cs (Resolve): Improved implementation of params
4434         attribute arguments.
4435
4436         * support.cs (ParameterData): Add HasParams to be faster.
4437
4438 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4439
4440         all things are for /doc support:
4441
4442         * doc.cs: new file that supports XML documentation generation.
4443         * mcs.exe.sources: added doc.cs.
4444         * driver.cs:
4445           Handle /doc command line option.
4446           Report error 2006 instead of 5 for missing file name for /doc.
4447           Generate XML documentation when required, after type resolution.
4448         * cs-tokenizer.cs:
4449           Added support for picking up documentation (/// and /** ... */),
4450           including a new XmlCommentState enumeration.
4451         * cs-parser.jay:
4452           Added lines to fill Documentation element for field, constant,
4453           property, indexer, method, constructor, destructor, operator, event
4454           and class, struct, interface, delegate, enum.
4455           Added lines to warn incorrect comment.
4456         * rootcontext.cs :
4457           Added Documentation field (passed only when /doc was specified).
4458         * decl.cs:
4459           Added DocComment, DocCommentHeader, GenerateDocComment() and
4460           OnGenerateDocComment() and some supporting private members for
4461           /doc feature to MemberCore.
4462         * class.cs:
4463           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4464         * delegate.cs:
4465           Added overriden DocCommentHeader.
4466         * enum.cs:
4467           Added overriden DocCommentHeader and GenerateDocComment().
4468
4469 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4470
4471         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4472         unwrapping the enumeration values, chain to
4473         DoConstantNumericPromotions again, so we can promote things to the
4474         fundamental types (takes care of enums that are bytes, sbytes).
4475
4476         Fixes bug #62054.
4477
4478 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4479
4480         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4481         Fix long-standing bug in type-lookup.  Use FindType instead of
4482         LookupType when ec.ResolvingTypeTree.
4483         (Attribute.ResolveType, Attribute.Resolve)
4484         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4485         Update to changes.
4486         (Attributes.Search): Remove internal version.  Update.
4487         (Attributes.SearchMulti): Update.
4488         (Attributes.GetClsCompliantAttribute): Remove.
4489         (Attributes.GetIndexerNameAttribute): Remove.
4490         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4491         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4492         * class.cs (Indexer.Define): Likewise.
4493
4494 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4495
4496         Fix bug #68790
4497         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4498         MarshallByReference members access.
4499
4500         * expression.cs: Use CheckMarshallByRefAccess;
4501         Better error CS0197 message.
4502
4503         * report.cs: Print whole related error message.
4504
4505 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4506
4507         * class (GetClassBases): Better error 60 report.
4508         (EventProperty): Disabled warning 67 detection.
4509
4510 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4511
4512         Fix bug #60324
4513         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4514
4515         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4516         precise values.
4517
4518 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4519
4520         Fix bug #49488
4521         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4522
4523         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4524
4525 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4526
4527         * attribute.cs (Attribute.Resolve): Refine error reporting and
4528         report a cs0117 if the identifier does not exist, to distinguish
4529         from 0617 which is a miss-use of the actual identifier.
4530
4531         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4532         between cs0070 and cs0079.
4533
4534         * class.cs (MemberBase.DoDefine): When reporting a wrong
4535         accessibility level, we use MethodCore to compare instead of
4536         Method (this was a regression in some refactoring effort).
4537
4538         So now we correctly report cs0056 again.
4539
4540         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4541         testing the target_type (which was known to be object_type) and
4542         not the source type (which is anonymous_method).
4543
4544         Fixed reporting of error cs1660.
4545
4546         * expression.cs (UserCast.Source): Expose the underlying cast.
4547
4548         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4549         allowed types to find a match to int32 first (most common).
4550
4551         In addition, it ignores any ImplicitUserConversions that did an
4552         internal implicit conversion (as the switch statement allows only
4553         one integral conversion to exist).
4554
4555         * class.cs (PartialContainer.Create): rename `name' to
4556         `member_name' for clarity.  Then replace the string calls with a
4557         call to MemberName.GetPartialName, as now using
4558         MemberName.ToString is an error (this is due to the side effects
4559         it had, that were fixed in the past).
4560
4561         This will restore the error reporting on a number of partial class
4562         errors that were missusing this (and getting an exception as a
4563         results, which is now just a plain textual warning, because
4564         yyparse debug output would crash otherwise).
4565
4566 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4567
4568         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4569
4570 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4571
4572         * rootcontext.cs (LookupType): Make sure to cache lookups that
4573         don't give us a negative result. This saves about 5% of corlib
4574         compilation time.
4575
4576 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4577
4578         * report.cs (AbstractMessage.Print): messages are sent to stderr
4579
4580         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4581         non-interface in the list of interfaces (at this point, either
4582         parent was properly set, or a base class is being listed in the
4583         interfaces section).
4584
4585         This flags error 1722, and resolves the crash from bug 69259.
4586
4587 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4588
4589         * statement.cs (Using.EmitExpressionFinally): make this work right
4590         for valuetypes. Fixes 69926.
4591
4592 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4593
4594         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4595         converted to an enum" here, before we try to change the underlying
4596         type.  This code exists, but it is a different code path than the
4597         one used while encoding constants.
4598
4599         (ImplicitReferenceConversionExists): In addition, resynchronized
4600         the code here, so it matches the same code in
4601         ImplicitReferenceConversionExists for the `from any class-type S
4602         to any interface-type T'.       
4603
4604 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4605
4606         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4607
4608 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4609
4610         * cs-parser.jay: Use verbosity accordingly. 
4611
4612 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4613
4614         * expression.cs (Unary.ResolveOperator): Do not report warning;
4615         AddressOf reads from variable.
4616         
4617         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4618
4619 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4620
4621         Fix bug #69462
4622
4623         * attribute.cs (Attributable): Removed CheckTargets.
4624         (Attributes.Emit): Explicit attribute targets are tested here.
4625
4626         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4627         not enabled for interfaces.
4628
4629         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4630         (GetAssemblyName): Ouch next bug there.
4631
4632 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4633
4634         * expression.cs: Error 275 added.
4635         
4636 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4637
4638         Fix bug #69177 (Implemented decimal constant support)
4639
4640         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4641         (BinaryFold): Add DecimalConstant.
4642
4643         * const.cs (Define): Decimal constant 
4644         (is not constant.
4645         (ChangeType): Add decimal type handling.
4646         (LookupConstantValue): Don't set value for decimal type but
4647         emit DecimalConstantAttribute. Needed for constant optimization.
4648
4649         * constant.cs (ToDecimal): New method.
4650         (ConvertToDecimal): New method.
4651         (IntConstant): Implemented ConvertToDecimal.
4652         (DecimalConstant.Emit): Emit optimized version for decimals in
4653         int range.
4654
4655         * expression.cs (ResolveOperator): Changed order of constant
4656         reduction to work correctly with native types which have
4657         overloaded operators.
4658         (ResolveMemberAccess): Extract constant value from attribute
4659         for decimal type.
4660
4661         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4662
4663         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4664         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4665         (ChangeType): Decimal is special.
4666         (TypeToCoreType): Add decimal type.
4667
4668 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4669
4670         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4671         decimal types.
4672
4673 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4674
4675         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4676         test cs1667-5.cs.
4677
4678 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4679
4680         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4681
4682         * pending.cs (PendingImplementation): Grab only interfaces.
4683
4684 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4685
4686         * statement.cs (ForeachHelperMethods): Add location member and
4687         error 202 detection.
4688
4689 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4690
4691         * expression.cs (DoResolveBase): Fixed wrong warning for out
4692         variables.
4693
4694 2004-12-04  Martin Baulig  <martin@ximian.com>
4695
4696         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
4697         to check whether the conversion is ok.
4698
4699         * typemanager.cs (TypeManager.GetTypeArguments): Just return
4700         `Type.EmptyTypes' if we're not a generic TypeContainer.
4701
4702 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4703
4704         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4705         old bug: when converting from the null literal to a pointer,
4706         return an EmptyCast, not the NullLiteral.
4707
4708         This fixes #69921, the recent null_type changes probably made this
4709         bug more prominent.
4710
4711 2004-12-03  Martin Baulig  <martin@ximian.com>
4712
4713         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4714         method as our child, call AnonymousMethod.Compatible() on it.
4715
4716 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4717
4718         * class.cs (FieldBase): Use an unused bit field from the field to
4719         encode the `has_offset' property from the FieldMember.  This saves
4720         a couple of Ks on bootstrap compilation.
4721
4722         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4723         method as our child, return the AnonymousMethod resolved
4724         expression.
4725
4726         * expression.cs (New.DoResolve): Allow return values from
4727         NewDelegate to also include AnonymousMethods.
4728
4729         Fixes #70150.
4730
4731 2004-11-29  Raja R Harinath  <rharinath@novell.com>
4732
4733         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
4734         cs1648 report.
4735         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
4736         System.Runtime.InteropServices._Exception, since it's a base
4737         interface of the core type System.Exception in the net_2_0 profile.
4738
4739 2004-11-27  Martin Baulig  <martin@ximian.com>
4740
4741         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
4742
4743 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4744
4745         * Makefile: Convert to use executable.make.
4746         * gmcs.exe.sources: New.
4747
4748 2004-11-25  Martin Baulig  <martin@ximian.com>
4749
4750         * expression.cs (Invocation.InferType): Added support for byref types.
4751
4752 2004-11-25  Martin Baulig  <martin@ximian.com>
4753
4754         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
4755         in TypeManager.TypeToCoreType().
4756
4757 2004-11-25  Martin Baulig  <martin@ximian.com>
4758
4759         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
4760         "Dispose" method from the `current_type'.
4761         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
4762         DoDefineMembers() instead of using the MethodBuilder; this is
4763         required for generic iterators.
4764
4765         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
4766
4767 2004-11-24  Martin Baulig  <martin@ximian.com>
4768
4769         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
4770
4771 2004-11-20  Martin Baulig  <martin@ximian.com>
4772
4773         * expression.cs (Invocation.InferType): Correctly infer generic
4774         instances; see gen-103.cs.
4775         (Invocation.InferTypeArguments): If a generic method doesn't have
4776         any unbound type parameters, we don't need to infer anything.
4777
4778 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4779
4780         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
4781
4782 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4783
4784         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4785         (TypeHandle.GetMemberCache): New.
4786         (TypeHandle.TypeHandle): Update.
4787         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4788         (TypeManager.LookupParentInterfacesCache):
4789         Rename from LookupInterfaceCache.  Optimize slightly.
4790         (TypeManager.MemberLookup_FindMembers): Update.
4791         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4792         multi-type variant.
4793         (AddCacheContents): Rename from AddHashtable.
4794         * class.cs (TypeContainer.parent_container): Remove.
4795         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4796         (TypeContainer.DoDefineMembers): Don't initialize it.
4797         Update to name changes.
4798         
4799 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4800
4801         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4802         that factors the code to check access modifiers on override.  
4803
4804         (PropertyBase): Use the code here.
4805
4806         Patch from Lluis S'anchez, fixes bug #69361.
4807
4808 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4809
4810         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4811         routine that is used to report the use of a captured variable
4812         whose address has been taken.
4813
4814         There are two checks: one when variables are being captured and
4815         the other check is when the address of a variable is taken. 
4816         
4817         (because an anonymous methods might be resolved before *or* after
4818         the address has been taken) and 
4819
4820         * expression.cs (Conditional.DoResolve): Remove the special
4821         casing that Martin added to trueExpr and falseExpr being both
4822         NullLiteral.  We get the right behavior now just by introducing
4823         the null_type into the compiler. 
4824
4825         * convert.cs (ExplicitConversion): Change the code to use
4826         null_type instead of testing `expr is NullLiteral'.
4827         (ImplicitConversionStandard): use null_type too.
4828         (ImplicitReferenceConversionExists): use null_type too.
4829         (ImplicitReferenceConversion): use null_type too.
4830
4831         * literal.cs: The type of `NullLiteral' is now null_type instead
4832         of object_type. 
4833         (Resolve): Set the type here.
4834
4835         * typemanager.cs: Introduce null_type.
4836
4837 2004-11-18  Martin Baulig  <martin@ximian.com>
4838
4839         * rootcontext.cs
4840         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
4841
4842 2004-11-18  Martin Baulig  <martin@ximian.com>
4843
4844         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
4845
4846 2004-11-18  Martin Baulig  <martin@ximian.com>
4847
4848         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
4849         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
4850         call ResolveConstructedType() on it to resolve it without checking
4851         constraints.
4852         (Constraints.ResolveTypes): Check them here.
4853         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
4854         but don't check constraints.
4855         (ConstructedType.ResolveAsTypeTerminal): Override this and also
4856         check constraints here.
4857         (ConstructedType.ResolveConstructedType): New public method.  This
4858         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
4859         resolve ourselves without checking constraints.
4860
4861         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
4862
4863 2004-11-18  Martin Baulig  <martin@ximian.com>
4864
4865         * decl.cs
4866         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
4867
4868         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
4869
4870 2004-11-18  Martin Baulig  <martin@ximian.com>
4871
4872         * ecore.cs (TypeExpr.ResolveType): Removed.
4873         (Expression.ResolveAsTypeTerminal): We always return a fully
4874         resolved `TypeExpr', so we can just access its `Type'.
4875
4876         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
4877
4878 2004-11-17  Martin Baulig  <martin@ximian.com>
4879
4880         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
4881         sure we don't return any unresolved TypeExpr's.
4882         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
4883         a `TypeExpr'.
4884         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
4885
4886         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
4887         unresolved `ConstructedType's.
4888
4889 2004-11-17  Martin Baulig  <martin@ximian.com>
4890
4891         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4892
4893 2004-11-17  Martin Baulig  <martin@ximian.com>
4894
4895         * ecore.cs
4896         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4897
4898         * decl.cs (DeclSpace.ResolveType): Removed.
4899         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4900
4901 2004-11-17  Martin Baulig  <martin@ximian.com>
4902
4903         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4904         direction, like FindMembers() does.  Fixes #69546, testcase is in
4905         test-315.cs.    
4906
4907 2004-11-16  Martin Baulig  <martin@ximian.com>
4908
4909         This is based on a patch from Marek Safar, see bug #69082.
4910         Fixes bugs #63705 and #67130.
4911
4912         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4913         method; create a MemberCache for an interface type and cache the
4914         result.
4915
4916         * decl.cs (IMemberContainer.ParentContainer): Removed.
4917         (IMemberContainer.ParentCache): New property.
4918         (MemberCache.SetupCacheForInterface): Removed.
4919         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4920         to create a cache for an interface's "parent".
4921
4922         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4923         interfaces too.
4924
4925 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4926
4927         * statement.cs: Avoid adding bools to a hashtable.
4928
4929 2004-11-15  Martin Baulig  <martin@ximian.com>
4930
4931         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4932
4933 2004-11-11  Martin Baulig  <martin@ximian.com>
4934
4935         * typemanager.cs (TypeManager.GetMethodName): New method.
4936
4937         * class.cs (MethodData.Define): Include the generic arity in the
4938         name of an explicit interface; also add it to the method name.
4939
4940         * pending.cs (PendingImplementation.InterfaceMethod): The method
4941         name now includes the generic arity.
4942
4943 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4944
4945         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4946         calling an unsafe method from a safe location.
4947
4948 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4949
4950         Fix #69167
4951         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4952
4953 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4954
4955         * namespace.cs (VerifyUsing): use GetPartialName instead of
4956         ToString. 
4957
4958 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4959
4960         * statement.cs (Return.Resolve): Fix regression in typo: if
4961         `in_exc', we have to request a NeedReturnLabel, this was a typo
4962         introduced in the anonymous method check-in.  Fixes #69131.
4963
4964         * Indexers were using the ShortName when defining themselves,
4965         causing a regression in the compiler bootstrap when applying the
4966         patch from 2004-11-02 (first part), now they use their full name
4967         and the bug is gone.
4968
4969 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4970
4971         * driver.cs: Strip the path from the names of embedded resources. Fixes
4972         #68519.
4973
4974 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4975
4976         Fix error message regression: cs0104-2.cs.
4977         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4978         (AliasEntry.Resolve): Update.
4979         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4980         'silent' flag.
4981         (RootContext.LookupType): Update.
4982
4983 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4984
4985         * cs-parser.jay: Add support for handling accessor modifiers
4986         * class: Add support port accessor modifiers and error checking,
4987         define PropertyMethod.Define as virtual (not abstract anymore)
4988         * ecore.cs: Add checking for proeprties access with access modifiers
4989         * iterators.cs: Modify Accessor constructor call based in the modified
4990         constructor
4991 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4992
4993         * expression.cs (StringConcat): Handle being called twice,
4994         as when we have a concat in a field init with more than two
4995         ctors in the class
4996
4997 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4998
4999         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5000         special case explicit implementations, we should always produce
5001         the .property or .event declaration.
5002         
5003         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5004         since it will not return correct data if people use this
5005         unresolved in the presence of using statements (see test-313).
5006
5007         * class.cs (MethodData.Define): If we are an explicit interface
5008         implementation, set the method name to the full name of the
5009         interface plus the name of the method.  
5010
5011         Notice that using the method.MethodName.GetFullName() does not
5012         work, as it will only contain the name as declared on the source
5013         file (it can be a shorthand in the presence of using statements)
5014         and not the fully qualifed type name, for example:
5015
5016         using System;
5017
5018         class D : ICloneable {
5019                 object ICloneable.Clone ()  {
5020                 }
5021         }
5022
5023         Would produce a method called `ICloneable.Clone' instead of
5024         `System.ICloneable.Clone'.
5025
5026         * namespace.cs (Alias.Resolve): Use GetPartialName.
5027         
5028 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5029
5030         * cs-parser.jay: Add error 1055 report.
5031
5032 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5033
5034         * assign.cs (Assign.DoResolve): Only do the transform of
5035         assignment into a New if the types are compatible, if not, fall
5036         through and let the implicit code deal with the errors and with
5037         the necessary conversions. 
5038
5039 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5040
5041         * cs-parser.jay: Add error 1031 report.
5042
5043         * cs-tokenizer.cs: Add location for error 1038.
5044
5045 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5046
5047         * cs-parser.jay: Add error 1016 report.
5048
5049 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * cs-parser.jay: Add errors 1575,1611 report.
5052
5053 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * cs-parser.jay: Add error 1001 report.
5056
5057 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5058
5059         Fix #68850
5060         * attribute.cs (GetMarshal): Add method argument for
5061         caller identification.
5062
5063         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5064         agument for GetMarshal and RuntimeMissingSupport.
5065
5066 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5067
5068         * attribute.cs (ExtractSecurityPermissionSet): Removed
5069         TypeManager.code_access_permission_type.
5070
5071         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5072
5073 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5074
5075         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5076         for obsolete use of a variable here.   Fixes regression on errors
5077         cs0619-25 and cs0619-26.
5078
5079 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5080
5081         Fix #62358, implemented security attribute encoding.
5082
5083         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5084         Tests permitted SecurityAction for assembly or other types.
5085         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5086         data from SecurityPermissionAttribute to PermisionSet class.
5087
5088         * class.cs (ApplyAttributeBuilder): Added special handling
5089         for System.Security.Permissions.SecurityAttribute based types.
5090
5091         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5092         special handling for System.Security.Permissions.SecurityAttribute
5093         based types.
5094
5095         * enum.cs (ApplyAttributeBuilder): Added special handling
5096         for System.Security.Permissions.SecurityAttribute based types.
5097
5098         * parameter.cs (ApplyAttributeBuilder): Added special handling
5099         for System.Security.Permissions.SecurityAttribute based types.
5100
5101         * rootcontext.cs: Next 2 core types.
5102
5103         * typemanager.cs (TypeManager.security_permission_attr_type):
5104         Built in type for the SecurityPermission Attribute.
5105         (code_access_permission_type): Build in type.
5106
5107 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5108
5109         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5110         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5111         all of this information into
5112         EmitContext.EmitCapturedVariableInstance.
5113         
5114         * codegen.cs (EmitCapturedVariableInstance): move here the
5115         funcionality of emitting an ldarg.0 in the presence of a
5116         remapping.   This centralizes the instance emit code.
5117
5118         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5119         then emit a load of this: it means that we have reached the
5120         topmost ScopeInfo: the one that contains the pointer to the
5121         instance of the class hosting the anonymous method.
5122
5123         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5124         captures to the topmost CaptureContext.
5125
5126 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5127
5128         * expression.cs (LocalVariableReference): Move the knowledge about
5129         the iterators into codegen's EmitCapturedVariableInstance.
5130
5131 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5132
5133         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5134         all code paths return a value from an anonymous method (it is the
5135         same as the 161 error, but for anonymous methods).
5136
5137 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5138
5139         The introduction of anonymous methods in the compiler changed
5140         various ways of doing things in the compiler.  The most
5141         significant one is the hard split between the resolution phase
5142         and the emission phases of the compiler.
5143
5144         For instance, routines that referenced local variables no
5145         longer can safely create temporary variables during the
5146         resolution phase: they must do so from the emission phase,
5147         since the variable might have been "captured", hence access to
5148         it can not be done with the local-variable operations from the runtime.
5149         
5150         * statement.cs 
5151
5152         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5153         is a toplevel block.
5154
5155         (ToplevelBlock): A new kind of Block, these are the blocks that
5156         are created by the parser for all toplevel method bodies.  These
5157         include methods, accessors and anonymous methods.
5158
5159         These contain some extra information not found in regular blocks:
5160         A pointer to an optional CaptureContext (for tracking captured
5161         local variables and parameters).  A pointer to the parent
5162         ToplevelBlock.
5163         
5164         (Return.Resolve): Catch missmatches when returning a value from an
5165         anonymous method (error 1662).
5166         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5167         phase.
5168
5169         (Break.Resolve): ditto.
5170
5171         (SwitchLabel): instead of defining the labels during the
5172         resolution phase, we now turned the public ILLabel and ILLabelCode
5173         labels into methods called GetILLabelCode() and GetILLabel() that
5174         only define the label during the Emit phase.
5175
5176         (GotoCase): Track the SwitchLabel instead of the computed label
5177         (its contained therein).  Emit the code by using
5178         SwitchLabel.GetILLabelCode ().
5179
5180         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5181         whether the Local has been captured or not.
5182
5183         (LocalInfo.IsCaptured): New property, used to tell whether the
5184         local has been captured.
5185         
5186         * anonymous.cs: Vastly updated to contain the anonymous method
5187         support.
5188
5189         The main classes here are: CaptureContext which tracks any
5190         captured information for a toplevel block and ScopeInfo used to
5191         track the activation frames for various local variables.   
5192
5193         Each toplevel block has an optional capture context associated
5194         with it.  When a method contains an anonymous method both the
5195         toplevel method and the anonymous method will create a capture
5196         context.   When variables or parameters are captured, they are
5197         recorded on the CaptureContext that owns them, for example:
5198
5199         void Demo () {
5200              int a;
5201              MyDelegate d = delegate {
5202                  a = 1;
5203              }
5204         }
5205
5206         Here `a' will be recorded as captured on the toplevel
5207         CapturedContext, the inner captured context will not have anything
5208         (it will only have data if local variables or parameters from it
5209         are captured in a nested anonymous method.
5210
5211         The ScopeInfo is used to track the activation frames for local
5212         variables, for example:
5213
5214         for (int i = 0; i < 10; i++)
5215                 for (int j = 0; j < 10; j++){
5216                    MyDelegate d = delegate {
5217                         call (i, j);
5218                    }
5219                 }
5220
5221         At runtime this captures a single captured variable `i', but it
5222         captures 10 different versions of the variable `j'.  The variable
5223         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
5224         recorded on a child.  
5225
5226         The toplevel ScopeInfo will also track information like the `this'
5227         pointer if instance variables were referenced (this is necessary
5228         as the anonymous method lives inside a nested class in the host
5229         type of the method). 
5230
5231         (AnonymousMethod): Expanded to track the Toplevel, implement
5232         `AnonymousMethod.Compatible' to tell whether an anonymous method
5233         can be converted to a target delegate type. 
5234
5235         The routine now also produces the anonymous method content
5236
5237         (AnonymousDelegate): A helper class that derives from
5238         DelegateCreation, this is used to generate the code necessary to
5239         produce the delegate for the anonymous method that was created. 
5240
5241         * assign.cs: API adjustments for new changes in
5242         Convert.ImplicitStandardConversionExists.
5243
5244         * class.cs: Adjustments to cope with the fact that now toplevel
5245         blocks are of type `ToplevelBlock'. 
5246
5247         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
5248         insteda of standard blocks.
5249
5250         Flag errors if params arguments are passed to anonymous methods.
5251
5252         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
5253         `CurrentAnonymousMethod' which points to the current Anonymous
5254         Method.  The variable points to the AnonymousMethod class that
5255         holds the code being compiled.  It is set in the new EmitContext
5256         created for the anonymous method.
5257
5258         (EmitContext.Phase): Introduce a variable and an enumeration to
5259         assist in enforcing some rules about when and where we are allowed
5260         to invoke certain methods (EmitContext.NeedsReturnLabel is the
5261         only one that enfonces this right now).
5262
5263         (EmitContext.HaveCaptureInfo): new helper method that returns
5264         whether we have a CapturedContext initialized.
5265
5266         (EmitContext.CaptureVariable): New method used to register that a
5267         LocalInfo must be flagged for capturing. 
5268
5269         (EmitContext.CapturedParameter): New method used to register that a
5270         parameters must be flagged for capturing. 
5271         
5272         (EmitContext.CapturedField): New method used to register that a
5273         field must be flagged for capturing. 
5274
5275         (EmitContext.HaveCapturedVariables,
5276         EmitContext.HaveCapturedFields): Return whether there are captured
5277         variables or fields. 
5278
5279         (EmitContext.EmitMethodHostInstance): This is used to emit the
5280         instance for the anonymous method.  The instance might be null
5281         (static methods), this (for anonymous methods that capture nothing
5282         and happen to live side-by-side with the current method body) or a
5283         more complicated expression if the method has a CaptureContext.
5284
5285         (EmitContext.EmitTopBlock): Routine that drives the emission of
5286         code: it will first resolve the top block, then emit any metadata
5287         and then emit the code.  The split is done so that we can extract
5288         any anonymous methods and flag any captured variables/parameters.
5289         
5290         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
5291         during this phase, the ILGenerator should not be used as labels
5292         and local variables declared here might not be accessible to any
5293         code that is part of an anonymous method.  
5294
5295         Exceptions to this include the temporary variables that are
5296         created by some statements internally for holding temporary
5297         variables. 
5298         
5299         (EmitContext.EmitMeta): New routine, in charge of emitting all the
5300         metadata for a cb
5301
5302         (EmitContext.TemporaryReturn): This method is typically called
5303         from the Emit phase, and its the only place where we allow the
5304         ReturnLabel to be defined other than the EmitMeta.  The reason is
5305         that otherwise we would have to duplicate a lot of logic in the
5306         Resolve phases of various methods that today is on the Emit
5307         phase. 
5308
5309         (EmitContext.NeedReturnLabel): This no longer creates the label,
5310         as the ILGenerator is not valid during the resolve phase.
5311
5312         (EmitContext.EmitThis): Extended the knowledge in this class to
5313         work in anonymous methods in addition to iterators. 
5314
5315         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5316         code is necessary on the stack to access the instance to a local
5317         variable (the variable will be accessed as a field).
5318
5319         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5320         EmitContext.EmitAddressOfParameter): Routines to support
5321         parameters (not completed at this point). 
5322         
5323         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5324         will also remove the parameters.
5325
5326         * convert.cs (Convert): Define a `ConstantEC' which points to a
5327         null.  This is just to prefity some code that uses
5328         ImplicitStandardConversion code and do not have an EmitContext
5329         handy.
5330
5331         The idea is to flag explicitly that at that point in time, it is
5332         known that the conversion will not trigger the delegate checking
5333         code in implicit conversions (which requires a valid
5334         EmitContext). 
5335
5336         Everywhere: pass new EmitContext parameter since
5337         ImplicitStandardConversionExists now requires it to check for
5338         anonymous method conversions. 
5339
5340         (Convert.ImplicitStandardConversionExists): If the type of an
5341         expression is the anonymous_method_type, and the type is a
5342         delegate, we invoke the AnonymousMethod.Compatible method to check
5343         whether an implicit conversion is possible. 
5344
5345         (Convert.ImplicitConversionStandard): Only do implicit method
5346         group conversions if the language level is not ISO_1.
5347
5348         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5349         MethodInfo for the Invoke method.  used by Delegate and
5350         AnonymousDelegate.
5351
5352         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5353         method conversions if the target type is a delegate.
5354
5355         Removed extra debugging nops.
5356
5357         (LocalVariableReference): Turn the `local_info' into a public
5358         field. 
5359
5360         Add `prepared' field, the same hack used for FieldExprs to cope
5361         with composed assignments, as Local variables do not necessarily
5362         operate purely on the stack as they used to: they can be captured
5363         fields. 
5364
5365         Add `temp' for a temporary result, like fields.
5366
5367         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5368
5369         It now copes with Local variables that are captured and emits the
5370         proper instance variable to load it from a field in the captured
5371         case. 
5372
5373         (ParameterReference.DoResolveBase): During the resolve phase,
5374         capture parameters if we are in an anonymous method.
5375
5376         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5377         anonymous method, use the EmitContext helper routines to emit the
5378         parameter reference.
5379
5380         * iterators.cs: Set RemapToProxy to true/false during the
5381         EmitDispose class.
5382
5383         * parameters.cs (GetParameterByName): New helper method. 
5384
5385         * typemanager.cs (anonymous_method_type) a new type that
5386         represents an anonyous method.  This is always an internal type,
5387         used as a fencepost to test against the anonymous-methodness of an
5388         expression. 
5389         
5390 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5391
5392         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5393         561 report.
5394         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5395
5396 2004-11-10  Martin Baulig  <martin@ximian.com>
5397
5398         * expression.cs (Invocation.BetterFunction): If two methods have
5399         equal parameter types, but only one of them is generic, the
5400         non-generic one wins.
5401         (New.DoResolve): Don't set `is_struct' to false if we're a generic
5402         instance; just use `Type.IsValueType' to determine whether
5403         something is a struct or not.
5404         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
5405         so we can be called multiple times.
5406
5407 2004-11-10  Martin Baulig  <martin@ximian.com>
5408
5409         * generic.cs (TypeParameter.DefineConstraints): New public method.
5410         (TypeParameter.CheckAccessLevel): Override this and return true.
5411         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
5412         override ResolveType() anymore.
5413         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
5414
5415 2004-11-10  Martin Baulig  <martin@ximian.com>
5416
5417         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
5418         call DeclSpace.ResolveNestedType() on it.
5419
5420 2004-11-10  Martin Baulig  <martin@ximian.com>
5421
5422         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
5423         non-null, call ParameterModifier() on it.
5424
5425 2004-11-10  Martin Baulig  <martin@ximian.com>
5426
5427         * iterators.cs
5428         (Iterators): Added `current_type' and `this_type' fields.
5429         (Iterators.DefineIterator): Create a new EmitContext and store it
5430         in `ec'; compute `this_type'.
5431
5432 2004-11-10  Martin Baulig  <martin@ximian.com>
5433
5434         * typemanager.cs
5435         (TypeManager.IsPrivateAccessible): New public method.
5436         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
5437
5438 2004-11-10  Martin Baulig  <martin@ximian.com>
5439
5440         * class.cs (TypeContainer.DefineType): Call
5441         TypeBuilder.DefineGenericParameters() before resolving the type
5442         parameters.
5443         (MethodData.parent_method): New protected field.
5444         (MethodData..ctor): Added `MethodInfo parent_method' argument.
5445         (MethodData.Define): Compute `parent_method'.
5446
5447         * decl.cs
5448         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5449         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5450         (DeclSpace.ec): New protected field; store the EmitContext here.
5451         (DeclSpace.EmitContext): New public property.
5452         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
5453         (DeclSpace.ResolveNestedType): New public method.
5454         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
5455         (DeclSpace.NestedAccessible): Added `Type tb' argument.
5456         (DeclSpace.FamilyAccessible): Likewise.
5457         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
5458         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5459         EmitContext.
5460
5461         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
5462         field.
5463
5464         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5465         (Enum.Emit): Don't create a new EmitContext.
5466
5467 2004-10-18  Martin Baulig  <martin@ximian.com>
5468
5469         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5470         `Type' directly, but call ResolveType() on it.
5471         (Catch.Resolve): Likewise.
5472         (Foreach.Resolve): Likewise.
5473
5474 2004-10-18  Martin Baulig  <martin@ximian.com>
5475
5476         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5477         `Type' directly, but call ResolveType() on it.
5478         (Probe.DoResolve): Likewise.
5479         (ArrayCreation.LookupType): Likewise.
5480         (TypeOf.DoResolve): Likewise.
5481         (SizeOf.DoResolve): Likewise.
5482
5483 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5484
5485         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5486         the ResolveType.
5487
5488 2004-10-17  John Luke  <john.luke@gmail.com>
5489
5490         * class.cs (Operator.GetSignatureForError): use CSharpName
5491
5492         * parameter.cs (Parameter.GetSignatureForError): Returns
5493         correct name even if was not defined.
5494
5495 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5496
5497         Fix #65816.
5498         * class.cs (TypeContainer.EmitContext): New property.
5499         (DefineNestedTypes): Create an emitcontext for each part.
5500         (MethodCore.DoDefineParameters): Use container's emitcontext.
5501         Pass type array to InternalParameters.
5502         (MemberBase.DoDefine): Use container's emitcontext.
5503         (FieldMember.Define): Likewise.
5504         (Event.Define): Likewise.
5505         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5506         Pass type array to InternalParameters.
5507         (SetIndexerMethod.GetParameterInfo): Likewise.
5508         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5509         * delegate.cs (Define): Pass emitcontext to
5510         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5511         array to InternalParameters.
5512         * expression.cs (ParameterReference.DoResolveBase): Pass
5513         emitcontext to GetParameterInfo.
5514         (ComposedCast.DoResolveAsTypeStep): Remove check on
5515         ec.ResolvingTypeTree.
5516         * parameter.cs (Parameter.Resolve): Change argument to
5517         EmitContext.  Use ResolveAsTypeTerminal.
5518         (Parameter.GetSignature): Change argument to EmitContext.
5519         (Parameters.ComputeSignature): Likewise.
5520         (Parameters.ComputeParameterTypes): Likewise.
5521         (Parameters.GetParameterInfo): Likewise.
5522         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5523         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5524         * support.cs (InternalParameters..ctor): Remove variant that takes
5525         a DeclSpace.
5526         * typemanager.cs (system_intptr_expr): New.
5527         (InitExpressionTypes): Initialize it.
5528
5529 2004-10-12  Chris Toshok  <toshok@ximian.com>
5530
5531         * cs-parser.jay: fix location for try_statement and catch_clause.
5532
5533 2004-10-18  Martin Baulig  <martin@ximian.com>
5534
5535         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5536         `Type' directly, but call ResolveType() on it.
5537         (MemberBase.DoDefine): Likewise.
5538
5539         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5540         `Type' directly, but call ResolveType() on it.
5541         (ComposedCast.DoResolveAsTypeStep): Likewise.
5542
5543         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5544         `Type' directly, but call ResolveType() on it.
5545
5546 2004-10-17  John Luke  <john.luke@gmail.com>
5547
5548         * class.cs (Operator.GetSignatureForError): use CSharpName
5549
5550         * parameter.cs (Parameter.GetSignatureForError): Returns
5551         correct name even if was not defined.
5552
5553 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5554
5555         Fix #65816.
5556         * class.cs (TypeContainer.EmitContext): New property.
5557         (DefineNestedTypes): Create an emitcontext for each part.
5558         (MethodCore.DoDefineParameters): Use container's emitcontext.
5559         Pass type array to InternalParameters.
5560         (MemberBase.DoDefine): Use container's emitcontext.
5561         (FieldMember.Define): Likewise.
5562         (Event.Define): Likewise.
5563         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5564         Pass type array to InternalParameters.
5565         (SetIndexerMethod.GetParameterInfo): Likewise.
5566         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5567         * delegate.cs (Define): Pass emitcontext to
5568         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5569         array to InternalParameters.
5570         * expression.cs (ParameterReference.DoResolveBase): Pass
5571         emitcontext to GetParameterInfo.
5572         (ComposedCast.DoResolveAsTypeStep): Remove check on
5573         ec.ResolvingTypeTree.
5574         * parameter.cs (Parameter.Resolve): Change argument to
5575         EmitContext.  Use ResolveAsTypeTerminal.
5576         (Parameter.GetSignature): Change argument to EmitContext.
5577         (Parameters.ComputeSignature): Likewise.
5578         (Parameters.ComputeParameterTypes): Likewise.
5579         (Parameters.GetParameterInfo): Likewise.
5580         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5581         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5582         * support.cs (InternalParameters..ctor): Remove variant that takes
5583         a DeclSpace.
5584         * typemanager.cs (system_intptr_expr): New.
5585         (InitExpressionTypes): Initialize it.
5586
5587 2004-10-12  Chris Toshok  <toshok@ximian.com>
5588
5589         * cs-parser.jay: fix location for try_statement and catch_clause.
5590
5591 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5592
5593         More DeclSpace.ResolveType avoidance.
5594         * decl.cs (MemberCore.InUnsafe): New property.
5595         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5596         with newly created EmitContext.
5597         (FieldMember.Define): Likewise.
5598         * delegate.cs (Delegate.Define): Likewise.
5599         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5600         only if normal name-lookup fails.
5601         (TypeExpr.DoResolve): Enable error-checking.
5602         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5603         (SizeOf.DoResolve): Likewise.
5604         (ComposedCast.DoResolveAsTypeStep): Likewise.
5605         (StackAlloc.DoResolve): Likewise.
5606         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5607         (Block.Unsafe): New property.
5608         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5609         (Unsafe): Set 'unsafe' flag of contained block.
5610         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5611         (Fixed.Resolve): Likewise.
5612         (Catch.Resolve): Likewise.
5613         (Using.ResolveLocalVariableDecls): Likewise.
5614         (Foreach.Resolve): Likewise.
5615
5616 2004-10-05  John Luke <john.luke@gmail.com>
5617
5618         * cs-parser.jay: add location to error CS0175
5619
5620 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5621
5622         * ecore.cs (Expression.Constantity): Add support for turning null
5623         into a constant.
5624
5625         * const.cs (Const.Define): Allow constants to be reference types
5626         as long as the value is Null.
5627
5628 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5629
5630         * namespace.cs (NamespaceEntry.Using): No matter which warning
5631         level is set, check if this namespace name has already been added.
5632
5633 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5634
5635         * expression.cs: reftype [!=]= null should always use br[true,false].
5636         # 67410
5637
5638 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5639
5640         Fix #67108
5641         * attribute.cs: Enum conversion moved to 
5642         GetAttributeArgumentExpression to be applied to the all
5643         expressions.
5644
5645 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5646
5647         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5648         * class.c (TypeContainer.DefineType): Flag error if
5649         base types aren't accessible due to access permissions.
5650         * decl.cs (DeclSpace.ResolveType): Move logic to
5651         Expression.ResolveAsTypeTerminal.
5652         (DeclSpace.ResolveTypeExpr): Thin layer over
5653         Expression.ResolveAsTypeTerminal.
5654         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5655         Refactor code into NestedAccess.  Use it.
5656         (DeclSpace.NestedAccess): New.
5657         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5658         argument to silence errors.  Check access permissions.
5659         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5660         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5661         (Cast.DoResolve): Likewise.
5662         (New.DoResolve): Likewise.
5663         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5664         (TypeOf.DoResolve): Likewise.
5665
5666         * expression.cs (Invocation.BetterConversion): Return the Type of
5667         the better conversion.  Implement section 14.4.2.3 more faithfully.
5668         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5669         section 14.4.2.2 explicit.
5670         (Invocation.OverloadResolve): Update.
5671         (Invocation): Remove is_base field.
5672         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5673         (Invocation.Emit): Likewise.
5674
5675 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * cs-parser.jay: Reverted 642 warning fix.
5678
5679 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5680
5681         Fix bug #66615
5682         * decl.cs (FindMemberWithSameName): Indexer can have more than
5683         1 argument.
5684
5685 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5686
5687         * expression.cs (LocalVariableReference.DoResolveLValue):
5688         Do not report warning 219 for out values.
5689         (EmptyExpression.Null): New member to avoid extra allocations.
5690
5691 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5692
5693         * cs-parser.jay: Fix wrong warning 642 report.
5694
5695         * cs-tokenizer.cs (CheckNextToken): New helper;
5696         Inspect next character if is same as expected.
5697
5698 2004-09-23  Martin Baulig  <martin@ximian.com>
5699
5700         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5701         (Convert.ImplicitReferenceConversionExists): Likewise.
5702
5703 2004-11-09  Raja R Harinath  <rharinath@novell.com>
5704
5705         * Makefile (DISTFILES): Comment out a few missing files.
5706
5707 2004-10-29  Raja R Harinath  <rharinath@novell.com>
5708
5709         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
5710         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
5711         (gmcs.exe): Invoke bootstrap-libs.
5712         (clean-local): Clean the net_2_0_bootstrap profile too.
5713         (PROGRAM_INSTALL_DIR): New.
5714         (install-local): Use it.
5715
5716 2004-10-13  Martin Baulig  <martin@ximian.com>
5717
5718         * generic.cs (TypeManager.InflatedConstraints): New nested class.
5719         (TypeParameter.DefineType): If we're a method type parameter and
5720         that method is overriding something, "inflate" its constraints.
5721
5722 2004-10-12  Martin Baulig  <martin@ximian.com>
5723
5724         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
5725         and have type arguments, create and resolve a ConstructedType.
5726
5727 2004-10-12  Martin Baulig  <martin@ximian.com>
5728
5729         * decl.cs (MemberCache.FindMemberToOverride): Use
5730         TypeManager.IsEqual() to compare the parameters and Type.Equals()
5731         to compare the invocationType.
5732
5733         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
5734         When comparing two type parameters, only do the signature-only
5735         comparision for method type parameters.
5736
5737 2004-10-11  Martin Baulig  <martin@ximian.com>
5738
5739         * report.cs: Don't make --fatal abort on warnings, we have
5740         -warnaserror for that.
5741
5742 2004-10-11  Martin Baulig  <martin@ximian.com>
5743
5744         * typemanager.cs
5745         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
5746         (TypeManager.IsEqual): Call ourself recursively instead of using
5747         Type.IsEqual(). 
5748
5749 2004-10-11  Martin Baulig  <martin@ximian.com>
5750
5751         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
5752         on our own type parameters, not on the ones we inherit from a containing
5753         class.
5754
5755         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
5756         the comparision.
5757
5758         * generic.cs (TypeParameter.Define): We may only be called once.
5759
5760         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
5761         instead of TypeManager.IsEqual().
5762
5763 2004-09-28  Martin Baulig  <martin@ximian.com>
5764
5765         * generic.cs
5766         (GenericConstraints.EffectiveBaseClass): New public property.
5767         (TypeParameter.GenericConstraints): New public property.
5768         (ConstructedType.CheckConstraints): Improved.
5769
5770         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
5771         (Convert.TypeParameterConversion): New private method; use this in
5772         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
5773         for all conversions related to type parameters.
5774
5775 2004-09-24  Martin Baulig  <martin@ximian.com>
5776
5777         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
5778         type parameter conversions for type parameters which are known to
5779         be reference types.
5780
5781 2004-09-24  Martin Baulig  <martin@ximian.com>
5782
5783         * generic.cs (GenericConstraints): Added `IsReferenceType' and
5784         `IsValueType' properties.
5785
5786         * support.cs (ReflectionConstraints): Use
5787         Type.GetGenericParameterConstraints() instead of the old hack.
5788
5789 2004-09-24  Martin Baulig  <martin@ximian.com>
5790
5791         * generic.cs (GenericConstraints): Moved here and made it an
5792         abstract class.
5793
5794         * support.cs (GenericConstraints): Moved to generic.cs.
5795
5796 2004-09-24  Martin Baulig  <martin@ximian.com>
5797
5798         * support.cs
5799         (ReflectionConstraints): Un-nested this class and made it public.
5800
5801         * typemanager.cs
5802         (TypeManager.GetTypeParameterConstraints): New public method.
5803         (TypeManager.HasConstructorConstraint): Use the attributes.
5804
5805 2004-09-24  Martin Baulig  <martin@ximian.com>
5806
5807         * support.cs (GenericConstraints): Replaced `HasConstructor',
5808         `IsReferenceType' and `IsValueType' with `Attributes'.
5809         (ReflectionParameters.ReflectionConstraints): Removed the Create()
5810         method and made the .ctor public.
5811
5812         * generic.cs (Constraints.Attributes): New public property.
5813         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
5814         `IsReferenceType' -> `HasReferenceTypeConstraint' and
5815         `IsValueType' -> `HasValueTypeConstraint'.
5816
5817 2004-09-23  Martin Baulig  <martin@ximian.com>
5818
5819         * generic.cs (Constraints): Reflect latest runtime changes.
5820
5821 2004-09-23  Martin Baulig  <martin@ximian.com>
5822
5823         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5824         (Convert.ImplicitReferenceConversionExists): Likewise.
5825
5826 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5827
5828         * class.cs (Operator.Define): Add error 448 and 559 report.
5829         
5830 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5831
5832         * class.cs (MemberBase.IsTypePermitted): New protected
5833         method for checking error CS0610.
5834
5835 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5836
5837         * class.cs (TypeContainer.HasExplicitLayout): New property
5838         Returns whether container has StructLayout attribute set Explicit.
5839         (FieldMember): New abstract class for consts and fields.
5840         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5841         (Field): Reuse FieldMember.
5842
5843         * const.cs (Const): Reuse FieldMember.
5844
5845         * rootcontext.cs: EmitConstants call moved to class.
5846
5847 2004-09-22  Martin Baulig  <martin@ximian.com>
5848
5849         Marek and me just fixed one of our oldest bugs: #28562 :-)
5850
5851         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5852
5853         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5854         we're an EnumConstant, just return that.
5855         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5856         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5857         to get the value which'll actually be written into the attribute.
5858         However, we have to use GetValue() to access the attribute's value
5859         in the compiler.        
5860
5861 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5862
5863         * constant.cs (Constant.IsNegative): New abstract property
5864         IsNegative.
5865
5866         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5867         (StackAlloc.DoResolve): Reused IsNegative.
5868
5869 2004-09-22  Martin Baulig  <martin@ximian.com>
5870
5871         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
5872         public method; like LookupTypeContainer, but also works for
5873         generic instances.
5874
5875         * report.cs (Report.SymbolRelatedToPreviousError): Use
5876         TypeManager.LookupGenericTypeContainer().       
5877
5878 2004-09-22  Martin Baulig  <martin@ximian.com>
5879
5880         Thanks to Peter Sestoft for this bug report.
5881
5882         * expression.cs (Conditional): If both the `trueExpr' and the
5883         `falseExpr' is a NullLiteral, return a NullLiteral.
5884
5885 2004-09-22  Martin Baulig  <martin@ximian.com>
5886
5887         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5888         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5889         for the "get_Current" call.
5890
5891 2004-09-21  Martin Baulig  <martin@ximian.com>
5892
5893         * convert.cs (Convert.ImplicitReferenceConversion): When
5894         converting to an interface type, first check whether we're
5895         converting from a reference type.
5896
5897 2004-09-14  Martin Baulig  <martin@ximian.com>
5898
5899         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5900
5901 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5902
5903         Fixed bug #61902
5904         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5905         called and is obsolete then this member suppress message
5906         when call is inside next [Obsolete] method or type.
5907
5908         * expression.cs: Use TestObsoleteMethodUsage member.
5909
5910 2004-09-14  Martin Baulig  <martin@ximian.com>
5911
5912         * genericparser.cs: Removed.
5913
5914 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5915
5916         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5917
5918 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5919
5920         * attribute.cs (Attribute.Resolve): Add error 653 report.
5921
5922         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5923         report.
5924         (Method.ApplyAttributeBuilder): Add error 685 report.
5925         (Operator.Define): Add error 564 report.
5926
5927         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5928
5929         * expression.cs (Invocation.DoResolve): Add error
5930         245 and 250 report.
5931
5932         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5933         error 674 report.
5934
5935 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5936
5937         * class.cs (ConstructorInitializer.Resolve):
5938         Wrong error number (515->516).
5939
5940 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5941
5942         * class.cs (Indexer.Define): Add error 631 report.
5943
5944 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5945
5946         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5947
5948 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5949
5950         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5951
5952 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5953
5954         * cs-parser.jay: Added error CS0241 report.
5955
5956 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5957
5958         * cs-parser.jay (fixed_statement): Introduce a scope for the
5959         declaration in the 'fixed' statement.
5960
5961 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5962
5963         * cs-parser.jay: Added CS0230 error report.
5964
5965 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5966
5967         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5968
5969 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5970
5971         * expression.cs (Argument.Resolve): Added error CS0192 and
5972         CS0199 report.
5973
5974 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5975
5976         C# 2.0 #pragma warning feature
5977
5978         * cs-tokenizer.cs (PreProcessPragma): New method; 
5979         Handles #pragma directive.
5980
5981         * report.cs (WarningRegions): New class; Support
5982         class for #pragma warning directive. It tests whether
5983         warning is enabled for a given line.
5984
5985 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5986
5987         * const.cs: Add more descriptive error report, tahnks to
5988         Sebastien. 
5989
5990 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5991
5992         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5993
5994 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5995
5996         * expression.cs: Apply patch from Ben: Remove dead code from
5997         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5998         as that code just threw an exception anwyays.
5999
6000         * const.cs: Remove the call to the turnintoconstant, for details
6001         see bug: #63144
6002         
6003         * literal.cs: The type of the null-literal is the null type;  So
6004         we use a placeholder type (literal.cs:System.Null, defined here)
6005         for it.
6006
6007         * expression.cs (Conditional.DoResolve): Remove some old code that
6008         is no longer needed, conversions have been fixed.
6009
6010         (ArrayCreationExpression.DoResolve): Return false if we fail to
6011         resolve the inner expression.
6012
6013 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6014
6015         Fix test-290.cs.
6016         * cs-parser.jay (delegate_declaration): Record a delegate
6017         declaration as a type declaration.
6018         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6019
6020 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6021
6022         * parameter.cs: Do not crash if the type can not be resolved. 
6023
6024         * expression.cs: Report errors with unsafe pointers, fixes #64896
6025
6026 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6027
6028         * expression.cs: Pointer arith always needs to do a conv.i
6029         if the operand is a long. fix 65320
6030
6031 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6032
6033         Fixed cs0619-37.cs, cs0619-38.cs
6034
6035         * enum.cs (GetObsoleteAttribute): Removed.
6036
6037         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6038         on Enum member is double staged. The first is tested member
6039         and then enum.
6040
6041 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6042
6043         Fixed #56986, #63631, #65231
6044
6045         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6046         adds member to name container.
6047         (TypeContainer.AddToTypeContainer): New method, adds type to
6048         name container.
6049         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6050         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6051         AddOperator): Simplified by reusing AddToMemberContainer.
6052         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6053         instead of field.
6054         (Method.CheckForDuplications): Fixed implementation to test all
6055         possibilities.
6056         (MemberBase): Detection whether member is explicit interface
6057         implementation is now in constructor.
6058         (MemberBase.UpdateMemberName): Handles IndexerName.
6059         (Accessor): Changed to keep also location information.
6060         (AbstractPropertyEventMethod): Is derived from MemberCore.
6061         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6062         will be emited or not.
6063         (PropertyBase.AreAccessorsDuplicateImplementation):
6064         Tests whether accessors are not in collision with some method.
6065         (Operator): Is derived from MethodCore to simplify common
6066         operations.
6067
6068         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6069         must be performed.
6070         (DeclSpace.AddToContainer): Adds the member to defined_names
6071         table. It tests for duplications and enclosing name conflicts.
6072
6073         * enum.cs (EnumMember): Clean up to reuse the base structures
6074
6075 2004-09-03  Martin Baulig  <martin@ximian.com>
6076
6077         Merged latest changes into gmcs.  Please keep this comment in
6078         here, it makes it easier for me to see what changed in MCS since
6079         the last time I merged.
6080
6081 2004-09-03  Martin Baulig  <martin@ximian.com>
6082
6083         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6084         into TypeContainer, to make partial classes work again.
6085
6086 2004-09-03  Martin Baulig  <martin@ximian.com>
6087
6088         * rootcontext.cs (RootContext.V2): Removed.
6089
6090 2004-03-23  Martin Baulig  <martin@ximian.com>
6091
6092         * expression.cs (Invocation.OverloadResolve): Added `bool
6093         may_fail' argument and use it instead of the Location.IsNull() hack.
6094
6095 2004-09-09  Martin Baulig  <martin@ximian.com>
6096
6097         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
6098
6099 2004-09-09  Martin Baulig  <martin@ximian.com>
6100
6101         * generic.cs (TypeParameter.DefineType): Added support for
6102         explicit interface methods.
6103
6104 2004-09-09  Martin Baulig  <martin@ximian.com>
6105
6106         * README.Changes: New document.  Started to list important changes
6107         between MCS and GMCS here.
6108
6109 2004-09-08  Martin Baulig  <martin@ximian.com>
6110
6111         * class.cs
6112         (TypeContainer.CheckRecursiveDefinition): New protected method.
6113         (TypeContainer.DefineType): Move the CS0146 check into
6114         CheckRecursiveDefinition().     
6115
6116 2004-09-06  Martin Baulig  <martin@ximian.com>
6117
6118         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
6119         types for the constructor constraint.
6120
6121 2004-09-03  Martin Baulig  <martin@ximian.com>
6122
6123         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6124         into TypeContainer, to make partial classes work again.
6125
6126 2004-09-03  Martin Baulig  <martin@ximian.com>
6127
6128         * rootcontext.cs (RootContext.V2): Removed.
6129
6130 2004-03-23  Martin Baulig  <martin@ximian.com>
6131
6132         * expression.cs (Invocation.OverloadResolve): Added `bool
6133         may_fail' argument and use it instead of the Location.IsNull() hack.
6134
6135 2004-09-03  Martin Baulig  <martin@ximian.com>
6136
6137         Merged latest changes into gmcs.  Please keep this comment in
6138         here, it makes it easier for me to see what changed in MCS since
6139         the last time I merged.
6140
6141 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6142
6143         Fix #61128.
6144         * expression.cs (BetterConversion): Don't allow either conversion 
6145         to be null.  Remove redundant implicit conversion test when 'q ==
6146         null' -- when this function is invoked, we already know that the
6147         implicit conversion exists.
6148         (BetterFunction): Assume that 'best' is non-null.  Remove
6149         redundant reimplementation of IsApplicable when 'best' is null.
6150         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6151         number of arguments.
6152         (IsAncestralType): Extract from OverloadResolve.
6153         (OverloadResolve): Make robust to the MethodGroupExpr being
6154         unsorted.  Implement all the logic of Section 14.5.5.1, and
6155         support overloading of methods from multiple applicable types.
6156         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6157
6158         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6159         (RealError, Warning): Append type of report to related symbol.
6160
6161 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6162
6163         * enum.cs: Fixed CLS-Compliance checks for enum members.
6164         Error tests cs3008-8.cs, cs3014-8.cs
6165
6166 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6167
6168         Fixed bug #62342, #63102
6169         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6170         like ImplementMethod.
6171
6172 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6173
6174         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6175         Fixed bug #65170.
6176
6177 2004-09-02  Martin Baulig  <martin@ximian.com>
6178
6179         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6180         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6181         on the MethodBase.
6182
6183 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6184
6185         C# 2.0 Static classes implemented
6186
6187         * class.cs (TypeContainer): instance_constructors,
6188         initialized_fields, initialized_static_fields,
6189         default_constructor, base_inteface_types are protected to be
6190         accessible from StaticClass.
6191         (TypeContainer.DefineDefaultConstructor): New virtual method
6192         for custom default constructor generating
6193         (StaticClass): New class to handle "Static classes" feature.
6194
6195         * cs-parser.jay: Handle static keyword on class like instance
6196         of StaticClass.
6197
6198         * driver.cs: Added "/langversion" command line switch with two
6199         options (iso-1, default).
6200
6201 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6202
6203         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6204
6205 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6206
6207         * delegate.cs: Style.
6208
6209 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6210
6211         * delegate.cs: Add seperate instance expr field for miguel.
6212
6213 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6214
6215         * PointerArithmetic (Resolve): make sure we are not doing
6216         pointer arith on void*. Also, make sure we are resolved
6217         by not setting eclass until resolve.
6218
6219         All callers: Make sure that PointerArithmetic gets resolved.
6220
6221 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6222
6223         * ArrayCreation (LookupType): If the type does not resolve 
6224         to an array, give an error.
6225
6226 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6227
6228         * statement.cs (Try.Resolve): Fixed bug #64222
6229
6230 2004-08-27  Martin Baulig  <martin@ximian.com>
6231
6232         * class.cs
6233         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6234         crash here.     
6235
6236 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6237
6238         * ecore.cs (Constantify): Get underlying type via
6239         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6240         Windows in special cases.
6241
6242 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6243
6244         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6245         for obtaining also private methods.
6246         (GetRemoveMethod): Used GetRemoveMethod (true)
6247         for obtaining also private methods.
6248
6249 2004-09-02  Martin Baulig  <martin@ximian.com>
6250
6251         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6252         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6253         on the MethodBase.
6254
6255 2004-08-27  Martin Baulig  <martin@ximian.com>
6256
6257         * class.cs
6258         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6259         crash here.     
6260
6261 2004-08-25  Martin Baulig  <martin@ximian.com>
6262
6263         * support.cs (ReflectionParameters..ctor): If this is a generic
6264         method, retrieve and store its type parameters.
6265         (InternalParameters..ctor): Added `TypeParameter[]' argument.
6266         (ReflectionParameters.GenericConstraints): The argument specifies
6267         the type parameter, not the method parameter.
6268         (InternalParameters.GenericConstraints): Likewise.
6269
6270         * generic.cs (TypeParameter.DefineType): Correctly handle
6271         constraints wrt. generic methods in interfaces and their
6272         implementations.        
6273
6274 2004-08-24  Martin Baulig  <martin@ximian.com>
6275
6276         * generic.cs (TypeParameter.IsSubclassOf): New public method.
6277         (Constraints.IsSubclassOf): New internal method.
6278
6279         * typemanager.cs (TypeManager.FindMembers): Added special support
6280         for GenericTypeParameterBuilder's.      
6281         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
6282         type parameters.
6283
6284 2004-08-24  Martin Baulig  <martin@ximian.com>
6285
6286         * typemanager.cs
6287         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6288         this for accessibility checks.
6289         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6290         IsNestedFamilyAccessible.
6291         (TypeManager.IsSubclassOf): New method, do what the name actually
6292         says.   
6293
6294 2004-08-24  Martin Baulig  <martin@ximian.com>
6295
6296         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
6297         as a SimpleName, include the generic arity.
6298
6299 2004-08-24  Martin Baulig  <martin@ximian.com>
6300
6301         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6302         MethodAttributes.HideBySig for operators.
6303
6304 2004-08-23  Martin Baulig  <martin@ximian.com>
6305
6306         Back to the old error reporting system :-)
6307
6308         * report.cs (Message): Removed.
6309         (Report.MessageData, ErrorData, WarningData): Removed.
6310         (Report.Error, Warning): Back to the old system.
6311
6312 2004-08-23  Martin Baulig  <martin@ximian.com>
6313
6314         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6315
6316         * class.cs (TypeContainer.ParentContainer): New public virtual
6317         method; replaces the explicit interface implementation.
6318         (ClassPart.ParentContainer): Override.
6319
6320 2004-08-23  Martin Baulig  <martin@ximian.com>
6321
6322         * statement.cs (Switch): Added support for constant switches; see
6323         #59428 or test-285.cs.
6324
6325 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6326
6327         Fixed bug #62740.
6328         * statement.cs (GetEnumeratorFilter): Removed useless
6329         logic because C# specs is strict. GetEnumerator must be
6330         public.
6331
6332 2004-08-22  Martin Baulig  <martin@ximian.com>
6333
6334         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6335         a switch and may break, reset the barrier.  Fixes #59867.
6336
6337 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6338
6339         CLS-Compliance speed up (~5% for corlib)
6340
6341         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6342         New method. Tests container for CLS-Compliant names
6343
6344         * class.cs (TypeContainer.VerifyClsName): New method.
6345         Checks whether container name is CLS Compliant.
6346         (Constructor): Implements IMethodData.
6347
6348         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6349         low-case table for CLS Compliance test.
6350         (MemberCache.VerifyClsParameterConflict): New method.
6351         Checks method parameters for CS3006 error.
6352
6353         * enum.cs (EnumMember): Is derived from MemberCore.
6354         (Enum.VerifyClsName): Optimized for better performance.
6355
6356 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6357
6358         * report.cs: Renamed Error_T to Error and changed all
6359         references.
6360
6361 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
6362
6363         * class.cs (TypeContainer.IndexerArrayList): New inner class
6364         container for indexers.
6365         (TypeContainer.DefaultIndexerName): New constant for default
6366         indexer name. Replaced all "Item" with this constant.
6367         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
6368
6369         * typemanager.cs (TypeManager.default_member_ctor): Cache here
6370         DefaultMemberAttribute constructor.
6371
6372 2004-08-05  Martin Baulig  <martin@ximian.com>
6373
6374         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6375         Fix bug #59429.
6376
6377 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
6378
6379         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
6380         multi platforms problem.
6381
6382         * compiler.csproj: Included shared files.
6383
6384 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6385
6386         Fix bug 60333, 55971 in the more general way
6387         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6388         Added arg_type argument for constant conversion.
6389         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
6390
6391 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6392
6393         Fix bug #59760
6394         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
6395         OperatorArrayList, MethodCoreArrayList for typecontainer
6396         containers. Changed class member types to these new types.
6397         (MethodArrayList.DefineMembers): Added test for CS0659.
6398
6399 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
6400
6401         * cfold.cs: Synchronize the folding with the code in expression.cs
6402         Binary.DoNumericPromotions for uint operands.
6403
6404         * attribute.cs: Revert patch from Raja, it introduced a regression
6405         while building Blam-1.2.1 (hard to isolate a test case).
6406
6407 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
6408
6409         Fix for #55382
6410         * class.cs:
6411         (TypeContainer.Define): Renamed to DefineContainerMembers because of
6412         name collision.
6413         (MethodCore.parent_method): New member. The method we're overriding
6414         if this is an override method.
6415         (MethodCore.CheckBase): Moved from Method class and made common.
6416         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
6417         private.
6418         (MethodCore.CheckForDuplications): New abstract method. For custom
6419         member duplication search in a container
6420         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
6421         method and its return type.
6422         (Event.conflict_symbol): New member. Symbol with same name in the
6423         parent class.
6424
6425         * decl.cs:
6426         (MemberCache.FindMemberWithSameName): New method. The method
6427         is looking for conflict with inherited symbols.
6428
6429 2004-08-04  Martin Baulig  <martin@ximian.com>
6430
6431         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6432
6433         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6434
6435 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6436
6437         * report.cs (Message): New enum for better error, warning reference in
6438         the code.
6439         (MessageData): New inner abstract class. It generally handles printing of
6440         error and warning messages.
6441         Removed unused Error, Warning, Message methods.
6442
6443 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6444
6445         Fix for cs0592-8.cs test
6446         * attribute.cs
6447         (Attributable.ValidAttributeTargets): Made public.
6448         (Attribute.ExplicitTarget): New member for explicit target value.
6449         (Attribute.CheckTargets): Now we translate explicit attribute
6450         target to Target here.
6451
6452 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
6453
6454         * ecore.cs (MethodGroupExpr): new IsBase property.
6455
6456         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6457
6458         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6459         rather than an instance expr.
6460
6461         (DelegateCreation.Emit): Use the method group rather than
6462         the instance expression. Also, if you have base.Foo as the
6463         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6464
6465         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6466
6467         (NewDelegate.DoResolve): Only check for the existance of Invoke
6468         if the method is going to be needed. Use MethodGroupExpr.
6469
6470         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6471
6472         * expression.cs: For pointer arith., make sure to use
6473         the size of the type, not the size of the pointer to
6474         the type.
6475
6476 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6477
6478         Fix for #60722
6479         * class.cs (Class): Added error CS0502 test.
6480
6481 2004-08-03  John Luke  <jluke@cfl.rr.com>
6482             Raja R Harinath  <rharinath@novell.com>
6483
6484         Fix for #60997.
6485         * attribute.cs (Attribute.complained_before): New flag.
6486         (Attribute.ResolveType, Attribute.Resolve),
6487         (Attribute.DefinePInvokeMethod): Set it.
6488         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6489         
6490 2004-08-03  Martin Baulig  <martin@ximian.com>
6491
6492         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6493         use a user-defined operator; we still need to do numeric
6494         promotions in case one argument is a builtin type and the other
6495         one has an implicit conversion to that type.  Fixes #62322.
6496
6497 2004-08-18  Martin Baulig  <martin@ximian.com>
6498
6499         * class.cs (Method.Define): Use the correct method name when
6500         creating the MethodBuilder for a generic method.
6501
6502 2004-08-17  Martin Baulig  <martin@ximian.com>
6503
6504         * generic.cs (Constraints): Support type parameter constraints.
6505
6506 2004-08-16  Martin Baulig  <martin@ximian.com>
6507
6508         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
6509         (Token.GENERIC_DIMENSION): New token; this is returned if we
6510         encounter an unbound generic type in a typeof() expression.
6511
6512         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
6513         this token is only generated while parsing a typeof() expression.
6514         (typeof_expression): Removed the old unbound_type hack.
6515
6516         * generic.cs (TypeArguments.IsUnbound): New public property.
6517
6518         * decl.cs (MemberName): Added support for unbound types.
6519
6520 2004-08-14  Martin Baulig  <martin@ximian.com>
6521
6522         * typemanager.cs
6523         (TypeManager.IsEqualGenericInstance): New static method.
6524         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
6525         just used to check accessibility, so follow the rules of 26.1.6.        
6526
6527         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
6528         ConstructedType instead of a TypeExpression if we have type arguments.
6529
6530         * cs-parser.jay (typeof_expression): Support unbound generic types.
6531
6532         * ecore.cs (UnboundTypeExpression): New public class.
6533
6534 2004-08-12  Martin Baulig  <martin@ximian.com>
6535
6536         * typemanager.cs (TypeManager.IsNestedChildOf): Use
6537         TypeManager.IsEqual() rather than `=='.
6538
6539         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
6540         generic instances as well.
6541
6542 2004-08-12  Martin Baulig  <martin@ximian.com>
6543
6544         * expression.cs (Invocation.InferType): We can only infer method
6545         type parameters.  Fixes #62647.
6546
6547 2004-08-11  Martin Baulig  <martin@ximian.com>
6548
6549         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
6550         before resolving the base classes.
6551
6552 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
6553
6554         * Makefile: install .mdb file too.
6555
6556 2004-08-05  Martin Baulig  <martin@ximian.com>
6557
6558         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
6559         initializer, the current type is just the TypeBuilder, not the
6560         instantiated generic type.
6561         (FieldExpr.IsFieldInitializer): New public property.
6562
6563 2004-08-04  Martin Baulig  <martin@ximian.com>
6564
6565         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
6566
6567         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
6568
6569 2004-08-03  Martin Baulig  <martin@ximian.com>
6570
6571         * class.cs (MethodData.Define): If we're an explicit
6572         implementation, remove the generic arity from the type name.
6573
6574 2004-08-03  Martin Baulig  <martin@ximian.com>
6575
6576         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6577         use a user-defined operator; we still need to do numeric
6578         promotions in case one argument is a builtin type and the other
6579         one has an implicit conversion to that type.  Fixes #62322.
6580
6581 2004-08-02  Martin Baulig  <martin@ximian.com>
6582
6583         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
6584         `TypeExpr[]' array.
6585         (TypeContainer.GetClassBases): Return the unexpanded list of
6586         interfaces; we expand them later.
6587         (TypeContainer.DefineType): After creating the TypeBuilder, call
6588         TypeManager.ExpandInterfaces() to get an expanded and resolved
6589         list of interfaces.
6590
6591         * ecore.cs (TypeExpr.GetInterfaces): Removed
6592
6593         * generics.cs (Constraints.InterfaceConstraints): Remove.
6594         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
6595         register the interface constraints.
6596
6597         * typemanager.cs
6598         (TypeManager.AddUserType): Removed the `ifaces' argument.
6599         (TypeManager.AddTypeParameter): Likewise.
6600         (TypeManager.AddUserInterface): Removed, was unused.
6601         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
6602         `TypeExpr[]' array for the interfaces.
6603         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
6604         has been defined, returns a list of the resolved interfaces types.
6605         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
6606         (TypeManager.GetExplicitInterfaces): Likewise.  
6607
6608 2004-08-02  Martin Baulig  <martin@ximian.com>
6609
6610         * expression.cs (Invocation.EmitCall): If we're invoking a method
6611         on a type parameter, use the new `Constrained' prefix opcode.
6612
6613 2004-08-02  Martin Baulig  <martin@ximian.com>
6614
6615         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6616         (LocalInfo.IsThis): New public property.
6617         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6618
6619 2004-08-01  Martin Baulig  <martin@ximian.com>
6620
6621         * class.cs (TypeContainer.GetClassBases): Don't set the default
6622         here since we may get called from GetPartialBases().
6623         (TypeContainer.DefineType): If GetClassBases() didn't return a
6624         parent, use the default one.
6625
6626 2004-07-30  Martin Baulig  <martin@ximian.com>
6627
6628         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6629
6630         * class.cs (SourceMethod): New public class, derive from the
6631         symbol writer's ISourceMethod.
6632         (Method): Use the new symbol writer API.
6633
6634         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6635         as argument and use the new symbol writer.
6636
6637         * location.cs
6638         (SourceFile): Implement the symbol writer's ISourceFile.
6639         (Location.SymbolDocument): Removed.
6640         (Location.SourceFile): New public property.
6641
6642         * symbolwriter.cs: Use the new symbol writer API.
6643
6644 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6645
6646         * Makefile (install-local): Remove.  Functionality moved to
6647         executable.make.
6648
6649 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6650
6651         * Makefile: Install mcs.exe.config file together with mcs.exe.
6652         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6653         correct runtime version.
6654         
6655 2004-07-25  Martin Baulig  <martin@ximian.com>
6656
6657         * class.cs
6658         (TypeContainer.RegisterOrder): Removed, this was unused.
6659         (TypeContainer, interface_order): Removed.
6660         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6661         TypeContainer as argument since we can also be called with a
6662         `PartialContainer' for a partial class/struct/interface.
6663         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6664         of checking whether we're an `Interface' - we could be a
6665         `PartialContainer'.
6666         (PartialContainer.Register): Override; call
6667         AddClass()/AddStruct()/AddInterface() on our parent.
6668
6669         * cs-parser.jay (interface_member_declaration): Add things to the
6670         `current_container', not the `current_class'.
6671
6672         * rootcontext.cs (RegisterOrder): The overloaded version which
6673         takes an `Interface' was unused, removed.
6674
6675         * typemanager.cs (TypeManager.LookupInterface): Return a
6676         `TypeContainer', not an `Interface'.
6677         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6678         contain a `PartialContainer' for an interface, so check it's
6679         `Kind' to figure out what it is.
6680
6681 2004-07-25  Martin Baulig  <martin@ximian.com>
6682
6683         * class.cs (Class.DefaultTypeAttributes): New public constant.
6684         (Struct.DefaultTypeAttributes): Likewise.
6685         (Interface.DefaultTypeAttributes): Likewise.
6686         (PartialContainer.TypeAttr): Override this and add the
6687         DefaultTypeAttributes.
6688
6689 2004-07-25  Martin Baulig  <martin@ximian.com>
6690
6691         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6692         we can just use the `Parent' field instead.
6693
6694 2004-07-25  Martin Baulig  <martin@ximian.com>
6695
6696         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6697
6698 2004-07-25  Martin Baulig  <martin@ximian.com>
6699
6700         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6701         our parts before defining any methods.
6702         (TypeContainer.VerifyImplements): Make this virtual.
6703         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6704         on our PartialContainer.
6705
6706 2004-07-25  Martin Baulig  <martin@ximian.com>
6707
6708         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6709
6710         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6711         argument, we can just use the `Parent' field instead.
6712
6713         * class.cs
6714         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6715         (MemberBase.DoDefine): Likewise.
6716
6717 2004-07-24  Martin Baulig  <martin@ximian.com>
6718
6719         * decl.cs (MemberCore.Parent): New public field.
6720         (DeclSpace.Parent): Moved to MemberCore.
6721
6722         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6723         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6724         parent's .ctor.
6725         (FieldBase, Field, Operator): Likewise.
6726         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6727         (EventField, Event): Likewise.
6728
6729 2004-07-23  Martin Baulig  <martin@ximian.com>
6730
6731         * class.cs (PartialContainer): New public class.
6732         (ClassPart): New public class.
6733         (TypeContainer): Added support for partial classes.
6734         (TypeContainer.GetClassBases): Splitted some of the functionality
6735         out into GetNormalBases() and GetPartialBases().
6736
6737         * cs-tokenizer.cs (Token.PARTIAL): New token.
6738         (Tokenizer.consume_identifier): Added some hacks to recognize
6739         `partial', but only if it's immediately followed by `class',
6740         `struct' or `interface'.
6741
6742         * cs-parser.jay: Added support for partial clases.
6743
6744 2004-07-23  Martin Baulig  <martin@ximian.com>
6745
6746         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6747         a `DeclSpace' and also made it readonly.
6748         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6749         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6750         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6751
6752         * cs-parser.jay: Pass the `current_class', not the
6753         `current_container' (at the moment, this is still the same thing)
6754         to a new Method, Property, Event, Indexer or Constructor.
6755
6756 2004-07-23  Martin Baulig  <martin@ximian.com>
6757
6758         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6759         and removed the `current_interface' one.
6760         (struct_declaration, class_declaration, interface_declaration):
6761         Set `current_class' to the newly created class/struct/interface;
6762         set their `Bases' and call Register() before parsing their body.
6763
6764 2004-07-23  Martin Baulig  <martin@ximian.com>
6765
6766         * class.cs (Kind): New public enum.
6767         (TypeContainer): Made this class abstract.
6768         (TypeContainer.Kind): New public readonly field.
6769         (TypeContainer.CheckDef): New public method; moved here from
6770         cs-parser.jay.
6771         (TypeContainer.Register): New public abstract method.
6772         (TypeContainer.GetPendingImplementations): New public abstract
6773         method.
6774         (TypeContainer.GetClassBases): Removed the `is_class' and
6775         `is_iface' parameters.
6776         (TypeContainer.DefineNestedTypes): Formerly known as
6777         DoDefineType().
6778         (ClassOrStruct): Made this class abstract.
6779
6780         * tree.cs (RootTypes): New public type. 
6781
6782 2004-07-20  Martin Baulig  <martin@ximian.com>
6783
6784         * tree.cs (Tree.RecordNamespace): Removed.
6785         (Tree.Namespaces): Removed.
6786
6787         * rootcontext.cs (RootContext.IsNamespace): Removed.
6788
6789         * cs-parser.jay (namespace_declaration): Just create a new
6790         NamespaceEntry here.
6791
6792 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
6793
6794         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
6795         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
6796         entry to make sure it runs in the correct runtime version.
6797         
6798 2004-07-18  Martin Baulig  <martin@ximian.com>
6799
6800         * generic.cs (ConstructedType.CheckConstraints): Improved
6801         constraints checking.
6802
6803 2004-07-18  Martin Baulig  <martin@ximian.com>
6804
6805         * expression.cs (Invocation.BetterMethod): Call
6806         TypeManager.TypeToCoreType() on all types and removed my previous
6807         hack; we're already doig the right thing here.
6808
6809 2004-07-17  Martin Baulig  <martin@ximian.com>
6810
6811         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
6812
6813 2004-07-16  Martin Baulig  <martin@ximian.com>
6814
6815         * iterators.cs: Added generics support.
6816
6817 2004-07-16  Martin Baulig  <martin@ximian.com>
6818
6819         * iterators.cs: Rewrote this.  We're now using one single Proxy
6820         class for both the IEnumerable and the IEnumerator interface and
6821         `Iterator' derives from Class so we can use the high-level API.
6822
6823         * class.cs (TypeContainer.AddIterator): New method.
6824         (TypeContainer.DoDefineType): New protected virtual method, which
6825         is called from DefineType().
6826         (TypeContainer.DoDefineMembers): Call DefineType() and
6827         DefineMembers() on all our iterators.
6828         (TypeContainer.Emit): Call Emit() on all our iterators.
6829         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6830
6831         * codegen.cs (EmitContext.CurrentIterator): New public field.
6832
6833 2004-07-15  Martin Baulig  <martin@ximian.com>
6834
6835         * typemanager.cs
6836         (TypeManager.not_supported_exception_type): New type.   
6837
6838 2004-07-14  Martin Baulig  <martin@ximian.com>
6839
6840         * typemanager.cs
6841         (TypeManager.generic_ienumerable_type): New type.
6842         (TypeManager.generic_ienumerator_type): New type.
6843
6844         * rootcontext.cs
6845         (RootContext.interfaces_first_stage): Added
6846         "System.Collections.Generic.IEnumerator`1" and
6847         "System.Collections.Generic.IEnumerable`1".     
6848
6849 2004-07-14  Martin Baulig  <martin@ximian.com>
6850
6851         * iterators.cs: Use real error numbers.
6852
6853 2004-07-14  Martin Baulig  <martin@ximian.com>
6854
6855         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6856         requires this to be a System.Collection.IEnumerable and not a
6857         class implementing that interface.
6858         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6859
6860 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6861
6862         * class.cs: Fixed previous fix, it broke some error tests.
6863
6864 2004-07-12  Martin Baulig  <martin@ximian.com>
6865
6866         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6867         Fixes #61293.
6868
6869 2004-07-14  Martin Baulig  <martin@ximian.com>
6870
6871         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
6872         an exclamation mark (!) for the generic arity to reflect the
6873         latest spec changes; ie. use "System.Collections.Generic.IList`1".
6874
6875 2004-07-13  Martin Baulig  <martin@ximian.com>
6876
6877         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
6878         specifiers being part of a type argument.
6879
6880 2004-07-13  Martin Baulig  <martin@ximian.com>
6881
6882         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
6883         name for generic types.
6884
6885 2004-07-13  Martin Baulig  <martin@ximian.com>
6886
6887         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
6888         bit to fix #60119.
6889
6890 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6891
6892         * assign.cs (LocalTemporary): Add new argument: is_address,If
6893         `is_address' is true, then the value that we store is the address
6894         to the real value, and not the value itself.
6895         
6896         * ecore.cs (PropertyExpr): use the new local temporary
6897         stuff to allow us to handle X.Y += z (where X is a struct)
6898
6899 2004-07-08  Martin Baulig  <martin@ximian.com>
6900
6901         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6902         not always return, just like we're doing in Using.Resolve().
6903
6904 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6905
6906         * cs-parser.jay (fixed_statement): flag this as Pinned.
6907
6908 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6909
6910         * typemanager.cs (TypeManager): Removed MakePinned method, this
6911         mechanism is replaced with the .NET 2.x compatible mechanism of
6912         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6913
6914         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6915         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6916         `IsFixed' property which has a different meaning.
6917
6918 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6919
6920         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6921         visible from inside a nested class, not just the names of the
6922         immediately enclosing class.
6923         Fix for bug #60730.
6924
6925 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6926
6927         * expression.cs (BetterConversion): Remove buggy special-case
6928         handling of "implicit constant expression conversions".  At this
6929         point, we already know that the conversion is possible -- we're
6930         only checking to see which is better.
6931
6932 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6933
6934         * cs-parser.jay: Added error CS0210 test.
6935
6936 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6937
6938         * cs-parser.jay: Added error CS0134 test.
6939
6940 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6941
6942         Fix bug #52507
6943         * cs-parser.jay: Added error CS0145 test.
6944
6945 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6946
6947         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6948
6949 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6950         
6951         * expression.cs (StackAlloc.Resolve): The argument may not
6952         be a constant; deal with this case.
6953         
6954 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6955
6956         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6957         GetIndexerAttributeValue.
6958         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6959
6960         * class.cs (Indexer.Define): Added error tests for CS0415,
6961         CS0609.
6962
6963 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6964
6965         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6966         property code.
6967
6968 2004-06-23  Martin Baulig  <martin@ximian.com>
6969
6970         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6971         neither return nor throw, reset the barrier as well.  Fixes #60457.
6972
6973 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6974
6975         * class.cs : EventAttributes is now set to None by default.
6976           This fixes bug #60459.
6977
6978 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6979
6980         Fix bug #60219
6981         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6982         Don't throw exception but return null (it's sufficient now).
6983
6984 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6985
6986         * typemanager.cs (GetArgumentTypes): Faster implementation.
6987
6988 2004-06-18  Martin Baulig  <martin@ximian.com>
6989
6990         * attribute.cs (Attribute.Resolve): Check whether we're an
6991         EmptyCast which a Constant child.  Fixes #60333.
6992
6993 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6994
6995         * statement.cs (EmitCollectionForeach): Account for the fact that
6996         not all valuetypes are in areas which we can take the address of.
6997         For these variables, we store to a temporary variable. Also, make
6998         sure that we dont emit a `callvirt' on a valuetype method.
6999
7000 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7001
7002         * expression.cs (StackAlloc.DoReSolve): Added test for
7003         negative parameter (CS0247).
7004
7005 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7006
7007         Fix bug #59792
7008         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7009
7010 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7011
7012         Fix bug #59781
7013         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7014         ulong.
7015
7016 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7017
7018         Fix bug #58254 & cs1555.cs, cs1556.cs
7019         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7020
7021 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7022
7023         * cs-parser.jay: Added error CS1669 test for indexers.
7024
7025 2004-06-18  Martin Baulig  <martin@ximian.com>
7026
7027         * generics.cs (GenericMethod.ctor): Don't take an Attributes
7028         argument.  Fixes #60441.
7029
7030 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
7031         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
7032         The name needs to have the actual name of the method in order
7033         for other tests (such as the one in OverloadResolve for Invoke
7034         on a delegate) to work. As well, it does not really help
7035         error reporting because the method group had multiple methods.
7036         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
7037         Make profiling work.
7038         
7039 2004-06-13  Martin Baulig  <martin@ximian.com>
7040
7041         * cs-parser.jay: Don't allow generic attributes.
7042
7043 2004-06-13  Martin Baulig  <martin@ximian.com>
7044
7045         * class.cs (MemberBase.DoDefineBase): New protected method.
7046         (MemberBase.DoDefine): Compute the `flags' in the new
7047         DoDefineBase() which must be called first.
7048         (Method.Define): Call DoDefineBase() first so we have the flags
7049         when defining the generic method.
7050
7051         * cs-parser.jay (interface_method_declaration): Support generic methods.
7052
7053 2004-06-13  Martin Baulig  <martin@ximian.com>
7054
7055         * decl.cs (TypeName): Removed.
7056         (MemberName): Removed TypeName and MemberNow; now we just have
7057         MemberName.
7058
7059         * cs-parser.jay: Don't distinguish between type arguments and type
7060         parameters in the grammar and simplified the rules a bit.  The
7061         reduce/reduce conflicts are now gone (except the one we inherited
7062         from mcs).
7063
7064 2004-06-11  Martin Baulig  <martin@ximian.com>
7065
7066         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7067         call this twice: for params and varargs methods.
7068
7069 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7070
7071         * class.cs:
7072         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7073
7074 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7075
7076         * attribute.cs (Attribute.GetValidTargets): Made public.
7077
7078         * class.cs: 
7079         (AbstractPropertyEventMethod): New class for better code sharing.
7080         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7081         CS1667 report.
7082         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7083
7084 2004-06-09  Martin Baulig  <martin@ximian.com>
7085
7086         * cs-parser.jay: Removed a reduce/reduce conflict.
7087
7088 2004-06-03  Martin Baulig  <martin@ximian.com>
7089
7090         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
7091         GetSimpleName() and return a SimpleName.
7092
7093         * ecore.cs (SimpleName.Arguments): New public field.
7094         (SimpleName): Added overloaded ctor which takes an additional
7095         TypeArguments argument.
7096         (SimpleName.SimpleNameResolve): Added support for generic methods.
7097         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
7098         formerly in MemberAccess.DoResolve(), but we also need it in
7099         SimpleNameResolve().
7100
7101         * expression.cs (MemberAccess.DoResolve): Use the new
7102         MethodGroupExpr.ResolveGeneric().       
7103
7104 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7105
7106         * decl.cs: If possible, use lookuptypedirect here. We can only do
7107         this if there is no `.' after the namespace. Avoids using
7108         LookupType, which does lots of slow processing.
7109         (FindNestedType) New method, does what it says :-).
7110         * namespace.cs: use LookupTypeDirect.
7111         * rootcontext.cs: use membercache, if possible.
7112         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7113
7114 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7115
7116         * expression.cs:
7117         According to the spec, 
7118
7119         In a member access of the form E.I, if E is a single identifier,
7120         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7121         field, property, localvariable, or parameter with the same type as
7122         the meaning of E as a type-name (§3.8), then both possible
7123         meanings of E are permitted.
7124
7125         We did not check that E as a simple-name had the same type as E as
7126         a type name.
7127
7128         This trivial check gives us 5-7% on bootstrap time.
7129
7130 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7131
7132         * expression.cs (Invocation.OverloadResolve): Avoid the
7133         use of hashtables and boxing here by allocating on demand.
7134
7135 2004-05-30  Martin Baulig  <martin@ximian.com>
7136
7137         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7138         we're doing a silent lookup.  Don't try to lookup nested types in
7139         TypeManager.object_type (thanks to Ben Maurer).
7140
7141 2004-05-30  Martin Baulig  <martin@ximian.com>
7142
7143         Committing a patch from Ben Maurer.
7144
7145         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7146
7147 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7148
7149         * convert.cs: add a trivial cache for overload operator resolution.
7150
7151 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
7152
7153         * attribute.cs
7154         (AttributeTester.GetObsoleteAttribute): Returns instance of
7155         ObsoleteAttribute when type is obsolete.
7156
7157         * class.cs
7158         (TypeContainer.VerifyObsoleteAttribute): Override.
7159         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7160         (MethodCode.VerifyObsoleteAttribute): Override.
7161         (MemberBase.VerifyObsoleteAttribute): Override.
7162
7163         * decl.cs
7164         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7165         and report proper error.
7166
7167         *delegate.cs
7168         (Delegate.VerifyObsoleteAttribute): Override.
7169
7170         * ecore.cs
7171         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7172         and report proper error.
7173         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7174
7175         * enum.cs
7176         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7177         and enum member.
7178
7179         * expression.cs
7180         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7181         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7182         Added test for ObsoleteAttribute.
7183
7184         * statement.cs
7185         (Catch): Derived from Statement.
7186
7187 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7188
7189         * decl.cs: If possible, use lookuptypedirect here. We can only do
7190         this if there is no `.' after the namespace. Avoids using
7191         LookupType, which does lots of slow processing.
7192         (FindNestedType) New method, does what it says :-).
7193         * namespace.cs: use LookupTypeDirect.
7194         * rootcontext.cs: use membercache, if possible.
7195         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7196
7197 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7198
7199         * expression.cs:
7200         According to the spec, 
7201
7202         In a member access of the form E.I, if E is a single identifier,
7203         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7204         field, property, localvariable, or parameter with the same type as
7205         the meaning of E as a type-name (§3.8), then both possible
7206         meanings of E are permitted.
7207
7208         We did not check that E as a simple-name had the same type as E as
7209         a type name.
7210
7211         This trivial check gives us 5-7% on bootstrap time.
7212
7213 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7214
7215         Fixed bug #59071 & cs0160.cs
7216         * statement.cs (Try.Resolve): Check here whether order of catch
7217         clauses matches their dependencies.
7218
7219 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
7220
7221         Fixed bug #58624
7222         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
7223         unsafe type.
7224
7225 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7226
7227         * expression.cs (Invocation.OverloadResolve): Avoid the
7228         use of hashtables and boxing here by allocating on demand.
7229
7230 2004-05-30  Martin Baulig  <martin@ximian.com>
7231
7232         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7233         we're doing a silent lookup.  Don't try to lookup nested types in
7234         TypeManager.object_type (thanks to Ben Maurer).
7235
7236 2004-05-30  Martin Baulig  <martin@ximian.com>
7237
7238         Committing a patch from Ben Maurer.
7239
7240         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
7241
7242 2004-05-29  Martin Baulig  <martin@ximian.com>
7243
7244         * class.cs (IMethodData.ShouldIgnore): New method.
7245
7246         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7247         `Location' argument, we don't need it anywhere.  Use
7248         `IMethodData.ShouldIgnore ()' instead of
7249         `MethodData.GetMethodFlags ()'.
7250         (TypeManager.AddMethod): Removed.
7251         (TypeManager.AddMethod2): Renamed to AddMethod.
7252
7253 2004-05-29  Martin Baulig  <martin@ximian.com>
7254
7255         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7256
7257         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7258         converting from a class type S to an interface type and we already
7259         have an object on the stack, don't box it again.  Fixes #52578.
7260
7261 2004-05-29  Martin Baulig  <martin@ximian.com>
7262
7263         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7264         Added support for `params' parameters.  Fixes #59267.
7265
7266 2004-05-29  Martin Baulig  <martin@ximian.com>
7267
7268         * literal.cs (NullPointer): Provide a private .ctor which sets
7269         `type' to TypeManager.object_type.  Fixes #59048.
7270
7271 2004-05-29  Martin Baulig  <martin@ximian.com>
7272
7273         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7274         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7275
7276         * ecore.cs (EventExpr.instance_expr): Make the field private.
7277
7278 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7279
7280         Fixed bug #50080 & cs0214-2.cs
7281         * expression.cs (Cast.DoResolve): Check unsafe context here.
7282         
7283         * statement.cs (Resolve.DoResolve): Likewise.
7284
7285 2004-05-26  Martin Baulig  <martin@ximian.com>
7286
7287         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7288
7289         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7290         (RootContext.LookupType): Pass down the `silent' flag.
7291
7292 2004-05-25  Martin Baulig  <martin@ximian.com>
7293
7294         * expression.cs
7295         (MethodGroupExpr.IdenticalTypeName): New public property.
7296         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7297         expression actually refers to a type.
7298
7299 2004-05-25  Martin Baulig  <martin@ximian.com>
7300
7301         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7302         for #56176 and made it actually work.
7303
7304 2004-05-25  Martin Baulig  <martin@ximian.com>
7305
7306         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7307         (FieldExpr, PropertyExpr): Override and implement
7308         CacheTemporaries.  Fixes #52279.
7309
7310 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7311
7312         * location.cs: In the new compiler listing a file twice is a
7313         warning, not an error.
7314
7315 2004-05-24  Martin Baulig  <martin@ximian.com>
7316
7317         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7318         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7319
7320 2004-05-24  Martin Baulig  <martin@ximian.com>
7321
7322         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7323         walking the `using' list.  Fixes #53921.
7324
7325 2004-05-24  Martin Baulig  <martin@ximian.com>
7326
7327         * const.cs (Const.LookupConstantValue): Added support for
7328         EmptyCast's; fixes #55251.
7329
7330 2004-05-24  Martin Baulig  <martin@ximian.com>
7331
7332         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7333         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7334         which does the CS0135 check.  The reason is that we first need to
7335         check whether the variable actually exists.
7336
7337 2004-05-24  Martin Baulig  <martin@ximian.com>
7338
7339         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7340         than RootContext.LookupType() to find the explicit interface
7341         type.  Fixes #58584.
7342
7343 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7344
7345         * Makefile: Simplify.  Use executable.make.
7346         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7347
7348 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7349
7350         * decl.cs:
7351         * enum.cs:
7352         Use the invariant culture when doing String.Compare for CLS case
7353         sensitivity.
7354         
7355 2004-05-23  Martin Baulig  <martin@ximian.com>
7356
7357         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7358         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7359
7360         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7361
7362 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7363
7364         * class.cs (MemberBase.Define): Reuse MemberType member for 
7365         resolved type. Other methods can use it too.
7366
7367 2004-05-23  Martin Baulig  <martin@ximian.com>
7368
7369         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
7370         the variable also exists in the current block (otherwise, we need
7371         to report a CS0103).  Fixes #58670.
7372
7373 2004-05-23  Martin Baulig  <martin@ximian.com>
7374
7375         * flowanalysis.cs (Reachability.Reachable): Compute this
7376         on-the-fly rather than storing it as a field.
7377
7378 2004-05-23  Martin Baulig  <martin@ximian.com>
7379
7380         * flowanalysis.cs (Reachability.And): Manually compute the
7381         resulting `barrier' from the reachability.      
7382        
7383 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7384
7385         Fix bug #57835
7386         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
7387         instance of ObsoleteAttribute when symbol is obsolete.
7388
7389         * class.cs
7390         (IMethodData): Extended interface for ObsoleteAttribute support.
7391
7392 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7393
7394         * attribute.cs: Fix bug #55970
7395
7396 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
7397
7398         Fix bug #52705
7399         * attribute.cs
7400         (GetObsoleteAttribute): New method. Creates the instance of
7401         ObsoleteAttribute.
7402         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
7403         ObsoleteAttribute when member is obsolete.
7404         (AttributeTester.Report_ObsoleteMessage): Common method for
7405         Obsolete error/warning reporting.
7406
7407         * class.cs
7408         (TypeContainer.base_classs_type): New member for storing parent type.
7409
7410         * decl.cs
7411         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
7412         for this MemberCore.
7413
7414 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7415
7416         * attribute.cs, const.cs: Fix bug #58590
7417
7418 2004-05-21  Martin Baulig  <martin@ximian.com>
7419
7420         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
7421         out parameters if the end of the method is unreachable.  Fixes
7422         #58098. 
7423
7424 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7425
7426         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
7427         Hari was right, why extra method.
7428
7429 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
7430
7431         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
7432
7433 2004-05-20  Martin Baulig  <martin@ximian.com>
7434
7435         * delegate.cs: Convert this file to Unix mode - like the original
7436         version in mcs is.
7437
7438 2004-05-20  Martin Baulig  <martin@ximian.com>
7439
7440         * attribute.cs: Convert this file to Unix mode - like the original
7441         version in mcs is.
7442
7443 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
7444
7445        Fix bug #58688 (MCS does not report error when the same attribute
7446        is assigned twice)
7447
7448        * attribute.cs (Attribute.Emit): Distinction between null and default.
7449
7450 2004-05-19  Raja R Harinath  <rharinath@novell.com>
7451
7452        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
7453        of a top-level attribute without an attribute target.
7454        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
7455        Make non-static.
7456        (Attribute.Conditional_GetConditionName), 
7457        (Attribute.Obsolete_GetObsoleteMessage): Update.
7458        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7459        part of ScanForIndexerName.
7460        (Attribute.CanIgnoreInvalidAttribute): New function.
7461        (Attribute.ScanForIndexerName): Move to ...
7462        (Attributes.ScanForIndexerName): ... here.
7463        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7464        (Attributes.Search): New internal variant that can choose not to
7465        complain if types aren't resolved.  The original signature now
7466        complains.
7467        (Attributes.GetClsCompliantAttribute): Use internal variant, with
7468        complaints suppressed.
7469        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7470        only if it not useful.
7471        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7472        top-level for attributes that are shared between the assembly
7473        and a top-level class.
7474        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7475        * class.cs: Update to reflect changes.
7476        (DefineIndexers): Fuse loops.
7477        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7478        a couple more variants of attribute names.
7479
7480 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7481
7482         Fix bug #52585 (Implemented explicit attribute declaration)
7483
7484         * attribute.cs:
7485         (Attributable.ValidAttributeTargets): New abstract method. It gets
7486         list of valid attribute targets for explicit target declaration.
7487         (Attribute.Target): It holds target itself.
7488         (AttributeSection): Removed.
7489         (Attribute.CheckTargets): New method. It checks whether attribute
7490         target is valid for the current element.
7491
7492         * class.cs:
7493         (EventProperty): New class. For events that are declared like
7494         property (with add and remove accessors).
7495         (EventField): New class. For events that are declared like field.
7496         class.cs
7497
7498         * cs-parser.jay: Implemented explicit attribute target declaration.
7499
7500         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7501         Override ValidAttributeTargets.
7502
7503         * parameter.cs:
7504         (ReturnParameter): Class for applying custom attributes on 
7505         the return type.
7506         (ParameterAtribute): New class. Class for applying custom
7507         attributes on the parameter type.
7508
7509 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7510
7511         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7512         definitions. 
7513
7514         (Method): Allow UNSAFE here.
7515
7516         * modifiers.cs: Support unsafe reporting.
7517
7518 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7519
7520         * decl.cs: Fix bug #58478.
7521
7522 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7523
7524         * statement.cs: When checking for unreachable code on an EmptyStatement,
7525         set the location. Fixes bug #58488.
7526
7527 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7528
7529         * driver.cs: Add -pkg handling.
7530
7531         From Gonzalo: UseShelLExecute=false
7532
7533 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7534
7535         * attribute.cs:
7536         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7537         for attribute.
7538         (Attribute.IsClsCompliaceRequired): Moved to base for better
7539         accesibility.
7540         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7541         when attribute is AttributeUsageAttribute.
7542         (Attribute.GetValidTargets): Simplified.
7543         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7544         attribute for this type.
7545         (Attribute.ApplyAttributes): Method renamed to Emit and make
7546         non-static.
7547         (GlobalAttributeSection): New class for special handling of global
7548         attributes (assembly, module).
7549         (AttributeSection.Emit): New method.
7550
7551         * class.cs: Implemented Attributable abstract methods.
7552         (MethodCore.LabelParameters): Moved to Parameter class.
7553         (Accessor): Is back simple class.
7554         (PropertyMethod): Implemented Attributable abstract class.
7555         (DelegateMethod): Implemented Attributable abstract class.
7556         (Event): New constructor for disctintion between normal Event
7557         and Event with accessors.
7558
7559         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7560
7561         * codegen.cs, const.cs, decl.cs, delegate.cs:
7562         (CommonAssemblyModulClass): Implemented Attributable abstract class
7563         and simplified.
7564
7565         * enum.cs: Implement IAttributeSupport interface.
7566         (EnumMember): New class for emum members. Implemented Attributable
7567         abstract class
7568
7569         * parameter.cs:
7570         (ParameterBase): Is abstract.
7571         (ReturnParameter): New class for easier [return:] attribute handling.
7572
7573         * typemanager.cs: Removed builder_to_attr.
7574
7575 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7576
7577         Fix bug #57151.
7578         * attribute.cs (Attribute.GetPositionalValue): New function.
7579         * class.cs (TypeContainer.VerifyMembers): New function.
7580         (TypeContainer.Emit): Use it.
7581         (ClassOrStruct): New base class for Class and Struct.
7582         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7583         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7584         class.
7585         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7586         then each non-static field should have a FieldOffset attribute.
7587         Otherwise, none of the fields should have a FieldOffset attribute.
7588         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7589         and FieldOffset attributes.
7590         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7591         (TypeManager.field_offset_attribute_type): New core types.
7592         (TypeManager.InitCoreTypes): Initialize them.
7593
7594 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7595
7596         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7597         Return correct type.
7598         From bug #58270.
7599
7600 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7601
7602         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7603         be implicitly converted to ulong.
7604         
7605         * expression.cs: The logic for allowing operator &, | and ^ worked
7606         was wrong, it worked before because we did not report an error in
7607         an else branch.  Fixes 57895.
7608
7609         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7610         allow volatile fields to be reference types.
7611
7612 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7613
7614         * driver.cs: Add support for /debug-
7615
7616 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7617
7618         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7619         Add a 'complain' parameter to silence errors.
7620         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7621         silently overlooked type-resolutions.
7622         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7623         to reflect changes.
7624         (Attributes.Search): New function.
7625         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7626         (Attributes.GetAttributeFullName): Remove hack.
7627         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7628         Update to reflect changes.
7629         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7630         Use Attributes.Search instead of nested loops.
7631
7632 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7633
7634         * decl.cs:
7635         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7636         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7637         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7638
7639         * report.cs: (Report.Warning): Renamed to Warning_T because of
7640         parameter collision.
7641
7642 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7643
7644         * expression.cs (MemberAccess.ResolveMemberAccess):
7645         Exit with non-zero status after Report.Error.
7646         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7647         Likewise.
7648         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7649
7650 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7651
7652         * support.cs: Don't hang when the file is empty.
7653
7654 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7655
7656         * support.cs: In SeekableStreamReader, compute the preamble size of the
7657           underlying stream. Position changes should take into account that initial
7658           count of bytes.
7659
7660 2004-05-03  Todd Berman  <tberman@sevenl.net>
7661
7662         * driver.cs: remove unused GetSysVersion function.
7663
7664 2004-05-03  Todd Berman  <tberman@sevenl.net>
7665
7666         * driver.cs: Remove the hack from saturday, as well as the hack
7667         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7668         link_paths to get that bit proper.
7669
7670 2004-05-01  Todd Berman  <tberman@sevenl.net>
7671
7672         * driver.cs: Try a LoadFrom before a Load, this checks the current
7673         path. This is currently a bug in mono that is be fixed, however, this
7674         provides a workaround for now. This will be removed when the bug
7675         is fixed.
7676
7677 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7678
7679         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7680         incomplete key pairs (#57941).
7681
7682 2004-05-01  Todd Berman  <tberman@sevenl.net>
7683
7684         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7685         from the GAC
7686
7687 2004-04-30  Jackson Harper  <jackson@ximian.com>
7688
7689         * codegen.cs: Open keys readonly.
7690         
7691 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7692
7693         * typemanager.cs: don't report cyclic struct layout when a struct
7694         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7695         which has 2 Pango.Rectangle fields.
7696
7697 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7698
7699         * expression.cs: Handle IntPtr comparisons with IL code
7700         rather than a method call.
7701
7702 2004-04-29  Martin Baulig  <martin@ximian.com>
7703
7704         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7705         the list of PropertyInfo's in class hierarchy and find the
7706         accessor.  Fixes #56013.
7707
7708 2004-04-29  Martin Baulig  <martin@ximian.com>
7709
7710         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7711
7712 2004-04-29  Martin Baulig  <martin@ximian.com>
7713
7714         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7715
7716         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7717
7718 2004-04-29  Martin Baulig  <martin@ximian.com>
7719
7720         * class.cs (ConstructorInitializer.Resolve): Check whether the
7721         parent .ctor is accessible.  Fixes #52146.
7722
7723 2004-04-29  Martin Baulig  <martin@ximian.com>
7724
7725         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7726
7727         * statement.cs (Using.EmitLocalVariableDecls): Use
7728         TypeManager.idisposable_type, not typeof (IDisposable).
7729         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7730
7731 2004-04-29  Martin Baulig  <martin@ximian.com>
7732
7733         * class.cs (Event.Define): Don't emit the field and don't set
7734         RTSpecialName and SpecialName for events on interfaces.  Fixes
7735         #57703. 
7736
7737 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7738
7739         Refactor Attribute.ApplyAttributes.
7740         * attribute.cs (Attributable): New base class for objects that can
7741         have Attributes applied on them.
7742         (Attribute): Make AttributeUsage fields public.
7743         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7744         (Attribute.IsInternalCall): New property.
7745         (Attribute.UsageAttr): Convert to a public read-only property.
7746         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7747         (Attribute.ResolveType, Attribute.Resolve)
7748         (Attribute.ScanForIndexerName): Update to reflect changes.
7749         (Attribute.CheckAttributeTarget): Re-format.
7750         (Attribute.ApplyAttributes): Refactor, to various
7751         Attributable.ApplyAttributeBuilder methods.
7752         * decl.cs (MemberCore): Make Attributable.
7753         * class.cs (Accessor): Make Attributable.
7754         (MethodData.ApplyAttributes): Use proper attribute types, not
7755         attribute names.
7756         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7757         (TypeContainer.ApplyAttributeBuilder)
7758         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7759         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7760         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7761         (Operator.ApplyAttributeBuilder): New factored-out methods.
7762         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7763         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7764         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7765         * parameter.cs (ParameterBase): New Attributable base class
7766         that can also represent Return types.
7767         (Parameter): Update to the changes.
7768
7769 2004-04-29  Jackson Harper  <jackson@ximian.com>
7770
7771         * driver.cs: Prefer the corlib system version when looking for
7772         assemblies in the GAC. This is still a hack, but its a better hack
7773         now.
7774         
7775 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7776
7777         * decl.cs, enum.cs: Improved error 3005 reporting.
7778   
7779         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7780         (related_symbols): New private member for list of symbols
7781         related to reported error/warning.
7782         
7783         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7784
7785 2004-04-29  Martin Baulig  <martin@ximian.com>
7786
7787         * ecore.cs (Expression.Constantify): If we're an enum and
7788         TypeManager.TypeToCoreType() doesn't give us another type, use
7789         t.UnderlyingSystemType.  Fixes #56178.  
7790
7791 2004-04-29  Martin Baulig  <martin@ximian.com>
7792
7793         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7794         interfaces and for each interface, only add members directly
7795         declared in that interface.  Fixes #53255.
7796
7797 2004-04-28  Martin Baulig  <martin@ximian.com>
7798
7799         * expression.cs (ConditionalLogicalOperator): Use a temporary
7800         variable for `left' to avoid that we evaluate it more than once;
7801         bug #52588.
7802
7803 2004-04-28  Martin Baulig  <martin@ximian.com>
7804
7805         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7806         `void[]' (CS1547).
7807
7808 2004-04-28  Martin Baulig  <martin@ximian.com>
7809
7810         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7811         void (CS1547).
7812
7813         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7814         whether the type is not void (CS1547).
7815
7816 2004-04-28  Martin Baulig  <martin@ximian.com>
7817
7818         * expression.cs (Unary.DoResolveLValue): Override this and report
7819         CS0131 for anything but Operator.Indirection.
7820
7821 2004-04-28  Martin Baulig  <martin@ximian.com>
7822
7823         Committing a patch from Ben Maurer; see bug #50820.
7824
7825         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7826         check for classes.
7827
7828         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7829         classes.        
7830
7831 2004-04-28  Martin Baulig  <martin@ximian.com>
7832
7833         Committing a patch from Ben Maurer; see bug #50820.
7834
7835         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7836         check for classes.
7837
7838         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7839         classes.        
7840
7841 2004-04-28  Martin Baulig  <martin@ximian.com>
7842
7843         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7844         (Block.AddLabel): Call DoLookupLabel() to only search in the
7845         current block.
7846
7847 2004-04-28  Martin Baulig  <martin@ximian.com>
7848
7849         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7850         comparing StringConstants and NullLiterals in Equality and Inequality.
7851
7852 2004-04-28  Jackson Harper  <jackson@ximian.com>
7853
7854         * driver.cs: Attempt to load referenced assemblies from the
7855         GAC. This is the quick and dirty version of this method that
7856         doesnt take into account versions and just takes the first
7857         canidate found. Will be good enough for now as we will not have more
7858         then one version installed into the GAC until I update this method.
7859
7860 2004-04-28  Martin Baulig  <martin@ximian.com>
7861
7862         * typemanager.cs (TypeManager.CheckStructCycles): New public
7863         static method to check for cycles in the struct layout.
7864
7865         * rootcontext.cs (RootContext.PopulateTypes): Call
7866         TypeManager.CheckStructCycles() for each TypeContainer.
7867         [Note: We only need to visit each type once.]
7868
7869 2004-04-28  Martin Baulig  <martin@ximian.com>
7870
7871         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7872
7873         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7874         success and added `out object value'.  Use a `bool resolved' field
7875         to check whether we've already been called rather than
7876         `ConstantValue != null' since this breaks for NullLiterals.
7877
7878 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7879
7880         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7881         setting of this flag, since the 'set' method may be non-public.
7882
7883 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7884
7885         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7886         check on current_vector.Block.
7887
7888 2004-04-27  Martin Baulig  <martin@ximian.com>
7889
7890         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7891         a field initializer.  Fixes #56459.
7892
7893 2004-04-27  Martin Baulig  <martin@ximian.com>
7894
7895         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7896         we're not attempting to use an indexer.  Fixes #52154.
7897
7898 2004-04-27  Martin Baulig  <martin@ximian.com>
7899
7900         * statement.cs (Return): Don't create a return label if we don't
7901         need it; reverts my change from January 20th.  Thanks to Ben
7902         Maurer for this.
7903
7904 2004-04-27  Martin Baulig  <martin@ximian.com>
7905
7906         According to the spec, `goto' can only leave a nested scope, but
7907         never enter it.
7908
7909         * statement.cs (Block.LookupLabel): Only lookup in the current
7910         block, don't recurse into parent or child blocks.
7911         (Block.AddLabel): Check in parent and child blocks, report
7912         CS0140/CS0158 if we find a duplicate.
7913         (Block): Removed this indexer for label lookups.
7914         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7915         this already does the error reporting for us.
7916
7917         * flowanalysis.cs
7918         (FlowBranching.UsageVector.Block): New public variable; may be null.
7919         (FlowBranching.CreateSibling): Added `Block' argument.
7920         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7921         label for the target of a `goto' and check whether we're not
7922         leaving a `finally'.
7923
7924 2004-04-27  Martin Baulig  <martin@ximian.com>
7925
7926         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7927         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7928         just for returns).
7929
7930 2004-04-27  Martin Baulig  <martin@ximian.com>
7931
7932         * statement.cs (Block.AddLabel): Also check for implicit blocks
7933         and added a CS0158 check.
7934
7935 2004-04-27  Martin Baulig  <martin@ximian.com>
7936
7937         * flowanalysis.cs (FlowBranchingLoop): New class.
7938         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7939         UsageVector's instead of an ArrayList.
7940         (FlowBranching.Label): Likewise.
7941         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7942         (FlowBranching.AddBreakVector): New method.
7943
7944 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7945
7946         * attribute.cs: Small regression fix: only convert the type if we
7947         the type is different, fixes System.Drawing build.
7948
7949 2004-04-27  Martin Baulig  <martin@ximian.com>
7950
7951         * attribute.cs (Attribute.Resolve): If we have a constant value
7952         for a named field or property, implicity convert it to the correct
7953         type.
7954
7955 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7956
7957         * statement.cs (Block.Block): Implicit blocks share
7958         'child_variable_names' fields with parent blocks.
7959         (Block.AddChildVariableNames): Remove.
7960         (Block.AddVariable): Mark variable as "used by a child block" in
7961         every surrounding block.
7962         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7963         been used in a child block, complain about violation of "Invariant
7964         meaning in blocks" rule.
7965         * cs-parser.jay (declare_local_variables): Don't use
7966         AddChildVariableNames.
7967         (foreach_statement): Don't create an implicit block: 'foreach'
7968         introduces a scope.
7969
7970 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7971
7972         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7973         converting from 0L to ulong.  Fixes 57522.
7974
7975 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7976
7977         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7978         derived class hides via 'new' keyword field from base class (test-242.cs).
7979         TODO: Handle this in the more general way.
7980         
7981         * class.cs (CheckBase): Ditto.
7982
7983 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7984
7985         * decl.cs (caching_flags): New member for storing cached values
7986         as bit flags.
7987         (MemberCore.Flags): New enum where bit flags for caching_flags
7988         are defined.
7989         (MemberCore.cls_compliance): Moved to caching_flags.
7990         (DeclSpace.Created): Moved to caching_flags.
7991
7992         * class.cs: Use caching_flags instead of DeclSpace.Created
7993         
7994 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7997         if we are only a derived class, not a nested class.
7998
7999         * typemanager.cs: Same as above, but do this at the MemberLookup
8000         level (used by field and methods, properties are handled in
8001         PropertyExpr).   Allow for the qualified access if we are a nested
8002         method. 
8003
8004 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8005
8006         * class.cs: Refactoring.
8007         (IMethodData): New inteface; Holds links to parent members
8008         to avoid member duplication (reduced memory allocation).
8009         (Method): Implemented IMethodData interface.
8010         (PropertyBase): New inner classes for get/set methods.
8011         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8012         (Event): New inner classes for add/remove methods.
8013         (Event.DelegateMethod): Implemented IMethodData interface.
8014
8015         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8016         EmitContext (related to class.cs refactoring).
8017
8018 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8019
8020         * delegate.cs (Delegate.VerifyApplicability): If the number of
8021         arguments are the same as the number of parameters, first try to
8022         verify applicability ignoring  any 'params' modifier on the last
8023         parameter.
8024         Fixes #56442.
8025
8026 2004-04-08  Martin Baulig  <martin@ximian.com>
8027
8028         Merged latest changes into gmcs.  Please keep this comment in
8029         here, it makes it easier for me to see what changed in MCS since
8030         the last time I merged.
8031
8032 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8033
8034         * class.cs (TypeContainer.AddIndexer): Use
8035         'ExplicitInterfaceName' to determine if interface name was
8036         explicitly specified.  'InterfaceType' is not initialized at this time.
8037         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8038         Indexers array is already in the required order.  Initialize
8039         'IndexerName' only if there are normal indexers.
8040         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8041         (TypeContainer.Emit): Emit DefaultMember attribute only if
8042         IndexerName is initialized.
8043         Fixes #56300.
8044
8045 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8046
8047         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8048         Fixes #57007
8049
8050 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8051
8052         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8053         attributes.
8054         Fix for #56456.
8055
8056         * attribute.cs (Attribute.Resolve): Check for duplicate named
8057         attributes.
8058         Fix for #56463.
8059
8060 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8061
8062         * iterators.cs (MarkYield): track whether we are in an exception,
8063         and generate code accordingly.  Use a temporary value to store the
8064         result for our state.
8065
8066         I had ignored a bit the interaction of try/catch with iterators
8067         since their behavior was not entirely obvious, but now it is
8068         possible to verify that our behavior is the same as MS .NET 2.0
8069
8070         Fixes 54814
8071
8072 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8073
8074         * iterators.cs: Avoid creating temporaries if there is no work to
8075         do. 
8076
8077         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8078         Enumerations, use TypeManager.EnumToUnderlying and call
8079         recursively. 
8080
8081         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8082         bug #57013
8083
8084         (This.Emit): Use EmitContext.EmitThis to emit our
8085         instance variable.
8086
8087         (This.EmitAssign): Ditto.
8088
8089         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8090         codepaths, we will move all the functionality into
8091         Mono.CSharp.This 
8092
8093         (FieldExpr.EmitAssign): Ditto.
8094
8095         This fixes several hidden bugs that I uncovered while doing a code
8096         review of this today.
8097
8098         * codegen.cs (EmitThis): reworked so the semantics are more clear
8099         and also support value types "this" instances.
8100
8101         * iterators.cs: Changed so that for iterators in value types, we
8102         do not pass the value type as a parameter.  
8103
8104         Initialization of the enumerator helpers is now done in the caller
8105         instead of passing the parameters to the constructors and having
8106         the constructor set the fields.
8107
8108         The fields have now `assembly' visibility instead of private.
8109
8110 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8111
8112         * expression.cs (Argument.Resolve): Check if fields passed as ref
8113         or out are contained in a MarshalByRefObject.
8114
8115         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8116         another compiler type.
8117
8118 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8119
8120         * class.cs (Indexer.Define): use the new name checking method.
8121         Also, return false on an error.
8122         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8123         (is_identifier_[start/part]_character): make static.
8124
8125 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * expression.cs (Binary.ResolveOperator): Do no append strings
8128         twice: since we can be invoked more than once (array evaluation)
8129         on the same concatenation, take care of this here.  Based on a fix
8130         from Ben (bug #56454)
8131
8132 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8133
8134         * codegen.cs: Fix another case where CS1548 must be reported (when 
8135         delay-sign isn't specified and no private is available #56564). Fix
8136         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8137         error when MCS is used on the MS runtime and we need to delay-sign 
8138         (which seems unsupported by AssemblyBuilder - see #56621).
8139
8140 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8141
8142         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8143         (TypeManager.ComputeNamespaces): Faster implementation for
8144         Microsoft runtime.
8145
8146         * compiler.csproj: Updated AssemblyName to mcs.
8147
8148 2004-05-11  Jackson Harper  <jackson@ximian.com>
8149
8150         * Makefile: Preserve MONO_PATH
8151         
8152 2004-05-11  Jackson Harper  <jackson@ximian.com>
8153
8154         * Makefile: Use mono and mcs to build gmcs
8155         
8156 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
8157
8158         * codegen.cs: Add patch from Robert Shade
8159         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
8160         sync with mcs.
8161
8162 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
8163
8164         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8165         incomplete key pairs (#57941).
8166
8167 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8168
8169         * codegen.cs: Fix another case where CS1548 must be reported (when 
8170         delay-sign isn't specified and no private is available #56564). Fix
8171         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8172         error when MCS is used on the MS runtime and we need to delay-sign 
8173         (which seems unsupported by AssemblyBuilder - see #56621).
8174
8175 2004-04-29  Jackson Harper  <jackson@ximian.com>
8176
8177         * Makefile: Set MONO_PATH to use the bootstrap corlib
8178         * driver.cs: Check the GAC for referenced assemblies.
8179                 
8180 2004-04-29  Martin Baulig  <martin@ximian.com>
8181
8182         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
8183
8184 2004-04-07  Martin Baulig  <martin@ximian.com>
8185
8186         * expression.cs (Binary.ResolveOperator): Added special case for
8187         Equality/Inequality between a type parameter and a null literal.
8188
8189 2004-04-07  Martin Baulig  <martin@ximian.com>
8190
8191         * convert.cs: Check null literal -> type parameter conversions.
8192
8193 2004-04-07  Martin Baulig  <martin@ximian.com>
8194
8195         * generic.cs (ConstructedType.CheckConstraints): Enforce the
8196         `class' and `struct' constraints.
8197
8198 2004-04-07  Martin Baulig  <martin@ximian.com>
8199
8200         * generic.cs (SpecialConstraint): New public enum.
8201         (Constraints.Resolve): Added support for the `class' and `struct'
8202         constraints.
8203
8204         * cs-parser.jay (type_parameter_constraint): Added support for the
8205         `class' and `struct' constraints.
8206
8207 2004-04-07  Martin Baulig  <martin@ximian.com>
8208
8209         * support.cs (GenericConstraints): Replaced `Types' by
8210         `ClassConstraint' and `InterfaceConstraints'; added
8211         `HasClassConstraint'.   
8212
8213 2004-04-07  Martin Baulig  <martin@ximian.com>
8214
8215         * generic.cs
8216         (Constraints.InterfaceConstraints): New public property.
8217         (Constraints.Types): Make this property public
8218         (TypeParameter): Implement IMemberContainer.
8219         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
8220         instead of a TypeBuilder/MethodBuilder; pass the interface
8221         constraints to TypeManager.AddTypeParameter().
8222         (TypeParameter.DefineType): Just take an EmitContext and no
8223         TypeBuilder/MethodBuilder.  Use the new public API.
8224
8225         * typemanager.cs (TypeManager.AddTypeParameter): Added
8226         `TypeExpr[]' argument; add the interfaces to the
8227         `builder_to_ifaces' hash.
8228         (TypeManager.LookupMemberContainer): For
8229         GenericTypeParameterBuilders, get the TypeParameter from the
8230         `builder_to_type_param'.
8231         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
8232         the TypeParameter and call FindMembers on it.
8233
8234 2004-04-07  Martin Baulig  <martin@ximian.com>
8235
8236         * class.cs
8237         (MethodCore.GenericMethod): Moved this field here from Method.
8238         (MethodCore.IsDuplicateImplementation): Take the number of type
8239         parameters into account if we're a generic method.
8240
8241         * expression.cs (Invocation.InferTypeArguments): Don't return true
8242         if `arguments' is null; we still need to check whether we actually
8243         don't need to infer anything in this case.
8244         (MemberAccess): Merged the functionality from GenericMemberAccess
8245         into this class.
8246
8247         * generic.cs (GenericMemberAccess): Removed.
8248
8249 2004-04-05  Martin Baulig  <martin@ximian.com>
8250
8251         * decl.cs (MemberCore): For generic classes, interfaces and
8252         structs, `Name' now includes the number of type parameters
8253         ("Stack!1.Node!1").
8254         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
8255         encode the number of type arguments in the type name.
8256
8257         * expression.cs (Expression.MemberLookup): Removed the
8258         `num_type_args' argument; we now encode the number of type
8259         arguments in the type name.
8260
8261         * ecore.cs (SimpleName): Encode the number of type arguments in
8262         the type name itself.
8263
8264         * generic.cs (ConstructedType): Likewise.
8265
8266         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
8267         `MemberName'; we now include the number of type parameters in the
8268         type name.
8269
8270         * typemanager.cs (TypeManager.CheckGeneric): Removed.
8271         (TypeManager.MemberLookup): Removed the
8272         `num_type_args' argument; we now encode the number of type
8273         arguments in the type name.     
8274
8275 2004-04-03  Martin Baulig  <martin@ximian.com>
8276
8277         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
8278         (MemberCore.MemberName): Moved here from MemberBase.
8279         (DeclSpace.SetParameterInfo): Just take the constraints as an
8280         ArrayList; we already have the type parameters in our
8281         `MemberName'; also do the CS0080 reporting here.
8282
8283         * cs-parser.jay (struct_declaration): Use `member_name' instead of
8284         `IDENTIFIER opt_type_parameter_list'; when constructing our
8285         `MemberName', it'll already include our type parameters.
8286         (class_declaration, interface_declaration): Likewise.
8287         (delegate_declaration): Likewise.
8288         (MakeName): Take a MemberName and return a MemberName.
8289         The following two changes are required to avoid shift/reduce conflicts:
8290         (member_name): Don't include a TypeName anymore; ie. this is now
8291         just 'IDENTIFIER opt_type_parameter_list'.
8292         (property_declaration, event_declaration): Use a
8293         `namespace_or_type_name' instead of a `member_name'.            
8294
8295 2004-04-03  Martin Baulig  <martin@ximian.com>
8296
8297         * decl.cs (MemberName): Renamed to `TypeName' and created a new
8298         `MemberName' class.
8299         (TypeName): Formerly known as MemberName.
8300
8301         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
8302         instead of a `MemberName'.
8303
8304         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
8305         (member_name): New rule; create a MemberName.
8306
8307 2004-04-02  Martin Baulig  <martin@ximian.com>
8308
8309         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
8310         (CS0305 and CS0308).
8311
8312 2004-04-02  Martin Baulig  <martin@ximian.com>
8313
8314         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
8315         support for nested types.
8316
8317 2004-04-02  Martin Baulig  <martin@ximian.com>
8318
8319         * ecore.cs (IAlias): New public interface.
8320         (TypeExpr, TypeExpression): Implement IAlias.
8321         (TypeAliasExpression): New public class.
8322
8323         * namespace.cs (Namespace): Implement IAlias.
8324         (Namespace.Lookup): Return an IAlias instead on an object.
8325         (Namespace.DefineName): Take an IAlias instead of an object.
8326         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
8327         an object.
8328         (NamespaceEntry.UsingAlias): Take a Membername instead of an
8329         Expression.
8330         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
8331         object.
8332         (NamespaceEntry.Lookup): Likewise.
8333
8334         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
8335         instead of a Type.      
8336
8337         * decl.cs (DeclSpace): Implement IAlias.
8338         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
8339
8340         * generic.cs (ConstructedType): Improved error checking.
8341
8342 2004-04-02  Martin Baulig  <martin@ximian.com>
8343
8344         * convert.cs: Added type parameter conversions.
8345
8346         * ecore.cs
8347         (UnboxCast.Emit): Emit an `unbox.any' for type params.
8348         (ClassCast.Emit): If the source type is a type parameter, box it.
8349         If the target type is a type parameter, emit an `unbox.any'
8350         instead of a `classcast'.1      
8351
8352 2004-04-01  Martin Baulig  <martin@ximian.com>
8353
8354         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
8355
8356 2004-04-01  Martin Baulig  <martin@ximian.com>
8357
8358         * generic.cs (ConstructedType.CheckConstraints): Use
8359         Convert.ImplicitStandardConversionExists(); user-defined implicit
8360         conversions are not allowed according to the spec.
8361
8362 2004-03-30  Martin Baulig  <martin@ximian.com>
8363
8364         * expression.cs (New): Added support for type parameters.
8365
8366         * typemanager.cs
8367         (TypeManager.activator_type): New public static field.
8368         (TypeManager.activator_create_instance): Likewise.
8369
8370 2004-03-30  Martin Baulig  <martin@ximian.com>
8371
8372         * typemanager.cs (TypeManager.HasConstructorConstraint): New
8373         public method.
8374
8375 2004-03-30  Martin Baulig  <martin@ximian.com>
8376
8377         * generic.cs (ConstructedType.CheckConstraints): Actually follow
8378         the spec here: the argument type must be convertible to the
8379         constraints.
8380
8381 2004-03-30  Martin Baulig  <martin@ximian.com>
8382
8383         * generic.cs
8384         (TypeParameter.Define, TypeParameter.DefineMethod): Call
8385         TypeManager.AddTypeParameter().
8386         (ConstructedType.CheckConstraints): Re-enable this and actually
8387         check whether we have a constructor constraint.
8388
8389         * typemanager.cs
8390         (TypeManager.builder_to_type_param): New static field.
8391         (TypeManager.AddTypeParameter): New static method.
8392         (TypeManager.LookupTypeParameter): New public method.
8393
8394 2004-03-30  Martin Baulig  <martin@ximian.com>
8395
8396         * generic.cs (TypeParameter.DefineType): Return a boolean and use
8397         the new API to actually define the constructor constraint.
8398
8399         * typemanager.cs
8400         (TypeManager.new_constraint_attr_type): New static field.
8401         (TypeManager.InitCoreTypes): Initialize it.
8402
8403 2004-03-30  Martin Baulig  <martin@ximian.com>
8404
8405         * generic.cs (Constraints): Completed error checking, use correct
8406         error numbers.
8407
8408 2004-03-29  Martin Baulig  <martin@ximian.com>
8409
8410         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
8411
8412         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8413         public version which takes a `ParameterData pd' instead of an
8414         `ArrayList args'.
8415
8416 2004-03-29  Martin Baulig  <martin@ximian.com>
8417
8418         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
8419         not a MethodInfo.       
8420
8421 2004-03-29  Martin Baulig  <martin@ximian.com>
8422
8423         * expression.cs (Argument.ResolveMethodGroup): If we're a
8424         ConstructedType, call GetMemberAccess() on it.  
8425
8426 2004-03-29  Martin Baulig  <martin@ximian.com>
8427
8428         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
8429         (MethodCore.CheckGenericOverride): When overriding a generic
8430         method, check whether the constraints match.
8431
8432         * support.cs (GenericConstraints): New public interface.
8433         (ParameterData.GenericConstraints): New public method.
8434
8435         * parameter.cs (Parameter.Resolve): Check whether we're a generic
8436         method parameter and compute our constraints if appropriate.
8437         (Parameter.GenericConstraints): New public property.
8438
8439         * generic.cs (Constraints): Implement GenericConstraints.
8440
8441 2004-03-29  Martin Baulig  <martin@ximian.com>
8442
8443         * decl.cs (MemberCache.FindMemberToOverride): Use
8444         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
8445
8446 2004-03-29  Martin Baulig  <martin@ximian.com>
8447
8448         * generic.cs (GenericMethod.Define): Resolve our type parameters.
8449
8450 2004-03-29  Martin Baulig  <martin@ximian.com>
8451
8452         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
8453         not allowed on non-generic declarations").
8454
8455 2004-03-29  Martin Baulig  <martin@ximian.com>
8456
8457         * expression.cs (Invocation.InferTypeArguments): Added overloaded
8458         public version of this method.
8459
8460         * class.cs (MethodCore.IsDuplicateImplementation): Use
8461         Invocation.InferTypeArguments() to check this.
8462
8463 2004-03-29  Martin Baulig  <martin@ximian.com>
8464
8465         * convert.cs: Use TypeManager.IsDelegateType() instead of
8466         comparing types correctly.
8467
8468 2004-03-29  Martin Baulig  <martin@ximian.com>
8469
8470         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
8471         types directly to make it work for generic instances.
8472
8473         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
8474
8475 2004-03-29  Martin Baulig  <martin@ximian.com>
8476
8477         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
8478         support for arrays.     
8479
8480 2004-03-24  Martin Baulig  <martin@ximian.com>
8481
8482         * decl.cs (DeclSpace.FindType): Also use
8483         TypeManager.CheckGeneric() for types from the using clauses.
8484
8485 2004-03-23  Martin Baulig  <martin@ximian.com>
8486
8487         * expression.cs (Invocation.OverloadResolve): Added `bool
8488         may_fail' argument and use it instead of the Location.IsNull() hack.
8489
8490 2004-03-23  Martin Baulig  <martin@ximian.com>
8491
8492         * expression.cs (Invocation.InferType): Use correct type inference
8493         rules here.     
8494
8495 2004-03-23  Martin Baulig  <martin@ximian.com>
8496
8497         * ecore.cs (MethodGroupExpr.Name): Use
8498         TypeManager.CSharpSignature() instead of just the name.
8499
8500         * expression.cs (Invocation.OverloadResolve): Provide better error
8501         reporting.
8502         (Invocation.DoResolve): OverloadResolve() never returns null
8503         without reporting an error, so removed the error -6 reporting here.
8504
8505 2004-03-23  Martin Baulig  <martin@ximian.com>
8506
8507         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
8508         generic methods.
8509
8510         * cs-parser.jay (delegate_declaration): Support generic delegates.
8511
8512         * delegate.cs: Support generic delegates.
8513
8514 2004-03-22  Martin Baulig  <martin@ximian.com>
8515
8516         * expression.cs (Invocation.InferParamsTypeArguments): New static
8517         method; does type inference for params arguments.
8518
8519 2004-03-21  Martin Baulig  <martin@ximian.com>
8520
8521         * typemanager.cs (TypeManager.IsGenericMethod): New public static
8522         method; checks whether a method is a generic method.    
8523
8524         * expression.cs (Invocation.InferTypeArguments): New static method;
8525         infer type arguments for generic method invocation.
8526
8527         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
8528         property; we set this to true if we're resolving a generic method
8529         invocation and the user specified type arguments, ie. we're not
8530         doing type inference.
8531
8532 2004-03-20  Martin Baulig  <martin@ximian.com>
8533
8534         * class.cs (MethodData.DeclaringType): New public property.
8535         (MethodData.Define): Set DeclaringType here.
8536         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
8537         instead of OperatorMethodBuilder.DeclaringType.
8538
8539 2004-03-20  Martin Baulig  <martin@ximian.com>
8540
8541         * cs-tokenizer.cs (xtoken): Return a special
8542         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
8543
8544         * cs-parser.jay (default_value_expression): Switch to the new
8545         syntax (14.5.13).
8546
8547 2004-03-19  Martin Baulig  <martin@ximian.com>
8548
8549         * decl.cs (MemberName): New class.  We use this to "construct"
8550         namespace_or_type_name's.
8551
8552         * generics.cs (TypeArguments.GetDeclarations): New public method;
8553         returns the type arguments as a string[] and reports a CS0081 if
8554         one of them is not an identifier.
8555
8556         * class.cs (MemberBase): The .ctor now takes the name as a
8557         MemberName instead of a string.
8558         (MemberBase.ExplicitInterfaceName): Changed type from string to
8559         Expression.
8560         (MemberBase.DoDefine): If we're an explicit implementation, the
8561         InterfaceType may be a generic instance.
8562
8563         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
8564         (namespace_name): Call MemberName.GetName () to transform the
8565         MemberName into a string and ensure we don't have any type
8566         arguments.
8567         (type_name): Call MemberName.GetTypeExpression() to transfrom the
8568         MemberName into an expression.
8569         (method_header): Use namespace_or_type_name instead of member_name.     
8570
8571 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8572
8573         * rootcontext.cs: Add new types to the boot resolution.
8574
8575         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8576         MulticastDelegate is not allowed.
8577
8578         * typemanager.cs: Add new types to lookup: System.TypedReference
8579         and ArgIterator.
8580
8581         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8582         check for TypedReference or ArgIterator, they are not allowed. 
8583
8584         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8585         makes us properly catch 1510 in some conditions (see bug 56016 for
8586         details). 
8587
8588 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8589
8590         * CryptoConvert.cs: update from corlib version
8591         with endian fixes.
8592
8593 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8594
8595         * class.cs (Indexer.Define): Check indexername declaration
8596
8597 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8598
8599         * attribute.cs (IsClsCompliant): Fixed problem with handling
8600         all three states (compliant, not-compliant, undetected).
8601
8602 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8603
8604         * attribute.cs (Attribute): Location is now public.
8605         (Resolve): Store resolved arguments (pos_values) in attribute class.
8606         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8607         (GetClsCompliantAttributeValue): New method that gets
8608         CLSCompliantAttribute value.
8609         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8610         if exists else null.
8611         (AttributeTester): New class for CLS-Compliant verification routines.
8612
8613         * class.cs (Emit): Add CLS-Compliant verification.
8614         (Method.GetSignatureForError): Implemented.
8615         (Constructor.GetSignatureForError): Implemented
8616         (Constructor.HasCompliantArgs): Returns if constructor has
8617         CLS-Compliant arguments.
8618         (Constructor.Emit): Override.
8619         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8620         is needed to test only parameters.
8621         (FieldBase.GetSignatureForError): Implemented.
8622         (TypeContainer): New member for storing base interfaces.
8623         (TypeContainer.FindMembers): Search in base interfaces too.
8624
8625         * codegen.cs (GetClsComplianceAttribute): New method that gets
8626         assembly or module CLSCompliantAttribute value.
8627         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8628         for assembly.
8629         (ModuleClass.Emit): Add error 3012 test.
8630
8631         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8632
8633         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8634         state for all decl types.
8635         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8636         if CLS-Compliant tests are required.
8637         (IsClsCompliaceRequired): New method. Analyze whether code
8638         must be CLS-Compliant.
8639         (IsExposedFromAssembly): New method. Returns true when MemberCore
8640         is exposed from assembly.
8641         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8642         value or gets cached value.
8643         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8644         is explicitly marked with CLSCompliantAttribute.
8645         (IsIdentifierClsCompliant): New abstract method. This method is
8646         used to testing error 3005.
8647         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8648         for identifier and parameters CLS-Compliant testing.
8649         (VerifyClsCompliance): New method. The main virtual method for
8650         CLS-Compliant verifications.
8651         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8652         null. I don't know why is null (too many public members !).
8653         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8654         and get value of first CLSCompliantAttribute that found.
8655
8656         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8657         (VerifyClsCompliance): Override and add extra tests.
8658
8659         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8660         clscheck- disable CLS-Compliant verification event if assembly is has
8661         CLSCompliantAttribute(true).
8662
8663         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8664         ApllyAttribute is now called in emit section as in the other cases.
8665         Possible future Emit integration.
8666         (IsIdentifierClsCompliant): New override.
8667         (VerifyClsCompliance): New override.
8668         (GetEnumeratorName): Returns full enum name.
8669
8670         * parameter.cs (GetSignatureForError): Implemented.
8671
8672         * report.cs (WarningData): New struct for Warning message information.
8673         (LocationOfPreviousError): New method.
8674         (Warning): New method. Reports warning based on the warning table.
8675         (Error_T): New method. Reports error based on the error table.
8676
8677         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8678         verifications are done here.
8679
8680         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8681
8682         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8683         CLSCompliantAttribute.
8684         (all_imported_types): New member holds all imported types from other
8685         assemblies.
8686         (LoadAllImportedTypes): New method fills static table with exported types
8687         from all referenced assemblies.
8688         (Modules): New property returns all assembly modules.
8689
8690 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8691
8692         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8693         throwing a parser error.
8694
8695         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8696         which removes the hardcoded get_/set_ prefixes for properties, as
8697         IL allows for the properties to be named something else.  
8698
8699         Bug #56013
8700
8701         * expression.cs: Do not override operand before we know if it is
8702         non-null.  Fix 56207
8703
8704 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8705
8706         * typemanager.cs: support for pinned variables.
8707
8708 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8709
8710         * decl.cs, typemanager.cs: Avoid using an arraylist
8711         as a buffer if there is only one result set.
8712
8713 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8714
8715         * expression.cs: Make sure you cant call a static method
8716         with an instance expression, bug #56174.
8717
8718 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8719
8720         * class.cs (IsDuplicateImplementation): Improve error reporting to
8721         flag 663 (method only differs in parameter modifier).
8722
8723         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8724         in preprocessor directives.
8725
8726         * location.cs (LookupFile): Allow for the empty path.
8727
8728         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8729         better approach for some of that patch, but its failing with the
8730         CharSet enumeration.  For now try/catch will do.
8731
8732         * typemanager.cs: Do not crash if a struct does not have fields.
8733         Fixes 56150.
8734
8735 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8736
8737         * expression.cs: cs0213, cant fix a fixed expression.
8738         fixes 50231.
8739
8740 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8741
8742         * cs-parser.jay: detect invalid embeded statements gracefully.
8743         bug #51113.
8744
8745 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8746
8747         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8748         As a regex:
8749         s/
8750         the invocation type may not be a subclass of the tye of the item/
8751         The type of the item must be a subclass of the invocation item.
8752         /g
8753
8754         Fixes bug #50820.
8755
8756 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8757
8758         * attribute.cs: Added methods to get a string and a bool from an
8759         attribute. Required to information from AssemblyKeyFileAttribute,
8760         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8761         * codegen.cs: Modified AssemblyName creation to include support for
8762         strongnames. Catch additional exceptions to report them as CS1548.
8763         * compiler.csproj: Updated include CryptoConvert.cs.
8764         * compiler.csproj.user: Removed file - user specific configuration.
8765         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8766         Mono.Security assembly. The original class is maintained and tested in
8767         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8768         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8769         like CSC 8.0 (C# v2) supports.
8770         * Makefile: Added CryptoConvert.cs to mcs sources.
8771         * rootcontext.cs: Added new options for strongnames.
8772
8773 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8774
8775         * driver.cs: For --expect-error, report error code `2'
8776         if the program compiled with no errors, error code `1' if
8777         it compiled with an error other than the one expected.
8778
8779 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8780
8781         * compiler.csproj: Updated for Visual Studio .NET 2003.
8782         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8783         * compiler.sln: Updated for Visual Studio .NET 2003.
8784
8785 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8786
8787         * expression.cs: Fix bug #47234. We basically need to apply the
8788         rule that we prefer the conversion of null to a reference type
8789         when faced with a conversion to 'object' (csc behaviour).
8790
8791 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8792
8793         * statement.cs: Shorter form for foreach, eliminates
8794         a local variable. r=Martin.
8795
8796 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8797
8798         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
8799         checks if we can use brtrue/brfalse to test for 0.
8800         * expression.cs: use the above in the test for using brtrue/brfalse.
8801         cleanup code a bit.
8802
8803 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8804
8805         * expression.cs: Rewrite string concat stuff. Benefits:
8806
8807         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
8808         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
8809         rather than a concat chain.
8810
8811         * typemanager.cs: Add lookups for more concat overloads.
8812
8813 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8814
8815         * expression.cs: Emit shorter il code for array init.
8816
8817         newarr
8818         dup
8819         // set 1
8820
8821         // set 2
8822
8823         newarr
8824         stloc.x
8825
8826         ldloc.x
8827         // set 1
8828
8829         ldloc.x
8830         // set 2
8831
8832 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
8833
8834         * statement.cs: Before, two switch blocks would be merged if the
8835         total size of the blocks (end_item - begin_item + 1) was less than
8836         two times the combined sizes of the blocks.
8837
8838         Now, it will only merge if after the merge at least half of the
8839         slots are filled.
8840
8841         fixes 55885.
8842
8843 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
8844
8845         * class.cs : csc build fix for GetMethods(). See bug #52503.
8846
8847 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
8848
8849         * expression.cs: Make sure fp comparisons work with NaN.
8850         This fixes bug #54303. Mig approved this patch a long
8851         time ago, but we were not able to test b/c the runtime
8852         had a related bug.
8853
8854 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
8855
8856         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
8857
8858 2004-03-19  Martin Baulig  <martin@ximian.com>
8859
8860         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
8861         two overloads may unify for some type parameter substitutions and
8862         report a CS0408 if appropriate.
8863
8864 2004-03-19  Martin Baulig  <martin@ximian.com>
8865
8866         * class.cs (MemberCore.IsDuplicateImplementation): Report the
8867         error here and not in our caller.
8868
8869 2004-03-19  Martin Baulig  <martin@ximian.com>
8870
8871         * interface.cs: Completely killed this file.
8872         (Interface): We're now a TypeContainer and live in class.cs.
8873
8874         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
8875         argument; we're now also called for interfaces.
8876         (TypeContainer.DefineMembers): Allow this method being called
8877         multiple times.
8878         (TypeContainer.GetMethods): New public method; formerly known as
8879         Interface.GetMethod().  This is used by PendingImplementation.
8880         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
8881         it's now private and non-static.
8882         (Interface): Moved this here; it's now implemented similar to
8883         Class and Struct.
8884         (Method, Property, Event, Indexer): Added `bool is_interface'
8885         argument to their .ctor's.
8886         (MemberBase.IsInterface): New public field.
8887
8888         * cs-parser.jay: Create normal Method, Property, Event, Indexer
8889         instances instead of InterfaceMethod, InterfaceProperty, etc.
8890         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8891         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8892
8893 2004-03-19  Martin Baulig  <martin@ximian.com>
8894
8895         * class.cs (MethodCore.IsDuplicateImplementation): New private
8896         method which does the CS0111 checking.
8897         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8898         Use IsDuplicateImplementation().
8899
8900 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8901
8902         * decl.cs (FindMemberToOverride): New method to find the correct
8903         method or property to override in the base class.
8904         * class.cs
8905             - Make Method/Property use the above method to find the
8906               version in the base class.
8907             - Remove the InheritableMemberSignatureCompare as it is now
8908               dead code.
8909
8910         This patch makes large code bases much faster to compile, as it is
8911         O(n) rather than O(n^2) to do this validation.
8912
8913         Also, it fixes bug 52458 which is that nested classes are not
8914         taken into account when finding the base class member.
8915
8916         Reviewed/Approved by Martin.
8917
8918 2004-03-17  Martin Baulig  <martin@ximian.com>
8919
8920         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8921         of type arguments into account; use the `real_num_type_args'
8922         approach like in DoResolveAsTypeStep().
8923
8924         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8925         nested types.
8926
8927 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8928
8929         * interface.cs: In all interface classes removed redundant
8930         member initialization.
8931
8932 2004-03-16  Martin Baulig  <martin@ximian.com>
8933
8934         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8935
8936 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8937
8938         * decl.cs (DefineTypeAndParents): New helper method to define a
8939         type's containers before the type itself is defined;  This is a
8940         bug exposed by the recent changes to Windows.Forms when an
8941         implemented interface was defined inside a class that had not been
8942         built yet.   
8943
8944         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8945
8946         (Check): Loop correctly to report errors modifiers
8947         (UNSAFE was not in the loop, since it was the same as TOP).
8948
8949         * interface.cs: Every interface member now takes a ModFlags,
8950         instead of a "is_new" bool, which we set on the base MemberCore. 
8951
8952         Every place where we called "UnsafeOk" in the interface, now we
8953         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8954         the unsafe settings from the member declaration instead of the
8955         container interface. 
8956
8957         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8958
8959         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8960         `set_indexer_name' to the pending bits (one per type).
8961
8962         We fixed a bug today that was picking the wrong method to
8963         override, since for properties the existing InterfaceMethod code
8964         basically ignored the method name.  Now we make sure that the
8965         method name is one of the valid indexer names.
8966
8967 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8968  
8969         * support.cs (SeekableStreamReader): Keep track of stream byte
8970         positions and don't mix them with character offsets to the buffer.
8971
8972         Patch from Gustavo Giráldez
8973
8974 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8975
8976         * interface.cs (InterfaceSetGetBase): Removed double member
8977         initialization, base class does it as well.
8978
8979 2004-03-13  Martin Baulig  <martin@ximian.com>
8980
8981         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8982         when compiling corlib.
8983
8984 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * convert.cs (ExplicitConversion): We were reporting an error on
8987         certain conversions (object_type source to a value type, when the
8988         expression was `null') before we had a chance to pass it through
8989         the user defined conversions.
8990
8991         * driver.cs: Replace / and \ in resource specifications to dots.
8992         Fixes 50752
8993
8994         * class.cs: Add check for duplicate operators.  Fixes 52477
8995
8996 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8997
8998         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8999         that are in the middle of the statements, not only at the end.
9000         Fixes #54987
9001
9002         * class.cs (TypeContainer.AddField): No longer set the
9003         `HaveStaticConstructor' flag, now we call it
9004         `UserDefineStaticConstructor' to diferentiate the slightly
9005         semantic difference.
9006
9007         The situation is that we were not adding BeforeFieldInit (from
9008         Modifiers.TypeAttr) to classes that could have it.
9009         BeforeFieldInit should be set to classes that have no static
9010         constructor. 
9011
9012         See:
9013
9014         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9015
9016         And most importantly Zoltan's comment:
9017
9018         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9019
9020         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9021          before its static fields are used', i.e. initialization does not need
9022          to be triggered by the first access to the type. Setting this flag
9023          helps the JIT to compile better code, since it can run the static
9024          constructor at JIT time, and does not need to generate code to call it
9025          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9026          this flag for lots of classes like String. 
9027          
9028          csc sets this flag if the type does not have an explicit static 
9029          constructor. The reasoning seems to be that if there are only static
9030          initalizers for a type, and no static constructor, then the programmer
9031          does not care when this initialization happens, so beforefieldinit
9032          can be used.
9033          
9034          This bug prevents the AOT compiler from being usable, since it 
9035          generates so many calls to mono_runtime_class_init that the AOT code
9036          is much slower than the JITted code. The JITted code is faster, 
9037          because it does not generate these calls if the vtable is type is
9038          already initialized, which is true in the majority of cases. But the
9039          AOT compiler can't do this."
9040
9041 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9042
9043         * class.cs (MethodData.Emit): Refactor the code so symbolic
9044         information is generated for destructors;  For some reasons we
9045         were taking a code path that did not generate symbolic information
9046         before. 
9047
9048 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9049
9050         * class.cs: Create a Constructor.CheckBase method that
9051         takes care of all validation type code. The method
9052         contains some code that was moved from Define.
9053
9054         It also includes new code that checks for duplicate ctors.
9055         This fixes bug #55148.
9056
9057 2004-03-09  Joshua Tauberer <tauberer@for.net>
9058
9059         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9060         a { ... }-style array creation invokes EmitStaticInitializers
9061         which is not good for reference-type arrays.  String, decimal
9062         and now null constants (NullCast) are not counted toward
9063         static initializers.
9064
9065 2004-03-05  Martin Baulig  <martin@ximian.com>
9066
9067         * location.cs (SourceFile.HasLineDirective): New public field;
9068         specifies whether the file contains or is referenced by a "#line"
9069         directive.
9070         (Location.DefineSymbolDocuments): Ignore source files which
9071         either contain or are referenced by a "#line" directive.        
9072
9073 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9074
9075         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9076         direct access to our parent, so check the method inline there.
9077
9078 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9079
9080         * expression.cs (Invocation.EmitCall): Miguel's last commit
9081         caused a regression. If you had:
9082
9083             T t = null;
9084             t.Foo ();
9085
9086         In Foo the implict this would be null.
9087
9088 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9089
9090         * expression.cs (Invocation.EmitCall): If the method is not
9091         virtual, do not emit a CallVirt to it, use Call.
9092
9093         * typemanager.cs (GetFullNameSignature): Improve the method to
9094         cope with ".ctor" and replace it with the type name.
9095
9096         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9097         as an argument the ConstructorBuilder where it is being defined,
9098         to catch the recursive constructor invocations.
9099
9100 2004-03-16  Martin Baulig  <martin@ximian.com>
9101
9102         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
9103         ConstructedType, call ResolveType() on it to get the type rather
9104         than just using `expr.Type'.
9105
9106 2004-03-16  Martin Baulig  <martin@ximian.com>
9107
9108         * generics.cs (ConstructedType.GetMemberAccess): Take the
9109         EmitContext instead on the TypeExpr and use
9110         ec.TypeContainer.CurrentType/ec.ContainerType.
9111
9112 2004-03-16  Martin Baulig  <martin@ximian.com>
9113
9114         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
9115         parameters before aliases.
9116
9117 2004-03-16  Martin Baulig  <martin@ximian.com>
9118
9119         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
9120         New oublic function; checks whether two generic instances may become
9121         equal under some instantiations (26.3.1).
9122
9123         * class.cs (TypeContainer.Define): Call
9124         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
9125         error.
9126
9127 2004-03-16  Martin Baulig  <martin@ximian.com>
9128
9129         * class.cs (TypeContainer.GetClassBases): Moved
9130         Error_TypeParameterAsBase() here and also check whether the base
9131         class is not an attribute.
9132
9133 2004-03-16  Martin Baulig  <martin@ximian.com>
9134
9135         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9136
9137 2004-03-16  Martin Baulig  <martin@ximian.com>
9138
9139         * class.cs (Error_TypeParameterAsBase): Use correct error number
9140         here (CS0689).  
9141
9142 2004-03-16  Martin Baulig  <martin@ximian.com>
9143
9144         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
9145         for generics.
9146
9147         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
9148         error reporting.
9149
9150 2004-03-15  Martin Baulig  <martin@ximian.com>
9151
9152         * typemanager.cs (TypeManager.GetFullName): New public method.
9153         (TypeManager.MemberLookup): Added `int_num_type_arguments'
9154         argument; only return members with the correct number of type
9155         arguments.
9156         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
9157         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
9158         whether the number of type arguments matches.
9159
9160         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
9161         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
9162
9163         * expression.cs (MemberAccess): Added public `NumTypeArguments'
9164         field; it's set by the protected .ctor when we're actually a
9165         GenericMemberAccess.
9166         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
9167         arguments and pass it to MemberLookupFinal ().
9168
9169         * ecore.cs (Expression.MemberLookup): Added `int
9170         num_type_arguments' argument; only return members with the correct
9171         number of type arguments.
9172         (Expression.MemberLookupFailed): Check whether the MemberLookup
9173         failed because we did not have the correct number of type
9174         arguments; report CS0305 in this case.
9175
9176         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
9177         `e.ResolveAsTypeTerminal()' already did so.
9178
9179 2004-03-15  Martin Baulig  <martin@ximian.com>
9180
9181         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
9182         we're a ConstructedType; in this case, the caller must report an
9183         error (for instance CS0131).
9184
9185         * generic.cs (TypeArguments): Added Location argument to the .ctor.
9186         (TypeArguments.Resolve): Actually report errors here.
9187
9188 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9189
9190         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9191         `set_indexer_name' to the pending bits (one per type).
9192
9193         We fixed a bug today that was picking the wrong method to
9194         override, since for properties the existing InterfaceMethod code
9195         basically ignored the method name.  Now we make sure that the
9196         method name is one of the valid indexer names.
9197
9198 2004-03-15  Martin Baulig  <martin@ximian.com>
9199
9200         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
9201         for generic instances.
9202
9203 2004-03-13  Martin Baulig  <martin@ximian.com>
9204
9205         * class.cs (TypeContainer.DefineType): Call
9206         TypeManager.AddUserType() immediately after creating the
9207         TypeBuilder; pass all type parameters when creating the
9208         CurrentType.
9209
9210         * decl.cs (DeclSpace.FindNestedType): New public method.
9211         (DeclSpace.FindType): Added `int num_type_args' argument; only
9212         return types with the correct number of type parameters.
9213         (DeclSpace.CountTypeParams): New public property.
9214
9215         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
9216         the number of type parameters; defaults to zero.
9217
9218         * generic.cs (TypeArguments.Count): New public property.
9219         (ConstructedType.DoResolveAsTypeStep): First call
9220         ds.FindNestedType() to find out whether we're nested in the
9221         current generic type; in this case, we inherit all type parameters
9222         from the current class.
9223
9224         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
9225         num_type_args' argument.
9226         (RootContext.LookupType): Added overloaded version which takes the
9227         number of type arguments; only return types with the correct
9228         number of type arguments.
9229
9230         * typemanager.cs (TypeManager.CheckGeneric): New public function;
9231         checks whether `Type t' has `int num_type_args'.
9232
9233 2004-03-13  Martin Baulig  <martin@ximian.com>
9234
9235         * generic.cs (GenericMethod.DefineType): New method; calls
9236         DefineType() on all the type parameters.
9237
9238         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
9239         (MethodData.Define): If we're a generic method, call
9240         GenericMethod.DefineType() to define the type parameters.       
9241
9242 2004-03-10  Martin Baulig  <martin@ximian.com>
9243
9244         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
9245         instead of IsAssignableFrom.    
9246
9247 2004-03-10  Martin Baulig  <martin@ximian.com>
9248
9249         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
9250
9251         * support.cs (ParameterData.HasArrayParameter): New property.
9252         (ReflectionParameters.ctor): Take a MethodBase instead of a
9253         ParameterInfo[].  If we have any type parameters, get the generic
9254         method definition and ask it whether we have variable arguments.
9255
9256 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9257
9258         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9259         routines to check if a type is an enumerable/enumerator allow
9260         classes that implement the IEnumerable or IEnumerator interfaces.
9261
9262         * class.cs (Property, Operator): Implement IIteratorContainer, and
9263         implement SetYields.
9264
9265         (Property.Define): Do the block swapping for get_methods in the
9266         context of iterators.   We need to check if Properties also
9267         include indexers or not.
9268
9269         (Operator): Assign the Block before invoking the
9270         OperatorMethod.Define, so we can trigger the Iterator code
9271         replacement. 
9272
9273         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9274         Property and Operator classes are not created when we parse the
9275         declarator but until we have the block completed, so we use a
9276         singleton SimpleIteratorContainer.Simple to flag whether the
9277         SetYields has been invoked.
9278
9279         We propagate this setting then to the Property or the Operator to
9280         allow the `yield' to function.
9281
9282 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9283
9284         * codegen.cs: Implemented attribute support for modules.
9285         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9286         Assembly/Module functionality.
9287
9288         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9289         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9290         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9291
9292 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9293
9294         * interface.cs (FindMembers): The operation is performed on all base
9295         interfaces and not only on the first. It is required for future CLS Compliance patch.
9296
9297 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9298
9299         * statement.cs, codegen.cs:
9300         This patch deals with patterns such as:
9301
9302         public class List : IEnumerable {
9303
9304                 public MyEnumerator GetEnumerator () {
9305                         return new MyEnumerator(this);
9306                 }
9307
9308                 IEnumerator IEnumerable.GetEnumerator () {
9309                         ...
9310                 }
9311                 
9312                 public struct MyEnumerator : IEnumerator {
9313                         ...
9314                 }
9315         }
9316
9317         Before, there were a few things we did wrong:
9318         1) we would emit callvirt on a struct, which is illegal
9319         2) we emited ldarg when we needed to emit ldarga
9320         3) we would mistakenly call the interface methods on an enumerator
9321         type that derived from IEnumerator and was in another assembly. For example:
9322
9323         public class MyEnumerator : IEnumerator
9324
9325         Would have the interface methods called, even if there were public impls of the
9326         method. In a struct, this lead to invalid IL code.
9327
9328 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9329
9330         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9331           renamed to Emit.
9332
9333         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9334
9335 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * cs-parser.jay: Fix small regression: we were not testing V2
9338         compiler features correctly.
9339
9340         * interface.cs: If the emit context is null, then create one
9341
9342 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9343
9344         * decl.cs (GetSignatureForError): New virtual method to get full name
9345           for error messages.
9346
9347         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9348           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9349
9350         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9351           Duplicated members and code in these classes has been removed.
9352           Better encapsulation in these classes.
9353
9354 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9355
9356         * assign.cs (Assign.DoResolve): When dealing with compound
9357         assignments, there is a new rule in ECMA C# 2.4 (might have been
9358         there before, but it is documented here) that states that in:
9359
9360         a op= b;
9361
9362         If b is of type int, and the `op' is a shift-operator, then the
9363         above is evaluated as:
9364
9365         a = (int) a op b 
9366
9367         * expression.cs (Binary.ResolveOperator): Instead of testing for
9368         int/uint/long/ulong, try to implicitly convert to any of those
9369         types and use that in pointer arithmetic.
9370
9371         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9372         method to print information for from the type, not from the
9373         null-method we were given.
9374
9375 2004-02-01  Duncan Mak  <duncan@ximian.com>
9376
9377         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9378         parsing for cmd, fixes bug #53694.
9379
9380 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9381
9382         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9383         in the member name duplication tests. Property and operator name duplication
9384         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9385
9386 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9387
9388         * interface.cs (PopulateMethod): Fixed crash when interface method
9389         returns not existing type (error test cs0246-3.cs).
9390
9391 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9392
9393         * cs-parser.jay (interface_accessors): Re-write actions to also
9394         store attributes attached to get and set methods. Fix spelling
9395         while at it.
9396
9397         (inteface_property_declaration): Modify accordingly.
9398
9399         (InterfaceAccessorInfo): New helper class to store information to pass
9400         around between rules that use interface_accessors.
9401
9402         * interface.cs (Emit): Apply attributes on the get and set
9403         accessors of properties and indexers too.
9404
9405         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9406         right MethodBuilder when applying attributes to the get and set accessors.
9407
9408 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9409
9410         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9411
9412 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9413
9414         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9415
9416 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9417
9418         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9419         changes that treat `yield' specially when present before `break'
9420         or `return' tokens.
9421
9422         * cs-tokenizer.cs: yield is no longer a keyword.
9423
9424 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9425
9426         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9427         setting for default constructors.
9428         For default constructors are almost every time set wrong Modifier. The
9429         generated IL code has been alright. But inside mcs this values was
9430         wrong and this was reason why several of my CLS Compliance tests
9431         failed.
9432
9433 2004-02-27  Martin Baulig  <martin@ximian.com>
9434
9435         * generics.cs (ConstructedType.ResolveType): Make the nested type
9436         stuff actually work.
9437
9438 2004-02-25  Martin Baulig  <martin@ximian.com>
9439
9440         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
9441         property; returns the type parameters just from the current type,
9442         ie. with the ones from outer classes.
9443         (DeclSpace.LookupGeneric): First search in the current class, then
9444         in outer classes.
9445         (DeclSpace.initialize_type_params): When hiding a type parameter
9446         from an outer class, put it into the `type_param_list' anyways.
9447
9448         * expression.cs (MemberAccess.expr): Made this field protected.
9449
9450         * class.cs (TypeContainer.Define): The `CurrentType' just contains
9451         the type parameters from the current class.
9452
9453         * generic.cs (ConstructedType.ResolveType): Support nested generic
9454         types by taking the type parameters which we inherit from outer
9455         classes into account.
9456         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
9457         support for nested generic types.
9458
9459 2004-02-23  Martin Baulig  <martin@ximian.com>
9460
9461         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
9462         field and check whether we're nested inside a generic type.
9463         (DeclSpace.ResolveType): If we're resolving to a generic type
9464         definition, create a ConstructedType and return its resolved type.
9465         (DeclSpace.initialize_type_params): New private method;
9466         initializes the `type_param_list' field from the type parameters
9467         from this and all enclosing classes.
9468         (DeclSpace.TypeParameters): Call initialize_type_params() unless
9469         we're already initialized.
9470
9471 2004-02-23  Martin Baulig  <martin@ximian.com>
9472
9473         * class.cs (Method.Define): Create the generic method before
9474         calling DoDefine().
9475         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
9476         the TypeContainer one); we use this for generic methods.
9477
9478         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
9479         parent's TypeBuilder.
9480
9481 2004-02-18  Martin Baulig  <martin@ximian.com>
9482
9483         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
9484         to check for equality.
9485
9486 2004-02-05  Martin Baulig  <martin@ximian.com>
9487
9488         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
9489         `ec.TypeContainer.CurrentType', use it instead of
9490         `ec.ContainerType' to check whether we're in the type's ctor.
9491
9492 2004-01-29  Martin Baulig  <martin@ximian.com>
9493
9494         * expression.cs (Invocation.DoResolve): If we're a
9495         `ConstructedType', then we're actually a generic method, so
9496         rewrite the expr as a GenericMemberAccess.
9497
9498         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
9499         here; manually parse it into a string.
9500
9501 2004-01-28  Martin Baulig  <martin@ximian.com>
9502
9503         * typemanager.cs (TypeManager.IsEqual): New static method.
9504         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
9505         check for equality instead of using `=='.
9506
9507 2004-01-26  Martin Baulig  <martin@ximian.com>
9508
9509         * decl.cs (DeclSpace.CurrentType): New public field.
9510
9511         * expression.cs (This.ResolveBase): If we have an
9512         `ec.TypeContainer.CurrentType', use it instead of
9513         `ec.ContainerType'.
9514
9515         * class.cs (TypeContainer.DefineType): If we're a generic type,
9516         create the `CurrentType' (unresolved).
9517         (TypeContainer.GenericType): New private field.
9518         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
9519         it and store it in `GenericType' before creating the MemberCache.
9520         (TypeContainer.GetMembers): If we have a `GenericType', call
9521         TypeManager.FindMembers() on it.
9522
9523         * interface.cs (Interface.GenericType): New private field.
9524         (Interface.DefineType): If we're a generic type, create the
9525         `CurrentType' (unresolved).
9526         (Interface.DefineMembers): If we have a `CurrentType', resolve it
9527         and store it in `GenericType' before creating the MemberCache.
9528         (Interface.GetMembers): If we have a `GenericType', call
9529         TypeManager.FindMembers() on it.
9530
9531 2004-01-22  Martin Baulig  <martin@ximian.com>
9532
9533         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9534         not a QualifiedIdentifier.  This is what `type_name_expression'
9535         was previously doing.
9536         (type_name_expression): Removed; the code is now in
9537         `namespace_or_type_name'.
9538         (qualified_identifier): Removed, use `namespace_or_type_name'
9539         instead.
9540         (QualifiedIdentifier): Removed this class.      
9541
9542 2004-01-22  Martin Baulig  <martin@ximian.com>
9543
9544         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9545         not a string as alias name.
9546
9547 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9548
9549         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9550         #52730 bug, and instead compute correctly the need to use a
9551         temporary variable when requesting an address based on the
9552         static/instace modified of the field and the constructor.
9553  
9554 2004-01-21  Martin Baulig  <martin@ximian.com>
9555
9556         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9557         class and namespace before looking up aliases.  Fixes #52517.
9558
9559 2004-01-21  Martin Baulig  <martin@ximian.com>
9560
9561         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9562         assinged in a 'try'; fixes exception4.cs.
9563
9564 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9565         * class.cs : Implemented parameter-less constructor for TypeContainer
9566
9567         * decl.cs: Attributes are now stored here. New property OptAttributes
9568
9569         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9570
9571         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9572
9573 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9574
9575         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9576           (CSharpSignature): New method for indexer and property signature.
9577
9578 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9579
9580         * pending.cs (IsVirtualFilter): Faster implementation.
9581
9582 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9583
9584         * typemanager.cs: Avoid inclusion of same assembly more than once.
9585
9586 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9587
9588         * cs-parser.jay: Fixed problem where the last assembly attribute
9589           has been applied also to following declaration (class, struct, etc.)
9590           
9591 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9592
9593         * class.cs: Added error CS0538, CS0539 reporting.
9594         Fixed crash on Microsoft runtime when field type is void.
9595
9596         * cs-parser.jay: Added error CS0537 reporting.
9597
9598         * pending.cs: Added error CS0535 reporting.
9599         Improved error report for errors CS0536, CS0534.
9600
9601 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9602
9603         Merge a few bits from the Anonymous Method MCS tree.
9604
9605         * statement.cs (ToplevelBlock): New class for toplevel methods,
9606         will hold anonymous methods, lifted variables.
9607
9608         * cs-parser.jay: Create toplevel blocks for delegates and for
9609         regular blocks of code. 
9610
9611 2004-01-20  Martin Baulig  <martin@ximian.com>
9612
9613         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9614         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9615         and `NeedExplicitReturn'; added `IsLastStatement'.
9616         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9617         have a `ReturnLabel' or we're not unreachable.
9618
9619         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9620         child's reachability; don't just override ours with it.  Fixes
9621         #58058 (lluis's example).
9622         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9623         InFinally(), InLoop(), InSwitch() and
9624         BreakCrossesTryCatchBoundary() methods.
9625
9626         * statement.cs (Return): Do all error checking in Resolve().
9627         Unless we are the last statement in a top-level block, always
9628         create a return label and jump to it.
9629         (Break, Continue): Do all error checking in Resolve(); also make
9630         sure we aren't leaving a `finally'.
9631         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9632         statement in a top-level block.
9633         (Block.Flags): Added `IsDestructor'.
9634         (Block.IsDestructor): New public property.
9635
9636 2004-01-20  Martin Baulig  <martin@ximian.com>
9637
9638         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9639
9640 2004-01-20  Martin Baulig  <martin@ximian.com>
9641
9642         * statement.cs (Statement.ResolveUnreachable): New public method.
9643         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9644         (Block.Resolve): Resolve unreachable statements.
9645
9646 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9647
9648         * expression.cs: We need to fix the case where we do
9649         not have a temp variable here.
9650
9651         * assign.cs: Only expression compound assignments need
9652         temporary variables.
9653
9654 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9655
9656         * flowanalysis.cs: Reduce memory allocation in a few ways:
9657           - A block with no variables should not allocate a bit
9658             vector for itself.
9659           - A method with no out parameters does not need any tracking
9660             for assignment of the parameters, so we need not allocate
9661             any data for it.
9662           - The arrays:
9663                 public readonly Type[] VariableTypes;
9664                 public readonly string[] VariableNames;
9665             Are redundant. The data is already stored in the variable
9666             map, so we need not allocate another array for it.
9667           - We need to add alot of checks for if (params | locals) == null
9668             due to the first two changes.
9669
9670 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9671
9672         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9673         implement IMemoryLocation, we store a copy on a local variable and
9674         take the address of it.  Patch from Benjamin Jemlich
9675
9676         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9677         to use a special "type_name_expression" rule which reduces the
9678         number of "QualifiedIdentifier" classes created, and instead
9679         directly creates MemberAccess expressions.
9680
9681 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9682
9683         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9684         that fixes #52853.  Null literal assignment to ValueType
9685
9686         * class.cs (MethodData.Emit): Instead of checking the name of the
9687         method to determine if its a destructor, create a new derived
9688         class from Method called Destructor, and test for that.  
9689
9690         * cs-parser.jay: Create a Destructor object instead of a Method.  
9691
9692         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9693
9694         Fixes: 52933
9695
9696 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9697
9698         * expression.cs (Binary.ResolveOperator): Perform an implicit
9699         conversion from MethodGroups to their delegate types on the
9700         Addition operation.
9701
9702         * delegate.cs: Introduce a new class DelegateCreation that is the
9703         base class for `NewDelegate' and `ImplicitDelegateCreation',
9704         factor some code in here.
9705
9706         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9707         conversion from MethodGroups to compatible delegate types. 
9708
9709         * ecore.cs (Expression.Resolve): Do not flag error 654
9710         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9711         we allow conversions from MethodGroups to delegate types now.
9712
9713         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9714         assignments in v2 either.
9715
9716 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9717
9718         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9719         static read-only fields in ctors.
9720
9721         Applied patch from Benjamin Jemlich 
9722
9723         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9724
9725 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9726
9727         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9728         here to return true, as they can be used like this:
9729
9730                 (XXX) int.MEMBER ()
9731
9732         Fixed 49836 and all the other dups
9733
9734 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9735
9736         * driver.cs: Implement /win32res and /win32icon.
9737
9738 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * cs-parser.jay: Add a rule to improve error handling for the
9741         common mistake of placing modifiers after the type.
9742
9743 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9744
9745         * cs-parser.jay (interface_event_declaration): Catch
9746         initialization of events on interfaces, and report cs0068
9747
9748         * cs-parser.jay (interface_event_declaration): Catch
9749         initialization of events. 
9750
9751         * ecore.cs: Better report missing constructors.
9752
9753         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9754         the error reporting done in the wrong place.  Fix.
9755
9756         * expression.cs (Binary.ResolveOperator): Catch the 
9757         operator + (E x, E y) error earlier, and later allow for implicit
9758         conversions in operator +/- (E e, U x) from U to the underlying
9759         type of E.
9760
9761         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9762         52596, if the container class is abstract, the default constructor
9763         is protected otherwise its public (before, we were always public).
9764
9765         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9766         fixed statement.
9767
9768         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9769         Jemlich that fixes bug #52597, MCS was generating invalid code for
9770         idisposable structs.   Thanks to Ben for following up with this
9771         bug as well.
9772
9773 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * driver.cs: Allow assemblies without code to be generated, fixes
9776         52230.
9777
9778 2004-01-07  Nick Drochak <ndrochak@gol.com>
9779
9780         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9781
9782 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9783
9784         * cs-parser.jay: Add rules to improve error reporting if fields or
9785         methods are declared at the namespace level (error 116)
9786
9787         * Add rules to catch event add/remove
9788
9789 2004-01-04  David Sheldon <dave-mono@earth.li>
9790
9791   * expression.cs: Added matching ")" to error message for 
9792   CS0077
9793
9794 2004-01-03 Todd Berman <tberman@gentoo.org>
9795
9796         * ecore.cs, attribute.cs:
9797         Applying fix from #52429.
9798
9799 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9800
9801         * ecore.cs, expression.cs, statement.cs:
9802         Total rewrite of how we handle branching. We
9803         now handle complex boolean expressions with fewer
9804         jumps. As well if (x == 0) no longer emits a ceq.
9805
9806         if (x is Foo) is much faster now, because we generate
9807         better code.
9808
9809         Overall, we get a pretty big improvement on our benchmark
9810         tests. The code we generate is smaller and more readable.
9811
9812         I did a full two-stage bootstrap. The patch was reviewed
9813         by Martin and Miguel.
9814
9815 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9816
9817         * cs-parser.jay: Make primary_expression not take a QI.
9818         we dont need this because the member_access rule covers
9819         us here. So we replace the rule with just IDENTIFIER.
9820
9821         This has two good effects. First, we remove a s/r conflict.
9822         Second, we allocate many fewer QualifiedIdentifier objects.
9823
9824 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9825
9826         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9827         set the correct information via SRE. This prevents
9828         hanging on the MS runtime. Fixes #29374.
9829
9830 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9831
9832         * convert.cs: correctly handle conversions to value types
9833         from Enum and ValueType as unboxing conversions.
9834
9835         Fixes bug #52569. Patch by Benjamin Jemlich.
9836
9837 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9838
9839         * expression.cs (BetterConversion): Prefer int -> uint
9840         over int -> ulong (csc's behaviour). This fixed bug #52046.
9841
9842 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9843
9844         * decl.cs (MemberCache.FindMembers): now returns a
9845         MemberInfo [].
9846
9847         * typemanager.cs: In general, go with with ^^.
9848         (CopyNewMethods): take an IList.
9849         (RealMemberLookup): Only allocate an arraylist
9850         if we copy from two sets of methods.
9851
9852         This change basically does two things:
9853         1) Fewer array lists allocated due to CopyNewMethods.
9854         2) the explicit cast in MemberList costed ALOT.
9855
9856 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9857
9858         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9859         a hashtable to avoid needless string allocations when an identifier is
9860         used more than once (the common case).
9861
9862 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9863
9864         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9865         is broken, it will not return anything. So, we
9866         have to use the information we have in mcs to
9867         do the task.
9868
9869         * typemanager.cs: Add a cache for GetInterfaces,
9870         since this will now be used more often (due to ^^)
9871
9872         (GetExplicitInterfaces) New method that gets the
9873         declared, not effective, interfaces on a type
9874         builder (eg, if you have interface IFoo, interface
9875         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9876         { IBar }.
9877
9878         This patch makes MCS able to bootstrap itself on
9879         Windows again.
9880
9881 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9882
9883         * expression.cs: Remove the Nop's that Miguel put
9884         in by mistake.
9885
9886 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9887
9888         * report.cs, codegen.cs: Give the real stack trace to
9889         the error when an exception is thrown.
9890
9891 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9892
9893         * decl.cs: only allocate hashtables for ifaces if 
9894         it is an iface!
9895
9896 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9897
9898         * expression.cs: fix the error from cs0121-2.cs
9899         (a parent interface has two child interfaces that
9900         have a function with the same name and 0 params
9901         and the function is called through the parent).
9902
9903 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9904
9905         * class.cs, rootcontext.cs, typmanager.cs: do not
9906         leak pointers.
9907
9908 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9909
9910         * codegen.cs: remove stack for the ec flow branching.
9911         It is already a linked list, so no need.
9912
9913 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9914
9915         * Makefile: Allow custom profiler here.
9916
9917 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9918
9919         * typemanager.cs (LookupType):
9920           - Use a static char [], because split takes
9921             a param array for args, so it was allocating
9922             every time.
9923           - Do not store true in a hashtable, it boxes.
9924
9925 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9926
9927         * flowanalysis.cs: bytify common enums.
9928
9929 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9930
9931         * modifiers.cs: Add a new set of flags for the
9932         flags allowed on explicit interface impls.
9933         * cs-parser.jay: catch the use of modifiers in
9934         interfaces correctly.
9935         * class.cs: catch private void IFoo.Blah ().
9936
9937         All related to bug #50572.
9938
9939 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9940
9941         * decl.cs: Rewrite the consistant accessability checking.
9942         Accessability is not linear, it must be implemented in
9943         a tableish way. Fixes #49704.
9944
9945 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9946
9947         * expression.cs: Handle negation in a checked context.
9948         We must use subtraction from zero. Fixes #38674.
9949
9950 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9951
9952         * class.cs: Ignore static void main in DLLs.
9953         * rootcontext.cs: Handle the target type here,
9954         since we are have to access it from class.cs
9955         * driver.cs: account for the above.
9956
9957 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9958
9959         * report.cs: Give line numbers and files if available.
9960
9961 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9962
9963         * driver.cs: Implement /addmodule.
9964
9965         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9966         ModuleBuilders.
9967
9968 2003-12-20  Martin Baulig  <martin@ximian.com>
9969
9970         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9971         (FieldBase.IsAssigned): Removed this field.
9972         (FieldBase.SetAssigned): New public method.
9973         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9974
9975 2003-12-20  Martin Baulig  <martin@ximian.com>
9976
9977         * expression.cs (LocalVariableReference.DoResolve): Don't set
9978         `vi.Used' if we're called from DoResolveLValue().
9979
9980         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9981         returns the usage vector it just merged into the current one -
9982         pass this one to UsageWarning().
9983         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9984         of the `EmitContext', don't call this recursively on our children.
9985
9986 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9987
9988         * driver.cs: Implement /target:module.
9989
9990 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9991
9992         * support.cs (CharArrayHashtable): New helper class.
9993
9994         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9995         char arrays, not strings, so we can avoid creating a string in
9996         consume_identifier if the identifier is a keyword.
9997
9998 2003-12-16  Martin Baulig  <martin@ximian.com>
9999
10000         * statement.cs (LocalInfo.Assigned): Removed this property.
10001         (LocalInfo.Flags): Removed `Assigned'.
10002         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10003         and uses flow analysis.
10004         (Block.UsageWarning): Made this method private.
10005         (Block.Resolve): Call UsageWarning() if appropriate.
10006
10007         * expression.cs (LocalVariableReference.DoResolve): Always set
10008         LocalInfo.Used here.
10009
10010 2003-12-13  Martin Baulig  <martin@ximian.com>
10011
10012         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10013         any value here; we're now using flow analysis to figure out
10014         whether a statement/block returns a value.
10015
10016 2003-12-13  Martin Baulig  <martin@ximian.com>
10017
10018         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10019         working again.
10020         (FlowBranching.MergeFinally): Don't call
10021         `branching.CheckOutParameters()' here, this is called in
10022         MergeTopBlock().
10023         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10024         when adding the `finally' vector.       
10025
10026 2003-12-13  Martin Baulig  <martin@ximian.com>
10027
10028         * flowanalysis.cs
10029         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10030         actually work and also fix #48962.
10031
10032 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10033
10034         * decl.cs: Do not check System.Object for nested types,
10035         since we know it does not have any. Big bang for buck:
10036
10037         BEFORE:
10038            Run 1:   8.35 seconds
10039            Run 2:   8.32 seconds
10040            corlib:  17.99 seconds
10041         AFTER:
10042            Run 1:   8.17 seconds
10043            Run 2:   8.17 seconds
10044            corlib:  17.39 seconds
10045
10046 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10047
10048         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10049         time we are returning 0 members, so we save alot here.
10050
10051 2003-12-11  Martin Baulig  <martin@ximian.com>
10052
10053         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10054         `MergeChild()', also just take the `FlowBranching' as argument;
10055         call Merge() on it and return the result.
10056         (FlowBranching.Merge): We don't need to do anything if we just
10057         have one sibling.
10058
10059 2003-12-11  Martin Baulig  <martin@ximian.com>
10060
10061         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10062         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10063         Maurer for this idea.
10064
10065 2003-12-11  Martin Baulig  <martin@ximian.com>
10066
10067         * flowanalysis.cs (MergeResult): This class is now gone; we now
10068         use the `UsageVector' for this.  The reason for this is that if a
10069         branching just has one sibling, we don't need to "merge" them at
10070         all - that's the next step to do.
10071         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10072         `MergeResult'.
10073
10074 2003-12-11  Martin Baulig  <martin@ximian.com>
10075
10076         Reworked flow analyis and made it more precise and bug-free.  The
10077         most important change is that we're now using a special `Reachability'
10078         class instead of having "magic" meanings of `FlowReturns'.  I'll
10079         do some more cleanups and optimizations and also add some more
10080         documentation this week.
10081
10082         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10083         largely reworked this class.
10084         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10085         the new `Reachability' class instead of having "magic" values here.
10086         (FlowBranching): We're now using an instance of `Reachability'
10087         instead of having separate `Returns', `Breaks' etc. fields.
10088
10089         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10090         based on flow analysis; ignore the return value of block.Emit ().
10091
10092 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10093
10094         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10095         if they are private.
10096
10097 2003-12-09  Martin Baulig  <martin@ximian.com>
10098
10099         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10100         call them directly on the UsageVector.
10101
10102 2003-12-09  Martin Baulig  <martin@ximian.com>
10103
10104         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10105         Changed return type from `FlowReturns' to `Reachability'.
10106
10107 2003-12-09  Martin Baulig  <martin@ximian.com>
10108
10109         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10110         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10111         `Reachable' fields with a single `Reachability' one.
10112
10113 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10114
10115         * class.cs (FindMembers): Remove foreach's.
10116
10117         Bootstrap times:
10118
10119         BEFORE
10120                 Run 1:   8.74 seconds
10121                 Run 2:   8.71 seconds
10122
10123         AFTER
10124                 Run 1:   8.64 seconds
10125                 Run 2:   8.58 seconds
10126
10127
10128 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10129
10130         * cs-parser.jay:
10131         * gen-treedump.cs:
10132         * statement.cs:
10133         This patch does a few things:
10134                 1. EmptyStatement is now a singleton, so it is never reallocated.
10135                 2. All blah is EmptyStatement constructs have been changed to
10136                    blah == EmptyStatement.Value, which is much faster and valid
10137                    now that EmptyStatement is a singleton.
10138                 3. When resolving a block, rather than allocating a new array for
10139                    the non-empty statements, empty statements are replaced with
10140                    EmptyStatement.Value
10141                 4. Some recursive functions have been made non-recursive.
10142         Mainly the performance impact is from (3), however (1) and (2) are needed for
10143         this to work. (4) does not make a big difference in normal situations, however
10144         it makes the profile look saner.
10145
10146         Bootstrap times:
10147
10148         BEFORE
10149         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10150         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10151         Total memory allocated: 56397 KB
10152
10153         AFTER
10154         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10155         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10156         Total memory allocated: 55666 KB
10157
10158 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10159
10160         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10161         than the hashtable in a hashtable version
10162
10163         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10164         we always end up concating a string. This results in a huge perf
10165         loss, because many strings have to be tracked by the GC. In this
10166         patch, we first use a hashtable that works with two keys, so that
10167         the strings do not need to be concat'ed.
10168
10169         Bootstrap times:
10170         BEFORE
10171                 Run 1:   8.74 seconds
10172                 Run 2:   8.71 seconds
10173
10174         AFTER
10175                 Run 1:   8.65 seconds
10176                 Run 2:   8.56 seconds
10177
10178 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10179
10180         * Makefile: Add a new target `do-time' that does a quick and simple
10181         profile, leaving easy to parse output.
10182
10183 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10184
10185         * codegen.cs (Init): Create the dynamic assembly with 
10186         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10187
10188 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10189
10190         * support.cs: Make the PtrHashtable use only one
10191         instance of its comparer.
10192
10193 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10194
10195         * typemanager.cs: Fix lookup of GetNamespaces.
10196
10197 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10198
10199         * expression.cs: Removed redundant line.
10200
10201         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10202         ArrayLists, use for loops with bounds.  
10203
10204         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10205         arraylist.
10206
10207         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10208         arraylists, use for loop with bounds.
10209
10210         The above three changes give us a 0.071 second performance
10211         improvement out of 3.294 seconds down to 3.223.  On my machine
10212         the above changes reduced the memory usage by 1,387 KB during
10213         compiler bootstrap.
10214
10215         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10216         QualifiedIdentifiers.  Before we created a new string through
10217         concatenation, and mostly later on, the result would be
10218         manipulated by DecomposeQI through string manipulation.
10219
10220         This reduced the compiler memory usage for bootstrapping from
10221         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10222         compile times in 0.05 seconds.
10223
10224 2003-11-28  Dick Porter  <dick@ximian.com>
10225
10226         * support.cs: Do string compares with the Invariant culture.
10227
10228         * rootcontext.cs: 
10229         * gen-treedump.cs: 
10230         * expression.cs: 
10231         * driver.cs: 
10232         * decl.cs: 
10233         * codegen.cs: 
10234         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10235         the comparison is done with the Invariant culture.
10236
10237 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10238
10239         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10240         GetEnumerator method.
10241
10242         (ProbeCollectionType): Iterate starting at the most specific type
10243         upwards looking for a GetEnumerator
10244
10245         * expression.cs: Shift count can be up to 31 for int/uint and 63
10246         for long/ulong.
10247
10248 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10249
10250         * statement.cs (Block.LookupLabel): Also look for the label on the
10251         children blocks.  Use a hash table to keep track of visited
10252         nodes. 
10253
10254         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10255         we actually did transform the other operand, otherwise fall back
10256         to the common codepath that casts to long.
10257
10258         * cs-tokenizer.cs: Use the same code pattern as the int case.
10259         Maybe I should do the parsing myself, and avoid depending on the
10260         Parse routines to get this done.
10261
10262 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10265         which fixes bug 51347.  This time test it.
10266
10267         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10268         attributes for example can not tell the difference between these.
10269         The difference was only a syntax feature of the language. 
10270
10271         * attribute.cs: Apply attributes to delegates.
10272
10273         * delegate.cs: Call the apply attributes method.
10274
10275 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10276
10277         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10278         comparing 0 vs Byte.MinValue, not the value
10279
10280         (ImplicitConversionRequired): When reporting a conversion error,
10281         use error 31 to print out the constant error instead of the
10282         simpler 29.
10283
10284         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10285         which fixes bug 51347.
10286
10287 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10288
10289         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10290         which fixes the -warnaserror command line option.
10291
10292 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10293
10294         * cfold.cs (DoNumericPromotions): During constant folding of
10295         additions on UIntConstant, special case intconstants with
10296         IntConstants like we do on the expression binary operator. 
10297
10298 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * convert.cs (ImplicitReferenceConversion): We were missing a case
10301         (System.Enum are not value types or class types, so we need to
10302         classify them separatedly).
10303
10304         * driver.cs: We do not support error 2007.
10305
10306 2003-11-12 Jackson Harper <jackson@ximian.com>
10307
10308         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10309         system directory. Also use the full file name so users can
10310         libraries names mscorlib-o-tron.dll in a non system dir.
10311         
10312 2004-01-04  David Sheldon <dave-mono@earth.li>
10313
10314         * expression.cs: Added matching ")" to error message for CS0077.
10315
10316 2003-12-19  Martin Baulig  <martin@ximian.com>
10317
10318         * typemanager.cs (TypeManager.IsEqualGenericType): New public
10319         static method; see documentation in the method.
10320         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
10321
10322         * convert.cs (Convert.ImplicitReferenceConversion,
10323         Convert.ImplicitReferenceConversionExists): Add support for
10324         generic type declarations; see gen-36.cs.
10325
10326 2003-12-19  Martin Baulig  <martin@ximian.com>
10327
10328         * pending.cs (Pending.InterfaceMethod): Use
10329         `Type.IsAssignableFrom()' instead of `=='.
10330
10331 2003-12-18  Martin Baulig  <martin@ximian.com>
10332
10333         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
10334         byref types first.
10335
10336         * convert.cs (Convert.ImplicitStandardConversionExists): Use
10337         `expr_type.Equals (target_type)' instead of `=='.
10338
10339 2003-12-08  Martin Baulig  <martin@ximian.com>
10340
10341         * generics.cs (Constraints.Types): Removed.
10342         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
10343         to Type's.
10344         (Constraints.ResolveTypes): New public method; resolves the
10345         TypeExpr's to Type's.
10346         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
10347         longer takes the constraints.
10348         (TypeParameter.DefineMethod): Likewise.
10349         (TypeParameter.DefineType): New public method.  Calls
10350         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
10351         the constraints.
10352
10353 2003-12-08  Martin Baulig  <martin@ximian.com>
10354
10355         * convert.cs (Convert.ImplicitConversionStandard): Use
10356         `expr_type.Equals (target_type)' instead of `=='.
10357
10358 2003-12-08  Martin Baulig  <martin@ximian.com>
10359
10360         * typemanager.cs (TypeManager.GetReferenceType): Call
10361         `Type.MakeByRefType ()'.
10362
10363 2003-12-08  Martin Baulig  <martin@ximian.com>
10364
10365         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
10366         just has some special meaning in some situations.  For instance,
10367         it is allowed to use `where' as the name of a variable etc.
10368
10369 2003-12-04  Martin Baulig  <martin@ximian.com>
10370
10371         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10372         `Type.MakeArrayType()' for array types.
10373
10374 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
10377         debugging message.
10378
10379         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
10380         corlib to compile.
10381
10382 2003-11-16  Martin Baulig  <martin@ximian.com>
10383
10384         * codegen.cs (EmitContext.IsGeneric): Removed.
10385
10386         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
10387         ResolveGeneric() on the DeclSpace.
10388
10389 2003-11-16  Martin Baulig  <martin@ximian.com>
10390
10391         * generic.cs (TypeArguments.Resolve):
10392         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
10393         `ResolveType()' on it to get the Type.
10394
10395 2003-11-15  Martin Baulig  <martin@ximian.com>
10396
10397         * generic.cs (ConstructedType.GetInterfaces): Override this.
10398
10399 2003-11-14  Martin Baulig  <martin@ximian.com>
10400
10401         * interface.cs (Interface.DefineType): Define all type parameters
10402         before adding the interfaces we inherit.
10403
10404 2003-11-11  Martin Baulig  <martin@ximian.com>
10405
10406         * generic.cs (ConstructedType.ResolveType): Always call
10407         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
10408
10409 2003-11-10  Martin Baulig  <martin@ximian.com>
10410
10411         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10412         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10413         calling `ResolveType()' on them, directly assign their `Type'.
10414
10415 2003-11-08  Martin Baulig  <martin@ximian.com>
10416
10417         * generic.cs (ConstructedType): Override `IsClass' etc.
10418
10419 2003-11-08  Martin Baulig  <martin@ximian.com>
10420
10421         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10422         return value and the `out parent' parameter.
10423         (TypeContainer.DefineType): Moved the CS0644 check into
10424         GetClassBases().  Don't pass the interface types to the
10425         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10426         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10427
10428         * ecore.cs (TypeExpr.IsAttribute): New property.
10429         (TypeExpr.GetInterfaces): New method.
10430
10431         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10432         TypeExpr instead of a Type.
10433         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10434         (Interface.DefineType): Don't pass the interface types to the
10435         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10436         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10437
10438         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10439         instead of a `Type[]'.
10440         (TypeManager.RegisterBuilder): Likewise.
10441         (TypeManager.AddUserInterface): Likewise.
10442         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10443         `Type[]' and also return a `TypeExpr[]'.
10444         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10445
10446 2003-11-08  Martin Baulig  <martin@ximian.com>
10447
10448         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10449         Expression.     
10450
10451 2003-11-08  Martin Baulig  <martin@ximian.com>
10452
10453         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10454         TypeManager.ResolveExpressionTypes().
10455
10456         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10457         instead of an Expression.
10458         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10459         (TypeExpression): New public class; formerly known as `TypeExpr'.
10460
10461         * expression.cs (ComposedCast): Derive from TypeExpr.
10462
10463         * typemanager.cs (TypeManager.system_*_expr): These are now
10464         TypExpr's instead of Expression's.
10465         (TypeManager.ResolveExpressionTypes): New public static function;
10466         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10467         of them.        
10468
10469 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10470
10471         * expression.cs (New.DoResolve): Do not dereference value that
10472         might be a null return.
10473
10474         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10475         sure that the constant value has the right type.  Fixes an
10476         unreported bug, similar to 50425.
10477
10478         * const.cs (Const.LookupConstantValue): Call
10479         ImplicitStandardConversionExists before doing a conversion to
10480         avoid havng the TypeManager.ChangeType do conversions.
10481
10482         Reduced the number of casts used
10483
10484         (Const.ChangeType): New routine to enable reuse of the constant
10485         type changing code from statement.
10486
10487         * typemanager.cs (ChangeType): Move common initialization to
10488         static global variables.
10489
10490         Fixes #50425.
10491
10492         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10493         every value type to go through, even if it was void.  Fix that. 
10494
10495         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10496         character of the define, and the is_identifier_part_character for
10497         the rest of the string.
10498
10499 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10500
10501         * expression.cs (UnaryMutator.EmitCode): When I updated
10502         LocalVariableReference.DoResolve, I overdid it, and dropped an
10503         optimization done on local variable references.
10504
10505 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * ecore.cs: Convert the return from Ldlen into an int.
10508
10509 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10510
10511         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10512         the accessibility, this is a special case for toplevel non-public
10513         classes (internal for instance).
10514
10515 2003-10-20  Nick Drochak <ndrochak@gol.com>
10516
10517         * ecore.cs: Fix typo and build.  Needed another right paren.
10518
10519 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10520
10521         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10522         `internal' case regular and protected, but not allowing protected
10523         to be evaluated later.  Bug 49840
10524
10525 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10526
10527         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10528         to kb.Nlast, and not the kb.nFirst to isolate the switch
10529         statement.
10530
10531         Extract the underlying type, so enumerations of long/ulong are
10532         treated like long/ulong.
10533
10534 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * expression.cs (New): Overload the meaning of RequestedType to
10537         track the possible creation of the NewDelegate type, since
10538         DoResolve is invoked more than once for new constructors on field
10539         initialization.
10540
10541         See bugs: #48800 and #37014
10542
10543         * cs-parser.jay (declare_local_constants): Take an arraylist
10544         instead of a single constant.
10545
10546         (local_constant_declaration): It should take a
10547         constant_declarators, not a constant_declarator.  Fixes 49487
10548
10549         * convert.cs: Fix error report.
10550
10551 2003-10-13 Jackson Harper <jackson@ximian.com>
10552
10553         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10554         bug #49611
10555         
10556 2003-11-03  Martin Baulig  <martin@ximian.com>
10557
10558         * expression.cs (ArrayAccess.GetStoreOpcode): Added
10559         `out bool has_type_arg'; if set, we need to pass the type to
10560         ig.Emit().
10561         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
10562         Stelem_Any/Ldelem_Any for generic parameters.   
10563
10564 2003-11-02  Martin Baulig  <martin@ximian.com>
10565
10566         * expression.cs (Invocation.EmitCall): Use
10567         `TypeManager.IsValueType()' to check whether it's a value type.
10568         Don't set `struct_call' when calling a method on a type parameter.
10569
10570 2003-11-02  Martin Baulig  <martin@ximian.com>
10571
10572         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
10573         and removed the TypeBuilder argument.
10574
10575         * typemanager.cs (TypeManager.IsValueType): Return
10576         `t.IsGenericParameter || t.IsValueType'.
10577
10578 2003-10-25  Martin Baulig  <martin@ximian.com>
10579
10580         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
10581         call ConstructedType.Resolve() on it.
10582
10583         * generic.cs (ConstructedType.Resolve): Set `type' on success.
10584
10585 2003-10-25  Martin Baulig  <martin@ximian.com>
10586
10587         * class.cs (TypeContainer.GetClassBases): Changed
10588         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
10589         CS8214 reporting here.
10590         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
10591         instead of a `Type' for our parent.  In case of a recursive
10592         declaration (see tests/gen-23.cs for an example), our parent is a
10593         ConstructedType and it doesn't have its type set.  So, first
10594         create our own TypeBuilder, then call constructed.Resolve() to get
10595         the parent's type and finally TypeBuilder.SetParent() it.
10596
10597         * ecore.cs (TypeExpr.Name): New public virtual property.
10598
10599         * generic.cs
10600         (ConstructedType): We're now a TypeExpr and not just an Expression.
10601         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
10602         arguments here; this is done later.
10603         (ConstructedType.Resolve): New public method to resolve the type
10604         arguments and bind them.
10605
10606 2003-10-21  Martin Baulig  <martin@ximian.com>
10607
10608         * convert.cs: Use `TypeManager.IsValueType' instead of
10609         'type.IsValueType' everywhere.
10610
10611         * typemanager.cs (TypeManager.IsValueType): Return true for type
10612         parameters.  The reason for this is that we need to box a type
10613         parameter when converting it to a reference type.
10614
10615         * cs-parser.jay: Added support for default value expressions.
10616
10617         * generics.cs (DefaultValueExpression): New public class.       
10618
10619 2003-10-17  Martin Baulig  <martin@ximian.com>
10620
10621         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
10622         TypeContainer so we can also use this for Interfaces.
10623         (TypeParameter.Resolve): Likewise.
10624
10625         * interface.cs (Interface.DefineType): Added support for generic
10626         interfaces.
10627
10628         * cs-parser.jay: Added support for generic structs and interfaces.
10629
10630 2003-10-17  Martin Baulig  <martin@ximian.com>
10631
10632         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
10633         call generic methods :-)
10634
10635 2003-10-16  Martin Baulig  <martin@ximian.com>
10636
10637         * cs-parser.jay (namespace_or_type_name): Only create a
10638         GenericMemberAccess if we actually have type arguments.
10639
10640 2003-10-13  Martin Baulig  <martin@ximian.com>
10641
10642         * class.cs (Method.Define): If we're a generic method, call
10643         TypeBuilder.DefineGenericMethod () before resolving
10644         the parameters.
10645         (MethodData): Added .ctor which takes an additional MethodBuilder
10646         argument; this is used for generic methods.
10647         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
10648         we already have a MethodBuilder.
10649
10650 2003-10-10  Martin Baulig  <martin@ximian.com>
10651
10652         * class.cs (Method): Added .ctor which takes a `GenericMethod'
10653         instead of a `DeclSpace'.  This is used for generic methods.
10654
10655         * cs-parser.jay (method_header): Added support for generic
10656         methods; create a `GenericMethod' instance and pass it to the
10657         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
10658         parameters and locals.
10659
10660         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
10661         since we already have the location.  Check whether we're a generic
10662         type declaration or a generic method and create the correct type
10663         parameter.
10664
10665         * generic.cs (TypeParameter.DefineMethod): New public method.
10666         (GenericMethod): New public class; derives from DeclSpace and is
10667         used for generic methods.       
10668
10669 2003-10-09  Martin Baulig  <martin@ximian.com>
10670
10671         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10672         to the .ctor.
10673         (MethodCore.DoDefineParameters): Removed the TypeContainer
10674         argument; use the DeclSpace which was passed to the .ctor instead.
10675         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10676         TypeContainer; we only need a DeclSpace here.
10677
10678 2003-10-09  Martin Baulig  <martin@ximian.com>
10679
10680         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10681         to the .ctor.
10682         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10683         EmitContext's .ctor.    
10684
10685 2003-10-09  Martin Baulig  <martin@ximian.com>
10686
10687         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10688         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10689         AsAccessible(), moved them as well.
10690
10691         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10692
10693 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10694
10695         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10696         generation for >=, as spotted by Paolo, bug 48679.  
10697         Patch from David Waite.
10698
10699         * cs-tokenizer.cs: Add handling for #pragma.
10700
10701         * cs-parser.jay: Allow for both yield and yield return in the
10702         syntax.  The anti-cobolization of C# fight will go on!
10703
10704         * class.cs (TypeBuilder.DefineType): Catch error condition here
10705         (Parent.DefineType erroring out and returning null).
10706
10707         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10708         coping with enumerations variables, we were mistakenly processing
10709         them as a regular value type instead of built-in types.  Fixes the
10710         bug #48063
10711
10712         * typemanager.cs (IsBuiltinOrEnum): New method.
10713
10714 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10715
10716         * cs-parser.jay: Upgrade: yield now needs the return clause.
10717
10718 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10719
10720         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10721
10722 2003-09-29  Martin Baulig  <martin@ximian.com>
10723
10724         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
10725         inflated generic methods.
10726
10727         * generics.cs (ConstructedType): Distinguish between open and
10728         closed constructed types; correctly resolve the arguments.
10729
10730 2003-09-22  Martin Baulig  <martin@ximian.com>
10731
10732         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
10733         all type arguments meet their constraints.
10734
10735 2003-09-19  Martin Baulig  <martin@ximian.com>
10736
10737         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10738         `MemberCache parent' argument.  Normally, an interface doesn't
10739         have a parent type except System.Object, but we use this in gmcs
10740         for generic type parameters.
10741
10742 2003-09-18  Martin Baulig  <martin@ximian.com>
10743
10744         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10745         on `type.IsInterface'; don't check whether the type has a parent
10746         to determine whether it's an interface.
10747
10748 2003-09-17  Martin Baulig  <martin@ximian.com>
10749
10750         * generic.cs (ConstructedType.ToString): Always use `name' as the
10751         type name.
10752
10753 2003-09-15  Martin Baulig  <martin@ximian.com>
10754
10755         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
10756
10757         * generic.cs (Constraints.Resolve): New public method; this is
10758         called to resolve the constraint types and to check whether all
10759         the constraints are correct.
10760         (Constraints.Types): New public property.
10761         (TypeParameter.Resolve): New public method; resolves all the
10762         type's constraints.
10763
10764         * class.cs (TypeContainer.DefineType): Call
10765         TypeParameter.Resolve() before actually defining the type.
10766
10767 2003-09-15  Martin Baulig  <martin@ximian.com>
10768
10769         * class.cs (TypeContainer.DefineType): Added an error flag to
10770         avoid reporting duplicate CS0146's ("class definition is
10771         circular.").
10772
10773         * driver.cs (Driver.MainDriver): Abort if
10774         RootContext.ResolveTree() reported any errors.
10775
10776 2003-09-07  Martin Baulig  <martin@ximian.com>
10777
10778         * report.cs (Error, Warning): Added overloaded versions which take
10779         a `params object[] args' and call String.Format().
10780
10781 2003-09-07  Martin Baulig  <martin@ximian.com>
10782
10783         * decl.cs (DeclSpace..ctor): Don't call
10784         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10785         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10786         (DeclSpace.RecordDecl): New method.
10787
10788         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10789
10790 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10791
10792         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10793         value attributes to be applied to ParameterBuilders.
10794
10795         * class.cs (MethodCore.LabelParameters): Make static and more
10796         generic so that it can be used from other places - like interface
10797         methods, for instance.
10798
10799         * interface.cs (Interface.Emit): Call LabelParameters before
10800         emitting attributes on the InterfaceMethod.
10801
10802 2003-09-07  Martin Baulig  <martin@ximian.com>
10803
10804         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
10805         if the number of type parameters doesn't match.
10806
10807 2003-09-04  Martin Baulig  <martin@ximian.com>
10808
10809         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
10810         for arrays of generic type params (ie. `!0[]').
10811
10812 2003-09-04  Martin Baulig  <martin@ximian.com>
10813
10814         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
10815         for the moment.
10816
10817 2003-09-04  Martin Baulig  <martin@ximian.com>
10818
10819         * decl.cs (DeclSpace.LookupGeneric): New method.
10820         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
10821         moment.
10822
10823         * generic.cs (TypeParameterExpr): Take a TypeParameter as
10824         argument, not just a string.
10825         (TypeParameter.Define): New public method; this is called to
10826         actually define the generic parameter; after this, you can use the
10827         new `Type' property to get the type.
10828
10829 2003-09-04  Martin Baulig  <martin@ximian.com>
10830
10831         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
10832         is now an ArrayList; initialize the result of the `TypeParameters'
10833         property here.
10834         (DeclSpace.GetGenericData): Removed.
10835         (DeclSpace.LookupGeneric): Temporarily removed; we need to
10836         implement this in a different way.
10837         (DeclSpace.GetTypeParameters): Removed; there's now a
10838         `TypeParameters' property.
10839         (DeclSpace.TypeParameters): New public property.
10840
10841         * generic.cs (Constraints): Make this class public.
10842         (TypeParameter): New public class.
10843
10844 2003-09-04  Martin Baulig  <martin@ximian.com>
10845
10846         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
10847         generic parameters.
10848
10849         * class.cs (TypeContainer.DefineType): Call
10850         TypeBuilder.DefineGenericParameter () on all generic parameters if
10851         this is a generic type.
10852
10853 2003-08-28  Martin Baulig  <martin@ximian.com>
10854
10855         * sample-stack.il: Compile this with ilasm: "ilasm /dll
10856         sample-stack.il".
10857
10858         * sample-hello.cs: Compile this with gmcs: "gmcs
10859         /r:sample-stack.dll sample-hello.cs".
10860
10861 2003-08-28  Martin Baulig  <martin@ximian.com>
10862
10863         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
10864         the parameters to the generic type.
10865
10866 2003-08-28  Martin Baulig  <martin@ximian.com>
10867
10868         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
10869
10870 2003-08-28  Martin Baulig  <martin@ximian.com>
10871
10872         * cs-parser.jay (opt_type_argument_list): Use
10873         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
10874         (primary_expression): Replace `qualified_identifier' with `type_name'.
10875         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
10876
10877         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
10878         parser to check whether it is syntactically a type parameter list;
10879         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
10880         this case.
10881
10882 2003-08-26  Martin Baulig  <martin@ximian.com>
10883
10884         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10885         resolving aliases; fixes #47927.
10886
10887 2003-08-26  Martin Baulig  <martin@ximian.com>
10888
10889         * statement.cs (Using.DoResolve): This is internally emitting a
10890         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10891         do not always return.  Fixes #47681.
10892
10893 2003-08-26  Martin Baulig  <martin@ximian.com>
10894
10895         * decl.cs (MemberCore): Moved WarningNotHiding(),
10896         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10897         into MemberBase.
10898         (AdditionResult): Make this nested in DeclSpace.
10899         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10900         argument; call NamespaceEntry.Define() unless we're nested in a
10901         class or struct.
10902
10903         * namespace.cs (Namespace.DefineName): New public function.  This
10904         is called from DeclSpace's .ctor to add 
10905         (Namespace.Lookup): Include DeclSpaces in the lookup.
10906
10907         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10908
10909         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10910
10911 2003-08-25  Martin Baulig  <martin@ximian.com>
10912
10913         * convert.cs (Convert.ExplicitReferenceConversion): When
10914         converting from an interface type to a class, unbox if the target
10915         type is a struct type.  Fixes #47822.
10916
10917 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10918
10919         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10920         #47854.
10921
10922 2003-08-22  Martin Baulig  <martin@ximian.com>
10923
10924         * class.cs (TypeManager.DefineType): When defining a nested type,
10925         call DefineType() on our parent; fixes #47801.
10926
10927 2003-08-22  Martin Baulig  <martin@ximian.com>
10928
10929         * class.cs (MethodData.Define): While checking if a method is an
10930         interface implementation, improve the test a bit more to fix #47654.
10931
10932 2003-08-22  Martin Baulig  <martin@ximian.com>
10933
10934         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10935         correctly; fixes #47722.
10936
10937 2003-08-22  Martin Baulig  <martin@ximian.com>
10938
10939         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10940         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10941
10942         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10943
10944 2003-08-22  Martin Baulig  <martin@ximian.com>
10945
10946         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10947         can only be assigned in static constructors.  Fixes #47161.
10948
10949 2003-08-22  Martin Baulig  <martin@ximian.com>
10950
10951         Rewrote and improved the flow analysis code.
10952
10953         * flowbranching.cs (FlowBranching): Make this class abstract.
10954         (FlowBranching.CreateBranching): New static function to create a
10955         new flow branching.
10956         (FlowBranchingBlock, FlowBranchingException): New classes.
10957         (FlowBranching.UsageVector.Type): New public readonly field.
10958         (FlowBranching.UsageVector.Breaks): Removed the setter.
10959         (FlowBranching.UsageVector.Returns): Removed the setter.
10960         (FlowBranching.UsageVector): Added Break(), Return(),
10961         NeverReachable() and Throw() methods to modify the reachability.
10962         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10963         done by FlowBranching.Merge().
10964         (FlowBranching.UsageVector.MergeChild): New method; merges the
10965         merge result into the current vector.
10966         (FlowBranching.Merge): New abstract method to merge a branching.
10967
10968 2003-08-12  Martin Baulig  <martin@ximian.com>
10969
10970         * expression.cs (Indirection.CacheTemporaries): Create the
10971         LocalTemporary with the pointer type, not its element type.
10972
10973 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10974
10975         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10976         token was a keyword or not.
10977
10978         Add `error' options where an IDENTIFIER was expected;  Provide
10979         CheckToken and CheckIdentifierToken convenience error reporting
10980         functions. 
10981
10982         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10983
10984         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10985         NameSpaceEntry NameSpaceEntry.
10986
10987         (LookupInterfaceOrClass): Avoid creating a full qualified name
10988         from namespace and name: avoid doing lookups when we know the
10989         namespace is non-existant.   Use new Tree.LookupByNamespace which
10990         looks up DeclSpaces based on their namespace, name pair.
10991
10992         * driver.cs: Provide a new `parser verbose' to display the
10993         exception thrown during parsing.  This is turned off by default
10994         now, so the output of a failure from mcs is more graceful.
10995
10996         * namespace.cs: Track all the namespaces defined in a hashtable
10997         for quick lookup.
10998
10999         (IsNamespace): New method
11000
11001 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11002
11003         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11004         we know that we need to concatenate (full typename can never be
11005         null). 
11006
11007         * class.cs: ditto.
11008
11009         * statement.cs: Use a bitfield;  Do not initialize to null things
11010         which are done by the constructor by default.
11011
11012         * cs-parser.jay: bug fix, parameter was 4, not 3.
11013
11014         * expression.cs: Just use the property;
11015
11016         * statement.cs: No need for GetVariableInfo method.
11017
11018 2003-08-08  Martin Baulig  <martin@ximian.com>
11019
11020         * flowanalysis.cs (FlowReturns): This is now nested in the
11021         `FlowBranching' class.
11022         (MyBitVector): Moved this here from statement.cs.
11023         (FlowBranching.SiblingType): New enum type.
11024         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11025
11026 2003-08-07  Martin Baulig  <martin@ximian.com>
11027
11028         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11029         `FlowBranching' class and called `BranchingType'.
11030
11031 2003-08-07  Martin Baulig  <martin@ximian.com>
11032
11033         * flowanalysis.cs: Moved all the control flow analysis code into
11034         its own file.
11035
11036 2003-08-07  Martin Baulig  <martin@ximian.com>
11037
11038         * assign.cs (Assign.DoResolve): `target' must either be an
11039         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11040         #37319.
11041
11042 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * expression.cs (BinaryMethod): This kind of expression is created by the
11045         Binary class if it determines that the operator has to be handled
11046         by a method.
11047
11048         (BinaryDelegate): This kind of expression is created if we are
11049         dealing with a + or - operator on delegates.
11050
11051         (Binary): remove method, argumetns, and DelegateOperator: when
11052         dealing with methods, 
11053
11054         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11055
11056         * statement.cs (Block): use bitfields for the three extra booleans
11057         we had in use.   Remove unused topblock parameter.
11058
11059         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11060
11061         * assign.cs: Drop extra unneeded tests.
11062
11063 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11064
11065         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11066
11067         * statement.cs (Foreach): Use VariableStorage instead of
11068         LocalBuilders.   
11069
11070         * codegen.cs (VariableStorage): New class used by clients that
11071         require a variable stored: locals or fields for variables that
11072         need to live across yield.
11073
11074         Maybe provide a convenience api for EmitThis+EmitLoad?
11075
11076         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11077         these bad boys.
11078
11079 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11082         RemapParameterLValue): New methods that are used to turn a
11083         precomputed FieldInfo into an expression like this:
11084
11085                 instance.FieldInfo
11086
11087         The idea is to use this instead of making LocalVariableReference
11088         have more than one meaning.
11089
11090         * cs-parser.jay: Add error production to BASE.
11091
11092         * ecore.cs: Deal with TypeManager.GetField returning null, which
11093         is now a valid return value.
11094
11095         (FieldExprNoAddress): New expression for Fields whose address can
11096         not be taken.
11097
11098         * expression.cs (LocalVariableReference): During the resolve
11099         phases, create new expressions if we are in a remapping context.
11100         Remove code that dealt with remapping here.
11101
11102         (ParameterReference): same.
11103
11104         (ProxyInstance): New expression, like the `This' expression, but
11105         it is born fully resolved.  We know what we are doing, so remove
11106         the errors that are targeted to user-provided uses of `this'.
11107
11108         * statement.cs (Foreach): our variable is now stored as an
11109         Expression;  During resolution, follow the protocol, dont just
11110         assume it will return this.
11111
11112 2003-08-06  Martin Baulig  <martin@ximian.com>
11113
11114         * support.cs (SeekableStreamReader.cs): New public class.
11115
11116         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11117         SeekableStreamReader instead of the normal StreamReader.
11118
11119 2003-08-04  Martin Baulig  <martin@ximian.com>
11120
11121         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11122         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11123         deambiguate casts and delegate invocations.
11124         (parenthesized_expression): Use the new tokens to ensure this is
11125         not a cast of method invocation.
11126
11127         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11128         when reading a `)' and Deambiguate_CloseParens () was previously
11129         called.
11130
11131         * expression.cs (ParenthesizedExpression): New class.  This is
11132         just used for the CS0075 test.
11133         (Binary.DoResolve): Check for CS0075.   
11134
11135 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11136
11137         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11138         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11139         reference comparison.
11140
11141         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11142         examine the ReturnType for equality - this is necessary in the
11143         cases of implicit and explicit operators whose signature also
11144         includes the return type.
11145
11146 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11147
11148         * namespace.cs: Cache the result of the namespace computation,
11149         instead of computing it every time.
11150
11151 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11152
11153         * decl.cs: Use a global arraylist that we reuse over invocations
11154         to avoid excesive memory consumption.  Reduces memory usage on an
11155         mcs compile by one meg (45 average).
11156
11157         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11158         private, work around that.
11159
11160 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11161
11162         * literal.cs (IntLiteral): Define Zero and One static literals. 
11163
11164         * cs-parser.jay (integer_literal): use static literals to reduce
11165         memory usage for the most used literals (0, 1 and -1).  211kb
11166         reduced in memory usage.
11167
11168         Replace all calls to `new ArrayList' with `new
11169         ArrayList(4)' which is a good average number for most allocations,
11170         and also requires only 16 bytes of memory for its buffer by
11171         default. 
11172
11173         This reduced MCS memory usage in seven megabytes for the RSS after
11174         bootstrapping.
11175
11176 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11177
11178         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11179         handle params methods the correct way by forming only one
11180         applicable set with params and normal methods in them. Earlier we
11181         were looking at params methods only if we found no normal methods
11182         which was not the correct thing to do.
11183
11184         (Invocation.BetterFunction): Take separate arguments indicating
11185         when candidate and the best method are params methods in their
11186         expanded form.
11187
11188         This fixes bugs #43367 and #46199.
11189
11190         * attribute.cs: Documentation updates.
11191
11192         (CheckAttribute): Rename to CheckAttributeTarget.
11193         (GetValidPlaces): Rename to GetValidTargets.
11194
11195         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11196         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11197
11198         Fixes bug #44468.
11199
11200 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
11201
11202         * codegen.cs: Compute IsGeneric correctly.
11203
11204         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
11205         resolution. 
11206
11207         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
11208         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
11209         regressions, and I was chasing more bugs than I required.
11210
11211         * interface.cs: Use expressions for base type names (like classes
11212         and structs have been doing for a while now), and resolve that.
11213         This patch should probably go into head as well.
11214
11215         This makes it one less user of FindType.
11216
11217 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11218
11219         This compiler can not self host currently.  Need to fix that.
11220         
11221         * Makefile: compile to `gmcs.exe'
11222
11223         * driver.cs: Turn on v2 by default on gmcs.
11224
11225         * generic.cs (ConstructedType): Does no longer take a container
11226         type argument;  That will be taken care of later.
11227
11228         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
11229         Use SimpleName to resolve for now, so we can continue the work on
11230         the parser, until we get Type.GetType that understands generics.
11231
11232         (ConstructedType.ToString): Implement
11233
11234         (TypeArguments.Resolve): Resolve the child expressions as types. 
11235         
11236         * cs-parser.jay: Rename interface_constraints to
11237         type_parameter_constraints
11238
11239         (namespace_or_type_name): Only use constructed types for the basic
11240         construction, we will deal with identifier<...> later.
11241
11242         (type/type_name): No longer call DecomposeQI, as
11243         namespace_or_type_name is always decoded now.
11244         
11245 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11246
11247         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11248         closely: we eliminate methods in base types when we have an
11249         applicable method in a top-level type.
11250
11251         Please see section 14.5.5.1 for an exact description of what goes
11252         on. 
11253
11254         This fixes bug #45127 and a host of other related to corlib compilation.
11255
11256         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11257         array is the method corresponding to the top-level type (this is
11258         because of the changes made to icall.c) so we change this
11259         accordingly.
11260
11261         (MethodGroupExpr.Name): This too.
11262
11263         * typemanager.cs (GetElementType): New method which does the right
11264         thing when compiling corlib. 
11265
11266         * everywhere: Make use of the above in the relevant places.
11267
11268 2003-07-22  Martin Baulig  <martin@ximian.com>
11269
11270         * cs-parser.jay (invocation_expression): Moved
11271         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11272         `cast_expression', but create a InvocationOrCast which later
11273         resolves to either an Invocation or a Cast.
11274
11275         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11276         method; call this before EmitStatement() to make sure that this
11277         expression can be used as a statement.
11278
11279         * expression.cs (InvocationOrCast): New class; resolves to either
11280         an Invocation or a Cast.
11281
11282         * statement.cs (StatementExpression): Call ResolveStatement() on
11283         the ExpressionStatement before emitting it.
11284
11285 2003-07-21  Martin Baulig  <martin@ximian.com>
11286
11287         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11288         `ref' and `out' attributes match; fixes #46220.
11289         (MemberAccess.ResolveMemberAccess): You can't reference a type
11290         through an expression; fixes #33180.
11291         (Indexers.GetIndexersForType): Don't return the indexers from
11292         interfaces the class implements; fixes #46502.
11293
11294 2003-07-21  Martin Baulig  <martin@ximian.com>
11295
11296         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11297         CS0661 checks; fixes bug #30442.
11298
11299 2003-07-21  Martin Baulig  <martin@ximian.com>
11300
11301         * decl.cs (AdditionResult): Added `Error'.
11302
11303         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11304
11305         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
11306         cs0031.cs actually work.
11307
11308  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11309  
11310         * cs-parser.jay (namespace_name): do not use
11311         namespace_or_type_name, use qualified_identifier, because
11312         namespace_or_type_name will soon return a composed expression
11313         instead of a string.
11314  
11315         (namespace_or_type_name): Instead of returning a string, now this
11316         production returns an expression.
11317  
11318         * codegen.cs (EmitContext): Setup IsGeneric property based on
11319         whether our DeclSpace is generic, our the method is generic.
11320  
11321         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
11322         the method is generic.
11323  
11324         * cs-parser.jay (type_arguments, opt_type_argument_list,
11325         type_parameters, type_parameter_list, opt_type_parameter_list,
11326         type_parameter,, opt_type_parameter_constraints_clauses,
11327         type_parameter_constraints_clauses,
11328         type_parameter_constraint_clause, type_parameter_constraint,
11329         interface_constraints): Add new production
11330  
11331         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
11332         DeclSpace is generic or not.
11333  
11334         (DeclSpace.SetParameterInfo): New routine, used to set the
11335         parameter info for a type.
11336  
11337         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
11338         returns a GenericTypeExpr
11339  
11340         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
11341         generic, lookup the generic argument.
11342  
11343         * attribute.cs: Do not allow TypeParameterExpressions in
11344         Attributes.
11345  
11346         * class.cs: Do not allow the Main method to be defined in a
11347         Generic container.
11348  
11349         * expression.cs (SizeOf): Do not allow generic types to be used as
11350         arguments to sizeof.
11351  
11352         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
11353         it: whether a type is generic or not.  Only works for types we are
11354         currently building for now.
11355         
11356 2003-07-20  Martin Baulig  <martin@ximian.com>
11357
11358         * namespace.cs: Fixed that bug which caused a crash when compiling
11359         the debugger's GUI.
11360
11361 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11362
11363         * typemanager.cs (LookupTypeReflection): Never expose types which
11364         are NotPublic, NestedPrivate, NestedAssembly, or
11365         NestedFamANDAssem.  We used to return these, and later do a check
11366         that would report a meaningful error, but the problem is that we
11367         would not get the real match, if there was a name override.
11368
11369 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11370
11371         * namespace.cs (Namespace, Name): Do not compute the namespace
11372         name dynamically, compute it in the constructor.  This reduced
11373         memory usage by 1697 KB.
11374
11375         * driver.cs: Use --pause to pause at the end.
11376
11377 2003-07-17  Peter Williams  <peter@newton.cx>
11378
11379         * Makefile: Change the name of the test target so that it doesn't
11380         conflict with the recursive test target.
11381
11382 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11385         AddressOf): Do not use EmitThis, that was wrong, use the actual
11386         this pointer.
11387
11388 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11389
11390         * class.cs (MethodData.Define): While checking if a method is an
11391         interface implementation, improve the test: If we are not public
11392         (use new test here: use the computed MethodAttributes directly,
11393         instead of the parsed modifier flags) check if the `implementing'
11394         method comes from an interface or not.
11395
11396         * pending.cs (VerifyPendingMethods): Slightly better error
11397         message.
11398
11399         * makefile: add test target that does the mcs bootstrap.
11400
11401 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11402
11403         * interface.cs (Define): Do nothing here since there are no
11404         members to populate etc. Move the attribute emission out of here
11405         since this was just totally the wrong place to put it. Attribute
11406         application happens during the 'Emit' phase, not in the 'Define'
11407         phase.
11408
11409         (Emit): Add this method and move the attribute emission here
11410
11411         * rootcontext.cs (EmitCode): Call the Emit method on interface
11412         types too.
11413
11414 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11415
11416         * expression.cs (OverloadResolve): Report error only if Location
11417         is not 'Null' which means that there was a probe going on.
11418
11419 2003-07-14  Martin Baulig  <martin@ximian.com>
11420
11421         * expression.cs (ConditionalLogicalOperator): New public class to
11422         implement user defined conditional logical operators.
11423         This is section 14.11.2 in the spec and bug #40505.
11424
11425 2003-07-14  Martin Baulig  <martin@ximian.com>
11426
11427         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11428
11429 2003-07-14  Martin Baulig  <martin@ximian.com>
11430
11431         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11432
11433         * ecore.cs (IVariable.VerifyFixed): New interface method.
11434
11435         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11436         operator, check whether the variable is actually fixed.  Fixes bug
11437         #36055.  Set a variable definitely assigned when taking its
11438         address as required by the spec.
11439
11440         * statement.cs (LocalInfo.IsFixed): New field.
11441         (LocalInfo.MakePinned): Set `IsFixed' to true.
11442
11443 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11444
11445         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11446         for .ctors, ensure that we only ask for members declared in the
11447         attribute type (BindingFlags.DeclaredOnly).
11448
11449         Fixes bug #43632.
11450
11451         * expression.cs (Error_WrongNumArguments): Report error 1501
11452         correctly the way CSC does.
11453
11454 2003-07-13  Martin Baulig  <martin@ximian.com>
11455
11456         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11457         lookup on the fully qualified name, to make things like "X.X" work
11458         where "X.X" is a fully qualified type name, but we also have a
11459         namespace "X" in the using list.  Fixes #41975.
11460
11461 2003-07-13  Martin Baulig  <martin@ximian.com>
11462
11463         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11464         function. If we're a CompoundAssign, we need to create an embedded
11465         CompoundAssign, not an embedded Assign.
11466         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11467         Fixes #45854.
11468
11469 2003-07-13  Martin Baulig  <martin@ximian.com>
11470
11471         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11472         work to fix bug #46088.
11473
11474 2003-07-13  Ravi Pratap <ravi@ximian.com>
11475
11476         * class.cs (Operator.Emit): Do not emit attributes here - it is
11477         taken care of by the Method class that we delegate too. This takes
11478         care of bug #45876.
11479
11480 2003-07-10  Martin Baulig  <martin@ximian.com>
11481
11482         * expression.cs (TypeOfVoid): New class.
11483         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11484
11485 2003-07-10  Martin Baulig  <martin@ximian.com>
11486
11487         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11488         bug #35957.
11489
11490 2003-07-10  Martin Baulig  <martin@ximian.com>
11491
11492         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11493         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11494
11495         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11496
11497         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11498
11499 2003-07-10  Martin Baulig  <martin@ximian.com>
11500
11501         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11502         of decimal.  Fixes #42850.
11503
11504         NOTE: I also fixed the created byte blob, but this doesn't work on
11505         the MS runtime and csc never produces any byte blobs for decimal
11506         arrays.
11507
11508 2003-07-10  Martin Baulig  <martin@ximian.com>
11509
11510         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11511         structs; fixes #32068.
11512         (Block.AddChildVariableNames): Fixed #44302.
11513
11514 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11515
11516         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11517
11518 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11519
11520         * attribute.cs: And this test is onger needed.
11521
11522 2003-07-08  Martin Baulig  <martin@ximian.com>
11523
11524         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11525         inaccessible types.  Fixes #36313.
11526
11527         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11528
11529         * namespace.cs (NamespaceEntry): Create implicit entries for all
11530         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11531         implicit entries for N1.N2 and N1.
11532
11533 2003-07-08  Martin Baulig  <martin@ximian.com>
11534
11535         Rewrote the handling of namespaces to fix a lot of the issues
11536         wrt. `using' aliases etc.
11537
11538         * namespace.cs (Namespace): Splitted this class into a
11539         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11540
11541         * typemanager.cs (TypeManager.IsNamespace): Removed.
11542         (TypeManager.ComputeNamespaces): Only compute namespaces from
11543         loaded assemblies here, not the namespaces from the assembly we're
11544         currently compiling.
11545
11546 2003-07-08  Martin Baulig  <martin@ximian.com>
11547
11548         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11549
11550 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11551
11552         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11553         already fixed it.  
11554
11555         I thought about the memory savings here, but LookupTypeReflection
11556         is used under already very constrained scenarios.  Compiling
11557         corlib or mcs only exposes one hit, so it would not really reduce
11558         any memory consumption.
11559
11560 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11561
11562         * typemanager.cs: fixes bug #45889 by only adding public types from
11563         other assemblies to the list of known types.
11564
11565 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11566
11567         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11568         on the type we resolved.
11569
11570 2003-07-05  Martin Baulig  <martin@ximian.com>
11571
11572         * pending.cs (PendingImplementation.ParentImplements): Don't
11573         create the proxy if the parent is abstract.
11574
11575         * class.cs (TypeContainer.DefineIndexers): Process explicit
11576         interface implementations first.  Fixes #37714.
11577
11578 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11579
11580         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11581         defined recursively;  but since we modify the input parameters
11582         (left is set to `this' temporarily), we reset this value if the
11583         left_is_explicit is false, which gives the original semantics to
11584         the code.  
11585
11586         * literal.cs (NullPointer): new class used to represent a null
11587         literal in a pointer context.
11588
11589         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11590         type is a pointer, use a NullPointer object instead of a
11591         NullLiteral.   Closes 43687
11592
11593         (ExplicitConversion): Convert pointer values using
11594         the conv opcode to the proper type.
11595
11596         * ecore.cs (New): change ValueTypeVariable property into a method,
11597         that returns whether the valuetype is suitable for being used.
11598
11599         * expression.cs (Binary.DoNumericPromotions): Only return if we
11600         the int constant was a valid uint, and we can return both left and
11601         right as uints.  If not, we continue processing, to trigger the
11602         type conversion.  This fixes 39018.
11603
11604         * statement.cs (Block.EmitMeta): During constant resolution, set
11605         the CurrentBlock property on the emitcontext, so that we resolve
11606         constants propertly.
11607
11608 2003-07-02  Martin Baulig  <martin@ximian.com>
11609
11610         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11611         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11612
11613         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11614         than emitting it here.
11615
11616         * statement.cs: Fixed some more flow analysis bugs.
11617
11618 2003-07-02  Martin Baulig  <martin@ximian.com>
11619
11620         * class.cs (MethodData.Define): When implementing interface
11621         methods, set Final unless we're Virtual.
11622
11623         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11624         check work for interface methods.
11625
11626 2003-07-01  Martin Baulig  <martin@ximian.com>
11627
11628         * ecore.cs (EmitContext.This): Replaced this property with a
11629         GetThis() method which takes a Location argument.  This ensures
11630         that we get the correct error location for a CS0188.
11631
11632 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11633
11634         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11635         ImplicitStandardConversion.
11636
11637         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11638
11639 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11640
11641         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11642         optimization.
11643
11644 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11647         constructors.
11648
11649         (MethodData.Define): Turn off initlocals for unsafe methods.
11650
11651 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11652
11653         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11654         complete;  Fixes #37521.
11655
11656         * delegate.cs: Use Modifiers.TypeAttr to compute the
11657         TypeAttributes, instead of rolling our own.  This makes the flags
11658         correct for the delegates.
11659
11660 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * class.cs (Constructor.Define): Set the private flag for static
11663         constructors as well.
11664
11665         * cs-parser.jay (statement_expression): Set the return value to
11666         null, to avoid a crash when we catch an error.
11667
11668 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11669
11670         * cs-parser.jay: Applied patch from Jackson that adds support for
11671         extern and unsafe modifiers to destructor declarations.
11672
11673         * expression.cs: Report error 21 if the user is trying to index a
11674         System.Array.
11675
11676         * driver.cs: Add an error message, suggested by the bug report.
11677
11678         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11679         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11680
11681 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * namespace.cs: Add some information to reduce FAQs.
11684
11685 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11686
11687         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11688         underlying enumeration types.  Fixes #43915.
11689
11690         * expression.cs: Treat ushort/short as legal values to be used in
11691         bitwise operations.
11692
11693 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11694
11695         * delegate.cs: transfer custom attributes for paramenters from
11696         the delegate declaration to Invoke and BeginInvoke.
11697
11698 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11699
11700         * attribute.cs: handle custom marshalers and emit marshal info
11701         for fields, too.
11702
11703 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11704
11705         * makefile.gnu: Added anonymous.cs to the compiler sources.
11706
11707 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * iterators.cs: Change the name of the proxy class to include two
11710         underscores.
11711
11712         * cs-parser.jay: Update grammar to include anonymous methods.
11713
11714         * anonymous.cs: new file.
11715
11716 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11717
11718         * class.cs (Field.Define): Add missing test for pointers and
11719         safety. 
11720
11721 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11722
11723         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11724         we use the stobj opcode.
11725
11726         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11727         since it wasn't the correct fix. 
11728
11729         It still is puzzling that we are required to use stobj for IntPtr
11730         which seems to be a ValueType.
11731
11732 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11733
11734         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11735         during regular simple name resolution.   Now, the trick is that
11736         instead of returning for processing the simplename, we do a
11737         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11738         contextual lookup type).   If a match is found, return that, if
11739         not, return for further composition.
11740
11741         This fixes long-standing 30485.
11742
11743         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11744         using the address to initialize an object, do an Stobj instead of
11745         using the regular Stelem.
11746
11747         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11748         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11749         Because if we are a BaseIndexerAccess that value will be true.
11750         Fixes 43643.
11751
11752         * statement.cs (GotoCase.Resolve): Return after reporting an
11753         error, do not attempt to continue. 
11754
11755         * expression.cs (PointerArithmetic.Emit): If our operand is a
11756         long, convert our constants to match the operand before
11757         multiplying.  Convert to I type before adding.   Fixes 43670.
11758
11759 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11760
11761         * enum.cs (ImplicitConversionExists) : Rename to
11762         ImplicitEnumConversionExists to remove ambiguity. 
11763
11764         * ecore.cs (NullCast): New type of cast expression class which
11765         basically is very similar to EmptyCast with the difference being
11766         it still is a constant since it is used only to cast a null to
11767         something else
11768         (eg. (string) null)
11769
11770         * convert.cs (ImplicitReferenceConversion): When casting a null
11771         literal, we return a NullCast.
11772
11773         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11774         should be around anymore.
11775
11776         The renaming (reported was slightly wrong). Corrections:
11777
11778         ConvertImplicitStandard -> ImplicitConversionStandard
11779         ConvertExplicitStandard -> ExplicitConversionStandard
11780
11781         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11782         before passing them in !
11783
11784         * convert.cs (ImplicitConversionStandard): When comparing for
11785         equal expr and target types, ensure that expr is not a
11786         NullLiteral.
11787
11788         In general, we must not be checking (expr_type ==
11789         target_type) in the top level conversion methods
11790         (ImplicitConversion, ExplicitConversion etc). This checking is
11791         done in the methods that they delegate to.
11792
11793 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * convert.cs: Move Error_CannotConvertType,
11796         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11797         ImplicitNumericConversion, ImplicitConversionExists,
11798         ImplicitUserConversionExists, StandardConversionExists,
11799         FindMostEncompassedType, FindMostSpecificSource,
11800         FindMostSpecificTarget, ImplicitUserConversion,
11801         ExplicitUserConversion, GetConversionOperators,
11802         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11803         TryImplicitIntConversion, Error_CannotConvertImplicit,
11804         ConvertImplicitRequired, ConvertNumericExplicit,
11805         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11806         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11807         its own file.
11808
11809         Perform the following renames:
11810
11811         StandardConversionExists -> ImplicitStandardConversionExists
11812         ConvertImplicit -> ImplicitConversion
11813         ConvertImplicitStandard -> ImplicitStandardConversion
11814         TryImplicitIntConversion -> ImplicitIntConversion
11815         ConvertImplicitRequired -> ImplicitConversionRequired
11816         ConvertNumericExplicit -> ExplicitNumericConversion
11817         ConvertReferenceExplicit -> ExplicitReferenceConversion
11818         ConvertExplicit -> ExplicitConversion
11819         ConvertExplicitStandard -> ExplicitStandardConversion
11820
11821 2003-05-19  Martin Baulig  <martin@ximian.com>
11822
11823         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11824         (TypeInfo): Added support for structs having structs as fields.
11825
11826         * ecore.cs (FieldExpr): Implement IVariable.
11827         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11828         VariableInfo for the field.
11829
11830 2003-05-18  Martin Baulig  <martin@ximian.com>
11831
11832         * expression.cs (This.DoResolve): Report a CS0027 if we're
11833         emitting a field initializer.
11834
11835 2003-05-18  Martin Baulig  <martin@ximian.com>
11836
11837         * expression.cs (This.ResolveBase): New public function.
11838         (This.DoResolve): Check for CS0188.
11839
11840         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11841         This.Resolve().
11842
11843         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11844         `instance_expression' to null if we don't have any non-static
11845         methods.
11846
11847 2003-05-18  Martin Baulig  <martin@ximian.com>
11848
11849         Reworked the way how local variables and parameters are handled by
11850         the flow analysis code.
11851
11852         * statement.cs (TypeInfo, VariableMap): New public classes.
11853         (VariableInfo): New public class.  This is now responsible for
11854         checking whether a variable has been assigned.  It is used for
11855         parameters and local variables.
11856         (Block.EmitMeta): Take the InternalParameters as argument; compute
11857         the layout of the flow vectors here.
11858         (Block.LocalMap, Block.ParameterMap): New public properties.
11859         (FlowBranching): The .ctor doesn't get the InternalParameters
11860         anymore since Block.EmitMeta() now computes the layout of the flow
11861         vector.
11862         (MyStructInfo): This class is now known as `StructInfo' and nested
11863         in `TypeInfo'; we don't access this directly anymore.
11864
11865         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11866         property and removed IsAssigned(), IsFieldAssigned(),
11867         SetAssigned() and SetFieldAssigned(); we now call them on the
11868         VariableInfo so we don't need to duplicate this code everywhere.
11869
11870         * expression.cs (ParameterReference): Added `Block block' argument
11871         to the .ctor.
11872         (LocalVariableReference, ParameterReference, This): The new
11873         VariableInfo class is now responsible for all the definite
11874         assignment stuff.
11875
11876         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11877         IsParameterAssigned, SetParameterAssigned): Removed.
11878
11879 2003-05-18  Martin Baulig  <martin@ximian.com>
11880
11881         * typemanager.cs (InitCoreTypes): Try calling
11882         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11883         the 3-args-version.  Corlib now also needs our `void_type'.
11884         (GetMethod): Added overloaded version which takes an optional
11885         `bool report_errors' to allow lookups of optional methods.
11886
11887 2003-05-12  Martin Baulig  <martin@ximian.com>
11888
11889         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11890         only used for locals and not for parameters.
11891
11892 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * support.cs (InternalParameters.ParameterType): Return the
11895         ExternalType of the parameter.
11896
11897         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11898         they were unused.
11899
11900 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11901
11902         * class.cs (MethodData.Define): Do not set the `newslot' on
11903         interface members, if they are also flagged as "override".
11904
11905         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11906         better code for ++i and i++.  This only works for static fields
11907         and local variables.
11908
11909         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11910         want to pull the DeclSpace out of the builder_to_declspace instead
11911         of the TypeBuilder (like in TypeContainer.FindMembers).
11912
11913         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11914         instead of LookupTypeContainer.  Fixes the crash on .NET for
11915         looking up interface members.
11916
11917         * const.cs: Create our own emit context during the Definition
11918         stage, so that constants are evaluated in the proper context, when
11919         a recursive definition happens.
11920
11921 2003-05-11  Martin Baulig  <martin@ximian.com>
11922
11923         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11924         new block for a switch section.
11925         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11926         the adding/lookup in the switch block.  Fixes #39828.
11927
11928 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11931         functionality: I needed to convert the data after I had performed
11932         the add/sub operation into the operands type size.
11933
11934         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11935         pass the type for the box operation, otherwise the resulting
11936         object would have been of type object.
11937
11938         (BoxedCast): Add constructor to specify the type to box as.
11939
11940 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * iterators.cs: I was reusing the `count' variable inadvertently,
11943         take steps to not allow this to happen.
11944
11945 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11946
11947         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11948         by creating an array at the point where the params starts and
11949         putting all those arguments there, then adjusting the size of the
11950         array.
11951
11952 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11953
11954         * expression.cs (New.AddressOf): Implement interface
11955         IMemoryLocation.  This is used when the `new' operator is used in
11956         the context of an invocation to a method on a value type.
11957
11958         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11959         example. 
11960
11961         * namespace.cs: Also check the using aliases here.
11962
11963         * driver.cs: Move the test for using validity after the types have
11964         been entered, so we do a single pass that also includes the using
11965         aliases. 
11966
11967         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11968         in the regular case.   CreateSiblingForFinally is doing extra
11969         error checking.
11970
11971         * attribute.cs (GetAttributeArgumentExpression): Store the result
11972         on an out value, and use the return value to indicate failure
11973         instead of using null (which is a valid return for Constant.GetValue).
11974
11975         * statement.cs: Perform the analysis flow for the increment
11976         portion after the statement, because this will be the real flow of
11977         execution.  Fixes #42385
11978
11979         * codegen.cs (EmitContext.EmitArgument,
11980         EmitContext.EmitStoreArgument): New helper functions when the
11981         RemapToProxy flag is set.
11982
11983         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11984         function.
11985
11986         Add support for remapping parameters. 
11987
11988         * iterators.cs: Propagate parameter values;  Store parameter
11989         values in the proxy classes.
11990
11991 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11992
11993         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11994         need a proxy reference;  I do not know what I was thinking
11995
11996         * cs-parser.jay (constructor_initializer): catch another error,
11997         and display nice message.
11998
11999         (field_declaration): catch void field declaration
12000         to flag a better error. 
12001
12002         * class.cs (MemberBase.CheckBase): Report an error instead of a
12003         warning if a new protected member is declared in a struct. 
12004         (Field.Define): catch the error of readonly/volatile.
12005
12006         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12007
12008         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12009         volatile variable is taken
12010
12011 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12012
12013         * statement.cs (Fixed.Resolve): Report an error if we are not in
12014         an unsafe context.
12015
12016 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12017
12018         * typemanager.cs: reuse the code that handles type clashes for
12019         delegates and enumerations.
12020
12021         * class.cs (Report28): Always report.
12022
12023         * expression.cs (EncodeAsAttribute): Allow nulls here.
12024
12025 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12026
12027         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12028         the functionality for testing whether an expression is valid for
12029         an attribute here.  Also handle the case of arrays of elements
12030         being stored. 
12031
12032         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12033         encoding a linear array into an array of objects that are suitable
12034         to be passed to an CustomAttributeBuilder.
12035
12036         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12037
12038         * ecore.cs: (FieldExpr): Handle field remapping here.
12039
12040         * iteratators.cs: Pass the instance variable (if the method is an
12041         instance method) to the constructors, so we can access the field
12042         variables on the class.
12043
12044         TODO: Test this with structs.  I think the THIS variable on
12045         structs might have to be a pointer, and not a refenrece
12046
12047 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12048
12049         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12050         local variables to fields in a proxy class.
12051
12052         * iterators.cs (PopulateProxy): Rename our internal fields to
12053         <XXX>.  
12054         Create a <THIS> field if we are an instance method, so we can
12055         reference our parent container variables.
12056         (MapVariable): Called back from the EmitContext code to enter a
12057         new variable to field mapping into the proxy class (we just create
12058         a FieldBuilder).
12059
12060         * expression.cs
12061         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12062         for using the remapped locals to fields.
12063
12064         I placed the code here, because that gives the same semantics to
12065         local variables, and only changes the Emit code.
12066
12067         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12068         statements inside iterators.
12069         (VariableInfo): Add a FieldBuilder for the cases when we are
12070         remapping local variables to fields in a proxy class
12071
12072         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12073         current_block != null.
12074
12075         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12076         not cope with strings, as it has been moved to the
12077         TableSwitchEmit.  Fixed bug in switch generation.
12078
12079         * expression.cs (New.DoResolve): Provide more context for the user
12080         when reporting an error.
12081
12082         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12083         pointers. 
12084
12085         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12086         check the permissions for it.  Note than in a type-resolution
12087         context the check was already present in DeclSpace.ResolveType,
12088         but was missing from the MemberAccess.
12089
12090         (ArrayCreation.CheckIndices): warn if the user has
12091         more nested levels of expressions, but there are no more
12092         dimensions specified.  Avoids crash on bug 41906.
12093
12094 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12095
12096         * statement.cs (Block): replace Implicit bool, for a generic
12097         flags.   
12098         New flag: `Unchecked'.  This is used during the EmitMeta phase
12099         (which is out-of-line with the regular Resolve/Emit process for a
12100         statement, as this is done ahead of time, but still gets a chance
12101         to call constant resolve).
12102
12103         (Block.Flags): new enum for adding a new flag.
12104
12105         (Block.EmitMeta): track the state of unchecked.
12106
12107         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12108         to enable constant resolution to work there as well.
12109
12110 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * typemanager.cs (ienumerable_type): Also look up
12113         System.Collections.IEnumerable. 
12114
12115 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12116
12117         TODO: Test more than one conditional per method.
12118
12119         * class.cs (Indexer.Define): Report the location where the user is
12120         referencing the unsupported feature.
12121
12122         (MethodData): Overload the use of `conditionals' to
12123         minimize the creation of needless ArrayLists.   This saves roughly
12124         212kb on my machine.
12125
12126         (Method): Implement the new IIteratorContainer interface.
12127         (Method.SetYields): Implement the method by setting the ModFlags
12128         to contain METHOD_YIELDS.
12129
12130         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12131         which just got set to null.
12132
12133         * iterators.cs: New file.
12134
12135         (Yield, YieldBreak): New statements.
12136
12137         * statement.cs (Return.Resolve): Flag an error if we are used in
12138         an iterator method.
12139
12140         * codegen.cs (InIterator): New flag set if the code is being
12141         compiled in an iterator method.
12142
12143         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12144         internal modifier, and we just use it to avoid adding extra
12145         fields, as this is seldom used.  
12146
12147         * cs-parser.jay: Add yield_statement (yield and yield break).
12148
12149         * driver.cs: New flag -v2 to turn on version 2 features. 
12150
12151         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12152         hashtable when v2 is enabled.
12153
12154 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12155
12156         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12157         there is already a namespace defined with this name.
12158
12159         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12160         people upgraded their corlibs.
12161
12162         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12163         always use fully qualified types, no need to use the compiler
12164         front end.
12165
12166         (TypeManager.IsNamespace): Use binarysearch.
12167
12168         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12169         AddDelegate): I did not quite use the new IsValid API properly: I
12170         have to pass the short-name and the fullname.  I was passing only
12171         the basename instead of the fullname sometimes. 
12172
12173         (TypeContainer.DefineType): call NamespaceClash.
12174
12175         * interface.cs (Interface.DefineType): use NamespaceClash before
12176         defining the type.
12177
12178         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12179         defining the type.
12180
12181         * enum.cs: (Enum.DefineType): use NamespaceClash before
12182         defining the type.
12183
12184         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12185         speed increase.  First, use the negative_hits cache when we get a
12186         negative.  Second, add the type with its full original name
12187         instead of the new . and + encoded name (reflection uses + to
12188         separate type from a nested type).  Use LookupTypeReflection
12189         directly which bypasses the type->name hashtable (that we already
12190         know does not contain the type.
12191
12192         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12193         location/container type. 
12194
12195         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12196
12197 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12200
12201         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12202         method is being referenced in the method group from a static
12203         context, and report error 120 if so.
12204
12205         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12206         Error118. 
12207
12208         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12209         is created, we create the A namespace).
12210
12211         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12212         Fixes #41591
12213
12214 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12215
12216         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12217         invocation to ModuleBuilder.GetType with the same values will
12218         return a new type instance, so we need to cache its return
12219         values. 
12220
12221         * expression.cs (Binary.ResolveOperator): Only allow the compare
12222         operators on enums if they are of the same type.
12223
12224         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12225         types of ValueType on their own case.  Before we were giving them
12226         the same treatment as objects.
12227
12228         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12229         fullname.  Short name is used to compare against container name.
12230         Fullname is used to check against defined namespace names.
12231
12232         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12233         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12234
12235         (Method.CheckBase): Call parent.
12236         (MemberBase.CheckBase): Check for protected members on sealed
12237         classes.
12238         (PropertyBase.CheckBase): Call parent.
12239         (Field.Define): Call parent.
12240
12241         * report.cs: Negative error codes are now mapped to 8000 - code,
12242         so that the display is render more nicely.
12243
12244         * typemanager.cs: Do not use try/catch, instead report a regular
12245         error. 
12246
12247         (GetPointerType, GetReferenceType): These methods provide
12248         mechanisms to obtain the T* and T& from a T.  We had the code
12249         previously scattered around the code base, and it also used
12250         TypeManager.LookupType that would go through plenty of caches.
12251         This one goes directly to the type source.
12252
12253         In some places we did the Type.GetType followed by
12254         ModuleBuilder.GetType, but not in others, so this unifies the
12255         processing as well.
12256
12257         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12258         statements now that we have namespace information.
12259
12260         * typemanager.cs (IsNamespace): New method, returns whether the
12261         string presented is a namespace or not.
12262
12263         (ComputeNamespaces): New public entry point, computes the list of
12264         available namespaces, using the GetNamespaces API call in Mono, or
12265         the slower version in MS.NET.   
12266
12267         Now before we start the semantic analysis phase, we have a
12268         complete list of namespaces including everything that the user has
12269         provided.
12270
12271         Deleted old code to cache namespaces in .nsc files.
12272
12273 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12274
12275         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12276         class/struct location definition Location for the implicit
12277         constructor location.
12278
12279         (Operator.Define): Use the location of the operator for the
12280         implicit Method definition.
12281
12282         (Constructor.Emit): use the constructor location for the implicit
12283         base initializer constructor.
12284
12285         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12286         and the Expression class now contains two new methods:
12287
12288         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12289         isolate type lookup from the rest of the resolution process.
12290
12291         Since we use Expressions to hold type definitions due to the way
12292         we parse the input we have historically overloaded Resolve to
12293         perform the Type lookups if a special flag is passed.  Now this is
12294         eliminated and two methods take their place. 
12295
12296         The differences in the two methods between xStep and xTerminal is
12297         that xStep is involved in our current lookup system that uses
12298         SimpleNames to compose a name, while xTerminal is used just to
12299         catch the case where the simplename lookup failed.
12300
12301 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12302
12303         * expression.cs (ResolveMemberAccess): Remove redundant code.
12304         TypeExpr expressions are always born fully resolved.
12305
12306         * interface.cs (PopulateMethod): Do not lookup the types twice.
12307         We were doing it once during SemanticAnalysis and once during
12308         PopulateMethod.
12309
12310         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12311         in local variable type definitions, were being returned as a
12312         SimpleName (we decomposed everything into a string), that is
12313         because primary_expression was being used instead of a type in the
12314         grammar (reduce/reduce conflicts).
12315
12316         The part that was wrong is that we converted the expression into a
12317         string (an oversimplification in one hand, compounded with primary
12318         expressions doing string concatenation).
12319
12320         So things like:
12321
12322         A.B.C [] x;
12323
12324         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12325         using clauses from working on this particular context.  And a type
12326         was being matched directly against "A.B.C[]".
12327
12328         We now use the correct approach, and allow for ComposedCast to be
12329         part of the unary expression.  So the "A.B.C []" become a composed
12330         cast of "A.B.C" (as a nested group of MemberAccess with a
12331         SimpleName at the end) plus the rank composition "[]". 
12332
12333         Also fixes 35567
12334
12335 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12336
12337         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12338         for the access level checking.
12339
12340         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12341         `TypeContainer container', because I kept getting confused when I
12342         was debugging this code.
12343
12344         * expression.cs (Indexers): Instead of tracking getters/setters,
12345         we now track them in parallel.  We create one arraylist less, but
12346         most importantly it is possible now for the LValue code to find a
12347         matching get for a set.
12348
12349         (IndexerAccess.DoResolveLValue): Update the code.
12350         GetIndexersForType has been modified already to extract all the
12351         indexers from a type.  The code assumed it did not.
12352
12353         Also make the code set the correct return type for the indexer.
12354         This was fixed a long time ago for properties, but was missing for
12355         indexers.  It used to be void_type.
12356
12357         (Binary.Emit): Test first for doubles instead of
12358         floats, as they are more common.
12359
12360         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12361         when dealing with floats and the <=, >= operators.  This fixes bug
12362         #39314 
12363
12364         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12365         to load the array value by emitting a load on the foreach variable
12366         type.  This was incorrect.  
12367
12368         We now emit the code to load an element using the the array
12369         variable type, and then we emit the conversion operator.
12370
12371         Fixed #40176
12372
12373 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12374
12375         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12376
12377 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12378
12379         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12380         test for protection before we test for signatures. 
12381
12382         (MethodSignature.ToString): implement.
12383
12384         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12385         to the case where we reduced into a LongConstant.
12386
12387         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12388         depend on whether the information is acurrate, because the
12389         Microsoft runtime will always claim that the array type is public,
12390         regardless of the real state.
12391
12392         If the type is a pointer, another problem happens: the type is
12393         reported as non-public in Microsoft.  
12394
12395         In both cases we have to call CheckAccessLevel recursively with
12396         the underlying type as the argument to be tested.
12397
12398 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12399
12400         * assign.cs (Assign.Emit): If we are dealing with a compound
12401         assignment expression, we should use the code path that stores the
12402         intermediate result in a temporary value.  This fixes #40903.
12403
12404         *expression.cs (Indirection.ToString): Provide ToString method for
12405         debugging. 
12406
12407 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12408
12409         * class.cs: Null out fields holding references to Block objects so
12410         they can be garbage collected.
12411
12412         * expression.cs (OverloadResolve): Remove unused local.
12413
12414 2003-04-07  Martin Baulig  <martin@ximian.com>
12415
12416         * codegen.cs (EmitContext.CurrentFile): New public field.
12417         (EmitContext.Mark): Use the CurrentFile to check whether the
12418         location is in the correct file.
12419         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12420
12421 2003-04-07  Martin Baulig  <martin@ximian.com>
12422
12423         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12424
12425         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12426         location.  [FIXME: The location argument which gets passed to this
12427         method is sometimes wrong!]
12428
12429 2003-04-07  Nick Drochak <ndrochak@gol.com>
12430
12431         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12432
12433 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12434
12435         * expression.cs (Indirection.EmitAssign): We were using the
12436         temporary, but returning immediately instead of continuing the
12437         EmitAssing flow.
12438
12439 2003-04-06  Martin Baulig  <martin@ximian.com>
12440
12441         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12442         if it's a nested child, but also deriving from the outer class.
12443         See test 190.cs.
12444
12445         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12446         nested child, but also deriving from the outer class.  See
12447         test-190.cs.
12448         (FilterWithClosure): We may access private members of the outer
12449         class if we're a nested child and deriving from the outer class.
12450         (RealMemberLookup): Only set `closure_private_ok' if the
12451         `original_bf' contained BindingFlags.NonPublic.
12452
12453 2003-04-05  Martin Baulig  <martin@ximian.com>
12454
12455         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
12456         probe if its a type parameter, and if so, flag an error.
12457
12458         * decl.cs: Move here the SetParameterInfo code from class.cs.
12459         Handle IsGeneric here.
12460
12461         Handle a variety of errors in the parameter info definition.
12462
12463         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
12464         type parameters here.
12465
12466         * cs-parser.jay (class_declaration): report errors for parameters
12467         here as well.
12468
12469 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
12470
12471         * generic.cs: New file, contains support code for generics.
12472
12473         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
12474         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
12475
12476         Update parser for the above removals.
12477
12478         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
12479         now taken care of in the parser.
12480
12481 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12482
12483         * class.cs (Event.Define): Do not allow abstract events to have
12484         initializers. 
12485
12486 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12487
12488         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12489         block in event declarations.
12490
12491         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12492         value type, get its address.
12493
12494         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12495         leaving a class on the stack instead of a boolean value (int
12496         0/1).  Change the code so we compare against null, and then the
12497         result against zero.
12498
12499         * class.cs (TypeContainer.GetClassBases): We were checking for the
12500         parent class being sealed too late.
12501
12502         * expression.cs (Binary.Emit): For <= and >= when dealing with
12503         floating point values, use cgt.un and clt.un instead of cgt and
12504         clt alone.
12505
12506 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12507
12508         * statement.cs: Apply the same optimization as MS: skip the 
12509         GetEnumerator returning an IEnumerator, and use the one returning a 
12510         CharEnumerator instead. This allows us to avoid the try-finally block 
12511         and the boxing.
12512
12513 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12514
12515         * cs-parser.jay: Attributes cannot be applied to
12516                          namespaces. Fixes #40473
12517
12518 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12519
12520         * class.cs:
12521         (Add*): check if the name is valid using the full name for constants,
12522         fields, properties and events.
12523
12524 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12525
12526         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12527         char constants to be part of the enumeration.
12528
12529         * expression.cs (Conditional.DoResolve): Add support for operator
12530         true. Implements the missing functionality from 14.12
12531
12532         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12533         operator true/false as required by the spec.
12534
12535         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12536         implicit conversion to boolean.
12537
12538         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12539         also one where the type implements `operator true'. 
12540
12541         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12542         get an expression that will invoke operator true based on an
12543         expression.  
12544
12545         (GetConversionOperators): Removed the hack that called op_True
12546         here.  
12547
12548         (Expression.ResolveBoolean): Move this from Statement.
12549
12550 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12551
12552         * ecore.cs (FieldExpr): do not allow initialization of initonly
12553         fields on derived classes
12554
12555 2003-03-13  Martin Baulig  <martin@ximian.com>
12556
12557         * statement.cs (Block.Emit): Call ig.BeginScope() and
12558         ig.EndScope() when compiling with debugging info; call
12559         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12560
12561 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12562
12563         * expression.cs (Indexers): Do not construct immediately, allow
12564         for new members to be appended as we go.  Fixes 38143
12565
12566 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12567
12568         * expression.cs: save/restore context when resolving an unchecked
12569         expression.
12570
12571 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12572
12573         * cfold.cs: Catch division by zero in modulus operator during
12574         constant folding.
12575
12576 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12577
12578         * interface.cs (Interface.DefineMembers): Avoid defining members
12579         twice. 
12580
12581 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12582
12583         * driver.cs: handle the +/- options for -noconfig
12584
12585         * statement.cs (Unckeched.Resolve): Also track the state of
12586         unchecked in the Resolve phase.
12587
12588 2003-02-27  Martin Baulig  <martin@ximian.com>
12589
12590         * ecore.cs (Expression.MemberLookup): Don't create a
12591         MethodGroupExpr for something which is not a method.  Fixes #38291.
12592
12593 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12594
12595         * class.cs (MemberBase.CheckParameters): Also check that the type
12596         is unmanaged if it is a pointer.
12597
12598         * expression.cs (SizeOf.Resolve): Add location information.
12599
12600         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12601         a managed type is declared.
12602
12603         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12604         parameter modifiers as well.  Fixes bug 38606
12605
12606         * class.cs: Very sad.  Am backing out the speed up changes
12607         introduced by the ArrayList -> Array in the TypeContainer, as they
12608         were not actually that much faster, and introduced a bug (no error
12609         reports on duplicated methods).
12610
12611         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12612         source first, this will guarantee that we have a valid expression
12613         before calling in lower levels functions that will require a
12614         resolved object.  Then use this original_source in the
12615         target.ResolveLValue instead of the original source that was
12616         passed to us.
12617
12618         Another change.  Use target.Resolve instead of LValueResolve.
12619         Although we are resolving for LValues, we will let the Assign code
12620         take care of that (it will be called again from Resolve).  This
12621         basically allows code like this:
12622
12623         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12624         class Y { void A (X x) { x [0] += o; }
12625
12626         The problem was that the indexer was trying to resolve for
12627         set_Item (idx, object o) and never finding one.  The real set_Item
12628         was set_Item (idx, X).  By delaying the process we get the right
12629         semantics. 
12630
12631         Fixes bug 36505
12632
12633 2003-02-23  Martin Baulig  <martin@ximian.com>
12634
12635         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12636         while calling DoEmit ().
12637
12638         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12639         source files; if you use the #line directive inside a method, the
12640         compiler stops emitting line numbers for the debugger until it
12641         reaches the end of the method or another #line directive which
12642         restores the original file.
12643
12644 2003-02-23  Martin Baulig  <martin@ximian.com>
12645
12646         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12647
12648 2003-02-23  Martin Baulig  <martin@ximian.com>
12649
12650         * statement.cs (Block.AddChildVariableNames): We need to call this
12651         recursively, not just for our immediate children.
12652
12653 2003-02-23  Martin Baulig  <martin@ximian.com>
12654
12655         * class.cs (Event.Define): Always make the field private, like csc does.
12656
12657         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12658         actually work, fixes bug #37521.
12659
12660 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12661
12662         * delegate.cs: When creating the various temporary "Parameters"
12663         classes, make sure that we call the ComputeAndDefineParameterTypes
12664         on those new parameters (just like we do with the formal ones), to
12665         allow them to be resolved in the context of the DeclSpace.
12666
12667         This fixes the bug that Dick observed in Bugzilla #38530.
12668
12669 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12670
12671         * expression.cs (ResolveMemberAccess): When resolving a constant,
12672         do not attempt to pull a constant if the value was not able to
12673         generate a valid constant.
12674
12675         * const.cs (LookupConstantValue): Do not report more errors than required.
12676
12677 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12678
12679         * expression.cs: fixes bug #38328.
12680
12681 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12682
12683         * class.cs: Changed all the various members that can be part of a
12684         class from being an ArrayList to be an Array of the right type.
12685         During the DefineType type_list, interface_list, delegate_list and
12686         enum_list are turned into types, interfaces, delegates and enums
12687         arrays.  
12688
12689         And during the member population, indexer_list, event_list,
12690         constant_list, field_list, instance_constructor_list, method_list,
12691         operator_list and property_list are turned into their real arrays.
12692
12693         Although we could probably perform this operation earlier, for
12694         good error reporting we need to keep the lists and remove the
12695         lists for longer than required.
12696
12697         This optimization was triggered by Paolo profiling the compiler
12698         speed on the output of `gen-sample-program.pl' perl script. 
12699
12700         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12701         not crash in methods like MemberLookupFailed that use this field.  
12702
12703         This problem arises when the compiler fails to resolve a type
12704         during interface type definition for example.
12705
12706 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12707
12708         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12709         inherit from System.Object, so we have to stop at null, not only
12710         when reaching System.Object.
12711
12712 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12713
12714         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12715         DeclaredOnly because the parent indexer might have had a different
12716         name, but did not loop until the top of the hierarchy was reached.
12717
12718         The problem this one fixes is 35492: when a class implemented an
12719         indexer from an interface, we were getting the interface method
12720         (which was abstract) and we were flagging an error (can not invoke
12721         abstract method).
12722
12723         This also keeps bug 33089 functioning, and test-148 functioning.
12724
12725         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12726         out if a method is special is to see if it is declared in a
12727         property or event, or whether it is one of the predefined operator
12728         names.   This should fix correctly #36804.
12729
12730 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12731
12732         The goal here is to remove the dependency on EmptyCast.Peel ().
12733         Killing it completely.
12734
12735         The problem is that currently in a number of places where
12736         constants are expected, we have to "probe" for an EmptyCast, and
12737         Peel, which is not the correct thing to do, as this will be
12738         repetitive and will likely lead to errors. 
12739
12740         The idea is to remove any EmptyCasts that are used in casts that
12741         can be reduced to constants, so we only have to cope with
12742         constants. 
12743
12744         This bug hunt was triggered by Bug 37363 and the desire to remove
12745         the duplicate pattern where we were "peeling" emptycasts to check
12746         whether they were constants.  Now constants will always be
12747         constants.
12748
12749         * ecore.cs: Use an enumconstant here instead of wrapping with
12750         EmptyCast.  
12751
12752         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12753         throwing me off.  By handling this we can get rid of a few hacks.
12754
12755         * statement.cs (Switch): Removed Peel() code.
12756
12757 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12758
12759         * class.cs: Location information for error 508
12760
12761         * expression.cs (New.DoResolve): Add a guard against double
12762         resolution of an expression.  
12763
12764         The New DoResolve might be called twice when initializing field
12765         expressions (see EmitFieldInitializers, the call to
12766         GetInitializerExpression will perform a resolve on the expression,
12767         and later the assign will trigger another resolution
12768
12769         This leads to bugs (#37014)
12770
12771         * delegate.cs: The signature for EndInvoke should contain any ref
12772         or out parameters as well.  We were not doing this in the past. 
12773
12774         * class.cs (Field.Define): Do not overwrite the type definition
12775         inside the `volatile' group.  Turns out that volatile enumerations
12776         were changing the type here to perform a validity test, which
12777         broke conversions. 
12778
12779 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12780
12781         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12782         and structs, we do not want to load the instance variable
12783
12784         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12785         enum_type has to be handled like an object reference (implicit
12786         conversions exists from this to object), but the regular IsClass
12787         and IsValueType tests will never return true for this one.
12788
12789         Also we use TypeManager.IsValueType instead of type.IsValueType,
12790         just for consistency with the rest of the code (this is only
12791         needed if we ever use the construct exposed by test-180.cs inside
12792         corlib, which we dont today).
12793
12794 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12795
12796         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12797         just InternalCall.
12798
12799 2003-02-09  Martin Baulig  <martin@ximian.com>
12800
12801         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12802         (Namespace.DefineNamespaces): New static public method; this is
12803         called when we're compiling with debugging to add all namespaces
12804         to the symbol file.
12805
12806         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12807         pass it to the Namespace's .ctor.
12808
12809         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12810         and MethodBase arguments; pass the namespace ID to the symwriter;
12811         pass the MethodBase instead of the token to the symwriter.
12812         (SymbolWriter.DefineNamespace): New method to add a namespace to
12813         the symbol file.
12814
12815 2003-02-09  Martin Baulig  <martin@ximian.com>
12816
12817         * symbolwriter.cs: New file.  This is a wrapper around
12818         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12819         methods here in near future.
12820
12821 2003-02-09  Martin Baulig  <martin@ximian.com>
12822
12823         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12824         ILGenerator.MarkSequencePoint() which are actually used by the
12825         symbol writer.
12826
12827 2003-02-09  Martin Baulig  <martin@ximian.com>
12828
12829         * location.cs (SourceFile): New public sealed class.  This
12830         contains the name and an index which is used in the location's token.
12831         (Location): Reserve an appropriate number of bits in the token for
12832         the source file instead of walking over that list, this gives us a
12833         really huge performance improvement when compiling with debugging.
12834
12835         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12836         `SourceFile' argument instead of a string.
12837         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12838         but don't parse/tokenize here, we need to generate the list of all
12839         source files before we do that.
12840         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12841         the files.
12842
12843         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12844         instead of a string.
12845
12846         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12847         of a string.
12848
12849 2003-02-09  Martin Baulig  <martin@ximian.com>
12850
12851         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12852         filename on `#line default'.
12853
12854 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12855
12856         * statement.cs: don't clear the pinned var when the fixed statement
12857         returns from the method (fixes bug#37752).
12858
12859 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12860
12861         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12862         to IsValueType.
12863
12864 2003-02-07  Martin Baulig  <martin@ximian.com>
12865
12866         * driver.cs: Removed the `--debug-args' command line argument.
12867
12868         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12869         automatically by the AsssemblyBuilder.
12870         (CodeGen.InitializeSymbolWriter): We don't need to call any
12871         initialization function on the symbol writer anymore.  This method
12872         doesn't take any arguments.
12873
12874 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12875
12876         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12877         from referenced assemblies as well.
12878
12879 2003-02-02  Martin Baulig  <martin@ximian.com>
12880
12881         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12882
12883 2003-02-02  Martin Baulig  <martin@ximian.com>
12884
12885         * class.cs (Constructor.Emit): Open the symbol writer before
12886         emitting the constructor initializer.
12887         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12888         single-stepping through constructor initializers.
12889
12890 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12891
12892         * class.cs: Handle error 549: do not allow virtual methods in
12893         sealed classes. 
12894
12895 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12896
12897         * decl.cs: Check access levels when resolving types
12898
12899 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12900
12901         * statement.cs: Add parameters and locals set in catch blocks that might 
12902         return to set vector
12903
12904 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12905
12906         * class.cs (Operator): Set the SpecialName flags for operators.
12907
12908         * expression.cs (Invocation.DoResolve): Only block calls to
12909         accessors and operators on SpecialName methods.
12910
12911         (Cast.TryReduce): Handle conversions from char constants.
12912
12913
12914 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12915
12916         * statement.cs: small memory and time optimization in FlowBranching.
12917
12918 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12919
12920         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12921         problem that the last fix but in the other sid (Set).
12922
12923         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12924         access when there is no indexer in the hierarchy.
12925
12926 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12927
12928         * class.cs: Combine some if statements.
12929
12930 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12931
12932         * driver.cs: fixed bug #37187.
12933
12934 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12935
12936         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12937         any indexer, it's needed to build a list with all the indexers in the
12938         hierarchy (AllGetters), else we have problems. Fixes #35653.
12939
12940 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * class.cs (MethodData.Define): It is wrong for an interface
12943         implementation to be static in both cases: explicit and implicit.
12944         We were only handling this in one case.
12945
12946         Improve the if situation there to not have negations.
12947
12948         * class.cs (Field.Define): Turns out that we do not need to check
12949         the unsafe bit on field definition, only on usage.  Remove the test.
12950
12951 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12952
12953         * driver.cs: use assembly.Location instead of Codebase (the latest
12954         patch made mcs fail when using MS assemblies).
12955
12956 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12957
12958         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12959         get the path to *corlib.dll.
12960
12961 2003-01-21  Nick Drochak <ndrochak@gol.com>
12962
12963         * cs-tokenizer.cs:
12964         * pending.cs:
12965         * typemanager.cs: Remove compiler warnings
12966
12967 2003-01-20  Duncan Mak  <duncan@ximian.com>
12968
12969         * AssemblyInfo.cs: Bump the version number to 0.19.
12970
12971 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12972
12973         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12974
12975 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12976
12977         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12978
12979 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12980
12981         * cs-parser.jay: Small fix: we were not comparing the constructor
12982         name correctly.   Thanks to Zoltan for the initial pointer.
12983
12984 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12985
12986         * cs-tokenizer.cs: Set file name when specified with #line
12987
12988 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * cs-parser.jay: Only perform the constructor checks here if we
12991         are named like the class;  This will help provider a better
12992         error.  The constructor path is taken when a type definition is
12993         not found, but most likely the user forgot to add the type, so
12994         report that rather than the constructor error.
12995
12996 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12997
12998         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12999         allocations.
13000
13001 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13002
13003         * cs-parser.jay: Add cleanup call.
13004
13005 2003-01-13  Duncan Mak  <duncan@ximian.com>
13006
13007         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13008         consistent with other methods.
13009
13010 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13011
13012         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13013
13014 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13015
13016         * attribute.cs: only set GuidAttr to true when we have a
13017         GuidAttribute.
13018
13019 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13020
13021         * ecore.cs:
13022         * expression.cs:
13023         * typemanager.cs: fixes to allow mcs compile corlib with the new
13024         Type.IsSubclassOf fix.
13025
13026 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13027
13028         * expression.cs (LocalVariableReference.DoResolve): Classify a
13029         constant as a value, not as a variable.   Also, set the type for
13030         the variable.
13031
13032         * cs-parser.jay (fixed_statement): take a type instead of a
13033         pointer_type, so we can produce a better error message later.
13034
13035         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13036         as an error.  
13037
13038         (For.DoEmit): Make inifinite loops have a
13039         non-conditional branch back.
13040
13041         (Fixed.DoEmit): First populate the pinned variables, then emit the
13042         statement, then clear the variables.  Before I was emitting the
13043         code once for each fixed piece.
13044
13045
13046 2003-01-08  Martin Baulig  <martin@ximian.com>
13047
13048         * statement.cs (FlowBranching.MergeChild): A break in a
13049         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13050
13051 2003-01-08  Martin Baulig  <martin@ximian.com>
13052
13053         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13054         lives in the same number space than `param_map'.  Fixes #36154.
13055
13056 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13057
13058         * cs-parser.jay (constructor_declaration): Set the
13059         Constructor.ModFlags before probing for it.  This makes the
13060         compiler report 514, 515 and 132 (the code was there, but got
13061         broken). 
13062
13063         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13064         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13065         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13066
13067 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13068
13069         * enum.cs: create the enum static fields using the enum type.
13070
13071 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13072
13073         * class.cs: don't try to create the ParamBuilder for the return
13074         type if it's not needed (and handle it breaking for the ms runtime
13075         anyway).
13076
13077 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13078
13079         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13080
13081 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13084         the command.   This showed up while compiling the JANET source
13085         code, which used \r as its only newline separator.
13086
13087 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13088
13089         * class.cs (Method.Define): If we are an operator (because it
13090         reuses our code), then set the SpecialName and HideBySig.  #36128
13091
13092 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13093
13094         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13095         exception, report error 120 `object reference required'.
13096
13097         * driver.cs: Add --pause option, used during to measure the size
13098         of the process as it goes with --timestamp.
13099
13100         * expression.cs (Invocation.DoResolve): Do not allow methods with
13101         SpecialName to be invoked.
13102
13103 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13104
13105         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13106         number before adding it.
13107
13108 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13109
13110         * ecore.cs (StandardImplicitConversion): When in an unsafe
13111         context, we allow conversion between void * to any other pointer
13112         type. This fixes bug #35973.
13113
13114 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13115
13116         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13117         is not thrown when extensionless outputs are used 
13118
13119 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13120
13121         * rootcontext.cs: fixed compilation of corlib.
13122
13123 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13124
13125         * attribute.cs (Attributes.Contains): Add new method.
13126
13127         * class.cs (MethodCore.LabelParameters): if the parameter is an
13128         `out' parameter, check that no attribute `[In]' has been passed.
13129
13130         * enum.cs: Handle the `value__' name in an enumeration.
13131
13132 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13133
13134         * decl.cs: Added special case to allow overrides on "protected
13135         internal" methods
13136
13137 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13138
13139         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13140         since it makes much more sense.
13141
13142         (Attributes.ctor): Don't require a Location parameter.
13143
13144         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13145
13146         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13147         since we already have that information per attribute.
13148
13149         * everywhere : make appropriate changes.
13150
13151         * class.cs (LabelParameters): Write the code which actually
13152         applies attributes to the return type. We can't do this on the MS
13153         .NET runtime so we flag a warning in the case an exception is
13154         thrown.
13155
13156 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13157
13158         * const.cs: Handle implicit null conversions here too.
13159
13160 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13161
13162         * class.cs (MethodCore.LabelParameters): Remove the extra
13163         Type [] parameter since it is completely unnecessary. Instead
13164         pass in the method's attributes so that we can extract
13165         the "return" attribute.
13166
13167 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13170         of ignoring it and letting the compile continue.
13171
13172         * typemanager.cs (ChangeType): use an extra argument to return an
13173         error condition instead of throwing an exception.
13174
13175 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13176
13177         * expression.cs (Unary.TryReduce): mimic the code for the regular
13178         code path.  Perform an implicit cast in the cases where we can
13179         implicitly convert to one of the integral types, and then reduce
13180         based on that constant.   This fixes bug #35483.
13181
13182 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13183
13184         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13185
13186 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13187
13188         * namespace.cs: fixed bug #35489.
13189
13190 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13191
13192         * class.cs: Remove some dead code.
13193
13194         * cs-parser.jay: Estimate the number of methods needed
13195         (RootContext.MethodCount);
13196
13197         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13198         numbers instead of StringBuilders.
13199
13200         * support.cs (PtrHashtable): Add constructor with initial size;
13201         We can now reduce reallocations of the method table.
13202
13203 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13204
13205         * attribute.cs (ApplyAttributes): Keep track of the emitted
13206         attributes on a per-target basis. This fixes bug #35413.
13207
13208 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13209
13210         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13211         default to the Windows 1252 encoding.
13212
13213         (UnixParseOption): Support version, thanks to Alp for the missing
13214         pointer. 
13215
13216         * AssemblyInfo.cs: Add nice assembly information.
13217
13218         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13219         (bug 35169).
13220
13221         * cs-parser.jay: Allow a trailing comma before the close bracked
13222         in the attribute_section production.
13223
13224         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13225         address of the instance was being taken, I will take this out,
13226         because we take the address of the object immediately here.
13227
13228 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13229
13230         * typemanager.cs (AreMultipleAllowed): Take care of the most
13231         obvious case where attribute type is not in the current assembly -
13232         stupid me ;-)
13233
13234 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13235
13236         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13237         definitions, instead of doing that afterwards.  
13238
13239         Also we use a nice little hack, depending on the constructor, we
13240         know if we are a "composed" name or a simple name.  Hence, we
13241         avoid the IndexOf test, and we avoid 
13242
13243         * codegen.cs: Add code to assist in a bug reporter to track down
13244         the source of a compiler crash. 
13245
13246 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13247
13248         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13249         types have been emitted for a given element and flag an error
13250         if something which does not have AllowMultiple set is used more
13251         than once.
13252
13253         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13254         attribute types and their corresponding AllowMultiple properties
13255
13256         (AreMultipleAllowed): Check the property for a given type.
13257
13258         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13259         property in the case we have a TypeContainer.
13260
13261         (Attributes.AddAttribute): Detect duplicates and just skip on
13262         adding them. This trivial fix catches a pretty gross error in our
13263         attribute emission - global attributes were being emitted twice!
13264
13265         Bugzilla bug #33187 is now fixed.
13266
13267 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13268
13269         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13270         instead of pp_and).
13271
13272         * expression.cs (Binary.ResolveOperator): I can only use the
13273         Concat (string, string, string) and Concat (string, string,
13274         string, string) if the child is actually a concatenation of
13275         strings. 
13276
13277 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13278
13279         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13280         context where we need a 2-character lookahead.
13281
13282         * pending.cs (PendingImplementation): Rework so we can keep track
13283         of interface types all the time, and flag those which were
13284         implemented by parents as optional.
13285
13286 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13287
13288         * expression.cs (Binary.ResolveOperator): Use
13289         String.Concat(string,string,string) or
13290         String.Concat(string,string,string,string) when possible. 
13291
13292         * typemanager: More helper methods.
13293
13294
13295 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13296
13297         * pending.cs: remove the bogus return from GetMissingInterfaces()
13298         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13299
13300 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13301
13302         * namespace.cs: avoid duplicated 'using xxx' being added to
13303         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13304         when we get more than one 'using' statement for the same namespace.
13305         Report a CS0105 warning for it.
13306
13307 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13308
13309         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13310         of calling getChar/putback, uses internal knowledge of it.    
13311
13312         (xtoken): Reorder tokenizer so most common patterns are checked
13313         first.  This reduces the compilation time in another 5% (from 8.11s
13314         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13315
13316         The parsing time is 22% of the compilation in mcs, and from that
13317         64% is spent on the tokenization process.  
13318
13319         I tried using a binary search for keywords, but this is slower
13320         than the hashtable.  Another option would be to do a couple of
13321         things:
13322
13323                 * Not use a StringBuilder, instead use an array of chars,
13324                   with a set value.  Notice that this way we could catch
13325                   the 645 error without having to do it *afterwards*.
13326
13327                 * We could write a hand-parser to avoid the hashtable
13328                   compares altogether.
13329
13330         The identifier consumption process takes 37% of the tokenization
13331         time.  Another 15% is spent on is_number.  56% of the time spent
13332         on is_number is spent on Int64.Parse:
13333
13334                 * We could probably choose based on the string length to
13335                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13336                   computations. 
13337
13338         Another 3% is spend on wrapping `xtoken' in the `token' function.
13339
13340         Handle 0xa0 as whitespace (#34752)
13341
13342 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13343
13344         * typemanager.cs (IsCLRType): New routine to tell whether a type
13345         is one of the builtin types.  
13346
13347         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13348         typecode in more places instead of doing pointer comparissions.
13349         We could leverage some knowledge about the way the typecodes are
13350         laid out.
13351
13352         New code to cache namespaces in assemblies, it is currently not
13353         invoked, to be used soon.
13354
13355         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13356
13357         * expression.cs (Binary.ResolveOperator): specially handle
13358         strings, and do not perform user-defined operator overloading for
13359         built-in types.
13360
13361 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13364         internalcall as it is a pretty simple operation;  Avoid whenever
13365         possible to call Char.IsLetter.
13366
13367         (consume_identifier): Cut by half the number of
13368         hashtable calls by merging the is_keyword and GetKeyword behavior.
13369
13370         Do not short-circuit, because if we do, we
13371         report errors (ie, #if false && true would produce an invalid
13372         directive error);
13373
13374
13375 2002-11-24  Martin Baulig  <martin@ximian.com>
13376
13377         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13378         check constant ranges and report a CS0221.  Fixes #33186.
13379
13380 2002-11-24  Martin Baulig  <martin@ximian.com>
13381
13382         * cs-parser.jay: Make this work for uninitialized variable
13383         declarations in the `for' initializer.  Fixes #32416.
13384
13385 2002-11-24  Martin Baulig  <martin@ximian.com>
13386
13387         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13388         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13389
13390 2002-11-24  Martin Baulig  <martin@ximian.com>
13391
13392         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13393         argument; if true, we also check for user-defined conversions.
13394         This is only needed if both arguments are of a user-defined type.
13395         Fixes #30443, added test-175.cs.
13396         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13397
13398         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13399
13400 2002-11-24  Martin Baulig  <martin@ximian.com>
13401
13402         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13403         function to get the store opcode.
13404         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13405         only emit the Ldelema if the store opcode is Stobj.  You must run
13406         both test-34 and test-167 to test this.  Fixes #34529.
13407
13408 2002-11-23  Martin Baulig  <martin@ximian.com>
13409
13410         * ecore.cs (Expression.MemberLookup): Added additional
13411         `qualifier_type' argument which is used when we're being called
13412         from MemberAccess.DoResolve() and null if we're called from a
13413         SimpleName lookup.
13414         (Expression.MemberLookupFailed): New method to report errors; this
13415         does the CS1540 check and reports the correct error message.
13416
13417         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13418         argument for the CS1540 check and redone the way how we're dealing
13419         with private members.  See the comment in the source code for details.
13420         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13421         `closure_start_type' to `closure_qualifier_type' and check whether
13422         it's not null.  It was not this filter being broken, it was just
13423         being called with the wrong arguments.
13424
13425         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13426         and pass it the correct `qualifier_type'; this also does the error
13427         handling for us.
13428
13429 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13430
13431         * expression.cs (Invocation.EmitParams): If the we are dealing
13432         with a non-built-in value type, load its address as well.
13433
13434         (ArrayCreation): Use a a pretty constant instead
13435         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13436         static initializers.  
13437
13438         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13439         because they are not really value types, just glorified integers. 
13440
13441         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13442
13443         * ecore.cs: Remove redundant code for enumerations, make them use
13444         the same code path as everything else, fixes the casting issue
13445         with enumerations in Windows.Forms.
13446
13447         * attribute.cs: Do only cast to string if it is a string, the
13448         validation happens later.
13449
13450         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13451         people upgrade their corlibs.
13452
13453         * ecore.cs: Oops, enumerations were not following the entire code path
13454
13455 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * typemanager.cs (FilterWithClosure): Commented out the test for
13458         1540 in typemanager.cs, as it has problems when accessing
13459         protected methods from a parent class (see test-174.cs). 
13460
13461         * attribute.cs (Attribute.ValidateGuid): new method.
13462         (Attribute.Resolve): Use above.
13463
13464 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13467
13468         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13469         handling for enumerations, as we only needed the TypeContainer
13470         functionality to begin with (this is required for the fix below to
13471         work for enums that reference constants in a container class for
13472         example). 
13473
13474         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13475
13476         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13477         a valid TypeBuilder to perform lookups on.o
13478
13479         * class.cs (InheritableMemberSignatureCompare): Use true in the
13480         call to GetGetMethod and GetSetMethod, because we are comparing
13481         the signature, and we need to get the methods *even* if they are
13482         private. 
13483
13484         (PropertyBase.CheckBase): ditto.
13485
13486         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13487         GotoCase.Resolve): Use Peel on EmpytCasts.
13488
13489         * ecore.cs (EmptyCast): drop child, add Peel method.
13490
13491 2002-11-17  Martin Baulig  <martin@ximian.com>
13492
13493         * ecore.cs (EmptyCast.Child): New public property.
13494
13495         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13496         label resolved to an EmptyCast.  Fixes #34162.
13497         (GotoCase.Resolve): Likewise.
13498         (Block.EmitMeta): Likewise.
13499
13500 2002-11-17  Martin Baulig  <martin@ximian.com>
13501
13502         * expression.cs (Invocation.BetterConversion): Prefer int over
13503         uint; short over ushort; long over ulong for integer literals.
13504         Use ImplicitConversionExists instead of StandardConversionExists
13505         since we also need to check for user-defined implicit conversions.
13506         Fixes #34165.  Added test-173.cs.
13507
13508 2002-11-16  Martin Baulig  <martin@ximian.com>
13509
13510         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13511         with the `true' and `false' literals.  Fixes #33151.
13512
13513 2002-11-16  Martin Baulig  <martin@ximian.com>
13514
13515         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13516         October 22nd; don't do the cs1540 check for static members.
13517
13518         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13519         now using our own filter here and doing the cs1540 check again.
13520
13521 2002-11-16  Martin Baulig  <martin@ximian.com>
13522
13523         * support.cs (InternalParameters): Don't crash if we don't have
13524         any fixed parameters.  Fixes #33532.
13525
13526 2002-11-16  Martin Baulig  <martin@ximian.com>
13527
13528         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13529         when looking up static methods to make this work on Windows.
13530         Fixes #33773.
13531
13532 2002-11-16  Martin Baulig  <martin@ximian.com>
13533
13534         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13535         a setter rather than using PropertyInfo.CanWrite.
13536
13537 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13538
13539         * class.cs: Allow acces to block member by subclasses. Fixes build
13540         breaker.
13541
13542 2002-11-14  Martin Baulig  <martin@ximian.com>
13543
13544         * class.cs (Constructor.Emit): Added the extern/block check.
13545         Fixes bug #33678.
13546
13547 2002-11-14  Martin Baulig  <martin@ximian.com>
13548
13549         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13550         iteration while looking for indexers, this is needed because the
13551         indexer may have a different name in our base classes.  Fixed the
13552         error reporting (no indexers at all, not get accessor, no
13553         overloaded match).  Fixes bug #33089.
13554         (IndexerAccess.DoResolveLValue): Likewise.
13555
13556 2002-11-14  Martin Baulig  <martin@ximian.com>
13557
13558         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13559         indexers.  Fixes the first part of bug #33089.
13560         (MethodSignature.InheritableMemberSignatureCompare): Added support
13561         for properties.
13562
13563 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13564
13565         * attribute.cs (Attribute.Resolve): Catch the
13566         NullReferenceException and report it since it isn't supposed to
13567         happen. 
13568
13569 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13570
13571         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13572         LogicalOr and LogicalAnd that can benefit from recursively
13573         handling EmitBranchable.  The code now should be nice for Paolo.
13574
13575 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13576
13577         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13578         the Type lookups, as we perform quite a number of lookups on
13579         non-Types.  This can be removed once we can deterministically tell
13580         whether we have a type or a namespace in advance.
13581
13582         But this might require special hacks from our corlib.
13583
13584         * TODO: updated.
13585
13586         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13587         and double which avoids a conversion from an integer to a double.
13588
13589         * expression.cs: tiny optimization, avoid calling IsConstant,
13590         because it effectively performs the lookup twice.
13591
13592 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13593
13594         But a bogus return here to keep the semantics of the old code
13595         until the Mono runtime is fixed.
13596
13597         * pending.cs (GetMissingInterfaces): New method used to remove all
13598         the interfaces that are already implemented by our parent
13599         classes from the list of pending methods. 
13600
13601         * interface.cs: Add checks for calls after ResolveTypeExpr.
13602
13603 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13604
13605         * class.cs (Class.Emit): Report warning 67: event not used if the
13606         warning level is beyond 3.
13607
13608         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13609         being a NullLiteral.
13610
13611         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13612         specifiers. 
13613
13614         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13615         path that might fail if a type can not be resolved.
13616
13617         * expression.cs (Binary.Emit): Emit unsigned versions of the
13618         operators. 
13619
13620         * driver.cs: use error 5.
13621
13622 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13623
13624         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13625
13626 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13627
13628         * cs-parser.jay (switch_section): A beautiful patch from Martin
13629         Baulig that fixed 33094.
13630
13631 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13634         Check whether the base is abstract and report an error if so.
13635
13636         * expression.cs (IndexerAccess.DoResolveLValue,
13637         IndexerAccess.DoResolve): ditto. 
13638
13639         (Invocation.DoResolve): ditto.
13640
13641         (Invocation.FullMethodDesc): Improve the report string.
13642
13643         * statement.cs (Block): Eliminate IsVariableDefined as it is
13644         basically just a wrapper for GetVariableInfo.
13645
13646         * ecore.cs (SimpleName): Use new 
13647
13648         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13649         type, as we return the actual parameter ref/unref state on a
13650         different call.
13651
13652 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13653
13654         * support.cs: Return proper flags REF/OUT fixing the previous
13655         commit.  
13656
13657         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13658         not used to mean `ref' but `ref or out' in ParameterReference
13659
13660         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13661         full type signature instead of calling TypeManger.CSharpName
13662         ourselves. 
13663
13664         * support.cs (InternalParameters.ParameterDesc): Do not compare
13665         directly to the modflags, because REF/OUT will actually be bitsets
13666         if set. 
13667
13668         * delegate.cs (VerifyMethod): Check also the modifiers.
13669
13670         * cs-tokenizer.cs: Fix bug where floating point values with an
13671         exponent where a sign was missing was ignored.
13672
13673         * driver.cs: Allow multiple assemblies to be specified in a single
13674         /r: argument
13675
13676 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13677
13678         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13679         because identifiers after a parenthesis would end up in this kind
13680         of production, and we needed to desamiguate it for having casts
13681         like:
13682
13683                 (UserDefinedType *) xxx
13684
13685 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13688         we should set on the Bindingflags.NonPublic, but not turn on
13689         private_ok.  private_ok controls whether a Private member is
13690         returned (this is chekced on the filter routine), while the
13691         BindingFlags.NonPublic just controls whether private/protected
13692         will be allowed.   This fixes the problem part of the problem of
13693         private properties being allowed to be used in derived classes.
13694
13695         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13696         so we can call the children DoResolveLValue method (this will
13697         properly signal errors on lvalue assignments to base properties)
13698
13699         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13700         getter are null, and we have a property info, we know that this
13701         happened because the lookup failed, so we report an error 122 for
13702         protection level violation.
13703
13704         We also silently return if setter and getter are null in the
13705         resolve functions, this condition only happens if we have flagged
13706         the error before.  This is the other half of the problem. 
13707
13708         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13709         not have accessibility information, that is why we were returning
13710         true in the filter function in typemanager.cs.
13711
13712         To properly report 122 (property is inaccessible because of its
13713         protection level) correctly, we report this error in ResolveAccess
13714         by failing if both the setter and the getter are lacking (ie, the
13715         lookup failed). 
13716
13717         DoResolve and DoLResolve have been modified to check for both
13718         setter/getter being null and returning silently, the reason being
13719         that I did not want to put the knowledge about this error in upper
13720         layers, like:
13721
13722         int old = Report.Errors;
13723         x = new PropertyExpr (...);
13724         if (old != Report.Errors)
13725                 return null;
13726         else
13727                 return x;
13728
13729         So the property expr is returned, but it is invalid, so the error
13730         will be flagged during the resolve process. 
13731
13732         * class.cs: Remove InheritablePropertySignatureCompare from the
13733         class, as we no longer depend on the property signature to compute
13734         whether it is possible to implement a method or not.
13735
13736         The reason is that calling PropertyInfo.GetGetMethod will return
13737         null (in .NET, in Mono it works, and we should change this), in
13738         cases where the Get Method does not exist in that particular
13739         class.
13740
13741         So this code:
13742
13743         class X { public virtual int A { get { return 1; } } }
13744         class Y : X { }
13745         class Z : Y { public override int A { get { return 2; } } }
13746
13747         Would fail in Z because the parent (Y) would not have the property
13748         defined.  So we avoid this completely now (because the alternative
13749         fix was ugly and slow), and we now depend exclusively on the
13750         method names.
13751
13752         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13753         reference method, instead of using the property.
13754
13755         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13756         routines are gone now.
13757
13758         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13759         names, they were incorrectly named.
13760
13761         * cs-tokenizer.cs: Return are more gentle token on failure. 
13762
13763         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13764         had an out-of-sync index variable, which caused it to remove from
13765         the list of pending methods the wrong method sometimes.
13766
13767 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13770         CanWrite, because those refer to this particular instance of the
13771         property, and do not take into account the fact that we can
13772         override single members of a property.
13773
13774         Constructor requires an EmitContext.  The resolution process does
13775         not happen here, but we need to compute the accessors before,
13776         because the resolution does not always happen for properties.
13777
13778         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13779         subclass, before we did not update this flag, but we did update
13780         bindingflags. 
13781
13782         (GetAccessors): Drop this routine, as it did not work in the
13783         presence of partially overwritten set/get methods. 
13784
13785         Notice that this broke the cs1540 detection, but that will require
13786         more thinking. 
13787
13788 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13789
13790         * class.cs:
13791         * codegen.cs:
13792         * driver.cs: issue a warning instead of an error if we don't support
13793         debugging for the platform. Also ignore a couple of errors that may
13794         arise when trying to write the symbols. Undo my previous patch.
13795
13796 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13797
13798         * driver.cs: ignore /debug switch except for Unix platforms.
13799
13800 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13801
13802         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13803
13804 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13805
13806         * driver.cs: Do not make mcs-debug conditional, so we do not break
13807         builds that use it.
13808
13809         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13810         review this patch.  But basically after all the children variables
13811         have been merged, the value of "Breaks" was not being set to
13812         new_breaks for Switch blocks.  I think that it should be set after
13813         it has executed.  Currently I set this to the value of new_breaks,
13814         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13815         conservative, but I do not understand this code very well.
13816
13817         I did not break anything in the build, so that is good ;-)
13818
13819         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13820
13821 2002-10-20  Mark Crichton  <crichton@gimp.org>
13822
13823         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13824
13825 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13826
13827         * cfold.cs: Fixed compile blocker.
13828
13829 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13830
13831         * driver.cs: I was chekcing the key, not the file.
13832
13833 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13834
13835         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13836         message that we were generating - we just need to silently return
13837         a null.
13838
13839 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13840
13841         * class.cs (Event.Define): Change my previous commit, as this
13842         breaks the debugger.  This is a temporary hack, as it seems like
13843         the compiler is generating events incorrectly to begin with.
13844
13845         * expression.cs (Binary.ResolveOperator): Added support for 
13846         "U operator - (E x, E y)"
13847
13848         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13849         y)".
13850
13851         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13852         init-only variables, but this path did not take into account that
13853         there might be also instance readonly variables.  Correct this
13854         problem. 
13855
13856         This fixes bug 32253
13857
13858         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13859         delegates as well.
13860
13861         * driver.cs: Change the extension for modules to `netmodule'
13862
13863         * cs-parser.jay: Improved slightly the location tracking for
13864         the debugger symbols.
13865
13866         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13867         modifiers that were specified instead of the hardcoded value
13868         (FamAndAssem).  This was basically ignoring the static modifier,
13869         and others.  Fixes 32429.
13870
13871         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13872         fixed a bug in the process (32476)
13873
13874         * expression.cs (ArrayAccess.EmitAssign): Patch from
13875         hwang_rob@yahoo.ca that fixes bug 31834.3
13876
13877 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13878
13879         * driver.cs: Make the module extension .netmodule.
13880
13881 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13882
13883         * driver.cs: Report an error if the resource file is not found
13884         instead of crashing.
13885
13886         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13887         false, like Emit does.
13888
13889 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13890
13891         * typemanager.cs: Remove unused private member.  Also reported mcs
13892         bug to report this as a warning like csc.
13893
13894 2002-10-15  Martin Baulig  <martin@gnome.org>
13895
13896         * statement.cs (Statement.Emit): Made this a virtual method; emits
13897         the line number info and calls DoEmit().
13898         (Statement.DoEmit): New protected abstract method, formerly knows
13899         as Statement.Emit().
13900
13901         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13902
13903 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13904
13905         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13906         have fixed a remaining problem: not every AddXXXX was adding a
13907         fully qualified name.  
13908
13909         Now everyone registers a fully qualified name in the DeclSpace as
13910         being defined instead of the partial name.  
13911
13912         Downsides: we are slower than we need to be due to the excess
13913         copies and the names being registered this way.  
13914
13915         The reason for this is that we currently depend (on the corlib
13916         bootstrap for instance) that types are fully qualified, because
13917         we dump all the types in the namespace, and we should really have
13918         types inserted into the proper namespace, so we can only store the
13919         basenames in the defined_names array.
13920
13921 2002-10-10  Martin Baulig  <martin@gnome.org>
13922
13923         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13924         from bug #31834, see the bug report for a testcase which is
13925         miscompiled.
13926
13927 2002-10-10  Martin Baulig  <martin@gnome.org>
13928
13929         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13930         flow analysis code for this.
13931
13932         * statement.cs (Do, While, For): Tell the flow analysis code about
13933         infinite loops.
13934         (FlowBranching.UsageVector): Added support for infinite loops.
13935         (Block.Resolve): Moved the dead code elimination here and use flow
13936         analysis to do it.
13937
13938 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13939
13940         * class.cs (Field.Define): Catch cycles on struct type
13941         definitions. 
13942
13943         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13944         fields if the fields are static.  We only need to check instance
13945         fields. 
13946
13947         * expression.cs (As.DoResolve): Test for reference type.
13948
13949         * statement.cs (Using.ResolveExpression): Use
13950         ConvertImplicitRequired, not ConvertImplicit which reports an
13951         error on failture
13952         (Using.ResolveLocalVariableDecls): ditto.
13953
13954         * expression.cs (Binary.ResolveOperator): Report errors in a few
13955         places where we had to.
13956
13957         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13958
13959 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13960
13961         * expression.cs: Use StoreFromPtr instead of extracting the type
13962         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13963
13964         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13965         an enumeration value to a System.Enum, but System.Enum is not a
13966         value type, but an class type, so we need to box.
13967
13968         (Expression.ConvertExplicit): One codepath could return
13969         errors but not flag them.  Fix this.  Fixes #31853
13970
13971         * parameter.cs (Resolve): Do not allow void as a parameter type.
13972
13973 2002-10-06  Martin Baulig  <martin@gnome.org>
13974
13975         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13976         if it's a class type and not a struct.  Fixes #31815.
13977
13978 2002-10-06  Martin Baulig  <martin@gnome.org>
13979
13980         * statement.cs: Reworked the flow analysis code a bit to make it
13981         usable for dead code elimination.
13982
13983 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13984
13985         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13986
13987 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13988
13989         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13990         to fix the test 165, will investigate deeper.
13991
13992 2002-10-04  Martin Baulig  <martin@gnome.org>
13993
13994         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13995         finally blocks actually work.
13996         (Try.Resolve): We don't need to create a sibling for `finally' if
13997         there is no finally block.
13998
13999 2002-10-04  Martin Baulig  <martin@gnome.org>
14000
14001         * class.cs (Constructor.Define): The default accessibility for a
14002         non-default constructor is private, not public.
14003
14004 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * class.cs (Constructor): Make AllowedModifiers public, add
14007         EXTERN.
14008
14009         * cs-parser.jay: Perform the modifiers test here, as the
14010         constructor for the Constructor class usually receives a zero
14011         because of the way we create it (first we create, later we
14012         customize, and we were never checking the modifiers).
14013
14014         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14015         is a version of LookupTypeReflection that includes the type-name
14016         cache.  This can be used as a fast path for functions that know
14017         the fully qualified name and are only calling into *.GetType() to
14018         obtain a composed type.
14019
14020         This is also used by TypeManager.LookupType during its type
14021         composition.
14022
14023         (LookupType): We now also track the real type name, as sometimes
14024         we can get a quey for the real type name from things like
14025         ComposedCast.  This fixes bug 31422.
14026
14027         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14028         complete type fullname, it does not have to go through the type
14029         resolution system to obtain the composed version of the type (for
14030         obtaining arrays or pointers).
14031
14032         (Conditional.Emit): Use the EmitBoolExpression to
14033         generate nicer code, as requested by Paolo.
14034
14035         (ArrayCreation.CheckIndices): Use the patch from
14036         hwang_rob@yahoo.ca to validate the array initializers. 
14037
14038 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14039
14040         * class.cs (ConstructorInitializer.Emit): simplify code by using
14041         Invocation.EmitCall, and at the same time, fix the bugs in calling
14042         parent constructors that took variable arguments. 
14043
14044         * ecore.cs (Expression.ConvertNumericExplicit,
14045         Expression.ImplicitNumericConversion): Remove the code that
14046         manually wrapped decimal (InternalTypeConstructor call is now gone
14047         as well).
14048
14049         * expression.cs (Cast.TryReduce): Also handle decimal types when
14050         trying to perform a constant fold on the type.
14051
14052         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14053
14054         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14055         that only turned off an error report, and did nothing else. 
14056
14057 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14058
14059         * driver.cs: Handle and ignore /fullpaths
14060
14061 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14062
14063         * expression.cs (Binary.ResolveOperator): Catch the case where
14064         DoNumericPromotions returns true, 
14065
14066         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14067
14068 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14069
14070         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14071         report error 70.
14072
14073 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14076         conversion exists, but it is also required that the conversion be
14077         performed.  This manifested in "(Type64Enum) 2".  
14078
14079         * class.cs (TypeManager.AddMethod): The fix is not to change
14080         AddEnum, because that one was using a fully qualified name (every
14081         DeclSpace derivative does), but to change the AddMethod routine
14082         that was using an un-namespaced name.  This now correctly reports
14083         the duplicated name.
14084
14085         Revert patch until I can properly fix it.  The issue
14086         is that we have a shared Type space across all namespaces
14087         currently, which is wrong.
14088
14089         Options include making the Namespace a DeclSpace, and merge
14090         current_namespace/current_container in the parser.
14091
14092 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * cs-parser.jay: Improve error reporting when we get a different
14095         kind of expression in local_variable_type and
14096         local_variable_pointer_type. 
14097
14098         Propagate this to avoid missleading errors being reported.
14099
14100         * ecore.cs (ImplicitReferenceConversion): treat
14101         TypeManager.value_type as a target just like object_type.   As
14102         code like this:
14103
14104         ValueType v = 1;
14105
14106         Is valid, and needs to result in the int 1 being boxed before it
14107         is assigned to the value type v.
14108
14109         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14110         to validate the enumeration name.
14111
14112         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14113         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14114         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14115
14116         * ecore.cs (TryImplicitIntConversion): When doing an
14117         implicit-enumeration-conversion, check if the type is 64-bits and
14118         perform a conversion before passing to EnumConstant.
14119
14120 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14123         report ambiguous type references.  Unlike the MS version, we
14124         report what the ambiguity is.   Innovation at work ;-)
14125
14126         (DeclSpace.FindType): Require a location argument to
14127         display when we display an ambiguous error.
14128
14129         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14130
14131         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14132
14133         * expression.cs (EmitDynamicInitializers): Apply patch from
14134         hwang_rob@yahoo.ca that fixes the order in which we emit our
14135         initializers. 
14136
14137 2002-09-21  Martin Baulig  <martin@gnome.org>
14138
14139         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14140         delegate takes no arguments.
14141
14142 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14143
14144         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14145         from integers.
14146
14147         * expression.cs: Extract the underlying type.
14148
14149         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14150
14151         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14152
14153 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14154
14155         * class.cs (TypeContainer.DefineType): We can not use the nice
14156         PackingSize with the size set to 1 DefineType method, because it
14157         will not allow us to define the interfaces that the struct
14158         implements.
14159
14160         This completes the fixing of bug 27287
14161
14162         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14163         means also structs.  This fixes part of the problem. 
14164         (Expresion.ImplicitReferenceConversionExists): ditto.
14165
14166         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14167         error if there were no errors reported during the type lookup
14168         process, to avoid duplicates or redundant errors.  Without this
14169         you would get an ambiguous errors plus a type not found.  We have
14170         beaten the user enough with the first error.  
14171
14172         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14173         reference. 
14174
14175         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14176         during the resolution process, stop the lookup, this avoids
14177         repeated error reports (same error twice).
14178
14179         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14180
14181         * typemanager.cs (LookupType): Redo the type lookup code to match
14182         the needs of System.Reflection.  
14183
14184         The issue is that System.Reflection requires references to nested
14185         types to begin with a "+" sign instead of a dot.  So toplevel
14186         types look like: "NameSpace.TopLevelClass", and nested ones look
14187         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14188         levels. 
14189
14190 2002-09-19  Martin Baulig  <martin@gnome.org>
14191
14192         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14193         says that a method always returns or always throws an exception,
14194         don't report the CS0161.
14195
14196         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14197         set `Returns = new_returns'.
14198
14199 2002-09-19  Martin Baulig  <martin@gnome.org>
14200
14201         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14202         to an enum constant, check for a CS0176.
14203
14204 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14207         for operators that must be in pairs and report errors.
14208
14209         * ecore.cs (SimpleName.DoResolveType): During the initial type
14210         resolution process, when we define types recursively, we must
14211         check first for types in our current scope before we perform
14212         lookups in the enclosing scopes.
14213
14214         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14215
14216         (Invocation.VerifyArgumentsCompat): Call
14217         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14218         I thought we were supposed to always call this, but there are a
14219         few places in the code where we dont do it.
14220
14221 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14222
14223         * driver.cs: Add support in -linkres and -resource to specify the
14224         name of the identifier.
14225
14226 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14227
14228         * ecore.cs (StandardConversionExists): Sync with the conversion
14229         code: allow anything-* to void* conversions.
14230
14231         (FindMostSpecificSource): Use an Expression argument
14232         instead of a Type, because we might be handed over a Literal which
14233         gets a few more implicit conversions that plain types do not.  So
14234         this information was being lost.
14235
14236         Also, we drop the temporary type-holder expression when not
14237         required.
14238
14239 2002-09-17  Martin Baulig  <martin@gnome.org>
14240
14241         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14242         this is an explicit interface implementation.
14243
14244 2002-09-17  Martin Baulig  <martin@gnome.org>
14245
14246         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14247         different `IndexerName' attributes.
14248
14249         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14250         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14251         virtual CommonResolve().
14252
14253 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14254
14255         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14256         and convert that to the UnderlyingType.
14257
14258         * statement.cs (Foreach.Resolve): Indexers are just like variables
14259         or PropertyAccesses.
14260
14261         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14262         inside quoted strings, we were not doing this before.
14263
14264 2002-09-16  Martin Baulig  <martin@gnome.org>
14265
14266         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14267         resolve it.  This is needed for the definite assignment check of the
14268         instance expression, fixes bug #29846.
14269         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14270
14271 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14272
14273         * parameter.cs: Fix compile error.  Cannot reference static member
14274         from an instance object.  Is this an mcs bug?
14275
14276 2002-09-14  Martin Baulig  <martin@gnome.org>
14277
14278         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14279         multiple times.  Fixes bug #30295, added test-166.cs.
14280
14281 2002-09-14  Martin Baulig  <martin@gnome.org>
14282
14283         * statement.cs (Block.Emit): Don't emit unreachable code.
14284         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14285         `break' statements.
14286         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14287
14288 2002-09-14  Martin Baulig  <martin@gnome.org>
14289
14290         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14291         is set.
14292
14293 2002-09-14  Martin Baulig  <martin@gnome.org>
14294
14295         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14296         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14297         be false on the ms runtime.
14298
14299 2002-09-13  Martin Baulig  <martin@gnome.org>
14300
14301         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14302         the CS0038 error message.
14303
14304 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14305
14306         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14307         constant inside, return it.
14308
14309 2002-09-12  Martin Baulig  <martin@gnome.org>
14310
14311         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14312         implicit conversion can be done between enum types.
14313
14314         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14315         check whether an implicit conversion to the current enum's UnderlyingType
14316         exists and report an error if not.
14317
14318         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14319         without debugging support.
14320
14321         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14322         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14323
14324 2002-09-12  Martin Baulig  <martin@gnome.org>
14325
14326         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14327
14328         * ecore.cs (IMemberExpr.DeclaringType): New property.
14329         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14330         nonstatic member of an outer type (CS0038).
14331
14332 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * driver.cs: Activate the using-error detector at warning level
14335         4 (at least for MS-compatible APIs).
14336
14337         * namespace.cs (VerifyUsing): Small buglett fix.
14338
14339         * pending.cs (PendingImplementation): pass the container pointer. 
14340
14341         * interface.cs (GetMethods): Allow for recursive definition.  Long
14342         term, I would like to move every type to support recursive
14343         definitions, not the current ordering mechanism that we have right
14344         now.
14345
14346         The situation is this: Attributes are handled before interfaces,
14347         so we can apply attributes to interfaces.  But some attributes
14348         implement interfaces, we will now handle the simple cases
14349         (recursive definitions will just get an error).  
14350
14351         * parameter.cs: Only invalidate types at the end if we fail to
14352         lookup all types.  
14353
14354 2002-09-09  Martin Baulig  <martin@gnome.org>
14355
14356         * ecore.cs (PropertyExpr.Emit): Also check for
14357         TypeManager.system_int_array_get_length so this'll also work when
14358         compiling corlib.  Fixes #30003.
14359
14360 2002-09-09  Martin Baulig  <martin@gnome.org>
14361
14362         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14363         and throw an exception if we can't get the type's size.  Fixed #30040,
14364         added test-165.cs.
14365
14366 2002-09-09  Martin Baulig  <martin@gnome.org>
14367
14368         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14369
14370         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14371         context.  Fixes bug #30027.
14372
14373         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14374         virtual functions.  Fixes bug #30043, added test-164.cs.
14375
14376 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14377
14378         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14379
14380 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14381
14382         * driver.cs: Use an object to get the windows codepage since it's not a
14383         static property.
14384
14385 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14386
14387         * statement.cs (For.Emit): for infinite loops (test == null)
14388         return whether there is a break inside, not always "true".
14389
14390         * namespace.cs (UsingEntry): New struct to hold the name of the
14391         using definition, the location where it is defined, and whether it
14392         has been used in a successful type lookup.
14393
14394         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14395         strings.
14396
14397         * decl.cs: ditto.
14398
14399 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14400
14401         * attribute.cs : Fix incorrect code which relied on catching
14402         a NullReferenceException to detect a null being passed in
14403         where an object was expected.
14404
14405 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14406
14407         * statement.cs (Try): flag the catch variable as assigned
14408
14409         * expression.cs (Cast): Simplified by using ResolveType instead of
14410         manually resolving.
14411
14412         * statement.cs (Catch): Fix bug by using ResolveType.
14413
14414 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14415
14416         * expression.cs (BetterConversion): Special case for when we have
14417         a NullLiteral as the argument and we have to choose between string
14418         and object types - we choose string the way csc does.
14419
14420         * attribute.cs (Attribute.Resolve): Catch the
14421         NullReferenceException and report error #182 since the Mono
14422         runtime no more has the bug and having this exception raised means
14423         we tried to select a constructor which takes an object and is
14424         passed a null.
14425
14426 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14427
14428         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14429         message (1502, 1503) when we can't locate a method after overload
14430         resolution. This is much more informative and closes the bug
14431         Miguel reported.
14432
14433         * interface.cs (PopulateMethod): Return if there are no argument
14434         types. Fixes a NullReferenceException bug.
14435
14436         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14437         expressions too. Previously we were checking only in one place for
14438         positional arguments leaving out named arguments.
14439
14440         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14441         type to the enum type is not allowed. Remove code corresponding to
14442         that.
14443
14444         (ConvertNumericExplicit): Allow explicit conversions from
14445         the underlying type to enum type. This precisely follows the spec
14446         and closes a bug filed by Gonzalo.
14447
14448 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14449
14450         * compiler.csproj:
14451         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14452
14453 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14454
14455         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14456         it was important that we stored the right value after the
14457         reduction in `converted'.
14458
14459 2002-09-04  Martin Baulig  <martin@gnome.org>
14460
14461         * location.cs (Location.SymbolDocument): Use full pathnames for the
14462         source files.
14463
14464 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14465
14466         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14467         of the expression resolve mechanism, because that will catch the
14468         SimpleName error failures.
14469
14470         (Conditional): If we can not resolve the
14471         expression, return, do not crash.
14472
14473 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14474
14475         * cs-tokenizer.cs:
14476         (location): display token name instead of its number.
14477
14478 2002-08-28  Martin Baulig  <martin@gnome.org>
14479
14480         * expression.cs (Binary.ResolveOperator): Don't silently return
14481         but return an error if an operator cannot be applied between two
14482         enum types.
14483
14484 2002-08-28  Martin Baulig  <martin@gnome.org>
14485
14486         * class.cs (Constructor.Define): Set the permission attributes
14487         correctly instead of making all constructors public.
14488
14489 2002-08-28  Martin Baulig  <martin@gnome.org>
14490
14491         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14492         for private members before reporting a CS0103; if we find anything,
14493         it's a CS0122.
14494
14495 2002-08-28  Martin Baulig  <martin@gnome.org>
14496
14497         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14498         to check whether `closure_start_type == closure_invocation_type',
14499         we also need to check whether `m.DeclaringType == closure_invocation_type'
14500         before bypassing the permission checks.  We might be accessing
14501         protected/private members from the base class.
14502         (TypeManager.RealMemberLookup): Only set private_ok if private
14503         members were requested via BindingFlags.NonPublic.
14504
14505         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14506
14507         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14508         MethodGroupExpr.IsExplicitImpl if appropriate.
14509         (Invocation.DoResolve): Don't report the CS0120 for explicit
14510         interface implementations.
14511
14512 2002-08-27  Martin Baulig  <martin@gnome.org>
14513
14514         * expression.cs (Invocation.DoResolve): If this is a static
14515         method and we don't have an InstanceExpression, we must report
14516         a CS0120.
14517
14518 2002-08-25  Martin Baulig  <martin@gnome.org>
14519
14520         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14521         `==' between a valuetype and an object.
14522
14523 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14524
14525         * ecore.cs (TypeExpr): Provide a ToString method.
14526
14527 2002-08-24  Martin Baulig  <martin@gnome.org>
14528
14529         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14530         now called proggie.dbg and it's a binary file.
14531
14532 2002-08-23  Martin Baulig  <martin@gnome.org>
14533
14534         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14535
14536 2002-08-23  Martin Baulig  <martin@gnome.org>
14537
14538         * struct.cs (MyStructInfo.ctor): Make this work with empty
14539         structs; it's not allowed to use foreach() on null.
14540
14541 2002-08-23  Martin Baulig  <martin@gnome.org>
14542
14543         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14544         writer the full pathname of the generated assembly.
14545
14546 2002-08-23  Martin Baulig  <martin@gnome.org>
14547
14548         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14549         A `finally' block never returns or breaks; improved handling of
14550         unreachable code.
14551
14552 2002-08-23  Martin Baulig  <martin@gnome.org>
14553
14554         * statement.cs (Throw.Resolve): Allow `throw null'.
14555
14556 2002-08-23  Martin Baulig  <martin@gnome.org>
14557
14558         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14559         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14560         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14561         MemberLookup would return a wrong event if this is an explicit
14562         interface implementation and the class has an event with the same
14563         name.
14564
14565 2002-08-23  Martin Baulig  <martin@gnome.org>
14566
14567         * statement.cs (Block.AddChildVariableNames): New public method.
14568         (Block.AddChildVariableName): Likewise.
14569         (Block.IsVariableNameUsedInChildBlock): Likewise.
14570         (Block.AddVariable): Check whether a variable name has already
14571         been used in a child block.
14572
14573         * cs-parser.jay (declare_local_variables): Mark all variable names
14574         from the current block as being used in a child block in the
14575         implicit block.
14576
14577 2002-08-23  Martin Baulig  <martin@gnome.org>
14578
14579         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14580         find the symbol writer.
14581
14582         * driver.cs: csc also allows the arguments to /define being
14583         separated by commas, not only by semicolons.
14584
14585 2002-08-23  Martin Baulig  <martin@gnome.org>
14586
14587         * interface.cs (Interface.GetMembers): Added static check for events.
14588
14589 2002-08-15  Martin Baulig  <martin@gnome.org>
14590
14591         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14592         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14593
14594         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14595         why the MethodData.EmitDestructor() change was necessary.
14596
14597 2002-08-20  Martin Baulig  <martin@gnome.org>
14598
14599         * class.cs (TypeContainer.FindMembers): Added static check for events.
14600
14601         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14602
14603         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14604         use Type.GetEvents(), not Type.FindMembers().
14605
14606 2002-08-20  Martin Baulig  <martin@gnome.org>
14607
14608         * decl.cs (MemberCache): Added a special method cache which will
14609         be used for method-only searched.  This ensures that a method
14610         search will return a MethodInfo with the correct ReflectedType for
14611         inherited methods.      
14612
14613 2002-08-20  Martin Baulig  <martin@gnome.org>
14614
14615         * decl.cs (DeclSpace.FindMembers): Made this public.
14616
14617 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14618
14619         * delegate.cs: fixed build on windows.
14620         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14621
14622 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14623
14624         * ecore.cs (StandardConversionExists): Return a false
14625         if we are trying to convert the void type to anything else
14626         since that is not allowed.
14627
14628         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14629         we flag error 70 in the event an event is trying to be accessed
14630         directly from outside the declaring type.
14631
14632 2002-08-20  Martin Baulig  <martin@gnome.org>
14633
14634         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14635         MemberCache from typemanager.cs to decl.cs.
14636
14637 2002-08-19  Martin Baulig  <martin@gnome.org>
14638
14639         * class.cs (TypeContainer): Implement IMemberContainer.
14640         (TypeContainer.DefineMembers): Create the MemberCache.
14641         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14642         return public members if BindingFlags.Public was given, check
14643         whether members are static.
14644
14645 2002-08-16  Martin Baulig  <martin@gnome.org>
14646
14647         * decl.cs (DeclSpace.Define): Splitted this in Define and
14648         DefineMembers.  DefineMembers is called first and initializes the
14649         MemberCache.
14650
14651         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14652         DefineMembers() on all our DeclSpaces.
14653
14654         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14655         but call DefineMembers() on all nested interfaces.  We call their
14656         Define() in our new Define() function.
14657
14658         * interface.cs (Interface): Implement IMemberContainer.
14659         (Interface.Define): Moved all code except the attribute stuf to
14660         DefineMembers().
14661         (Interface.DefineMembers): Initialize the member cache.
14662
14663         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14664         need this anymore since we can use MemberCache.FindMembers directly.
14665
14666 2002-08-19  Martin Baulig  <martin@gnome.org>
14667
14668         * typemanager.cs (MemberCache): When creating the cache for an
14669         interface type, add all inherited members.
14670         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14671         to `out bool used_cache' and documented it.
14672         (TypeManager.MemberLookup): If we already used the cache in the first
14673         iteration, we don't need to do the interfaces check.
14674
14675 2002-08-19  Martin Baulig  <martin@gnome.org>
14676
14677         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14678         here from IMemberFinder and don't implement this interface anymore.
14679         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14680
14681         * typemanager.cs (IMemberFinder): This interface is now only used by
14682         classes which actually support the member cache.
14683         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14684         since we only put DeclSpaces into this Hashtable.
14685         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14686         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14687
14688 2002-08-16  Martin Baulig  <martin@gnome.org>
14689
14690         * typemanager.cs (ICachingMemberFinder): Removed.
14691         (IMemberFinder.MemberCache): New property.
14692         (TypeManager.FindMembers): Merged this with RealFindMembers().
14693         This function will never be called from TypeManager.MemberLookup()
14694         so we can't use the cache here, just the IMemberFinder.
14695         (TypeManager.MemberLookup_FindMembers): Check whether the
14696         IMemberFinder has a MemberCache and call the cache's FindMembers
14697         function.
14698         (MemberCache): Rewrote larger parts of this yet another time and
14699         cleaned it up a bit.
14700
14701 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14702
14703         * driver.cs (LoadArgs): Support quoting.
14704
14705         (Usage): Show the CSC-like command line arguments.
14706
14707         Improved a few error messages.
14708
14709 2002-08-15  Martin Baulig  <martin@gnome.org>
14710
14711         * typemanager.cs (IMemberContainer.Type): New property.
14712         (IMemberContainer.IsInterface): New property.
14713
14714         The following changes are conditional to BROKEN_RUNTIME, which is
14715         defined at the top of the file.
14716
14717         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14718         class'es members, but add all members from TypeHandle.ObjectType
14719         if we're an interface.
14720         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14721         is the current type.
14722         (MemberCache.CacheEntry.Container): Removed this field.
14723         (TypeHandle.GetMembers): Include inherited members.
14724
14725 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14726
14727         * typemanager.cs: fixed compilation and added a comment on a field that
14728         is never used.
14729
14730 2002-08-15  Martin Baulig  <martin@gnome.org>
14731
14732         * class.cs (ConstructorInitializer.Resolve): In the
14733         Expression.MemberLookup call, use the queried_type as
14734         invocation_type.
14735
14736         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14737         declared' attribute, it's always true.
14738         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14739         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14740         temporary wrapper for FindMembers which tells MemberLookup whether
14741         members from the base classes are included in the return value.
14742         This will go away soon.
14743         (TypeManager.MemberLookup): Use this temporary hack here; once the
14744         new MemberCache is completed, we don't need to do the DeclaredOnly
14745         looping here anymore since the MemberCache will take care of this.
14746         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14747         (MemberCache): When creating the MemberCache for a class, get
14748         members from the current class and all its base classes.
14749         (MemberCache.CacheEntry.Container): New field.  This is a
14750         temporary hack until the Mono runtime is fixed to distinguish
14751         between ReflectedType and DeclaringType.  It allows us to use MCS
14752         with both the MS runtime and the unfixed Mono runtime without
14753         problems and without accecting performance.
14754         (MemberCache.SearchMembers): The DeclaredOnly looping from
14755         TypeManager.MemberLookup is now done here.      
14756
14757 2002-08-14  Martin Baulig  <martin@gnome.org>
14758
14759         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14760         Type.GetFields on dynamic types but get the fields from the
14761         corresponding TypeContainer.
14762         (MyStructInfo.GetStructInfo): Added check for enum types.
14763
14764         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14765         (MemberList.SyncRoot): Implemented.
14766         (TypeManager.FilterWithClosure): No need to check permissions if
14767         closure_start_type == closure_invocation_type, don't crash if
14768         closure_invocation_type is null.
14769
14770 2002-08-13  Martin Baulig  <martin@gnome.org>
14771
14772         Rewrote TypeContainer.FindMembers to use a member cache.  This
14773         gives us a speed increase of about 35% for the self-hosting MCS
14774         build and of about 15-20% for the class libs (both on GNU/Linux).
14775
14776         * report.cs (Timer): New class to get enhanced profiling.  This
14777         whole class is "TIMER" conditional since it remarkably slows down
14778         compilation speed.
14779
14780         * class.cs (MemberList): New class.  This is an IList wrapper
14781         which we're now using instead of passing MemberInfo[]'s around to
14782         avoid copying this array unnecessarily.
14783         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14784         (ICachingMemberFinder, IMemberContainer): New interface.
14785         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14786         has already been checked, otherwise use it for the name comparision.
14787         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14788         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14789         if possible.  Returns a MemberList, not a MemberInfo [].
14790         (TypeHandle): New class, implements IMemberContainer.  We create
14791         one instance of this class per type, it contains a MemberCache
14792         which is used to do the member lookups.
14793         (MemberCache): New class.  Each instance of this class contains
14794         all members of a type and a name-based hash table.
14795         (MemberCache.FindMembers): This is our new member lookup
14796         function.  First, it looks up all members of the requested name in
14797         the hash table.  Then, it walks this list and sorts out all
14798         applicable members and returns them.
14799
14800 2002-08-13  Martin Baulig  <martin@gnome.org>
14801
14802         In addition to a nice code cleanup, this gives us a performance
14803         increase of about 1.4% on GNU/Linux - not much, but it's already
14804         half a second for the self-hosting MCS compilation.
14805
14806         * typemanager.cs (IMemberFinder): New interface.  It is used by
14807         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14808         Enum, Delegate or Interface.
14809         (TypeManager.finder_to_member_finder): New PtrHashtable.
14810         (TypeManager.finder_to_container): Removed.
14811         (TypeManager.finder_to_delegate): Removed.
14812         (TypeManager.finder_to_interface): Removed.
14813         (TypeManager.finder_to_enum): Removed.
14814
14815         * interface.cs (Interface): Implement IMemberFinder.
14816
14817         * delegate.cs (Delegate): Implement IMemberFinder.
14818
14819         * enum.cs (Enum): Implement IMemberFinder.
14820
14821         * class.cs (TypeContainer): Implement IMemberFinder.
14822
14823 2002-08-12  Martin Baulig  <martin@gnome.org>
14824
14825         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14826
14827 2002-08-12  Martin Baulig  <martin@gnome.org>
14828
14829         * ecore.cs (ITypeExpression): New interface for expressions which
14830         resolve to a type.
14831         (TypeExpression): Renamed to TypeLookupExpression.
14832         (Expression.DoResolve): If we're doing a types-only lookup, the
14833         expression must implement the ITypeExpression interface and we
14834         call DoResolveType() on it.
14835         (SimpleName): Implement the new ITypeExpression interface.
14836         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14837         hack, the situation that we're only looking up types can't happen
14838         anymore when this method is called.  Moved the type lookup code to
14839         DoResolveType() and call it.
14840         (SimpleName.DoResolveType): This ITypeExpression interface method
14841         is now doing the types-only lookup.
14842         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14843         (ResolveFlags): Added MaskExprClass.
14844
14845         * expression.cs (MemberAccess): Implement the ITypeExpression
14846         interface.
14847         (MemberAccess.DoResolve): Added support for a types-only lookup
14848         when we're called via ITypeExpression.DoResolveType().
14849         (ComposedCast): Implement the ITypeExpression interface.
14850
14851         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14852         Expression.Resolve() with ResolveFlags.Type instead.
14853
14854 2002-08-12  Martin Baulig  <martin@gnome.org>
14855
14856         * interface.cs (Interface.Define): Apply attributes.
14857
14858         * attribute.cs (Attribute.ApplyAttributes): Added support for
14859         interface attributes.
14860
14861 2002-08-11  Martin Baulig  <martin@gnome.org>
14862
14863         * statement.cs (Block.Emit): Only check the "this" variable if we
14864         do not always throw an exception.
14865
14866         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14867         whether the property has a set accessor.
14868
14869 2002-08-11  Martin Baulig  <martin@gnome.org>
14870
14871         Added control flow analysis support for structs.
14872
14873         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14874         with control flow analysis turned off.
14875         (IVariable): New interface.
14876         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14877         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14878         (FieldExpr.DoResolve): Resolve the instance expression with flow
14879         analysis turned off and do the definite assignment check after the
14880         resolving when we know what the expression will resolve to.
14881
14882         * expression.cs (LocalVariableReference, ParameterReference):
14883         Implement the new IVariable interface, only call the flow analysis
14884         code if ec.DoFlowAnalysis is true.
14885         (This): Added constructor which takes a Block argument.  Implement
14886         the new IVariable interface.
14887         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14888         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14889         This does the definite assignment checks for struct members.
14890
14891         * class.cs (Constructor.Emit): If this is a non-static `struct'
14892         constructor which doesn't have any initializer, call
14893         Block.AddThisVariable() to tell the flow analysis code that all
14894         struct elements must be initialized before control returns from
14895         the constructor.
14896
14897         * statement.cs (MyStructInfo): New public class.
14898         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14899         argument to this indexer.  If non-zero, check an individual struct
14900         member, not the whole struct.
14901         (FlowBranching.CheckOutParameters): Check struct members.
14902         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14903         overloaded versions of these methods which take an additional
14904         `int field_idx' argument to check struct members.
14905         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14906         overloaded versions of these methods which take an additional
14907         `string field_name' argument to check struct member.s
14908         (VariableInfo): Implement the IVariable interface.
14909         (VariableInfo.StructInfo): New public property.  Returns the
14910         MyStructInfo instance of the variable if it's a struct or null.
14911         (Block.AddThisVariable): New public method.  This is called from
14912         Constructor.Emit() for non-static `struct' constructor which do
14913         not have any initializer.  It creates a special variable for the
14914         "this" instance variable which will be checked by the flow
14915         analysis code to ensure that all of the struct's fields are
14916         initialized before control returns from the constructor.
14917         (UsageVector): Added support for struct members.  If a
14918         variable/parameter is a struct with N members, we reserve a slot
14919         in the usage vector for each member.  A struct is considered fully
14920         initialized if either the struct itself (slot 0) or all its
14921         members are initialized.
14922
14923 2002-08-08  Martin Baulig  <martin@gnome.org>
14924
14925         * driver.cs (Driver.MainDriver): Only report an error CS5001
14926         if there were no compilation errors.
14927
14928         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14929         `UnsafeContext' property to determine whether the parent is in
14930         unsafe context rather than checking the parent's ModFlags:
14931         classes nested in an unsafe class are unsafe as well.
14932
14933 2002-08-08  Martin Baulig  <martin@gnome.org>
14934
14935         * statement.cs (UsageVector.MergeChildren): Distinguish between
14936         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14937         we return.  Added test17() and test18() to test-154.cs.
14938
14939 2002-08-08  Martin Baulig  <martin@gnome.org>
14940
14941         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14942         Family access, make sure the invoking type isn't a subclass of the
14943         queried type (that'd be a CS1540).
14944
14945         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14946         this method which takes an additional `Type invocation_type'.
14947
14948         * expression.cs (BaseAccess.DoResolve): Use the base type as
14949         invocation and query type.
14950         (MemberAccess.DoResolve): If the lookup failed and we're about to
14951         report a CS0122, try a lookup with the ec.ContainerType - if this
14952         succeeds, we must report a CS1540.
14953
14954 2002-08-08  Martin Baulig  <martin@gnome.org>
14955
14956         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14957         (MethodGroupExpr): Implement the IMemberExpr interface.
14958
14959         * expression (MemberAccess.ResolveMemberAccess): No need to have
14960         any special code for MethodGroupExprs anymore, they're now
14961         IMemberExprs.   
14962
14963 2002-08-08  Martin Baulig  <martin@gnome.org>
14964
14965         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14966         Family, FamANDAssem and FamORAssem permissions.
14967         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14968
14969 2002-08-08  Martin Baulig  <martin@gnome.org>
14970
14971         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14972         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14973         or loop block.
14974
14975 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14976
14977         * driver.cs: implemented /resource option to embed managed resources.
14978
14979 2002-08-07  Martin Baulig  <martin@gnome.org>
14980
14981         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14982         (FieldBase.HasFieldInitializer): New public property.
14983         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14984         returns the field initializer and makes sure it is only resolved once.
14985         (TypeContainer.EmitFieldInitializers): Call
14986         FieldBase.GetInitializerExpression to get the initializer, this ensures
14987         that it isn't resolved multiple times.
14988
14989         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14990         the resolving process (SimpleName/MemberLookup) that we're currently
14991         emitting a field initializer (which must not access any instance members,
14992         this is an error CS0236).
14993
14994         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14995         argument, if the `IsFieldInitializer' flag is set, we must report and
14996         error CS0236 and not an error CS0120.   
14997
14998 2002-08-07  Martin Baulig  <martin@gnome.org>
14999
15000         * ecore.cs (IMemberExpr): New public interface.
15001         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15002         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15003         if the expression is an IMemberExpr.
15004
15005         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15006         to be null, implicitly default to `this' if we're non-static in
15007         this case.  Simplified the code a lot by using the new IMemberExpr
15008         interface.  Also fixed bug #28176 here.
15009
15010 2002-08-06  Martin Baulig  <martin@gnome.org>
15011
15012         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15013         ParameterReferences during semantic analysis so that we can do a
15014         type-only search when resolving Cast, TypeOf and SizeOf.
15015         (block): Pass the `current_local_parameters' to the Block's
15016         constructor.
15017
15018         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15019         argument to the constructor.
15020         (ConstructorInitializer.Resolve): Create a temporary implicit
15021         block with the parameters.
15022
15023         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15024         references here if we aren't doing a type-only search.
15025
15026         * statement.cs (Block): Added constructor which takes a
15027         `Parameters parameters' argument.
15028         (Block.Parameters): New public property.
15029
15030         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15031         to `Parameters' and made it public readonly.
15032
15033 2002-08-06  Martin Baulig  <martin@gnome.org>
15034
15035         * ecore.cs (Expression.Warning): Made this public as well.
15036
15037         * report.cs (Report.Debug): Print the contents of collections.
15038
15039 2002-08-06  Martin Baulig  <martin@gnome.org>
15040
15041         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15042         used to tell Resolve() which kinds of expressions it may return.
15043         (Expression.Resolve): Added overloaded version of this method which
15044         takes a `ResolveFlags flags' argument.  This can be used to tell
15045         Resolve() which kinds of expressions it may return.  Reports a
15046         CS0118 on error.
15047         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15048         ResolveFlags.SimpleName.
15049         (Expression.Error118): Added overloaded version of this method which
15050         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15051         which kinds of expressions are allowed.
15052
15053         * expression.cs (Argument.ResolveMethodGroup): New public method.
15054         Resolves an argument, but allows a MethodGroup to be returned.
15055         This is used when invoking a delegate.
15056
15057         * TODO: Updated a bit.
15058
15059 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15060
15061         Fixed compilation with csc.
15062
15063         * ecore.cs: Expression.Error made public. Is this correct? Should
15064         Warning be made public too?
15065
15066         * expression.cs: use ea.Location instead of ea.loc.
15067         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15068
15069 2002-08-06  Martin Baulig  <martin@gnome.org>
15070
15071         * ecore.cs (Expression.loc): Moved the location here instead of
15072         duplicating it in all derived classes.
15073         (Expression.Location): New public property.
15074         (Expression.Error, Expression.Warning): Made them non-static and
15075         removed the location argument.
15076         (Expression.Warning): Added overloaded version which takes an
15077         `int level' argument.
15078         (Expression.Error118): Make this non-static and removed the
15079         expression and location arguments.
15080         (TypeExpr): Added location argument to the constructor.
15081
15082         * expression.cs (StaticCallExpr): Added location argument to
15083         the constructor.
15084         (Indirection, PointerArithmetic): Likewise.
15085         (CheckedExpr, UnCheckedExpr): Likewise.
15086         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15087         (StringPtr): Likewise.
15088
15089
15090 2002-08-05  Martin Baulig  <martin@gnome.org>
15091
15092         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15093
15094         * assign.cs (Assign.DoResolve): Check whether the source
15095         expression is a value or variable.
15096
15097         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15098         while resolving the corresponding blocks.
15099
15100         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15101         an error, don't silently return null.
15102
15103         * statement.cs (Block.AddVariable): Do the error reporting here
15104         and distinguish between CS0128 and CS0136.
15105         (Block.DoResolve): Report all unused labels (warning CS0164).
15106         (LabeledStatement): Pass the location to the constructor.
15107         (LabeledStatement.HasBeenReferenced): New property.
15108         (LabeledStatement.Resolve): Set it to true here.
15109
15110         * statement.cs (Return.Emit): Return success even after reporting
15111         a type mismatch error (CS0126 or CS0127), this is what csc does and
15112         it avoids confusing the users with any consecutive errors.
15113
15114 2002-08-05  Martin Baulig  <martin@gnome.org>
15115
15116         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15117
15118         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15119
15120         * expression.cs (MemberAccess.DoResolve): Silently return if an
15121         error has already been reported.
15122
15123         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15124         error has already been reported.
15125
15126 2002-08-05  Martin Baulig  <martin@gnome.org>
15127
15128         * statement.cs (UsageVector): Only initialize the `parameters'
15129         vector if we actually have any "out" parameters.
15130
15131 2002-08-05  Martin Baulig  <martin@gnome.org>
15132
15133         * expression.cs (Binary.ResolveOperator): When combining delegates,
15134         they must have the same type.
15135
15136 2002-08-05  Martin Baulig  <martin@gnome.org>
15137
15138         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15139         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15140         work with the ms runtime and we also don't need it: if we're a
15141         PropertyBuilder and not in the `indexer_arguments' hash, then we
15142         are a property and not an indexer.
15143
15144         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15145         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15146         since the latter one doesn't work with the ms runtime.
15147
15148 2002-08-03  Martin Baulig  <martin@gnome.org>
15149
15150         Fixed bugs #27998 and #22735.
15151
15152         * class.cs (Method.IsOperator): New public field.
15153         (Method.CheckBase): Report CS0111 if there's already a method
15154         with the same parameters in the current class.  Report CS0508 when
15155         attempting to change the return type of an inherited method.
15156         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15157         and it's not marked abstract or extern.
15158         (PropertyBase): New abstract base class for Property and Indexer.
15159         (PropertyBase.CheckBase): Moved here from Property and made it work
15160         for indexers.
15161         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15162         the same so we can reuse it there.
15163         (Property, Indexer): Derive from PropertyBase.
15164         (MethodSignature.inheritable_property_signature_filter): New delegate
15165         to find properties and indexers.
15166
15167         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15168         argument and improved error reporting.
15169
15170         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15171         EmptyReadOnlyParameters and made it a property.
15172
15173         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15174         version of this method which takes a `PropertyInfo indexer'.
15175         (TypeManager.RegisterIndexer): New method.
15176
15177         * class.cs: Added myself as author of this file :-)
15178
15179 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15180
15181         * class.cs: fixed compilation on windoze.
15182
15183 2002-08-03  Martin Baulig  <martin@gnome.org>
15184
15185         * interface.cs (Interface.GetInterfaceBases): Check whether all
15186         base interfaces are at least as accessible than the current one.
15187
15188         * class.cs (TypeContainer.GetClassBases): Check whether base types
15189         are at least as accessible than the current type.
15190         (TypeContainer.AsAccessible): Implemented and made non-static.
15191         (MemberBase.CheckParameters): Report errors if the accessibility
15192         checks fail.
15193
15194         * delegate.cs (Delegate.Delegate): The default visibility is
15195         internal for top-level types and private for nested types.
15196         (Delegate.Define): Report errors if the accessibility checks fail.
15197
15198         * enum.cs (Enum.Enum): The default visibility is internal for
15199         top-level types and private for nested types.
15200         (Enum.DefineType): Compute the correct visibility.
15201
15202         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15203         function which takes a `bool is_toplevel' instead of a TypeContainer.
15204
15205         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15206         builtin type.
15207
15208 2002-08-02  Martin Baulig  <martin@gnome.org>
15209
15210         * expression.cs (LocalVariableReferenc): Added constructor which
15211         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15212         (LocalVariableReference.IsReadOnly): New property.
15213         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15214         variable is readonly, use our own readonly flag to do this; you can
15215         use the new constructor to get a writable reference to a read-only
15216         variable.
15217
15218         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15219         reference to the local variable.
15220
15221 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15222
15223         * rootcontext.cs (ResolveCore): Also include System.Exception
15224
15225         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15226         we reach an EmptyStatement.
15227
15228         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15229         is also fine.
15230
15231         * expression.cs (Binary.ResolveOperator): Check error result in
15232         two places.
15233
15234         use brtrue/brfalse directly and avoid compares to null.
15235
15236 2002-08-02  Martin Baulig  <martin@gnome.org>
15237
15238         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15239         Fixes bug #28407, added test-155.cs.
15240
15241 2002-08-01  Martin Baulig  <martin@gnome.org>
15242
15243         * class.cs (Event.EmitDefaultMethod): Make this work with static
15244         events.  Fixes #28311, added verify-3.cs.
15245
15246 2002-08-01  Martin Baulig  <martin@gnome.org>
15247
15248         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15249         `is_disposable' fields.
15250         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15251         `hm.is_disposable' if we're using the collection pattern.
15252         (Foreach.EmitCollectionForeach): Use the correct type for the
15253         enumerator's local variable, only emit the try/finally block if
15254         necessary (fixes #27713).
15255
15256 2002-08-01  Martin Baulig  <martin@gnome.org>
15257
15258         * ecore.cs (Expression.report118): Renamed to Error118 and made
15259         it public static.
15260
15261         * statement.cs (Throw.Resolve): Check whether the expression is of
15262         the correct type (CS0118) and whether the type derives from
15263         System.Exception (CS0155).
15264         (Catch.Resolve): New method.  Do the type lookup here and check
15265         whether it derives from System.Exception (CS0155).
15266         (Catch.CatchType, Catch.IsGeneral): New public properties.
15267
15268         * typemanager.cs (TypeManager.exception_type): Added.
15269
15270 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15271
15272         * driver.cs: Updated About function.
15273
15274 2002-07-31  Martin Baulig  <martin@gnome.org>
15275
15276         Implemented Control Flow Analysis.
15277
15278         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15279         (EmitContext.CurrentBranching): Added.
15280         (EmitContext.StartFlowBranching): Added.
15281         (EmitContext.EndFlowBranching): Added.
15282         (EmitContext.KillFlowBranching): Added.
15283         (EmitContext.IsVariableAssigned): Added.
15284         (EmitContext.SetVariableAssigned): Added.
15285         (EmitContext.IsParameterAssigned): Added.
15286         (EmitContext.SetParameterAssigned): Added.
15287         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15288         Added control flow analysis stuff here.
15289
15290         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15291         resolve the expression as lvalue.
15292         (LocalVariableReference.DoResolve): Check whether the variable has
15293         already been assigned.
15294         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15295         the parameter as assigned here.
15296         (ParameterReference.DoResolve): Check whether the parameter has already
15297         been assigned.
15298         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15299         expression as lvalue.
15300
15301         * statement.cs (FlowBranching): New class for the flow analysis code.
15302         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15303         (LabeledStatement.IsDefined): New public property.
15304         (LabeledStatement.AddUsageVector): New public method to tell flow
15305         analyis that the label may be reached via a forward jump.
15306         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15307         flow analysis.
15308         (VariableInfo.Number): New public field.  This is used by flow analysis
15309         to number all locals of a block.
15310         (Block.CountVariables): New public property.  This is the number of
15311         local variables in this block (including the locals from all parent
15312         blocks).
15313         (Block.EmitMeta): Number all the variables.
15314
15315         * statement.cs: Added flow analysis support to all classes.
15316
15317 2002-07-31  Martin Baulig  <martin@gnome.org>
15318
15319         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15320         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15321         then use this argument.
15322
15323         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15324
15325         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15326         use this to specify /define options.
15327
15328 2002-07-29  Martin Baulig  <martin@gnome.org>
15329
15330         * statement.cs (Fixed): Moved all code that does variable lookups
15331         and resolvings from Emit to Resolve.
15332
15333         * statement.cs (For): Moved all code that does variable lookups
15334         and resolvings from Emit to Resolve.
15335
15336         * statement.cs (Using): Moved all code that does variable lookups
15337         and resolvings from Emit to Resolve.
15338
15339 2002-07-29  Martin Baulig  <martin@gnome.org>
15340
15341         * attribute.cs (Attribute.Resolve): Explicitly catch a
15342         System.NullReferenceException when creating the
15343         CustromAttributeBuilder and report a different warning message.
15344
15345 2002-07-29  Martin Baulig  <martin@gnome.org>
15346
15347         * support.cs (ParameterData.ParameterName): Added method to
15348         get the name of a parameter.
15349
15350         * typemanager.cs (TypeManager.IsValueType): New public method.
15351
15352 2002-07-29  Martin Baulig  <martin@gnome.org>
15353
15354         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15355         is a flag which specifies that it's either ref or out.
15356         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15357         the out parameter to `out Parameter.Modifier mod', also set the
15358         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15359
15360         * support.cs (InternalParameters.ParameterModifier): Distinguish
15361         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15362         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15363
15364         * expression.cs (Argument.GetParameterModifier): Distinguish
15365         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15366         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15367
15368 2002-07-29  Martin Baulig  <martin@gnome.org>
15369
15370         * expression.cs (ParameterReference.ParameterReference): Added
15371         `Location loc' argument to the constructor.
15372
15373         * cs-parser.jay: Pass location to ParameterReference.
15374
15375 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15376
15377         * statement.cs (Try): Initialize the location.
15378
15379         * cs-parser.jay: pass location to Try.
15380
15381         * expression.cs (Unary.Reduce): Change the prototype to return
15382         whether a constant fold could be performed or not.  The result is
15383         returned in an out parameters.  In the case of Indirection and
15384         AddressOf, we want to perform the full tests.
15385
15386 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15387
15388         * statement.cs (Statement.Emit): Flag dead code.
15389
15390 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15391
15392         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15393
15394 2002-07-27  Martin Baulig  <martin@gnome.org>
15395
15396         * class.cs (MethodData.Define): Put back call to
15397         TypeManager.AddMethod(), accidentally commented this out.
15398
15399         * report.cs (Debug): New public method to print debugging information,
15400         this is `[Conditional ("DEBUG")]'.
15401
15402 2002-07-26  Martin Baulig  <martin@gnome.org>
15403
15404         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15405         (switch_statement): Push the current_block to the switch_stack and
15406         pop it again when we're done with the switch.
15407         (switch_section): The new block is a child of the current_block.
15408         Fixes bug #24007, added test-152.cs.
15409
15410 2002-07-27  Martin Baulig  <martin@gnome.org>
15411
15412         * expression.cs (Invocation.EmitArguments): When calling a varargs
15413         function with only its fixed arguments, we need to pass an empty
15414         array.
15415
15416 2002-07-27  Martin Baulig  <martin@gnome.org>
15417
15418         Mono 0.13 has been released.
15419
15420 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15421
15422         * driver.cs: Rename --resource to --linkres, because that is what
15423         we do currently, we dont support --resource yet.
15424
15425         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15426
15427 2002-07-25  Martin Baulig  <martin@gnome.org>
15428
15429         * class.cs (MethodData): New public class.  This is a `method builder'
15430         class for a method or one accessor of a Property/Indexer/Event.
15431         (MethodData.GetMethodFlags): Moved here from MemberBase.
15432         (MethodData.ApplyAttributes): Likewise.
15433         (MethodData.ApplyObsoleteAttribute): Likewise.
15434         (MethodData.ApplyConditionalAttribute): Likewise.
15435         (MethodData.ApplyDllImportAttribute): Likewise.
15436         (MethodData.CheckAbstractAndExternal): Likewise.
15437         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15438         (MethodData.Emit): Formerly known as Method.Emit().
15439         (MemberBase): Moved everything which was specific to a single
15440         accessor/method to MethodData.
15441         (Method): Create a new MethodData and call Define() and Emit() on it.
15442         (Property, Indexer, Event): Create a new MethodData objects for each
15443         accessor and call Define() and Emit() on them.
15444
15445 2002-07-25  Martin Baulig  <martin@gnome.org>
15446
15447         Made MethodCore derive from MemberBase to reuse the code from there.
15448         MemberBase now also checks for attributes.
15449
15450         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15451         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15452         as virtual.
15453         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15454         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15455         (MemberBase.ApplyAttributes): New virtual method; applies the
15456         attributes to a method or accessor.
15457         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15458         (MemberBase.ApplyConditionalAttribute): Likewise.
15459         (MemberBase.ApplyDllImportAttribute): Likewise.
15460         (MemberBase.CheckAbstractAndExternal): Likewise.
15461         (MethodCore.ParameterTypes): This is now a property instead of a
15462         method, it's initialized from DoDefineParameters().
15463         (MethodCore.ParameterInfo): Removed the set accessor.
15464         (MethodCore.DoDefineParameters): New protected virtual method to
15465         initialize ParameterTypes and ParameterInfo.
15466         (Method.GetReturnType): We can now simply return the MemberType.
15467         (Method.GetMethodFlags): Override the MemberBase version and add
15468         the conditional flags.
15469         (Method.CheckBase): Moved some code from Define() here, call
15470         DoDefineParameters() here.
15471         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15472         here to avoid some larger code duplication.
15473         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15474         ensure that abstract and external accessors don't declare a body.
15475
15476         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15477         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15478         lookup in the attribute's parent classes, so we need to abort as soon
15479         as we found the first match.
15480         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15481         the attribute has no arguments.
15482
15483         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15484         of a Method.
15485
15486 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15487
15488         * cs-parser.jay: reverted previous patch.
15489
15490 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15491
15492         * cs-parser.jay: fixed bug #22119.
15493
15494 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15495
15496         * attribute.cs: fixed compilation. The error was:
15497         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15498         be assigned to before control leaves the current method."
15499         [FIXME:  Filed as bug #28186: MCS must report this error.]
15500
15501 2002-07-25  Martin Baulig  <martin@gnome.org>
15502
15503         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15504         method to pull the condition name ouf of a Conditional attribute.
15505         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15506         the obsolete message and error flag out of an Obsolete attribute.
15507
15508         * class.cs (Method.GetMethodFlags): New public method to get the
15509         TypeManager.MethodFlags for this method.
15510         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15511         private methods.
15512         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15513         if we're overriding a virtual function, set the new private variable
15514         `parent_method'; call the new TypeManager.AddMethod().
15515
15516         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15517         the MethodBuilder and the Method in a PtrHashtable.
15518         (TypeManager.builder_to_method): Added for this purpose.
15519         (TypeManager.MethodFlags): Added IsObsoleteError.
15520         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15521         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15522         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15523         the message from the attribute.
15524
15525 2002-07-24  Martin Baulig  <martin@gnome.org>
15526
15527         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15528         preprocessor directives, ensure that the argument to #define/#undef is
15529         exactly one identifier and that it's actually an identifier.
15530
15531         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15532         did not work ....
15533
15534 2002-07-24  Martin Baulig  <martin@gnome.org>
15535
15536         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15537         initialize it to TypeManager.object_type in the constructor.
15538         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15539         of the `hm.get_current' method if we're using the collection pattern.
15540         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15541         for the explicit conversion to make it work when we're using the collection
15542         pattern and the `Current' property has a different return type than `object'.
15543         Fixes #27713.
15544
15545 2002-07-24  Martin Baulig  <martin@gnome.org>
15546
15547         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15548         does not match, but don't report any errors.  This method is called in
15549         order for all methods in a MethodGroupExpr until a matching method is
15550         found, so we don't want to bail out if the first method doesn't match.
15551         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15552         matches, report the 123.  Fixes #28070.
15553
15554 2002-07-24  Martin Baulig  <martin@gnome.org>
15555
15556         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15557         TypeManager.TypeToCoreType() to the top of the method so the
15558         following equality checks will work.  Fixes #28107.
15559
15560 2002-07-24  Martin Baulig  <martin@gnome.org>
15561
15562         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15563         operand is of type uint, and the other operand is of type sbyte,
15564         short or int, the operands are converted to type long." -
15565         Actually do what this comment already told us.  Fixes bug #28106,
15566         added test-150.cs.
15567
15568 2002-07-24  Martin Baulig  <martin@gnome.org>
15569
15570         * class.cs (MethodBase): New abstract class.  This is now a base
15571         class for Property, Indexer and Event to avoid some code duplication
15572         in their Define() and DefineMethods() methods.
15573         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15574         generic methods for Define() and DefineMethods().
15575         (FieldBase): Derive from MemberBase, not MemberCore.
15576         (Property): Derive from MemberBase, not MemberCore.
15577         (Property.DefineMethod): Moved all the code from this method to the
15578         new MethodBase.DefineAccessor(), just call it with appropriate
15579         argumetnts.
15580         (Property.Define): Call the new Property.DoDefine(), this does some
15581         sanity checks and we don't need to duplicate the code everywhere.
15582         (Event): Derive from MemberBase, not MemberCore.
15583         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15584         accessors, this will also make them work with interface events.
15585         (Indexer): Derive from MemberBase, not MemberCore.
15586         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15587         (Indexer.Define): Use the new MethodBase functions.
15588
15589         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15590         argument to the constructor.
15591         (Interface.FindMembers): Added support for interface events.
15592         (Interface.PopluateEvent): Implemented.
15593
15594         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15595
15596 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15599         but this is required to check for a method name being the same as
15600         the containing class.  
15601
15602         Handle this now.
15603
15604 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15605
15606         * interface.cs: initialize variable.
15607
15608 2002-07-23  Martin Baulig  <martin@gnome.org>
15609
15610         Implemented the IndexerName attribute in interfaces.
15611
15612         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15613         name if this is an explicit interface implementation.
15614         (Indexer.InterfaceIndexerName): New public variable.  If we're
15615         implementing an interface indexer, this is the IndexerName in that
15616         interface.  Otherwise, it's the IndexerName.
15617         (Indexer.DefineMethod): If we're implementing interface indexer,
15618         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15619         and Pending.ImplementIndexer methods.
15620         (Indexer.Define): Also define the PropertyBuilder if we're
15621         implementing an interface indexer and this is neither an explicit
15622         interface implementation nor do the IndexerName match the one in
15623         the interface.
15624
15625         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15626         If a method is defined here, then we always need to create a proxy
15627         for it.  This is used when implementing interface indexers.
15628         (Pending.IsInterfaceIndexer): New public method.
15629         (Pending.ImplementIndexer): New public method.
15630         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15631         This is used when implementing interface indexers to define a proxy
15632         if necessary.
15633         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15634         define a proxy if necessary.
15635
15636         * interface.cs (Interface.IndexerName): New public variable.
15637         (Interface.PopulateIndexer): Set the IndexerName.
15638         (Interface.DefineIndexers): New private method.  Populate all the
15639         indexers and make sure their IndexerNames match.
15640
15641         * typemanager.cs (IndexerPropertyName): Added support for interface
15642         indexers.
15643
15644 2002-07-22  Martin Baulig  <martin@gnome.org>
15645
15646         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15647         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15648         ret if HasReturnLabel.
15649         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15650         variables.
15651
15652         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15653         and set the ec.LoopBeginTryCatchLevel.
15654         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15655         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15656         the current ec.TryCatchLevel, the branch goes out of an exception
15657         block.  In this case, we need to use Leave and not Br.
15658
15659 2002-07-22  Martin Baulig  <martin@gnome.org>
15660
15661         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15662         block unless the block does not always return or it is contained in
15663         another try { ... } catch { ... } block.  Fixes bug #26506.
15664         Added verify-1.cs to the test suite.
15665
15666 2002-07-22  Martin Baulig  <martin@gnome.org>
15667
15668         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15669         then we do not always return.  Fixes bug #24985.
15670
15671 2002-07-22  Martin Baulig  <martin@gnome.org>
15672
15673         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15674         lookup on a per-class level; ie. walk up the class hierarchy until we
15675         found at least one applicable method, then choose the best among them.
15676         Fixes bug #24463 and test-29.cs.
15677
15678 2002-07-22  Martin Baulig  <martin@gnome.org>
15679
15680         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15681         return types of the methods.  The return type is not part of the
15682         signature and we must not check it to make the `new' modifier work.
15683         Fixes bug #27999, also added test-147.cs.
15684         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15685
15686         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15687         on the method's return type.
15688
15689 2002-07-21  Martin Baulig  <martin@gnome.org>
15690
15691         * assign.cs: Make this work if the rightmost source is a constant and
15692         we need to do an implicit type conversion.  Also adding a few more tests
15693         to test-38.cs which should have caught this.
15694
15695         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15696         target in the makefile for this.  The makefile.gnu is primarily intended
15697         for end-users who don't want to debug the compiler.
15698
15699 2002-07-21  Martin Baulig  <martin@gnome.org>
15700
15701         * assign.cs: Improved the Assign class so it can now handle embedded
15702         assignments (X = Y = Z = something).  As a side-effect this'll now also
15703         consume less local variables.  test-38.cs now passes with MCS, added
15704         a few new test cases to that test.
15705
15706 2002-07-20  Martin Baulig  <martin@gnome.org>
15707
15708         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15709         instructions.  Fixes bug #27977, also added test-146.cs.
15710
15711 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15712
15713         * cs-tokenizer.cs: fixed getHex ().
15714
15715 2002-07-19  Martin Baulig  <martin@gnome.org>
15716
15717         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15718         not Type.GetType() to lookup the array type.  This is needed when
15719         we're constructing an array of a user-defined type.
15720         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15721         single-dimensional arrays, but also for single-dimensial arrays of
15722         type decimal.
15723
15724 2002-07-19  Martin Baulig  <martin@gnome.org>
15725
15726         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15727         this function is called, it's not allowed to share LocalBuilders
15728         among ILGenerators.
15729
15730 2002-07-19  Martin Baulig  <martin@gnome.org>
15731
15732         * expression.cs (Argument.Resolve): Report an error 118 when trying
15733         to pass a type as argument.
15734
15735 2002-07-18  Martin Baulig  <martin@gnome.org>
15736
15737         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15738         Conv_R_Un for the signed `long' type.
15739
15740 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15743         `expr' for the temporary result, as that will fail if we do
15744         multiple resolves on the same expression.
15745
15746 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15749         ec.TypeContainer for looking up aliases. 
15750
15751         * class.cs (TypeContainer): Remove LookupAlias from here.
15752
15753         * decl.cs (DeclSpace); Move here.
15754
15755 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * class.cs (FindMembers): Only call filter if the constructor
15758         bulider is not null.
15759
15760         Also handle delegates in `NestedTypes' now.  Now we will perform
15761         type lookups using the standard resolution process.  This also
15762         fixes a bug.
15763
15764         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15765         This uses Expressions (the limited kind that can be parsed by the
15766         tree) instead of strings.
15767
15768         * expression.cs (ComposedCast.ToString): Implement, used to flag
15769         errors since now we have to render expressions.
15770
15771         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15772         FormArrayType. 
15773
15774         * ecore.cs (SimpleName.ToString): ditto.
15775
15776         * cs-parser.jay: Instead of using strings to assemble types, use
15777         Expressions to assemble the type (using SimpleName, ComposedCast,
15778         MemberAccess).  This should fix the type lookups in declarations,
15779         because we were using a different code path for this.
15780
15781         * statement.cs (Block.Resolve): Continue processing statements
15782         even when there is an error.
15783
15784 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15785
15786         * class.cs (Event.Define): Also remove the `remove' method from
15787         the list of pending items.
15788
15789         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15790         generate more compact code. 
15791
15792 2002-07-17  Martin Baulig  <martin@gnome.org>
15793
15794         * const.cs (Const.LookupConstantValue): Add support for constant
15795         `unchecked' and `checked' expressions.
15796         Also adding test case test-140.cs for this.
15797
15798 2002-07-17  Martin Baulig  <martin@gnome.org>
15799
15800         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15801         check whether mi.ReturnType implements the IEnumerator interface; the
15802         `==' and the IsAssignableFrom() will fail in this situation.
15803
15804 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15805
15806         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15807         here too.
15808
15809 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15810
15811         * expression.cs: fixed bug #27811.
15812
15813 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15814
15815         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15816         Molaro: when we are a ref, the value already contains a pointer
15817         value, do not take the address of it.
15818
15819 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15820         * removed mb-parser.jay and mb-tokenizer.cs
15821
15822 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15823
15824         * expression.cs: check against the building corlib void type.
15825
15826 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15827
15828         * ecore.cs: fix for valuetype static readonly fields: when 
15829         initializing them, we need their address, not the address of a copy.
15830
15831 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15832
15833         * typemanager.cs: register also enum_type in corlib.
15834
15835 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15836
15837         * class.cs: allow calling this (but not base) initializers in structs.
15838
15839 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15840
15841         * ecore.cs: make sure we compare against the building base types
15842         in GetTypeSize ().
15843
15844 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15845
15846         * typemanager.cs: fix TypeToCoreType() to handle void and object
15847         (corlib gets no more typerefs after this change).
15848
15849 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15850
15851         * expression.cs (ArrayCreation.EmitArrayArguments): use
15852         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15853
15854         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15855         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15856         array indexes, the runtime actually forbids them.
15857
15858         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15859         for array arguments here.
15860
15861         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15862         instead of the default for ValueTypes.
15863
15864         (New.DoEmit): Use IsValueType instead of
15865         IsSubclassOf (value_type)
15866         (New.DoResolve): ditto.
15867         (Invocation.EmitCall): ditto.
15868
15869         * assign.cs (Assign): ditto.
15870
15871         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15872         Statements *are* currently doing part of their resolution during
15873         Emit.  
15874
15875         Expressions do always resolve during resolve, but statements are
15876         only required to propagate resolution to their children.
15877
15878 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15879
15880         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15881
15882         (LoadAssembly): Do not add the dll if it is already specified
15883
15884         (MainDriver): Add the System directory to the link path at the end,
15885         after all the other -L arguments. 
15886
15887         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15888         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15889         ldelem.u1) and using the opposite for sbytes.
15890
15891         This fixes Digger, and we can finally run it.
15892
15893         * driver.cs (UnixParseOption): Move the option parsing here.  
15894         (CSCParseOption): Implement CSC-like parsing of options.
15895
15896         We now support both modes of operation, the old Unix way, and the
15897         new CSC-like way.  This should help those who wanted to make cross
15898         platform makefiles.
15899
15900         The only thing broken is that /r:, /reference: and /lib: are not
15901         implemented, because I want to make those have the same semantics
15902         as the CSC compiler has, and kill once and for all the confussion
15903         around this.   Will be doing this tomorrow.
15904
15905         * statement.cs (Unsafe.Resolve): The state is checked during
15906         resolve, not emit, so we have to set the flags for IsUnsfe here.
15907
15908 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15911         not catch the Error_ObjectRefRequired in SimpleName (as it is
15912         possible to have a class/instance variable name that later gets
15913         deambiguated), we have to check this here.      
15914
15915 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15916
15917         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15918         make static and put into Expression.
15919
15920         (Event.Define): Register the private field of the event with the 
15921         TypeManager so that GetFieldFromEvent can get at it.
15922
15923         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15924         keep track of the private field associated with an event which
15925         has no accessors.
15926
15927         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15928         private field.
15929
15930         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15931
15932 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15933
15934         * expression.cs (Binary.EmitBranchable): this routine emits the
15935         Binary expression in a branchable context.  This basically means:
15936         we need to branch somewhere, not just get the value on the stack.
15937
15938         This works together with Statement.EmitBoolExpression.
15939
15940         * statement.cs (Statement.EmitBoolExpression): Use
15941         EmitBranchable. 
15942
15943 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * statement.cs (For): Reduce the number of jumps in loops.
15946
15947         (For): Implement loop inversion for the For statement.
15948
15949         (Break): We can be breaking out of a Try/Catch controlled section
15950         (foreach might have an implicit try/catch clause), so we need to
15951         use Leave instead of Br.
15952
15953         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15954         now).  If the instace expression supports IMemoryLocation, we use
15955         the AddressOf method from the IMemoryLocation to extract the
15956         address instead of emitting the instance.
15957
15958         This showed up with `This', as we were emitting the instance
15959         always (Emit) instead of the Address of This.  Particularly
15960         interesting when This is a value type, as we dont want the Emit
15961         effect (which was to load the object).
15962
15963 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15966
15967         * statement.cs (Checked): Set the CheckedState during the resolve
15968         process too, as the ConvCast operations track the checked state on
15969         the resolve process, and not emit.
15970
15971         * cs-parser.jay (namespace_member_declaration): Flag that we have
15972         found a declaration when we do.  This is used to flag error 1529
15973
15974         * driver.cs: Report ok when we display the help only.
15975
15976 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15977
15978         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15979
15980 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15981
15982         * cs-tokenizer.cs (define): We also have to track locally the
15983         defines.  AllDefines is just used for the Conditional Attribute,
15984         but we also need the local defines for the current source code. 
15985
15986 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * statement.cs (While, For, Do): These loops can exit through a
15989         Break statement, use this information to tell whether the
15990         statement is the last piece of code.
15991
15992         (Break): Flag that we break.
15993
15994         * codegen.cs (EmitContexts): New `Breaks' state variable.
15995
15996 2002-07-03  Martin Baulig  <martin@gnome.org>
15997
15998         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15999         modifiers in method declarations in structs.  Otherwise, you won't
16000         be able to override things like Object.Equals().
16001
16002 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * class.cs (Method, Property, Indexer): Do not allow the public
16005         modifier to be used in explicit interface implementations.
16006
16007         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16008         override modifiers in method declarations in structs
16009
16010 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16011
16012         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16013         integer or real overflow, report an error
16014
16015 2002-07-02  Martin Baulig  <martin@gnome.org>
16016
16017         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16018         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16019         to tell the runtime about our newly created System.Object and
16020         System.ValueType types.
16021
16022 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16025         struct instead of Ldarg/Starg.
16026
16027 2002-07-02  Martin Baulig  <martin@gnome.org>
16028
16029         * expression.cs (Indirection.Indirection): Call
16030         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16031
16032 2002-07-02  Martin Baulig  <martin@gnome.org>
16033
16034         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16035         ValueType, call TypeManager.TypeToCoreType() on it.
16036         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16037         the OpCodes.Newarr argument.
16038
16039 2002-07-02  Martin Baulig  <martin@gnome.org>
16040
16041         * expression.cs (Invocation.EmitCall): When compiling corlib,
16042         replace all calls to the system's System.Array type to calls to
16043         the newly created one.
16044
16045         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16046         System.Array methods.
16047         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16048         from the system's System.Array type which must be replaced.
16049
16050 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16051
16052         * typemanager.cs: load unverifiable_code_ctor so we can build
16053         corlib using the correct type. Avoid using GetTypeCode() with
16054         TypeBuilders.
16055         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16056         TypeManager.object_type to allow building corlib.
16057
16058 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16059
16060         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16061
16062 2002-07-01  Martin Baulig  <martin@gnome.org>
16063
16064         * class.cs: Make the last change actually work, we need to check
16065         whether `ifaces != null' to avoid a crash.
16066
16067 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16068
16069         * class.cs: when we build structs without fields that implement
16070         interfaces, we need to add the interfaces separately, since there is
16071         no API to both set the size and add the interfaces at type creation
16072         time.
16073
16074 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16075
16076         * expression.cs: the dimension arguments to the array constructors
16077         need to be converted if they are a long.
16078
16079 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16080
16081         * class.cs: don't emit ldarg.0 if there is no parent constructor
16082         (fixes showstopper for corlib).
16083
16084 2002-06-29  Martin Baulig  <martin@gnome.org>
16085
16086         MCS now compiles corlib on GNU/Linux :-)
16087
16088         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16089         ie. check for MethodImplOptions.InternalCall.
16090
16091         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16092         and TypeManager.attribute_type are null, so we must explicitly check
16093         whether parent is not null to find out whether it's an attribute type.
16094         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16095         and SetBuilder, not only if the property is neither abstract nor external.
16096         This is necessary to set the MethodImplOptions on the accessor methods.
16097         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16098         SetBuilder, see Property.Emit().
16099
16100         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16101         populate "System.Object", "System.ValueType" and "System.Attribute" since
16102         they've already been populated from BootCorlib_PopulateCoreTypes().
16103
16104 2002-06-29  Martin Baulig  <martin@gnome.org>
16105
16106         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16107         is the NullLiteral, we also need to make sure that target_type is not
16108         an enum type.   
16109
16110 2002-06-29  Martin Baulig  <martin@gnome.org>
16111
16112         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16113         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16114         before calling BootstrapCorlib_ResolveDelegate ().
16115
16116 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16117
16118         * statement.cs: fixed build-breaker. All tests passed ok.
16119
16120 2002-06-27  Martin Baulig  <martin@gnome.org>
16121
16122         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16123         for System.Decimal when compiling corlib.
16124
16125 2002-06-27  Martin Baulig  <martin@gnome.org>
16126
16127         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16128         switch blocks which contain nothing but a default clause.
16129
16130 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16131
16132        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16133
16134 2002-06-27  Martin Baulig  <martin@gnome.org>
16135
16136         * ecore.cs (PropertyExpr.PropertyExpr): Call
16137         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16138
16139         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16140         is already a TypeBuilder.
16141
16142 2002-06-27  Martin Baulig  <martin@gnome.org>
16143
16144         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16145         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16146         the "from an array-type to System.Array" case.  This makes it work
16147         when compiling corlib.
16148
16149 2002-06-27  Martin Baulig  <martin@gnome.org>
16150
16151         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16152         non-static PropertyExpr, set its InstanceExpression.  This makes
16153         the `ICollection.Count' property work in System/Array.cs.
16154
16155 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16156
16157         * driver.cs: Made error handling more consistent.  Errors now
16158         tracked by Report class, so many methods which used to return int
16159         now return void.  Main() now prints success/failure and 
16160         errors/warnings message.
16161
16162         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16163         the magic number return values (123 and 124).  Now, if the
16164         expected error occurs, the compiler exits with success (exit value
16165         0).  If the compilation completes without seeing that particular
16166         error, the compiler exits with failure (exit value 1).  The
16167         makefile in mcs/errors has been changed to handle the new behaviour.
16168
16169         * report.cs: Made 'expected error' number a property and renamed
16170         it from 'Probe' to 'ExpectedError'.
16171
16172         * genericparser.cs: Removed error handling support, since it is
16173         now all done by Report class.
16174
16175         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16176         class, so parse() no longer returns an int.
16177
16178         * namespace.cs: Use Report.Error instead of GenericParser.error
16179
16180 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16183         TypeContainer.AddOperator): At the front of the list put the
16184         explicit implementations, so they get resolved/defined first. 
16185
16186 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16187
16188         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16189         interface type is implemented by this TypeContainer.  Used during
16190         explicit interface implementation.
16191
16192         (Property.Define, Indexer.Define, Method.Define): Validate that
16193         the given interface in the explicit implementation is one of the
16194         base classes for the containing type.
16195
16196         Also if we are explicitly implementing an interface, but there is
16197         no match in the pending implementation table, report an error.
16198
16199         (Property.Define): Only define the property if we are
16200         not explicitly implementing a property from an interface.  Use the
16201         correct name also for those properties (the same CSC uses,
16202         although that is really not needed).
16203
16204         (Property.Emit): Do not emit attributes for explicitly implemented
16205         properties, as there is no TypeBuilder.
16206
16207         (Indexer.Emit): ditto.
16208
16209         Hiding then means that we do not really *implement* a pending
16210         implementation, which makes code fail.
16211
16212 2002-06-22  Martin Baulig  <martin@gnome.org>
16213
16214         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16215         the return value of Object.GetType().  [FIXME: we need to do this whenever
16216         we get a type back from the reflection library].
16217
16218 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16219
16220         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16221
16222 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16223
16224         * attribute.cs: Return null if we can not look up the type.
16225
16226         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16227         the interface types found.
16228
16229         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16230         interface types found.
16231
16232         * typemanager.cs (GetInterfaces): Make this routine returns alll
16233         the interfaces and work around the lame differences between
16234         System.Type and System.Reflection.Emit.TypeBuilder in the results
16235         result for GetInterfaces.
16236
16237         (ExpandInterfaces): Given an array of interface types, expand and
16238         eliminate repeated ocurrences of an interface.  This expands in
16239         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16240         be IA, IB, IC.
16241
16242 2002-06-21  Martin Baulig  <martin@gnome.org>
16243
16244         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16245         on System.Enum.
16246
16247 2002-06-21  Martin Baulig  <martin@gnome.org>
16248
16249         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16250         and called with one of the core types, return the corresponding typebuilder for
16251         that type.
16252
16253         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16254         element type.
16255
16256 2002-06-21  Martin Baulig  <martin@gnome.org>
16257
16258         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16259         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16260         (Expression.ConvertReferenceExplicit): Likewise.
16261
16262         * expression.cs (ElementAccess.DoResolve): Likewise.
16263         (ElementAccess.DoResolveLValue): Likewise.
16264
16265 2002-06-10  Martin Baulig  <martin@gnome.org>
16266
16267         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16268         add the "value" parameter to the parameter list.
16269
16270         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16271         to our caller.
16272
16273 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16274
16275         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16276         the argument to an int, uint, long or ulong, per the spec.  Also
16277         catch negative constants in array creation.
16278
16279 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16280
16281         * class.cs: do not allow the same interface to appear twice in
16282         the definition list.
16283
16284 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16285
16286         * ecore.cs: don't use ldlen with System.Array.
16287
16288 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16289
16290         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16291
16292 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16293
16294         * modifiers.cs: produce correct field attributes for protected
16295         internal. Easy fix so miguel can work on ther harder stuff:-)
16296
16297 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16298
16299         * pending.cs: New file.  Move the code from class.cs here.
16300         Support clearning the pending flag for all methods (when not doing
16301         explicit interface implementation).
16302
16303 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16304
16305         * rootcontext.cs: added a couple more types needed to bootstrap.
16306
16307 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16308
16309         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16310         constructor in the type, instead of any constructor in the type
16311         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16312         a bug in the Mono runtime when applying the params attribute). 
16313
16314 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16315         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16316
16317 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16318
16319         * expression.cs (Unary.ResolveOperator): Use TypeManager
16320         to resolve the type.
16321
16322 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16323
16324         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16325         attached.
16326
16327         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16328         with each member too.
16329
16330         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16331         field builders too - this takes care of the enum member case.
16332
16333 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16334
16335         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16336         address-of operator on both value types and pointers.
16337
16338 2002-06-10  Martin Baulig  <martin@gnome.org>
16339
16340         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16341         PropertyBuilder to the `property_builders' list.
16342
16343         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16344         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16345         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16346         find any indexers which are inherited from an interface.
16347
16348 2002-06-09  Martin Baulig  <martin@gnome.org>
16349
16350         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16351         the same type as the constant if necessary.  There's also a test-130.cs
16352         for this.
16353
16354         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16355
16356         * typemanager.cs (TypeManager.ChangeType): Previously known as
16357         Enum.ChangeEnumType().
16358
16359 2002-06-09  Martin Baulig  <martin@gnome.org>
16360
16361         * expression.cs (Cast.TryReduce): Added support for consts.
16362
16363 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16364
16365         * class.cs (Accessor): Hold attributes information so we can pass
16366         it along.
16367
16368         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16369         Modify to pass in attributes attached to the methods.
16370
16371         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16372
16373         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16374         to handle the Accessor kind :-)
16375
16376         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16377
16378 2002-06-08  Martin Baulig  <martin@gnome.org>
16379
16380         * expression.cs (Unary.TryReduceNegative): Added support for
16381         ULongConstants.
16382
16383 2002-06-08  Martin Baulig  <martin@gnome.org>
16384
16385         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16386         name can't be found in the `defined_names' - the caller will do a
16387         MemberLookup in this case and thus find methods in System.Enum
16388         such as Enum.IsDefined().
16389
16390 2002-06-08  Martin Baulig  <martin@gnome.org>
16391
16392         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16393         Convert.ChangeType() which works with TypeBuilder created types.
16394         (Enum.LookupEnumValue, Enum.Define): Use it here.
16395
16396         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16397         `TypeBuilder.BaseType != null' check.
16398         (TypeContainer.FindMembers): Only lookup parent members if we
16399         actually have a parent.
16400         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16401         (ConstructorInitializer.Resolve): Likewise.
16402
16403         * interface.cs (Interface.FindMembers): Added
16404         `TypeBuilder.BaseType != null' check.
16405
16406         * rootcontext.cs (RootContext.ResolveCore): Added
16407         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16408         classes_second_stage.
16409
16410         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16411         debug_type and trace_type when compiling with --nostdlib.       
16412
16413 2002-06-07  Martin Baulig  <martin@gnome.org>
16414
16415         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16416         (AddField): Set it to true when adding a non-static field.
16417         (DefineType): Use `have_nonstatic_fields' to find out whether we
16418         have non-static fields, not `Fields != null'.
16419
16420 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16423         dereferencing a null on the static-field code path)
16424
16425 2002-05-30  Martin Baulig  <martin@gnome.org>
16426
16427         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16428         to take command line arguments.  Use reflection to call the new
16429         custom `Initialize' function on the symbol writer and pass it the
16430         command line arguments.
16431
16432         * driver.cs (--debug-args): New command line argument to pass command
16433         line arguments to the symbol writer.
16434
16435 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16436
16437         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16438         the target type for indexers and properties.  Thanks to Joe for
16439         catching this.
16440
16441 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16442
16443         * typemanager.cs (MethodFlags): returns the method flags
16444         (Obsolete/ShouldIgnore) that control warning emission and whether
16445         the invocation should be made, or ignored. 
16446
16447         * expression.cs (Invocation.Emit): Remove previous hack, we should
16448         not do this on matching a base type, we should do this based on an attribute
16449
16450         Only emit calls to System.Diagnostics.Debug and
16451         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16452         on the command line.
16453
16454         * rootcontext.cs: Global settings for tracing and debugging.
16455
16456         * cs-tokenizer.cs (define): New utility function to track
16457         defines.   Set the global settings for TRACE and DEBUG if found.
16458
16459 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16460
16461         * interface.cs (Populate*): Pass in the TypeContainer as well as
16462         the DeclSpace as parameters so that we can create EmitContexts and
16463         then use that to apply attributes etc.
16464
16465         (PopulateMethod, PopulateEvent, PopulateProperty)
16466         (PopulateIndexer): Apply attributes everywhere.
16467
16468         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16469         etc.
16470
16471         (ApplyAttributes): Update accordingly.
16472
16473         We now apply interface attributes for all members too.
16474
16475 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * class.cs (Indexer.Define); Correctly check if we are explicit
16478         implementation (instead of checking the Name for a ".", we
16479         directly look up if the InterfaceType was specified).
16480
16481         Delay the creation of the PropertyBuilder.
16482
16483         Only create the PropertyBuilder if we are not an explicit
16484         interface implementation.   This means that explicit interface
16485         implementation members do not participate in regular function
16486         lookups, and hence fixes another major ambiguity problem in
16487         overload resolution (that was the visible effect).
16488
16489         (DefineMethod): Return whether we are doing an interface
16490         implementation. 
16491
16492         * typemanager.cs: Temporary hack until we get attributes in
16493         interfaces (Ravi is working on that) and we get IndexerName
16494         support in interfaces.
16495
16496         * interface.cs: Register the indexers as properties.
16497
16498         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16499         warning, I have verified that this is a bug in the .NET runtime
16500         (JavaScript suffers of the same problem).
16501
16502         * typemanager.cs (MemberLookup): When looking up members for
16503         interfaces, the parent of an interface is the implicit
16504         System.Object (so we succeed in searches of Object methods in an
16505         interface method invocation.  Example:  IEnumerable x;  x.ToString
16506         ()) 
16507
16508 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16509
16510         * class.cs (Event): Events should also register if they do
16511         implement the methods that an interface requires.
16512
16513         * typemanager.cs (MemberLookup); use the new GetInterfaces
16514         method. 
16515
16516         (GetInterfaces): The code used to lookup interfaces for a type is
16517         used in more than one place, factor it here. 
16518
16519         * driver.cs: Track the errors at the bottom of the file, we kept
16520         on going.
16521
16522         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16523         instance if the method we are calling is static!
16524
16525 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * attribute.cs (ApplyAttributes): Make this function filter out
16528         the IndexerName attribute (as that attribute in reality is never
16529         applied) and return the string constant for the IndexerName
16530         attribute. 
16531
16532         * class.cs (TypeContainer.Emit): Validate that all the indexers
16533         have the same IndexerName attribute, and if so, set the
16534         DefaultName attribute on the class. 
16535
16536         * typemanager.cs: The return value might contain other stuff (not
16537         only methods).  For instance, consider a method with an "Item"
16538         property and an Item method.
16539
16540         * class.cs: If there is a problem with the parameter types,
16541         return. 
16542
16543 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16544
16545         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16546         looks at user defined conversion after making a call to 
16547         StandardConversionExists - we need this for overload resolution.
16548
16549         * expression.cs : Update accordingly the various method calls.
16550
16551         This fixes 2 bugs filed against implicit user defined conversions 
16552
16553 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16554
16555         * statement.cs: Track the result of the assignment.
16556
16557 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16558
16559         * expression.cs (MemberAccess): Improved error reporting for
16560         inaccessible members.
16561
16562 2002-05-22  Martin Baulig  <martin@gnome.org>
16563
16564         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16565         itself with debugging support.
16566
16567 2002-05-22  Martin Baulig  <martin@gnome.org>
16568
16569         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16570         Removed, this isn't needed anymore.
16571
16572 2002-05-20  Martin Baulig  <martin@gnome.org>
16573
16574         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16575         be underlying type for an enum.
16576
16577 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16578
16579         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16580         that splits out the loading of just the core types.
16581
16582         * rootcontext.cs (ResolveCore): Split the struct resolution in
16583         two, so we can load the enumeration underlying types before any
16584         enums are used.
16585
16586         * expression.cs (Is): Bandaid until we fix properly Switch (see
16587         bug #24985 for details).
16588
16589         * typemanager.cs (ImplementsInterface): The hashtable will contain
16590         a null if there are no interfaces implemented.
16591
16592 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * cs-parser.jay (indexer_declarator): It is fine to have array
16595         parameters
16596
16597 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * typemanager.cs: (RegisterBuilder): New function used to register
16600         TypeBuilders that implement interfaces.  Since
16601         TypeBuilder.GetInterfaces (as usual) does not work with lame
16602         Reflection.Emit. 
16603         (AddUserType): register interfaces.
16604
16605         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16606         dealing with TypeBuilder.  Also, arrays are showing up as
16607         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16608         methods can not be invoked on them!
16609
16610         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16611         (ImplicitReferenceConversionExists): Split out from
16612         StandardConversionExists. 
16613
16614         * expression.cs (As): We were only implementing one of the three
16615         cases for the as operator.  We now implement them all.
16616         (Is): Implement the various other cases for Is as well.
16617
16618         * typemanager.cs (CACHE): New define used to control if we want or
16619         not the FindMembers cache.  Seems to have a negative impact on
16620         performance currently
16621
16622         (MemberLookup): Nested types have full acess to
16623         enclosing type members
16624
16625         Remove code that coped with instance/static returns for events, we
16626         now catch this in RealFindMembers.
16627
16628         (RealFindMembers): only perform static lookup if the instance
16629         lookup did not return a type or an event.  
16630
16631 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16632
16633         * assign.cs (CompoundAssign): We pass more semantic information
16634         now to Compound Assignments than we did before: now we have all
16635         the information at hand, and now we resolve the target *before* we
16636         do the expression expansion, which allows the "CacheValue" method
16637         to have the effect we intended (before, a [x] += 1 would generate
16638         two differen ArrayAccess expressions from the ElementAccess,
16639         during the resolution process).
16640
16641         (CompoundAssign.DoResolve): Resolve target and original_source here.
16642
16643 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16644
16645         * expression.cs (ArrayAccess): dropped debugging information. 
16646
16647         * typemanager.cs: Small bug fix: I was always returning i_members,
16648         instead of one of i_members or s_members (depending on which had
16649         the content).
16650
16651         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16652         method is invoked before any code generation takes place, and it
16653         is a mechanism to inform that the expression will be invoked more
16654         than once, and that the method should use temporary values to
16655         avoid having side effects
16656
16657         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16658
16659         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16660         implementation.
16661
16662         * expression.cs (Indirection, ArrayAccess): Add support for
16663         CacheTemporaries in these two bad boys. 
16664
16665         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16666         ldobj or ldind_ref.  
16667         (StoreFromPtr): Handle stobj as well.
16668
16669         * expression.cs (UnaryMutator): Share more code.
16670
16671         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16672         down: I was not tracking the Filter function as well, which
16673         was affecting the results of the cache.
16674
16675 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16676
16677         * attribute.cs: Remove the hack to handle the CharSet property on
16678         StructLayouts. 
16679
16680 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16681
16682         * attribute.cs (DoResolve): More uglyness, we now only try to
16683         resolve the attribute partially, to extract the CharSet
16684         information (only if we are a StructLayout attribute).  Otherwise 
16685
16686         (GetExtraTypeInfo): Add some code to conditionally kill in the
16687         future this.   I am more and more convinced that the .NET
16688         framework has special code to handle the attribute setting on
16689         certain elements.
16690
16691         * expression.cs (IsParamsMethodApplicable): Revert my previous
16692         foreach change here, it was wrong.
16693
16694 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16697         (pp_expr): do not abort on unknown input, just return.
16698         (eval): abort if there are pending chars.
16699
16700         * attribute.cs (Attribute.Resolve): Positional parameters are
16701         optional.  Deal with that case.
16702
16703         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16704         the Ansi/Unicode/Auto information for the type.
16705
16706         (TypeContainer.DefineType): instantiate the EmitContext here, as
16707         we will be using it during the type definition (to resolve
16708         attributes) and during the emit phase.
16709
16710         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16711         to pull type information out of the attributes
16712
16713         (Attribute.Resolve): track the constructor builder, and allow for
16714         multiple invocations (structs and classes will use this).
16715
16716         * ecore.cs (MemberLookupFinal): new version with all the
16717         parameters customizable.
16718
16719         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16720         constructors.  Return if the result value is null (as the error
16721         would have been flagged already by MemberLookupFinal)
16722
16723         Do not allow instances of abstract classes or interfaces to be
16724         created.
16725
16726         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16727         We have to compare the assembly property here when dealing with
16728         FamANDAssem and Assembly access modifiers, because we might be
16729         creating an assembly from *modules* (that means that we are not
16730         getting TypeBuilders for types defined in other modules that are
16731         part of this assembly).
16732
16733         (Method.Emit): If the method is marked abstract and has a body,
16734         emit an error. 
16735
16736         (TypeContainer.DefineMembers): If both the defined member and the
16737         parent name match are methods, then do not emit any warnings: let
16738         the Method.Define routine take care of flagging warnings.  But if
16739         there is a mismatch (method overrides something else, or method is
16740         overriwritten by something, then emit warning).
16741
16742         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16743         set to null, this means `do not check for the return type on the
16744         signature'. 
16745
16746         (Method.Define): set the return type for the method signature to
16747         null, so that we get methods with the same name and parameters and
16748         different return types.  This is used to flag warning 114 (you are
16749         hiding a method, and you probably want to use the new/override
16750         keywords instead).
16751
16752         * typemanager.cs (MemberLookup): Implemented proper access
16753         control, closing a long standing set of bug reports.  The problem
16754         was that the Framework only has two bits: Public and NonPublic,
16755         and NonPublic includes private and protected methods, but we need
16756         to enforce the FamANDAssem, FamOrAssem and Family. 
16757
16758 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16759
16760         * statement.cs (GotoCase): Return true: Ammounts to giving up
16761         knowledge on whether we return or not, and letting the other case
16762         be responsible for it.
16763
16764 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16765
16766         * driver.cs: Do not load directories for each file processed, only
16767         do it if there is a pattern.
16768
16769         * ecore.cs: Report readonly assigns here as well, as we might have
16770         been resolved only by MemberAccess.
16771
16772         (SimpleName.SimpleNameResolve): Also be useful for LValue
16773         resolution.   We need this to propagate assign to local readonly variables
16774
16775         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16776         do not want to reuse potential criteria memory.
16777
16778         * class.cs (MyEventBuilder): Set reflected_type;
16779
16780         * ecore.cs (Constantify): Added support for constifying bools.
16781
16782         (RootContext.LookupType): Added a cache for values looked up in
16783         the declaration space.
16784
16785         * typemanager.cs (FindMembers): Now is a front-end to
16786         RealFindMembers, and provides a two-level hashtable-based cache to
16787         the request.  
16788
16789         15% performance improvement: from 22.5 to 19.2 seconds.
16790
16791         * expression.cs (IsParamsMethodApplicable): use foreach.
16792         (Invocation.DoResolve): ditto.
16793         (New.DoResolve): ditto.
16794         (ArrayCreation.DoResolve): ditto.
16795
16796         * ecore.cs (FindMostEncompassingType): use foreach.
16797
16798         * delegate.cs (NewDelegate.DoResolve): Use foreach
16799
16800         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16801         (RemoveMethods): use foreach.
16802
16803         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16804         nested foreach statements instead of for, and also break out of
16805         the inner loop once a match is found.
16806
16807         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16808
16809 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16810
16811         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16812         we actually unwrap the expression to allow for extra information
16813         to be extracted. 
16814
16815         * expression.cs: Use Shr_Un on unsigned operations. 
16816
16817 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16818
16819         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16820         applicable operators was not being considered correctly. This closes
16821         the bug Miguel reported.
16822
16823 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16824
16825         * attribute.cs: check that the type derives from System.Attribute
16826         and report the correct error in that case (moved the duplicate code to
16827         its own method, too).
16828
16829 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16830
16831         * attribute.cs: lookup attribute type name as the spec says: first the
16832         bare attribute name and then name + "Attribute" (nant compiles with
16833         mcs after this fix).
16834
16835 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16836
16837         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16838         Because of the way we parse things, we should try to see if a
16839         UIntConstant can fit in an integer.
16840
16841 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16842
16843         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16844         when we are in an explicit context.
16845
16846         (ConvertReferenceExplicit): When converting from Iface type S to Class
16847         T make sure the rules are implemented as an OR.
16848
16849         * parameter.cs (ParameterType): Make it a property for now although the
16850         purpose really isn't anything immediate.
16851
16852         * expression.cs (Is*Applicable): Do better checking on the parameter type
16853         of a ref/out parameter. The ones from the system assemblies are already 
16854         marked with the correct type so we don't need to do any correction.
16855
16856         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16857         the object type is standard too so include that.
16858
16859 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16860
16861         * ecore.cs (StandardConversionExists): Augment with missing code:
16862         deal with IntConstant, LongConstants and Enumerations.
16863
16864         * assign.cs: Report the error, instead of failing silently
16865
16866         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16867         typecontainer that they are declared, because the
16868         typecontainer/namespace will have the list of using clauses that
16869         need to be applied.
16870
16871         Assembly Attributes were escaping the normal registration
16872         mechanism. 
16873
16874         (EmitCode): Apply attributes within an EmitContext that represents
16875         the container they were declared on.
16876
16877         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16878
16879 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16880
16881         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16882         Revamp completely - make much cleaner as we now operate only
16883         on a set of Types.
16884
16885         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16886         to implement the logic detailed in the spec more correctly.
16887
16888         (UserDefinedConversion): Update accordingly.
16889
16890 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16891
16892         * statement.cs: Return flow analysis information up.
16893
16894         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16895         and the default.
16896
16897         (token): Do not consume an extra character before calling
16898         decimal_digits.
16899
16900 2002-05-06  Piers Haken <piersh@friskit.com>
16901
16902         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16903
16904 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16905
16906         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16907         EmitContext during the instance constructor initializer
16908         resolution, to stop access to instance variables.
16909
16910         This is mandated by the spec, last paragraph of the `constructor
16911         initializers' section. 
16912
16913 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16914
16915         * cs-parser.jay, class.cs (Accessor): new class used to represent
16916         an accessor (get or set).  In the past we used `null' to represent
16917         a missing accessor.  But this is ambiguous because there was no
16918         way to tell in abstract indexers/properties if one of them was
16919         specified.
16920
16921         Now there is a way of addressing that.
16922
16923         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16924         instead of FindMembers.
16925
16926         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16927         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16928
16929         * attribute.cs: Treat indexers and properties as the same in terms
16930         of applying attributes
16931
16932         * ecore.cs (FindMostEncompassedType): Use statically initialized
16933         EmptyExpressions()s like we do elsewhere to avoid creating useless
16934         objects (and we take this out of the tight loop).
16935
16936         (GetConversionOperators): Move the code to extract the actual
16937         operators to a separate routine to clean things up.
16938
16939 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16940
16941         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16942         events are always registered FieldBuilders.
16943
16944         * class.cs (FieldBase): New class shared by Fields 
16945
16946         * delegate.cs: If we are a toplevel delegate, use our full name.
16947         If we are a nested delegate, then only use our tail name.
16948
16949 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16950
16951         * expression.cs (IsApplicable): Ensure that we add the "&" to
16952         ref/out types before comparing it with the type of the argument.
16953
16954         (IsParamsMethodApplicable): Ditto.
16955
16956         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16957         silly me ;-)
16958
16959         * delegate.cs : Handle the case when we have more than one applicable
16960         method. Flag an error only when we finish checking all.
16961
16962 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16963
16964         * expression.cs: Add support for boolean static initializers.
16965
16966 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16967
16968         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16969
16970         * parameter.cs (ComputeParameterTypes,
16971         ComputeAndDefineParameterTypes): Better error handling: now we
16972         clear the `types' cache if we fail during any of the type lookups.
16973         We also return the status code correctly to our caller
16974
16975         * delegate.cs: If we fail to define a delegate, abort the extra
16976         steps. 
16977
16978         * expression.cs (Binary.ResolveOperator): for
16979         operator==(object,object) and operator !=(object, object) we also
16980         have to verify that there is an implicit conversion from one to
16981         the other.
16982
16983         (ArrayAccess.DoResolve): Array Access can operate on
16984         non-variables. 
16985
16986 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16987
16988         * assign.cs (CompoundAssign): A new class used as a "flag" that
16989         the assignment actually is happening as part of a compound
16990         assignment operator.
16991
16992         During compound assignment, a few new rules exist to enable things
16993         like:
16994
16995         byte b |= 1 + 2
16996
16997         From the spec:
16998
16999         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17000         to the type of x) if y is implicitly convertible to the type of x,
17001         and the operator is a builtin operator and the return type of the
17002         operator is explicitly convertible to the type of x. 
17003
17004         * rootcontext.cs: Reset warning level to 2.  4 catches various
17005         "interesting" features in mcs, we must clean this up at some
17006         point, but currently am trying to kill other bugs ;-)
17007
17008         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17009         in container classes as well.  
17010
17011         * expression.cs (Binary.ResolveOperator): Handle string case
17012         before anything else (as operator overloading does emit an error
17013         before doing anything else).
17014
17015         This code could go away when we move to a table driven model, but
17016         i could not come up with a good plan last night.
17017
17018 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17019
17020         * typemanager.cs (CSharpName): reimplementation using regex.
17021         * class.cs: added null check for fields in Emit
17022         * rootcontext.cs: set warninglevel to 4
17023
17024 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * typemanager.cs (CSharpName): reimplemented with Lupus
17027         suggestion.
17028
17029 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * statement.cs (If): correclty implement Resolve, because we were
17032         not catching sem errors in there.  The same process is needed
17033         everywhere else. 
17034         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17035
17036
17037         (Statement.Warning_DeadCodeFound): Factorize code.
17038         (While): Report dead code here too.
17039
17040         (Statement): Added Resolve virtual method to allow
17041         for resolution split from the emit code.
17042
17043 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17044
17045         * statement.cs (EmitBoolExpression): No longer try to resolve the
17046         expression here.    
17047         (MakeBoolean): New utility function that resolve, implicitly
17048         converts to boolean and tags the expression. 
17049
17050
17051         (If, Do): Implement dead code elimination.
17052         (While): Implement loop inversion
17053
17054         (Do, While, For, If): Resolve the expression prior to calling our
17055         code generation.
17056
17057 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17058
17059         * class.cs:
17060           - added method Report28 (warning: program has more than one entry point)
17061           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17062           - modified method Method.Define, the part at the end of the method
17063
17064         * rootcontext.cs: added static public Location EntryPointLocation;
17065           
17066         * ../errors/cs0028.cs : Add test case for the above warning.              
17067
17068         * typemanager.cs:
17069           - modified method CSharpName to allow arrays of primitive type to
17070             be printed nicely (e.g. instead of System.Int32[][] it now prints
17071             int[][])
17072           - added method CSharpSignature: returns the signature of a method
17073             in string format to be used in reporting errors, warnings, etc.
17074
17075         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17076         with String.Empty.
17077
17078 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17079
17080         * delegate.cs (Define): Fix extremely silly bug where I was
17081         setting the type of the 'object' parameter of the BeginInvoke
17082         method to System.IAsyncResult instead of System.Object ;-)
17083
17084 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17087         here. 
17088
17089         (Constructor.Emit): return if we fail to initialize the
17090         constructor.  Another door closed!  
17091
17092         * expression.cs (New.DoResolve): Improve error message (from -6 to
17093         1501).  Use DeclaredOnly lookup to find the exact constructor.
17094
17095         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17096         loop.  This is useful.
17097
17098         * cs-parser.jay: Adjust the default parameters so that destructors
17099         have the proper signature.
17100
17101 2002-04-26  Martin Baulig  <martin@gnome.org>
17102
17103         * driver.cs (LoadAssembly): If `assembly' contains any characters
17104         which are only valid in path names and not in assembly names
17105         (currently slash, backslash and point), use Assembly.LoadFrom ()
17106         instead of Assembly.Load () on the `assembly' (before iteration
17107         over the link_paths).
17108
17109 2002-04-26  Martin Baulig  <martin@gnome.org>
17110
17111         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17112
17113 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17114
17115         * class.cs (Property): use the new typemanager.MemberLookup
17116
17117         (TypeContainer.MemberLookup): Implement using the
17118         TypeManager.MemberLookup now. 
17119
17120         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17121         and return MemberInfos, so that these can be used without an
17122         EmitContext (what we had before).
17123
17124 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17125
17126         * expression.cs: Fix the case where the argument to params if the
17127         type of the params.  I omitted handling this before.   Fixed
17128
17129 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17130
17131         * driver.cs: Call BootCorlib_PopulateCoreType
17132
17133         * class.cs (Property.CheckBase): Check for properties only, not
17134         for all members. 
17135
17136         * interface.cs: Temporary hack: try/catch around the
17137         CustomAttributeBuilder, because I am getting an exception that I
17138         do not understand.
17139
17140         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17141         types whose definitions are required to be there (attributes are
17142         defined before standard types).
17143
17144         Compute definitions as we boot the various types, as they are used
17145         immediately (value_type class will need object_type, but if we do
17146         not initialize object_type, we will pass a null, which will let
17147         the runtime pick the System.Object from the existing corlib, which
17148         is not what we want).
17149
17150 2002-04-22  Patrik Torstensson <totte@labs2.com>
17151
17152         * cs-tokenizer.cs: fixed a number of trim() issues.
17153
17154 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17155
17156         * expression.cs (Argument.Type): Ensure that we return the correct
17157         type when we have out or ref parameters [in which case we 
17158         append a "&"].
17159
17160 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17161
17162         * class.cs (Property, Indexer): Allow extern modifier in there. 
17163
17164         * typemanager.cs (InitBaseTypes): Initializes object_type and
17165         value_type, since those will be used early on during the bootstrap
17166         process to compile corlib.
17167
17168         (InitCoreTypes): Move code from here to InitBaseTypes.
17169
17170 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17173         single-dimension arrays as using the ldlen opcode.  
17174
17175         Daniel Lewis discovered this optimization.  
17176
17177         * typemanager.cs: Add signature for System.Array::get_Length
17178
17179 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17180
17181         * statement.cs: report the error when the foreach does not apply to an
17182         array nor a collection.
17183
17184 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17185
17186         * expression.cs: Add implicit conversions to the operator ~.
17187
17188         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17189
17190         * typemanager.cs: Locate the decimal constructor.
17191
17192 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17193
17194         * attribute.cs: use the new property of TypeOf.
17195         * expression.cs: added 'get' property around typearg.
17196
17197         These changes fix a build breaker reported by NickD. Is this the
17198         correct way to fix?  If not, please, revert my changes and make it
17199         work :-).
17200
17201 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * attribute.cs: Add support for typeof in attribute invocations.
17204         I am not sure that this is right though.
17205
17206 2002-04-14  Duncan Mak  <duncan@ximian.com>
17207
17208         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17209         Binary.Operator.Division case.
17210
17211 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17212
17213         * class.cs (DefineType): Ensure that we do a proper check on
17214         attribute types and also register it with the TypeManager.
17215
17216         (TypeContainer.Targets): The default for attribute types is
17217         AttributeTargets.All.
17218
17219         * attribute.cs (ApplyAttributes): Registering the attribute type
17220         is done elsewhere, not when we discover we have a Usage attribute.
17221
17222 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17223
17224         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17225         and get rid of is_delegate parameter.
17226
17227         * everywhere : update.
17228
17229 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17230
17231         * cs-parser.jay (compilation_unit): Revamp completely to use
17232         some new ideas that I got from Rhys' grammar to solve the problems
17233         with assembly level attributes.
17234
17235         (outer_declaration): New grammar production.
17236
17237         (attribute_sections): Add.
17238
17239         (opt_attributes): Base on attribute_sections
17240
17241         (namespace_declaration): Allow opt_attributes to tackle the case
17242         when we have assembly level attributes - we are clever in this
17243         regard now ;-)
17244
17245         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17246         attributes in the non-global context.
17247
17248         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17249         instead of SetGlobalAttributes.
17250
17251         * class.cs, rootcontext.cs : Ensure we define and generate 
17252         attribute types before anything else.
17253
17254         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17255         and flag the new error -20 for the case when the attribute type
17256         does not have valid targets specified. csc does not catch this.
17257
17258         * ../errors/errors.txt : update for error # -20
17259
17260 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17261
17262         * support.cs (InternalParameters.ParameterModifier): Do some null
17263         checking and return sane values.
17264
17265         * class.cs (Method.Define): If we are a PInvoke method, ensure
17266         that we are static and extern. Report error # 601
17267
17268         * ../errors/cs0601.cs : Add test case for the above error.
17269
17270 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17271
17272         * rootcontext.cs (attribute_types): We need to keep type of
17273         all attribute types separately and emit code for them first.
17274
17275         (RegisterAttribute) : Implement.
17276
17277         * class.cs (DefineType): Check if the current Type is a custom
17278         attribute type and register it accordingly.
17279
17280         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17281         adding the first attribute twice and rename to
17282
17283         (SetGlobalAttributes): this.
17284
17285         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17286         lookups.
17287
17288         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17289         if we are processing global arguments. Hmm, I am unsure of this.
17290
17291 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17292
17293         * expression.cs: added static array of strings to avoid calling
17294         Enum.ToString () for Operator in Binary. Significant recover of
17295         performance.
17296
17297 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * class.cs (FindMembers): Allow the Builders of the various
17300         members to be null.  If they are skip them.  This only happens
17301         during the PInvoke declaration.
17302
17303 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17304
17305         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17306         failure, so we do not keep going afterwards.
17307
17308         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17309         wanted to pass `false' as the `is_delegate' argument.  If this is
17310         the case, why not use delegate_type == null to mean `is_delegate =
17311         false' and anything else as is_delegate = true.
17312
17313 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17314
17315         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17316         code for the section, not the beginning of the tests.
17317
17318 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17319
17320         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17321
17322         * expression.cs (Binary): same.  Warn about errors where we have
17323         Enum/Enum in operator + as well.
17324
17325 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17326
17327         * statement.cs:
17328                 - added support for switch(bool)
17329                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17330                 - add TableSwitchEmit() to handle table-based switch statements
17331
17332 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17333
17334         * expression.cs (Invocation.OverloadResolve): Factor out code which
17335         does parameter compatibility checking with arguments so that we can 
17336         re-use the code even from Delegate.VerifyApplicability
17337
17338         (VerifyArgumentsCompat): Move above code here.
17339
17340         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17341         and instead make a call to the above method.
17342
17343 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17344
17345         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17346         We use it to keep track of classes which are attribute types.
17347
17348 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * delegate.cs (Delegate.Define): Correctly define the types in the
17351         presence of fixed and array parameters.
17352
17353         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17354         doing FindMembers.
17355
17356         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17357         include NonPublic after the first iteration.
17358
17359         * class.cs (Indexer.CheckBase): Only check if both parents are
17360         non-null. 
17361
17362         * cs-parser.jay (accessor_body): If empty, set to null.
17363
17364         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17365         same code path here to resolve constants names that we did have in
17366         MemberAccess.DoResolve.  There is too much code duplicated here.
17367
17368 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17369
17370         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17371
17372         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17373         to MakeUnionSet.
17374
17375         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17376         tokens, numbers and strings.
17377
17378         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17379         parenthesis.
17380
17381         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17382         asyncronous parameters and the regular parameters.  
17383
17384         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17385         specify the target directory.
17386
17387         * expression.cs: (This.DoResolve): Simplify
17388         (As.Emit): Optimize, do not generate IsInst if the expression is
17389         always of the given type.
17390
17391         (Is.DoResolve): Bug fix, we were reporting both always/never for
17392         the is expression.
17393
17394         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17395         creating too many unnecessary arrays.
17396
17397 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17398
17399         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17400         fields instead of rolling our own initializer.   Takes care of all
17401         implicit conversions, and drops unnecessary static checks/argument.
17402
17403 2002-03-31  Dick Porter  <dick@ximian.com>
17404
17405         * driver.cs: use the GetDirectories() return values properly, and
17406         use "/" as path separator.
17407
17408 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * expression.cs (Unary): Optimize - - expr into expr.
17411         (Binary): Optimize a + (-b) into a -b.
17412
17413         * codegen.cs (CodeGen): Made all methods static.
17414
17415 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17416
17417         * rootcontext.cs: 
17418
17419         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17420         TypeBuilder property.
17421
17422         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17423         instead. 
17424
17425         * tree.cs: Removed the various RecordXXXX, and replaced with a
17426         single RecordDecl.  Removed all the accessor methods, and just
17427         left a single access point Type 
17428
17429         * enum.cs: Rename DefineEnum to DefineType.
17430
17431         * decl.cs: New abstract method `DefineType' used to unify the
17432         Defines for Enumerations, Interfaces, TypeContainers and
17433         Delegates.
17434
17435         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17436         LookupBaseClasses method that used to live in class.cs and
17437         interface.cs here, and renamed to FindType.
17438
17439         * delegate.cs: Implement DefineType.  Take advantage of the
17440         refactored pattern for locating the parent builder without taking
17441         the parent_builder argument (which we know does not work if we are
17442         nested, and triggering a toplevel definition).
17443
17444 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17447         accessibility of a member has changed during override and report
17448         an error if so.
17449
17450         * class.cs (Method.Define, Property.Define): Only complain on
17451         overrides if the method is private, any other accessibility is
17452         fine (and since we just checked the permission is the same, we are
17453         good to go).
17454
17455         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17456         and elif are processed always.  The other pre-processing
17457         directives are only processed if we are "taking" the path
17458
17459 2002-03-29  Martin Baulig  <martin@gnome.org>
17460
17461         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17462         current location is not Null.
17463
17464         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17465         a separate method so we can profile it.
17466
17467         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17468         `span.Seconds' are just seconds, but no minutes or hours.
17469         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17470
17471 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17472
17473         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17474         Remove the gratuitous set of Final:
17475
17476                                 // If an interface implementation, then we can set Final.
17477                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17478                                     implementing.DeclaringType.IsInterface)
17479                                         flags |= MethodAttributes.Final;
17480
17481         I do not know what I was smoking when I used that.
17482
17483
17484         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17485         step into fixing the name resolution issues for delegates and
17486         unifying the toplevel name resolution.
17487
17488 2002-03-28  Martin Baulig  <martin@gnome.org>
17489
17490         * class.cs (Method.Emit): If we have a symbol writer, call its
17491         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17492         tell it about the current method.
17493
17494         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17495         writer that we're going to emit the first byte of IL code for a new
17496         statement (a new source line).
17497         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17498         EmitContext.Mark() before emitting any code.
17499
17500         * location.cs (SymbolDocument): Return null when we're Null.
17501
17502         * statement.cs (Statement): Moved the `Location loc' variable here.
17503         (Statement.EmitBoolExpression): If we have a symbol writer, call
17504         ec.Mark() before emitting any code to tell it that we're at the
17505         beginning of a new statement.
17506         (StatementExpression): Added `Location' argument to the constructor.
17507         (Block): Added public readonly variable `StartLocation' and public
17508         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17509         (Block): Added constructor which takes a start and end location.
17510         (Block.SetEndLocation): New method. This sets the end location.
17511         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17512         local variables we create.
17513         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17514         each statement and do also mark the begin and end of the block.
17515
17516         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17517         tell it the current lexer.Location, use Location.Null for the end of the
17518         block.
17519         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17520         current block, set its end location using SetEndLocation().
17521         (statement_expression): StatementExpression constructor now takes the
17522         lexer.Location as additional argument.
17523         (for_statement, declare_local_variables): Likewise.
17524         (declare_local_variables): When creating a new implicit block, use the
17525         new Block constructor and pass it the lexer.Location.
17526
17527 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17528
17529         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17530         members also on the parent interfaces recursively.
17531
17532 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * report.cs: Use new formats, since Gonzalo finished the missing
17535         bits. 
17536
17537         * expression.cs (Binary.ResolveOperator): added missing operator|
17538         operator& and operator^ for bool/bool.
17539
17540         * cs-parser.jay: CheckDef now takes a Location argument that is
17541         used to report errors more precisly (instead of reporting the end
17542         of a definition, we try to track something which is a lot closer
17543         to the source of the problem).
17544
17545         * cs-tokenizer.cs: Track global token use, so we can properly flag
17546         the use of #define/#undef after the first token has been seen.
17547
17548         Also, rename the reportXXXX to Error_DescriptiveName
17549
17550         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17551         TypeContainer, so that Enum and Interface can use this too.
17552
17553         * class.cs (TypeContainer.LookupInterfaceOrClass,
17554         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17555         `builder' argument.  Typically this was used to pass the parent
17556         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17557         the definition).  
17558
17559         The problem is that a nested class could trigger the definition of
17560         a toplevel class, and the builder would be obviously wrong in that
17561         case. 
17562
17563         So we drop this argument, and we compute dynamically the
17564         TypeBuilder/ModuleBuilder (the correct information was available
17565         to us anyways from DeclSpace.Parent)
17566
17567         * interface.cs (Interface.DefineInterface): Drop builder
17568         parameter cleanup like class.cs
17569
17570         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17571         like class.cs
17572
17573         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17574         values. 
17575
17576         (Try.Emit): Propagate the returns value from the statement.
17577
17578         (Return.Emit): Even if we are leavning 
17579
17580         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17581
17582         * modifiers.cs: Fix the computation of MethodAttributes flags.
17583
17584 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17585
17586         * driver.cs: allow compilation of files that start with '/'.
17587         Add a default case when checking the argument of --target.
17588
17589 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17590
17591         * interface.cs: Implement the same search algorithm for types in
17592         the interface code.
17593
17594         * delegate.cs: Do not allow multiple definition.
17595
17596         * Recovered ChangeLog that got accidentally amputated
17597
17598         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17599
17600         * rootcontext.cs: Load manually enum to allow core classes to
17601         contain enumerations.
17602
17603         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17604         Update to new static methods in TypeManager.
17605
17606         * typemanager.cs (GetMethod, GetConstructor): Use our
17607         implementation of FindMembers to find the members, since during
17608         corlib compilation, the types are TypeBuilders and GetMethod and
17609         GetConstructor do not work.
17610
17611         Make all methods in TypeManager static.
17612
17613         (InitCodeHelpers): Split the functionality from
17614         the InitCodeTypes function.
17615
17616         * driver.cs: Call InitCodeHelpers after we have populated the
17617         types. 
17618
17619         * cs-parser.jay (delegate_declaration): we did not used to compute
17620         the delegate name correctly for void delegates.
17621
17622 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * rootcontext.cs (RootContext): Init the interface_resolve_order
17625         and type_container_resolve_order always.
17626
17627         (ResolveCore, BootstrapCorlib_ResolveClass,
17628         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17629         compiler when compiling with --nostdlib
17630
17631         * class.cs (TypeContainer.DefineType): Check that our parent is
17632         not null.  This test is most important when we are bootstraping
17633         the core types.
17634
17635         * codegen.cs: Split out the symbol writing code.
17636
17637 2002-03-25  Martin Baulig  <martin@gnome.org>
17638
17639         * driver.cs (-g): Made -g an alias for --debug.
17640
17641 2002-03-24  Martin Baulig  <martin@gnome.org>
17642
17643         * codegen.cs (SymbolWriter): New public variable. Returns the
17644         current symbol writer.
17645         (CodeGen): Added `bool want_debugging_support' argument to the
17646          constructor. If true, tell the ModuleBuild that we want debugging
17647         support and ask it for the ISymbolWriter.
17648         (Save): If we have a symbol writer, call it's Close() method after
17649         saving the assembly.
17650
17651         * driver.c (--debug): New command line argument to create a
17652         debugger information file.
17653
17654         * location.cs (SymbolDocument): New public property. Returns an
17655         ISymbolDocumentWriter object for the current source file or null
17656         if we don't have a symbol writer.
17657
17658 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17659
17660         * driver.cs (LoadAssembly): Correctly return when all the paths
17661         have been tried and not before.
17662
17663         * statement.cs (Switch.Emit): return the actual coverage for this
17664         statement (returns/not-returns)
17665
17666         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17667         switch of the statement if we are the last switch section.  That
17668         kills two problems: try/catch problems (we used to emit an empty
17669         nop at the end) and switch statements where all branches would
17670         return. 
17671
17672 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17673
17674         * driver.cs: Add default assemblies (the equivalent to the
17675         Microsoft CSC.RSP file)
17676
17677         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17678         also update tokens_seen and set it to false.
17679
17680         * driver.cs: Implement --recurse for Mike.
17681
17682         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17683         correctly splitting out the paths.
17684
17685 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17686
17687         * interface.cs (Interface.PopulateProperty): Instead of using
17688         `parent' as the declaration space for the set parameters, use
17689         `this' 
17690
17691         * support.cs (InternalParameters): InternalParameters constructor
17692         takes a DeclSpace instead of a TypeContainer.
17693
17694         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17695         types are being initialized, load the address of it before calling
17696         the function.  
17697
17698         (New): Provide a mechanism to disable the generation of local
17699         value type temporaries when the caller will be providing us with
17700         an address to store it.
17701
17702         (ArrayCreation.EmitDynamicInitializers): Use it.
17703
17704 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17705
17706         * expression.cs (Invocation.EmitArguments): Only probe for array
17707         property if there is more than one argument.  Sorry about that.
17708
17709         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17710         empty param arrays.
17711
17712         * class.cs (Method.LabelParameters): Fix incorrect code path that
17713         prevented the `ParamArrayAttribute' from being applied to the
17714         params attribute.
17715
17716 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17717
17718         * support.cs (ReflectionParameters): Correctly compute whether the
17719         last argument is a params array.  Fixes the problem with
17720         string.Split ('a')
17721
17722         * typemanager.cs: Make the assemblies array always be non-null
17723         (empty, but non-null)
17724
17725         * tree.cs (RecordDecl): New function that abstracts the recording
17726         of names.  This reports error 101, and provides a pointer to the
17727         previous declaration.  Fixes a crash in the compiler.
17728
17729         * cs-parser.jay (constructor_declaration): Update to new grammar,
17730         and provide a constructor_body that can be empty.
17731
17732 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * driver.cs: Add support for --resources.
17735
17736         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17737         Make all types for the various array helper methods be integer.
17738
17739         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17740         CheckState to ConvCast.
17741
17742         (ConvCast): Now it takes a `checked' state argument, to avoid
17743         depending on the emit context for the conversion, and just using
17744         the resolve time setting.
17745
17746         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17747         instead of Invocation.EmitArguments.  We do not emit the original
17748         arguments, instead we emit those which have been converted to
17749         unsigned int expressions.
17750
17751         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17752
17753         * codegen.cs: ditto.
17754
17755         * expression.cs (LocalVariableReference): Drop the use of the
17756         Store function that depended on the variable index.
17757
17758         * statement.cs (VariableInfo): Drop the `Idx' property from this
17759         class, as this is not taking into account the indexes for
17760         temporaries tat we generate during the execution, getting the
17761         indexes wrong.
17762
17763         * class.cs: First emit class initializers, then call the parent
17764         constructor. 
17765
17766         * expression.cs (Binary): Fix opcode emision.
17767         (UnaryMutator.EmitCode): Support checked code generation
17768
17769         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17770         matches for events for both the Static and Instance scans,
17771         pointing to the same element.   Fix that.
17772
17773 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * rootcontext.cs (ResolveTree): Always set the
17776         interface_resolve_order, because nested interfaces will be calling
17777         into us.
17778
17779         * class.cs (GetInterfaceOrClass): Track the same resolution
17780         process used by TypeManager.LookupType.  This fixes the nested
17781         type lookups in class declarations (separate path from
17782         LookupType). 
17783
17784         (TypeContainer.DefineType): Also define nested interfaces.
17785         (TypeContainer.RegisterOrder): New public function used to
17786         register the order in which child interfaces need to be closed.
17787
17788         Nested interfaces need to be closed after their parents have been
17789         created. 
17790
17791         * interface.cs (InterfaceAttr): Put all the logic for computing
17792         the interface attribute here. 
17793
17794         (DefineInterface): Register our interface order with the
17795         RootContext or with the TypeContainer depending on the case.
17796
17797 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17798
17799         * cs-parser.jay: rework foreach statement to work with the new
17800         changes to the policy on SimpleNames.
17801
17802         * report.cs: support Stacktrace on warnings as well.
17803
17804         * makefile: drop --unsafe and /unsafe from the compile.
17805
17806 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17807
17808         * ecore.cs (StandardConversionExists): Modify to take an Expression
17809         as the first parameter. Ensure we do null -> reference type conversion
17810         checking.
17811
17812         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17813         temporary Expression objects.
17814
17815 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17816
17817         * interface.cs: workaround bug in method overloading resolution
17818         (there is already a bugzilla bug for it).
17819
17820 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17821
17822         We could also solve this problem by having a separate path for
17823         performing type lookups, instead of DoResolve, we could have a
17824         ResolveType entry point, and only participating pieces of the
17825         production (simplename, deref, array) would implement this. 
17826
17827         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17828         signal SimpleName to only resolve type names and not attempt to
17829         resolve anything else.
17830
17831         * expression.cs (Cast): Set the flag.
17832
17833         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17834
17835         * class.cs: Only report 108 if there is no `new' modifier.
17836
17837         * cs-parser.jay: rework foreach statement to work with the new
17838         changes to the policy on SimpleNames.
17839         
17840         * report.cs: support Stacktrace on warnings as well.
17841
17842         * makefile: drop --unsafe and /unsafe from the compile.
17843
17844 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17845
17846         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17847         lookups here, instead of doing that at parse time.  This means
17848         that our grammar will not introduce `LocalVariableReferences' as
17849         expressions at this point.  That solves the problem of code like
17850         this:
17851
17852         class X {
17853            static void Main ()
17854            { int X = 1;
17855             { X x = null }}}
17856
17857         This is only half the fix.  The full fix requires parameters to
17858         also be handled in this way.
17859
17860         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17861         makes the use more obvious of the DeclSpace.  The
17862         ec.TypeContainer.TypeBuilder is now only used to pull the
17863         TypeBuilder for it.
17864
17865         My theory is that I can get rid of the TypeBuilder completely from
17866         the EmitContext, and have typecasts where it is used (from
17867         DeclSpace to where it matters).  
17868
17869         The only pending problem is that the code that implements Aliases
17870         is on TypeContainer, and probably should go in DeclSpace.
17871
17872         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17873         lookups here, instead of doing that at parse time.  This means
17874         that our grammar will not introduce `LocalVariableReferences' as
17875         expressions at this point.  That solves the problem of code like
17876         this:
17877
17878         class X {
17879            static void Main ()
17880            { int X = 1;
17881             { X x = null }}}
17882
17883         This is only half the fix.  The full fix requires parameters to
17884         also be handled in this way.
17885
17886         * class.cs (Property.DefineMethod): When implementing an interface
17887         method, set newslot, when implementing an abstract method, do not
17888         set the flag (before we tried never setting it, or always setting
17889         it, which is the difference).
17890         (Indexer.DefineMethod): same.
17891         (Method.DefineMethod): same.
17892
17893         * ecore.cs: Only set the status used flag if we get back a Field.
17894
17895         * attribute.cs: Temporary hack, so Paolo can keep working.
17896
17897 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17898
17899         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17900         the unmanaged type in the case we have a MarshalAs attribute.
17901
17902         (Resolve): Handle the case when we are parsing the special MarshalAs
17903         attribute [we need to store the unmanaged type to use later]
17904
17905         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17906         MarshalAs Attribute.
17907
17908         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17909         on parameters and accordingly set the marshalling info.
17910
17911 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17912
17913         * class.cs: Optimizing slightly by removing redundant code after
17914         we switched to the `NoTypes' return value.
17915         (Property.DefineMethod): use NoTypes here too.
17916
17917         This fixes the bug I introduced in my last batch of changes.
17918
17919 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17920
17921         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17922
17923         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17924         Enums since those are types too. 
17925
17926         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17927
17928         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17929         thanks to a call during the lookup process.
17930
17931 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * statement.cs (Foreach): Lots of work to accomodate a particular
17934         kind of foreach statement that I had not kept in mind.  It is
17935         possible to have foreachs on classes that provide a GetEnumerator
17936         method that return objects that implement the "pattern" for using
17937         a foreach, there is no need to support GetEnumerator
17938         specifically. 
17939
17940         This is needed to compile nant.
17941
17942         * decl.cs: Only report 114 if the member is not `Finalize' and if
17943         the warning level is at least 2.
17944
17945         * class.cs: Moved the compare function from Method to
17946         MethodSignature. 
17947
17948         (MethodSignature.InheritableMemberSignatureCompare): Add new
17949         filter function that is used to extract inheritable methods from a
17950         class. 
17951
17952         (Method.Define): Use the new `inheritable_method_signature_filter'
17953         delegate
17954
17955         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17956         command. 
17957
17958 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17959
17960         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17961
17962         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17963
17964         * expression.cs: Pass location information to
17965         ConvertImplicitStandard. 
17966
17967         * class.cs: Added debugging code to track return values from
17968         interfaces. 
17969
17970 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17971
17972         * expression.cs (Is.DoResolve): If either side of the `is' is an
17973         interface, do not flag the warning.
17974
17975         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17976         for interfaces
17977
17978         * report.cs: Allow for --fatal to be used with --probe.
17979
17980         * typemanager.cs (NoTypes): Move the definition for the empty Type
17981         array here. 
17982
17983         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17984         properties. 
17985         (TypeContainer.DefineProxy): New function used to proxy to parent
17986         implementations when implementing interfaces.
17987         (TypeContainer.ParentImplements): used to lookup if our parent
17988         implements a public function that is required by an interface.
17989         (TypeContainer.VerifyPendingMethods): Hook this up.
17990
17991         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17992         `modules' and `assemblies' arraylists into arrays.  We only grow
17993         these are the very early start up of the program, so this improves
17994         the speedof LookupType (nicely measured).
17995
17996         * expression.cs (MakeByteBlob): Replaced unsafe code with
17997         BitConverter, as suggested by Paolo.
17998
17999         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18000         folding of string concatenation, but if either side is a string,
18001         and the other is not, then return null, and let the runtime use
18002         the concatenation on the string plus the object (using
18003         `Object.ToString'). 
18004
18005 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18006
18007         Constant Folding has been implemented now.
18008
18009         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18010         the error instead on types that are not supported in one's
18011         complement. 
18012
18013         * constant.cs (Constant and all children): New set of functions to
18014         perform implict and explicit conversions.
18015
18016         * ecore.cs (EnumConstant): Implement the new functions to perform
18017         conversion by proxying to the child expression.
18018
18019         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18020         own separate setting that can not be turned off from the command
18021         line using --unchecked or --checked and is only controlled using
18022         the checked/unchecked statements and expressions.  This setting is
18023         used by the constant folder to flag errors.
18024
18025         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18026         ConstantCheckState as well.   
18027
18028         During Resolve, they also have to flag the state, because the
18029         constant folder runs completely in the Resolve phase.
18030
18031         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18032         well.
18033
18034 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * cfold.cs: New file, this file contains the constant folder.
18037
18038         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18039         argument to track whether we are using the resulting address to
18040         load or store a value and provide better error messages. 
18041
18042         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18043         new AddressOf arguments.
18044
18045         * statement.cs (Foreach.EmitCollectionForeach): Update
18046
18047         * expression.cs (Argument.Emit): Call AddressOf with proper
18048         arguments to track usage.
18049
18050         (New.DoEmit): Call AddressOf with new arguments.
18051
18052         (Unary.Emit): Adjust AddressOf call.
18053
18054 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18055
18056         * cs-parser.jay (member_access): Change the case for pre-defined types
18057         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18058         this suggestion.
18059
18060         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18061         a method body.
18062
18063         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18064         essentially like methods and apply attributes like MethodImplOptions to them too.
18065
18066         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18067         not being null.
18068
18069         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18070         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18071         is the DeclSpace.
18072
18073         * Update code everywhere accordingly.
18074
18075         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18076
18077         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18078
18079 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18080
18081         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18082         try performing lookups against those instead of jumping straight into using
18083         the 'using' clauses.
18084
18085         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18086
18087         (LookupType): Perform lookups in implicit parents too.
18088
18089         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18090         sequence as RootContext.LookupType. 
18091
18092         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18093         the various cases of namespace lookups into this method.
18094
18095 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18098         in positional arguments)
18099
18100         * class.cs (Operator): Update the AllowedModifiers to contain
18101         extern. 
18102
18103         * cs-parser.jay: Update operator declaration to allow for the
18104         operator body to be empty.
18105
18106         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18107         values. 
18108
18109 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * class.cs (Method.Emit): Label parameters.
18112
18113         * driver.cs: Return 1 or 0 as the program exit code.
18114
18115 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18116
18117         * expression.cs: Special case the `null' object when trying to
18118         auto-compute the type, as anything can be explicitly converted to
18119         that. 
18120
18121         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18122         spotting this Paolo.
18123
18124         (Expression.ImplicitNumericConversion): Perform comparissions of
18125         the type using the underlying type in the case of an enumeration
18126         rather than using the enumeration type for the compare.
18127
18128         Cope with the underlying == type case, which is not possible to
18129         catch before. 
18130
18131         (Expression.ConvertNumericExplicit): Perform comparissions of
18132         the type using the underlying type in the case of an enumeration
18133         rather than using the enumeration type for the compare.
18134
18135         * driver.cs: If the user does not supply an extension, assume .exe
18136
18137         * cs-parser.jay (if_statement): Rewrote so that we can track the
18138         location for the if statement.
18139
18140         * expression.cs (Binary.ConstantFold): Only concat strings when
18141         the operation is "+", not everything ;-)
18142
18143         * statement.cs (Statement.EmitBoolExpression): Take a location
18144         argument. 
18145         (If, While, Do): Track location.
18146
18147         * expression.cs (Binary.ResolveOperator): In the object + string
18148         case, I was missing a call to ConvertImplicit
18149
18150 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18151
18152         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18153         Location arguments. Ensure we use RootContext.LookupType to do our work
18154         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18155
18156         * interface.cs (PopulateMethod): Handle the type of the parameter being
18157         null gracefully.
18158
18159         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18160         have a params method with no fixed arguments and a call is made with no
18161         arguments.
18162
18163 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18166         the verbatim-string-literal
18167
18168         * support.cs (InternalParameters.ParameterModifier): handle null
18169         fixed parameters.
18170         (InternalParameters.ParameterType): ditto.
18171
18172         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18173         duplicating the name of the variable parameter.
18174         (GetParameterByName): Fix bug where we were not looking up array
18175         paramters if they were the only present (thanks Paolo!).
18176         (GetParameterInfo): We only have an empty set of types if both
18177         fixed and array are set to null.
18178         (GetParameterInfo-idx): Handle FixedParameter == null
18179
18180         * cs-parser.jay: Handle the case where there is no catch
18181         statements (missing null test).
18182
18183 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18184
18185         * driver.cs (MainDriver): Be conservative on our command line
18186         handling.
18187
18188         Catch DirectoryNotFoundException when calling GetFiles.
18189
18190         (SplitPathAndPattern): Used to split the input specification into
18191         a path and a pattern that we can feed to Directory.GetFiles.
18192
18193 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18194
18195         * statement.cs (Fixed): Implement the last case of the Fixed
18196         statement (string handling).
18197
18198         * expression.cs (StringPtr): New class used to return a char * to
18199         a string;  Used by the Fixed statement.
18200
18201         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18202
18203         * expression.cs (Binary.ResolveOperator): Remove redundant
18204         MemberLookup pn parent type.
18205         Optimize union call, we do not need a union if the types are the same.
18206         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18207         type.
18208
18209         Specialize the use of MemberLookup everywhere, instead of using
18210         the default settings. 
18211
18212         (StackAlloc): Implement stackalloc keyword.
18213
18214         * cs-parser.jay: Add rule to parse stackalloc.
18215
18216         * driver.cs: Handle /h, /help, /?
18217
18218         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18219         before we supported unsafe code.
18220
18221         * makefile: add --unsafe to the self compilation of mcs.
18222
18223 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18224
18225         * expression.cs (PointerArithmetic): New class that is used to
18226         perform pointer arithmetic.
18227         (Binary.Resolve): Handle pointer arithmetic
18228         Handle pointer comparission.
18229         (ArrayPtr): Utility expression class that is used to take the
18230         address of an array.
18231
18232         (ElementAccess): Implement array access for pointers
18233
18234         * statement.cs (Fixed): Implement fixed statement for arrays, we
18235         are missing one more case before we are done.
18236
18237         * expression.cs (Indirection): Implement EmitAssign and set the
18238         ExprClass to Variable.  This allows pointer dereferences to be
18239         treated as variables, and to have values assigned to them.
18240
18241         * ecore.cs (Expression.StoreFromPtr): New utility function to
18242         store values dereferencing.
18243
18244 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18245
18246         * expression.cs (Binary.ResolveOperator): Ensure that we are
18247         not trying to operate on a void type - this fixes the reported
18248         bug.
18249
18250         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18251         the parent implementation is sealed.
18252
18253         * ../errors/cs0239.cs : Add.
18254
18255         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18256
18257         * typemanager.cs (unverifiable_code_type): Corresponds to 
18258         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18259         which have unsafe code in them.
18260
18261         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18262         unsafe context.
18263
18264 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * cs-tokenizer.cs: Add support for @"litreal strings"
18267
18268         Make tokenizer accept pre-processor directives
18269         on any column (remove the old C-like limitation). 
18270
18271         * rootcontext.cs (EmitCode): Emit any global attributes.
18272         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18273
18274         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18275
18276         * cs-parser.jay: Add support for global attributes.  
18277
18278 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * expression.cs (Indirection): New helper class.  Unary will
18281         create Indirection classes to be able to implement the
18282         IMemoryLocation interface on it.
18283
18284 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18285
18286         * cs-parser.jay (fixed_statement): reference the right statement.
18287
18288         * statement.cs (Fixed.Emit): Finish implementing the fixed
18289         statement for the &x case.
18290
18291 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * class.cs (Property.Define, Method.Define): Remove newslot when
18294         `implementing'.  
18295
18296         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18297         wrong.  NewSlot should only be used if the `new' keyword is present.
18298
18299         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18300         locating our system dir.  Sorry about this.
18301
18302 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18303
18304         * driver.cs (GetSystemDir): Compute correctly the location of our
18305         system assemblies.  I was using the compiler directory instead of
18306         the library directory.
18307
18308 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18309
18310         * expression.cs (BetterFunction): Put back in what Miguel commented out
18311         since it is the correct fix. The problem is elsewhere ;-)
18312
18313         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18314         parameters of the parms method are themselves compatible or not !
18315
18316         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18317         to check that a class implements an interface before saying that an implicit
18318         conversion was allowed. Use ImplementsInterface to do the checking.
18319
18320 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18321
18322         * class.cs (Method.Define): Track whether we are an explicit
18323         implementation or not.  And only call DefineMethodOverride if we
18324         are an explicit implementation.
18325
18326         (Property.DefineMethod): Ditto.
18327
18328 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18329
18330         * expression.cs (BetterFunction): Catch hideous bug which was
18331          preventing us from detecting ambiguous calls due to implicit casts i.e
18332         cs0121.
18333
18334 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * support.cs (Pair): Remove un-needed method.  I figured why I was
18337         getting the error in cs-parser.jay, the variable in a foreach loop
18338         is readonly, and the compiler does not really treat this as a variable.
18339
18340         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18341         instead of EQUALS in grammar.  
18342
18343         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18344
18345         * expression.cs (Unary.DoResolve): Check whether the argument is
18346         managed or not.
18347
18348 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18349
18350         * support.cs: Api for Pair to set a value.  Despite the fact that
18351         the variables are public the MS C# compiler refuses to compile
18352         code that accesses the field if the variable is part of a foreach
18353         statement. 
18354
18355         * statement.cs (Fixed): Begin implementation of the fixed
18356         statement.
18357
18358         (Block.AddVariable): Return the VariableInfo on success and null
18359         on failure instead of true/false. 
18360
18361         * cs-parser.jay (foreach): Catch errors on variables already
18362         defined (we were ignoring this value before) and properly unwind
18363         the block hierarchy
18364
18365         (fixed_statement): grammar for the fixed statement.
18366
18367 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18368
18369         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18370         pointer types to be incretemented.
18371
18372         (SizeOf): Implement.
18373
18374         * cs-parser.jay (pointer_member_access): Implement
18375         expr->IDENTIFIER production.
18376
18377         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18378         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18379         on safe contexts.
18380
18381         (Unary): Implement indirection.
18382
18383         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18384         use in non-unsafe context).
18385
18386         (SimpleName.DoResolve): Check for pointers in field access on safe
18387         contexts. 
18388
18389         (Expression.LoadFromPtr): Factor the load-indirect code in this
18390         function.  This was duplicated in UnboxCast and ParameterReference
18391
18392 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18393
18394         * expression.cs (ComposedCast): report an error if a pointer cast
18395         is used in a safe region.
18396
18397         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18398         pointer type casts in unsafe context.
18399
18400         * codegen.cs (EmitContext): Set up IsUnsafe.
18401
18402         * cs-parser.jay (non_expression_type): Add productions for pointer
18403         casts. 
18404
18405         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18406         code.  We should not use force into static mode if the method is
18407         not virtual.  Fixes bug in MIS
18408
18409         * statement.cs (Do.Emit, While.Emit, For.Emit,
18410         Statement.EmitBoolExpression): Add support to Do and While to
18411         propagate infinite loop as `I do return' semantics.
18412
18413         Improve the For case to also test for boolean constants.
18414
18415         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18416         to the list of attributes we can add.
18417
18418         Remove `EmitContext' argument.
18419
18420         * class.cs (Method.Define): Apply parameter attributes.
18421         (Constructor.Define): Apply parameter attributes.
18422         (MethodCore.LabelParameters): Move here the core of labeling
18423         parameters. 
18424
18425         * support.cs (ReflectionParameters.ParameterModifier,
18426         InternalParameters.ParameterModifier): Use IsByRef on the type and
18427         only return the OUT bit for these parameters instead of in/out/ref
18428         flags.
18429
18430         This is because I miss-understood things.  The ParameterInfo.IsIn
18431         and IsOut represent whether the parameter has the [In] and [Out]
18432         attributes set.  
18433
18434 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * ecore.cs (FieldExpr.Emit): Release temporaries.
18437
18438         * assign.cs (LocalTemporary.Release): new function.
18439
18440         * codegen.cs (EmitContext.GetTemporaryStorage,
18441         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18442         temporary storage.  Now we can "put back" localbuilders when we
18443         are done with them
18444
18445 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18446
18447         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18448         need to make a copy of the variable to generate verifiable code.
18449
18450 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * driver.cs: Compute dynamically the system directory.
18453
18454         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18455         Slower, but more generally useful.  Used by the abstract
18456         registering implementation. 
18457
18458         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18459         the rules for the special rule on Type/instances.  First check if
18460         we have the same name, and if so, try that special static path
18461         rather than the instance path.
18462
18463 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18466         for, while and if.
18467
18468         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18469         Enum, ValueType, Delegate or Array for non-corlib compiles.
18470
18471         * cs-tokenizer.cs: Catch long identifiers (645)
18472
18473         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18474         piece of code.
18475
18476         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18477         fix, we were returning too early, so we were not registering
18478         pending methods from abstract classes.
18479
18480         Do not register pending methods if the class is abstract.
18481
18482         * expression.cs (Conditional.DoResolve): Report circular implicit
18483         conversions when we neecd to compute it for conditional
18484         expressions. 
18485
18486         (Is.DoResolve): If the expression is always of the provided type,
18487         flag warning 183.  If the expression can not ever be of the
18488         provided type flag warning 184.
18489
18490         * class.cs: Catch 169 as well.
18491
18492         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18493         read. 
18494
18495 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18496
18497         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18498
18499 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * interface.cs: (PopulateMethod): Check for pointers being defined
18502         only if the unsafe context is active.
18503         (PopulateProperty): ditto.
18504         (PopulateIndexer): ditto.
18505
18506         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18507         specified.  If pointers are present, make sure that they are
18508         present in an unsafe context.
18509         (Constructor, Constructor.Define): ditto.
18510         (Field, Field.Define): ditto.
18511         (Property, Property.Define): ditto.
18512         (Event, Event.Define): ditto.
18513
18514         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18515         hashtable if there are classes or structs defined.
18516
18517         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18518         code, as the constant resolution moved.
18519
18520         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18521         the metadata, so we can flag error 133. 
18522
18523         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18524         pointer is being declared in an unsafe context.
18525
18526 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18527
18528         * modifiers.cs (Modifiers.Check): Require a Location argument.
18529         Report error 227 for Unsafe use.
18530
18531         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18532
18533         * statement.cs (For.Emit): If the test is null, then report that
18534         we do `return', as we wont reach anything afterwards.
18535
18536         (Switch.SwitchGoverningType): Track the expression that matched
18537         the conversion.
18538
18539         * driver.cs: Allow negative numbers as an error code to flag.
18540
18541         * cs-parser.jay: Handle 1551.
18542
18543         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18544
18545 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18546
18547         * cs-parser.jay: Report 1518 (type declaration can only contain
18548         class, struct, interface, enum or delegate)
18549
18550         (switch_label): Report 1523 (keywords `case' or `default' must
18551         preced code)
18552
18553         (opt_switch_sections): Report 1522 (empty switch)
18554
18555         * driver.cs: Report 1515 (response file specified multiple times)
18556         Report 1516 (Source file specified multiple times).
18557
18558         * expression.cs (Argument.Resolve): Signal 1510
18559
18560         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18561         access not allowed in static code)
18562
18563 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18564
18565         * typemanager.cs (IsPointerType): Utility method which we are going
18566         to need a lot.
18567
18568         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18569         the object type, so we take care of that.
18570
18571         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18572
18573         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18574         added to non-params parameters :-)
18575
18576         * typemanager.cs (CSharpName): Include 'void' type too. 
18577
18578         (void_ptr_type): Include in the set of core types.
18579
18580         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18581         duplicating code.
18582
18583         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18584         an unsafe context.
18585
18586         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18587         completely forgotten about it.
18588
18589 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18590
18591         * cs-parser.jay (pointer_type): Add. This begins our implementation
18592         of parsing rules for unsafe code.
18593
18594         (unsafe_statement): Implement.
18595
18596         (embedded_statement): Modify to include the above.
18597
18598         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18599
18600         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18601         if the current context is an unsafe one.
18602
18603         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18604         are handled differently, we need separate rules for them.
18605
18606         (local_variable_declaration): Update to use local_variable_pointer_type
18607         to allow variable declarations of unmanaged pointer types.
18608
18609         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18610         in unsafe contexts.
18611
18612         * ../errors/cs0214.cs : Add.
18613
18614 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18615
18616         * makefile: remove 'response' file when cleaning.
18617
18618 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18619
18620         * cs-parser.jay: Report 1524.
18621
18622 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18623
18624         * typemanager.cs (RegisterMethod): drop checking if we have
18625         registered this from here
18626
18627 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * class.cs (Method.EmitDestructor): Implement calling our base
18630         destructor. 
18631
18632         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18633         value of InFinally.
18634
18635         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18636         this routine and will wrap the call in a try/catch block.  Deal
18637         with the case.
18638
18639 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18640
18641         * ecore.cs (Expression.MemberLookup): instead of taking a
18642         parameter `same_type' that was used to tell whether we could
18643         access private members we compute our containing type from the
18644         EmitContext.
18645
18646         (FieldExpr): Added partial support for volatile fields.  This does
18647         not work for volatile fields exposed from assemblies, as I can not
18648         figure out how to extract the modreq from it.
18649
18650         Updated all the source files to use this.
18651
18652         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18653         because it is referenced by MemberLookup very often. 
18654
18655 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18656
18657         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18658         TypeBuilder.GetCustomAttributes to retrieve what we need.
18659
18660         Get rid of redundant default_member_attr_type as this is the same as
18661         default_member_type which already exists.
18662
18663         * interface.cs, attribute.cs : Update accordingly.
18664
18665 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18666
18667         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18668         work for TYpeBuilders though.  Ravi, can you please fix this?
18669
18670         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18671
18672         * expression.cs (Argument.Emit): Handle the case of ref objects
18673         being passed to ref functions;  
18674
18675         (ParameterReference.EmitLoad): Loads the content of the pointer
18676         without dereferencing.
18677
18678 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18679
18680         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18681
18682 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18683
18684         * class.cs (Indexer.DefineMethod): Incorporate the interface
18685         type in the name of the method if we are doing explicit interface
18686         implementation.
18687
18688         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18689
18690         (BetterConversion): Fix extremely trivial bug where we were referring to
18691         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18692         again !
18693
18694         * ../errors/bug16.cs : Add although we have fixed it.
18695
18696 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18697
18698         * expression.cs (BaseIndexer): Begin implementation.
18699
18700         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18701
18702         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18703         production directly to remove a shift/reduce, and implement
18704         explicit interface implementation.
18705
18706         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18707         after a floating point suffix.
18708
18709         * expression.cs (DoNumericPromotions): Improved the conversion for
18710         uint/uint.  If we have a constant, we avoid doing a typecast to a
18711         larger type.
18712
18713         * class.cs (Indexer): Implement explicit interface implementation
18714         for indexers.
18715
18716 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18717
18718         * class.cs: make the default instance constructor public and hidebysig.
18719
18720 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18721
18722         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18723         so we can call it from elsewhere.
18724
18725         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18726         we emit it internally if the class has a defined indexer; otherwise the user
18727         emits it by decorating the class definition with the DefaultMemberAttribute.
18728
18729         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18730         attribute is not used on a type which defines an indexer.
18731
18732         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18733         character when we skip whitespace.
18734
18735         * ../errors/cs0646.cs : Add.
18736
18737 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18738
18739         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18740         again. 
18741
18742         * makefile: Add practical target `mcs3.exe' which builds the third
18743         generation compiler. 
18744
18745         * expression.cs (New): Fix structures constructor calling.
18746
18747         * class.cs (Property, Method, Indexer): Emit Final flag on the
18748         method if we are an interface implementation and we are not
18749         abstract. 
18750
18751         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18752         whether this property is referencing a `base' method.
18753
18754         * expression.cs (Invocation.EmitCall): take an extra argument:
18755         is_base, this is used to determine whether the `call' or
18756         `callvirt' opcode should be used.
18757
18758
18759         * delegate.cs: update EmitCall.
18760
18761         * class.cs (Method.Define): Set NewSlot for the cases where we are
18762         not implementing an interface method.
18763
18764         (Property.Define): ditto.
18765
18766 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18767
18768         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18769         'r'.  Allows mcs to parse itself fully.
18770
18771 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18772
18773         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18774         of the number of initializers that require the InitializeArray method.
18775
18776         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18777         update the above field where necessary.
18778
18779         (MakeByteBlob): Update accordingly.
18780
18781         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18782         greater than 2.
18783
18784         (EmitDynamicInitializers): Update in accordance with the new optimization.
18785
18786         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18787         same OpCode applies.
18788
18789         * cs-parser.jay : Fix some glaring errors I introduced.
18790
18791 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18792
18793         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18794         so that we can check for name clashes there too.
18795
18796         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18797         for interface indexers.
18798
18799         * interfaces.cs (Define): Emit the default member attribute.
18800
18801         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18802         variable was being referred to while setting the value ;-)
18803
18804 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18805
18806         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18807         byte-by-byte information when we know the data is zero.
18808
18809         Make the block always a multiple of 4, because
18810         DefineInitializedData has a bug.
18811
18812         * assign.cs: Fix, we should assign from the temporary, not from
18813         the source. 
18814
18815         * expression.cs (MakeByteBlob): Fix my incorrect code.
18816
18817 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18818
18819         * typemanager.cs (EnumToUnderlying): This function is used to get
18820         the underlying type from an enumeration, because it does not
18821         always work. 
18822
18823         * constant.cs: Use the I4_S form for values between -128 and 127.
18824
18825         * statement.cs (Block.LookupLabel): Looks up a label.
18826         (Block): Drop support for labeled blocks.
18827
18828         (LabeledStatement): New kind of statement that represents a label
18829         only.
18830
18831         (Goto): Finally implement this bad boy.
18832
18833         * cs-parser.jay: Update to reflect new mechanism to implement
18834         labels.
18835
18836 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18837
18838         * codegen.cs (EmitContext.This): a codegen property that keeps the
18839         a single instance of this instead of creating many different this
18840         instances. 
18841
18842         * delegate.cs (Delegate.DoResolve): Update to use the property;
18843
18844         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18845
18846         * expression.cs (BaseAccess.DoResolve): Ditto.
18847
18848 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18849
18850         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18851         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18852
18853         (InitCoreTypes): Update accordingly.
18854
18855         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18856         so we can quickly store the state.
18857
18858         (ApplyAttributes): Set the correct implementation flags
18859         for InternalCall methods.
18860
18861 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18862
18863         * expression.cs (EmitCall): if a method is not virtual, then do
18864         not use callvirt on it.
18865
18866         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18867         user defined stuff) requires the use of stobj, which takes an
18868         address on the stack instead of an array and an index.  So emit
18869         the Ldelema operation for it.
18870
18871         (EmitStoreOpcode): Use stobj for valuetypes.
18872
18873         (UnaryMutator.EmitCode): Use the right 1 value depending on
18874         whether we are dealing with int64/uint64, float or doubles.
18875
18876         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18877         constructors that I implemented last night.
18878
18879         (Constructor.IsDefault): Fix to work properly for static
18880         constructors.
18881
18882         * cs-parser.jay (CheckDef): report method signature errors.
18883         Update error number 103 to be 132.
18884
18885         * decl.cs: New AdditionResult enumeration value: MethodExists.
18886         Although we do this check for methods later on in the semantic
18887         analysis, catching repeated default constructors is so easy that
18888         we catch these here. 
18889
18890         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18891         promotions code.
18892
18893         (ParameterReference.EmitAssign, Emit): handle
18894         bools as bytes.
18895
18896         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18897         (ArrayAccess.EmitStoreOpcode): ditto.
18898
18899         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18900
18901         * expression.cs (MakeByteBlob): Complete all the missing types
18902         (uint, short, ushort, byte, sbyte)
18903
18904         * class.cs: Only init instance field initializers on instance
18905         constructors. 
18906
18907         Rename `constructors' to instance_constructors. 
18908
18909         (TypeContainer.AddConstructor): Only add constructors to the list
18910         if it is not static.
18911
18912         Make sure that we handle default_static_constructor independently
18913         everywhere where we handle instance_constructors
18914
18915 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18916
18917         * class.cs: Do not lookup or create a base initializer for a
18918         static constructor.
18919
18920         (ConstructorInitializer.Resolve): use the proper type to lookup
18921         for constructors.
18922
18923         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18924
18925         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18926         in DeclSpace. 
18927
18928         * decl.cs: CloseType is now an virtual method, the default
18929         implementation just closes this type.
18930
18931 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18932
18933         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18934         to PreserveSig by default. Also emit HideBySig on such methods.
18935
18936         Basically, set the defaults to standard values.
18937
18938         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18939         argument, if candidate is better, it can't be worse than the best !
18940
18941         (Invocation): Re-write bits to differentiate between methods being
18942         applicable in their expanded form and their normal form - for params
18943         methods of course.
18944
18945         Get rid of use_standard everywhere as only standard conversions are allowed
18946         in overload resolution. 
18947
18948         More spec conformance.
18949
18950 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * driver.cs: Add --timestamp, to see where the compiler spends
18953         most of its time.
18954
18955         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18956         `this' in static code.
18957
18958         (SimpleName.DoResolve): Implement in terms of a helper function
18959         that allows static-references to be passed upstream to
18960         MemberAccess.
18961
18962         (Expression.ResolveWithSimpleName): Resolve specially simple
18963         names when called by MemberAccess to implement the special
18964         semantics. 
18965
18966         (Expression.ImplicitReferenceConversion): Handle conversions from
18967         Null to reference types before others, as Null's type is
18968         System.Object. 
18969
18970         * expression.cs (Invocation.EmitCall): Handle the special case of
18971         calling methods declared on a reference type from a ValueType
18972         (Base classes System.Object and System.Enum)
18973
18974         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18975         the left hand side is a TypeExpr, not on every enumeration. 
18976
18977         (Binary.Resolve): If types are reference types, then do a cast to
18978         object on operators != and == of both arguments.
18979
18980         * typemanager.cs (FindMembers): Extract instance and static
18981         members if requested.
18982
18983         * interface.cs (PopulateProperty): Use void_type instead of null
18984         as the return type for the setter method.
18985
18986         (PopulateIndexer): ditto.
18987
18988 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18989
18990         * support.cs (ReflectionParameters): Fix minor bug where we
18991         were examining the wrong parameter for the ParamArray attribute.
18992
18993         Cope with requests for the type of the parameter at position
18994         greater than the params parameter's. We now return the element
18995         type of the params array as that makes more sense.
18996
18997         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18998         accordingly as we no longer have to extract the element type
18999         ourselves.
19000
19001         (Invocation.OverloadResolve): Update.
19002
19003 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19004
19005         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19006         against IEnumerator, test whether the return value is a descendant
19007         of the IEnumerator interface.
19008
19009         * class.cs (Indexer.Define): Use an auxiliary method to implement
19010         the other bits of the method definition.  Begin support for
19011         explicit interface implementation.
19012
19013         (Property.DefineMethod): Use TypeManager.void_type instead of null
19014         for an empty return value.
19015
19016 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19017
19018         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19019         dealing with a FieldExpr which is composed of a FieldBuilder, in
19020         the code path we did extract the constant, but we should have
19021         obtained the underlying value to be able to cast it (otherwise we
19022         end up in an infinite loop, this is what Ravi was running into).
19023
19024         (ArrayCreation.UpdateIndices): Arrays might be empty.
19025
19026         (MemberAccess.ResolveMemberAccess): Add support for section
19027         14.5.4.1 that deals with the special case of E.I when E is a type
19028         and something else, that I can be a reference to a static member.
19029
19030         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19031         handle a particular array type to create byte blobs, it is just
19032         something we dont generate byteblobs for.
19033
19034         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19035         arguments. 
19036
19037         * location.cs (Push): remove the key from the hashtable that we
19038         are about to add.   This happens for empty files.
19039
19040         * driver.cs: Dispose files after we have parsed them.
19041
19042         (tokenize): new function that only runs the tokenizer on its
19043         input, for speed testing.
19044
19045 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19046
19047         * class.cs (Event.Define): Define the private field only if there
19048         are no accessors defined.
19049
19050         * expression.cs (ResolveMemberAccess): If there is no associated
19051         field with the event, that means we have an event defined with its
19052         own accessors and we should flag error cs0070 since transforming
19053         ourselves into a field is not valid in that case.
19054
19055         * ecore.cs (SimpleName.DoResolve): Same as above.
19056
19057         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19058         and charset to sane values.
19059
19060 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19061
19062         * assign.cs (DoResolve): Perform check on events only if they 
19063         are being accessed outside the declaring type.
19064
19065         * cs-parser.jay (event_declarations): Update rules to correctly
19066         set the type of the implicit parameter etc.
19067
19068         (add_accessor, remove_accessor): Set current local parameters.
19069
19070         * expression.cs (Binary): For delegate addition and subtraction,
19071         cast the return value from the method into the appropriate delegate
19072         type.
19073
19074 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19075
19076         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19077         of these as the workaround is unnecessary.
19078
19079         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19080         delegate data - none of that is needed at all.
19081
19082         Re-write bits to extract the instance expression and the delegate method
19083         correctly.
19084
19085         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19086         on delegates too.
19087
19088         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19089         of attaching attributes instead of duplicating code everywhere.
19090
19091         * everywhere : Update code to do attribute emission using the above method.
19092
19093 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * expression.cs (IsParamsMethodApplicable): if there are not
19096         parameters, return immediately.
19097
19098         * ecore.cs: The 0 literal can be implicity converted to an enum
19099         type. 
19100
19101         (SimpleName.DoResolve): First lookup the type, then lookup the
19102         members. 
19103
19104         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19105         want to get its address.  If the InstanceExpression is not
19106         addressable, store the result in a temporary variable, then get
19107         the address of it.
19108
19109         * codegen.cs: Only display 219 errors on warning level or above. 
19110
19111         * expression.cs (ArrayAccess): Make it implement the
19112         IMemoryLocation interface.
19113
19114         (Binary.DoResolve): handle the operator == (object a, object b)
19115         and operator != (object a, object b) without incurring into a
19116         BoxedCast (because 5 != o should never be performed).
19117
19118         Handle binary enumerator operators.
19119
19120         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19121         value type, otherwise use Ldelem_ref.
19122
19123         Use precomputed names;
19124
19125         (AddressOf): Implement address of
19126
19127         * cs-parser.jay (labeled_statement): Fix recursive block
19128         addition by reworking the production.
19129
19130         * expression.cs (New.DoEmit): New has a special case:
19131                 
19132                  If we are dealing with a ValueType, we have a few
19133                  situations to deal with:
19134                 
19135                     * The target of New is a ValueType variable, that is
19136                       easy, we just pass this as the variable reference
19137                 
19138                     * The target of New is being passed as an argument,
19139                       to a boxing operation or a function that takes a
19140                       ValueType.
19141                 
19142                       In this case, we need to create a temporary variable
19143                       that is the argument of New.
19144
19145
19146 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19147
19148         * rootcontext.cs (LookupType): Check that current_type is not null before
19149         going about looking at nested types.
19150
19151         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19152         not implement the IAssignMethod interface any more.
19153
19154         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19155         where we tranform them into FieldExprs if they are being resolved from within
19156         the declaring type.
19157
19158         * ecore.cs (SimpleName.DoResolve): Do the same here.
19159
19160         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19161
19162         * ../errors/bug10.cs : Add.
19163
19164         * ../errors/cs0070.cs : Add.
19165
19166         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19167
19168         * assign.cs : Get rid of EventIsLocal everywhere.
19169
19170 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19171
19172         * ecore.cs (ConvertIntLiteral): finished the implementation.
19173
19174         * statement.cs (SwitchLabel): Convert the value we are using as a
19175         key before looking up the table.
19176
19177 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19178
19179         * codegen.cs (EmitTopBlock): Require a Location argument now.
19180
19181         * cs-parser.jay (constructor_declarator): We need to setup
19182         current_local_parameters before we parse the
19183         opt_constructor_initializer, to allow the variables to be bound
19184         to the constructor arguments.
19185
19186         * rootcontext.cs (LookupType): First lookup nested classes in our
19187         class and our parents before we go looking outside our class.
19188
19189         * expression.cs (ConstantFold): Extract/debox the values at the
19190         beginnning. 
19191
19192         * rootcontext.cs (EmitCode): Resolve the constants first before we
19193         resolve the types.  This is not really needed, but it helps debugging.
19194
19195         * statement.cs: report location.
19196
19197         * cs-parser.jay: pass location to throw statement.
19198
19199         * driver.cs: Small bug fix.
19200
19201         * report.cs: Updated format to be 4-zero filled digits.
19202
19203 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19204
19205         * expression.cs (CheckIndices): Fix minor bug where the wrong
19206         variable was being referred to ;-)
19207
19208         (DoEmit): Do not call EmitStaticInitializers when the 
19209         underlying type is System.Object.
19210
19211 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19212
19213         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19214         and do the usual workaround for SRE.
19215
19216         * class.cs (MyEventBuilder.EventType): New member to get at the type
19217         of the event, quickly.
19218
19219         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19220
19221         * assign.cs (Assign.DoResolve): Handle the case when the target
19222         is an EventExpr and perform the necessary checks.
19223
19224         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19225         interface.
19226
19227         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19228
19229         (EventExpr): Set the type in the constructor itself since we 
19230         are meant to be born fully resolved.
19231
19232         (EventExpr.Define): Revert code I wrote earlier.
19233                 
19234         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19235         instance expression is null. The instance expression is a This in that case
19236         or a null, depending on whether it is a static method or not.
19237
19238         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19239         refers to more than one method.
19240
19241         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19242         and accordingly flag errors.
19243
19244 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19245
19246         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19247
19248 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19249
19250         * location.cs (ToString): Provide useful rutine.
19251
19252 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19253
19254         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19255         objects, return the actual integral boxed.
19256
19257         * statement.cs (SwitchLabel): define an ILLabel for each
19258         SwitchLabel. 
19259
19260         (Switch.CheckSwitch): If the value is a Literal, extract
19261         the underlying literal.
19262
19263         Also in the unused hashtable we had, add the SwitchLabel so we can
19264         quickly look this value up.
19265
19266         * constant.cs: Implement a bunch of new constants.  Rewrite
19267         Literal based on this.  Made changes everywhere to adapt to this.
19268
19269         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19270         dereferencing array only once, and also copes with enumrations.
19271
19272         bytes are two bytes wide, not one.
19273
19274         (Cast): Perform constant conversions.
19275
19276         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19277         wrappers to the literals here.
19278
19279         * expression.cs (DoNumericPromotions): long literals can converted
19280         to ulong implicity (this is taken care of elsewhere, but I was
19281         missing this spot).
19282
19283         * ecore.cs (Expression.Literalize): Make the return type Literal,
19284         to improve type checking.
19285
19286         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19287
19288 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19289
19290         * literal.cs: Revert code from ravi that checked the bounds.  The
19291         bounds are sane by the definition of the type itself. 
19292
19293         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19294         need to actually look up in our parent hierarchy for interfaces
19295         implemented. 
19296
19297         * const.cs: Use the underlying type for enumerations
19298
19299         * delegate.cs: Compute the basename for the delegate creation,
19300         that should fix the delegate test case, and restore the correct
19301         Type Lookup semantics in rootcontext
19302
19303         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19304         referencing a nested type with the Reflection API is using the "+"
19305         sign. 
19306
19307         * cs-parser.jay: Do not require EOF token at the end.
19308
19309 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19310
19311         * rootcontext.cs (LookupType): Concatenate type names with
19312         a '.' instead of a '+' The test suite passes again.
19313
19314         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19315         field of the enumeration.
19316
19317         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19318         the case when the member is an EventExpr.
19319
19320         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19321         static has an associated instance expression.
19322
19323         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19324
19325         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19326
19327         * class.cs (Event.Define): Register event and perform appropriate checks
19328         for error #111.
19329
19330         We define the Add and Remove methods even if the use provides none because
19331         in that case, we provide default implementations ourselves.
19332
19333         Define a private field of the type of the event. This is done by the CSC compiler
19334         and we should be doing it too ;-)
19335
19336         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19337         More methods we use in code we generate.
19338
19339         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19340         is important.
19341
19342         (InitCoreTypes): Update accordingly for the above.
19343
19344         * class.cs (Event.Emit): Generate code for default accessors that we provide
19345
19346         (EmitDefaultMethod): Do the job in the above.
19347
19348         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19349         appropriate place.
19350
19351 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19354         builders even if we were missing one.
19355
19356         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19357         pass the Basename as our class name instead of the Name.  The
19358         basename will be correctly composed for us.
19359
19360         * parameter.cs (Paramters): Now takes a Location argument.
19361
19362         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19363         make all the code call directly LookupType in RootContext and take
19364         this chance to pass the Location information everywhere.
19365
19366         * Everywhere: pass Location information.
19367
19368 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * class.cs (Constructor.Define): Updated way of detecting the
19371         length of the parameters.
19372
19373         (TypeContainer.DefineType): Use basename as the type name for
19374         nested types.
19375
19376         (TypeContainer.Define): Do not recursively define types here, as
19377         definition is taken care in order by the RootContext.
19378
19379         * tree.cs: Keep track of namespaces in a per-file basis.
19380
19381         * parameter.cs (Parameter.ComputeSignature): Update to use
19382         DeclSpace. 
19383
19384         (Parameters.GetSignature): ditto.
19385
19386         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19387         instead of a TypeContainer.
19388
19389         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19390         resolve names.  Because we need to be resolve in our context, not
19391         our parents.
19392
19393         * driver.cs: Implement response files.
19394
19395         * class.cs (TypeContainer.DefineType): If we are defined, do not
19396         redefine ourselves.
19397
19398         (Event.Emit): Emit the code for add/remove handlers.
19399         (Event.Define): Save the MethodBuilders for add/remove.
19400
19401         * typemanager.cs: Use pair here too.
19402
19403         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19404         DictionaryEntry requires the first argument to be non-null.  
19405
19406         (enum_declaration): Compute full name for registering the
19407         enumeration.
19408
19409         (delegate_declaration): Instead of using
19410         formal_parameter_list, use opt_formal_parameter_list as the list
19411         can be empty.
19412
19413         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19414         (EventParsing): New property that controls whether `add' and
19415         `remove' are returned as tokens or identifiers (for events);
19416
19417 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19418
19419         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19420         use MyEventBuilder only and let it wrap the real builder for us.
19421
19422         (MyEventBuilder): Revamp constructor etc.
19423
19424         Implement all operations that we perform on EventBuilder in precisely the same
19425         way here too.
19426
19427         (FindMembers): Update to use the EventBuilder member.
19428
19429         (Event.Emit): Update accordingly.
19430
19431 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19432
19433         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19434         by calling the appropriate methods.
19435
19436         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19437         useful.
19438
19439         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19440
19441 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19442
19443         * delegate.cs (Delegate.Populate): Check that the return type
19444         and various parameters types are indeed accessible.
19445
19446         * class.cs (Constructor.Define): Same here.
19447
19448         (Field.Define): Ditto.
19449
19450         (Event.Define): Ditto.
19451
19452         (Operator.Define): Check that the underlying Method defined itself
19453         correctly - so it's MethodBuilder should not be null.
19454
19455         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19456         expression happens to be null.
19457
19458         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19459         members but as of now we don't seem to be able to do anything really useful with it.
19460
19461         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19462         not the EventBuilder.
19463
19464 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * cs-tokenizer.cs: Add support for defines.
19467         Add support for #if, #elif, #else, #endif
19468
19469         (eval_var): evaluates a variable.
19470         (eval): stubbed for evaluating functions.
19471
19472         * cs-parser.jay: Pass the defines information
19473
19474         * driver.cs: Add --define command line option.
19475
19476         * decl.cs: Move MemberCore here.
19477
19478         Make it the base class for DeclSpace.  This allows us to catch and
19479         report 108 and 109 for everything now.
19480
19481         * class.cs (TypeContainer.Define): Extract all the members
19482         before populating and emit the warning 108 (new keyword required
19483         to override) instead of having each member implement this.
19484
19485         (MemberCore.Define): New abstract method, we will be using this in
19486         the warning reporting engine in Populate.
19487
19488         (Operator.Define): Adjust to new MemberCore protocol. 
19489
19490         * const.cs (Const): This does not derive from Expression, it is a
19491         temporary object we use to create fields, it is a MemberCore. 
19492
19493         * class.cs (Method.Define): Allow the entry point to be in a
19494         specific class.
19495
19496         * driver.cs: Rewrite the argument handler to clean it up a bit.
19497
19498         * rootcontext.cs: Made it just an auxiliary namespace feature by
19499         making everything static.
19500
19501         * driver.cs: Adapt code to use RootContext type name instead of
19502         instance variable.
19503
19504         * delegate.cs: Remove RootContext argument.
19505
19506         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19507         argument. 
19508
19509         * class.cs (Event.Define): The lookup can fail.
19510
19511         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19512
19513         * expression.cs: Resolve the this instance before invoking the code.
19514
19515 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * cs-parser.jay: Add a production in element_access that allows
19518         the thing to become a "type" reference.  This way we can parse
19519         things like "(string [])" as a type.
19520
19521         Note that this still does not handle the more complex rules of
19522         casts. 
19523
19524
19525         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19526
19527         * ecore.cs: (CopyNewMethods): new utility function used to
19528         assemble the list of methods from running FindMembers.
19529
19530         (MemberLookup): Rework FindMembers so that 
19531
19532 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19533
19534         * class.cs (TypeContainer): Remove Delegates who fail to be
19535         defined.
19536
19537         * delegate.cs (Populate): Verify that we dont get null return
19538         values.   TODO: Check for AsAccessible.
19539
19540         * cs-parser.jay: Use basename to emit error 574 (destructor should
19541         have the same name as container class), not the full name.
19542
19543         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19544         possible representation.  
19545
19546         Also implements integer type suffixes U and L.
19547
19548 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19549
19550         * expression.cs (ArrayCreation.DoResolve): We need to do the
19551         argument resolution *always*.
19552
19553         * decl.cs: Make this hold the namespace.  Hold the root context as
19554         well.
19555         (LookupType): Move here.
19556
19557         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19558
19559         * location.cs (Row, Name): Fixed the code, it was always returning
19560         references to the first file.
19561
19562         * interface.cs: Register properties defined through interfaces.
19563
19564         * driver.cs: Add support for globbing on the command line
19565
19566         * class.cs (Field): Make it derive from MemberCore as well.
19567         (Event): ditto.
19568
19569 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19570
19571         * class.cs (Event::Define): Check that the type of the event is a delegate
19572         type else flag error #66.
19573
19574         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19575         same.
19576
19577         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19578         values of EntryPoint, CharSet etc etc.
19579
19580         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19581
19582         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19583         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19584         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19585         which needs this to do its work.
19586
19587         * ../errors/cs0066.cs : Add.
19588
19589 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19590
19591         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19592         helper functions.
19593
19594         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19595         clears out the parameters field.
19596         (MemberSignatureCompare): Cleanup
19597
19598         (MemberCore): New base class used to share code between MethodCore
19599         and Property.
19600
19601         (RegisterRequiredImplementations) BindingFlags.Public requires
19602         either BindingFlags.Instace or Static.  Use instance here.
19603
19604         (Property): Refactored code to cope better with the full spec.
19605
19606         * parameter.cs (GetParameterInfo): Return an empty array instead
19607         of null on error.
19608
19609         * class.cs (Property): Abstract or extern properties have no bodies.
19610
19611         * parameter.cs (GetParameterInfo): return a zero-sized array.
19612
19613         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19614         method modifier validation to the typecontainer so we can reuse
19615         this on properties.
19616
19617         (MethodCore.ParameterTypes): return an empty sized array of types.
19618
19619         (Property.Define): Test property modifier validity.
19620
19621         Add tests for sealed/override too.
19622
19623         (Method.Emit): abstract or extern methods have no bodies.
19624
19625 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19626
19627         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19628         thing.
19629
19630         (Method::Define, ::Emit): Modify accordingly.
19631
19632         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19633
19634         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19635
19636         * makefile: Pass in /unsafe.
19637
19638 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19639
19640         * class.cs (MakeKey): Kill routine.
19641
19642         * class.cs (TypeContainer.Define): Correctly define explicit
19643         method implementations (they require the full interface name plus
19644         the method name).
19645
19646         * typemanager.cs: Deply the PtrHashtable here and stop using the
19647         lame keys.  Things work so much better.
19648
19649         This of course broke everyone who depended on `RegisterMethod' to
19650         do the `test for existance' test.  This has to be done elsewhere.
19651
19652         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19653         the object stupid Equals method (because, that like fails all over
19654         the place).  We still do not use it.
19655
19656         * class.cs (TypeContainer.SetRequiredInterface,
19657         TypeContainer.RequireMethods): Killed these two routines and moved
19658         all the functionality to RegisterRequiredImplementations.
19659
19660         (TypeContainer.RegisterRequiredImplementations): This routine now
19661         registers all the implementations required in an array for the
19662         interfaces and abstract methods.  We use an array of structures
19663         which can be computed ahead of time to reduce memory usage and we
19664         also assume that lookups are cheap as most classes will not
19665         implement too many interfaces.
19666
19667         We also avoid creating too many MethodSignatures.
19668
19669         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19670         clear the "pending" bit if we find that there are problems with
19671         the declaration.
19672
19673         (TypeContainer.VerifyPendingMethods): Update to report errors of
19674         methods that look like implementations but are not.
19675
19676         (TypeContainer.Define): Add support for explicit interface method
19677         implementation. 
19678
19679 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * typemanager.cs: Keep track of the parameters here instead of
19682         being a feature of the TypeContainer.
19683
19684         * class.cs: Drop the registration of parameters here, as
19685         InterfaceMethods are also interface declarations.
19686
19687         * delegate.cs: Register methods with the TypeManager not only with
19688         the TypeContainer.  This code was buggy.
19689
19690         * interface.cs: Full registation here.
19691
19692 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * expression.cs: Remove reducer for binary expressions, it can not
19695         be done this way.
19696
19697         * const.cs: Put here the code that used to go into constant.cs
19698
19699         * constant.cs: Put here the code for constants, this is a new base
19700         class for Literals.
19701
19702         * literal.cs: Make Literal derive from Constant.
19703
19704 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * statement.cs (Return.Emit): Report error 157 if the user
19707         attempts to return from a finally block.
19708
19709         (Return.Emit): Instead of emitting a return, jump to the end of
19710         the function.
19711
19712         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19713         LocalBuilder to store the result of the function.  ReturnLabel is
19714         the target where we jump.
19715
19716
19717 2001-12-09  Radek Doulik  <rodo@ximian.com>
19718
19719         * cs-parser.jay: remember alias in current namespace
19720
19721         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19722         namespaces
19723
19724         * class.cs (LookupAlias): lookup alias in my_namespace
19725
19726         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19727         aliases hashtable
19728         (LookupAlias): lookup alias in this and if needed in parent
19729         namespaces
19730
19731 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * support.cs: 
19734
19735         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19736         making things static.  I need this to avoid passing the
19737         TypeContainer when calling ParameterType.
19738
19739         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19740         that did string manipulation to compute the type and then call
19741         GetType.  Use Parameter.ParameterType instead.
19742
19743         * cs-tokenizer.cs: Consume the suffix for floating values.
19744
19745         * expression.cs (ParameterReference): figure out whether this is a
19746         reference parameter or not.  Kill an extra variable by computing
19747         the arg_idx during emission.
19748
19749         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19750         function that returns whether a parameter is an out/ref value or not.
19751
19752         (Parameter.ParameterType): The type of the parameter (base,
19753         without ref/out applied).
19754
19755         (Parameter.Resolve): Perform resolution here.
19756         (Parameter.ExternalType): The full type (with ref/out applied).
19757
19758         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19759         support for expressions on the using statement.
19760
19761 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * statement.cs (Using.EmitLocalVariableDecls): Split the
19764         localvariable handling of the using statement.
19765
19766         (Block.EmitMeta): Keep track of variable count across blocks.  We
19767         were reusing slots on separate branches of blocks.
19768
19769         (Try.Emit): Emit the general code block, we were not emitting it. 
19770
19771         Check the type of the declaration to be an IDisposable or
19772         something that can be implicity converted to it. 
19773
19774         Emit conversions if required.
19775
19776         * ecore.cs (EmptyExpression): New utility class.
19777         (Expression.ImplicitConversionExists): New utility function.
19778
19779 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * statement.cs (Using): Implement.
19782
19783         * expression.cs (LocalVariableReference): Support read only variables.
19784
19785         * statement.cs: Remove the explicit emit for the Leave opcode.
19786         (VariableInfo): Add a readonly field.
19787
19788 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19789
19790         * ecore.cs (ConvCast): new class used to encapsulate the various
19791         explicit integer conversions that works in both checked and
19792         unchecked contexts.
19793
19794         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19795         properly generate the overflow opcodes.
19796
19797 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19798
19799         * statement.cs: The correct type for the EmptyExpression is the
19800         element_type, not the variable type.  Ravi pointed this out.
19801
19802 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19803
19804         * class.cs (Method::Define): Handle PInvoke methods specially
19805         by using DefinePInvokeMethod instead of the usual one.
19806
19807         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19808         above to do the task of extracting information and defining the method.
19809
19810 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19811
19812         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19813         of the condition for string type.
19814
19815         (Emit): Move that here. 
19816
19817         (ArrayCreation::CheckIndices): Keep string literals in their expression
19818         form.
19819
19820         (EmitDynamicInitializers): Handle strings appropriately.
19821
19822 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * codegen.cs (EmitContext): Replace multiple variables with a
19825         single pointer to the current Switch statement.
19826
19827         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19828         EmitContext.
19829
19830 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19831
19832         * statement.cs 
19833
19834         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19835         default'.
19836
19837         (Foreach.Emit): Foreach on arrays was not setting
19838         up the loop variables (for break/continue).
19839
19840         (GotoCase): Semi-implented.
19841
19842 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19843
19844         * attribute.cs (CheckAttribute): Handle system attributes by using
19845         Attribute.GetAttributes to examine information we need.
19846
19847         (GetValidPlaces): Same here.
19848
19849         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19850
19851         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19852
19853         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19854
19855         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19856
19857         (Method::Emit): Handle the case when we are a PInvoke method.
19858
19859 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19860
19861         * expression.cs: Use ResolveWithSimpleName on compound names.
19862
19863 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19864
19865         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19866         before trying to reduce it.
19867
19868         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19869
19870         * constant.cs (LookupConstantValue): Implement.
19871
19872         (EmitConstant): Use the above in emitting the constant.
19873
19874         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19875         that are user-defined by doing a LookupConstantValue on them.
19876
19877         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19878         too, like above.
19879
19880 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19883
19884         (BaseAccess.DoResolve): Implement.
19885
19886         (MemberAccess.DoResolve): Split this routine into a
19887         ResolveMemberAccess routine that can be used independently
19888
19889 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19890
19891         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19892         As that share bits of the implementation.  Is returns a boolean,
19893         while As returns the Type that is being probed.
19894
19895 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19896
19897         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19898         instead of a Literal - much easier.
19899
19900         (EnumInTransit): Remove - utterly useless :-)
19901
19902         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19903
19904         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19905
19906         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19907         chain when we have no associated expression.
19908
19909 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19910
19911         * constant.cs (Define): Use Location while reporting the errror.
19912
19913         Also emit a warning when 'new' is used and there is no inherited
19914         member to hide.
19915
19916         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19917         populated.
19918
19919         (LookupEnumValue): Implement to lookup an enum member's value and define it
19920         if necessary.
19921
19922         (Populate): Re-write accordingly to use the above routine.
19923
19924 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19925
19926         * expression.cs (This): Fix prototype for DoResolveLValue to
19927         override the base class DoResolveLValue.
19928
19929         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19930         declarations) 
19931
19932         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19933         (we need to load the address of the field here).  This fixes
19934         test-22. 
19935
19936         (FieldExpr.DoResolveLValue): Call the DoResolve
19937         function to initialize the Instance expression.
19938
19939         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19940         correctly the GetEnumerator operation on a value type.
19941
19942         * cs-parser.jay: Add more simple parsing error catches.
19943
19944         * statement.cs (Switch): Add support for string switches.
19945         Handle null specially.
19946
19947         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19948
19949 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19950
19951         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19952
19953         (declare_local_constant): New helper function.
19954
19955         * statement.cs (AddConstant): Keep a separate record of constants
19956
19957         (IsConstant): Implement to determine if a variable is a constant.
19958
19959         (GetConstantExpression): Implement.
19960
19961         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19962
19963         * statement.cs (IsVariableDefined): Re-write.
19964
19965 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19966
19967         * class.cs (TypeContainer::FindMembers): Look for constants
19968         in the case when we are looking for MemberTypes.Field
19969
19970         * expression.cs (MemberAccess::DoResolve): Check that in the
19971         case we are a FieldExpr and a Literal, we are not being accessed
19972         by an instance reference.
19973
19974         * cs-parser.jay (local_constant_declaration): Implement.
19975
19976         (declaration_statement): Implement for constant declarations.
19977
19978 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19979
19980         * statement.cs (Switch): Catch double defaults.
19981
19982         (Switch): More work on the switch() statement
19983         implementation.  It works for integral values now, need to finish
19984         string support.
19985
19986
19987 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19990         integer literals into other integer literals.  To be used by
19991         switch. 
19992
19993 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19994
19995         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19996         some memory.
19997
19998         (EmitDynamicInitializers): Cope with the above since we extract data
19999         directly from ArrayData now.
20000
20001         (ExpectInitializers): Keep track of whether initializers are mandatory
20002         or not.
20003
20004         (Bounds): Make it a hashtable to prevent the same dimension being 
20005         recorded for every element in that dimension.
20006
20007         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20008         from being found.
20009
20010         Also fix bug which was causing the indices to be emitted in the reverse
20011         order.
20012
20013 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20016         unfinished.  They do not work, because the underlying code is
20017         sloppy.
20018
20019 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20020
20021         * cs-parser.jay: Remove bogus fixme.
20022
20023         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20024         on Switch statement.
20025
20026 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20027
20028         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20029         the same. 
20030
20031         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20032         parameter. Apparently, any expression is allowed. 
20033
20034         (ValidateInitializers): Update accordingly.
20035
20036         (CheckIndices): Fix some tricky bugs thanks to recursion.
20037
20038         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20039         I was being completely brain-dead.
20040
20041         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20042         and re-write acordingly.
20043
20044         (DelegateInvocation): Re-write accordingly.
20045
20046         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20047
20048         (MakeByteBlob): Handle types more correctly.
20049
20050         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20051         initialization from expressions but it is incomplete because I am a complete
20052         Dodo :-|
20053
20054 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20055
20056         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20057         on If.  Basically, we have to return `true' (ie, we do return to
20058         our caller) only if both branches of the if return.
20059
20060         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20061         short-circuit operators, handle them as short circuit operators. 
20062
20063         (Cast.DoResolve): Resolve type.
20064         (Cast.Cast): Take an expression as the target type.
20065
20066         * cs-parser.jay (cast_expression): Remove old hack that only
20067         allowed a limited set of types to be handled.  Now we take a
20068         unary_expression and we resolve to a type during semantic
20069         analysis.
20070
20071         Use the grammar productions from Rhys to handle casts (this is
20072         not complete like Rhys syntax yet, we fail to handle that corner
20073         case that C# has regarding (-x), but we will get there.
20074
20075 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20076
20077         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20078         field which is an array type.
20079
20080         * cs-parser.jay (declare_local_variables): Support array initialization too.
20081
20082         * typemanager.cs (MakeKey): Implement.
20083
20084         (everywhere): Use the above appropriately.
20085
20086         * cs-parser.jay (for_statement): Update for array initialization while
20087         declaring variables.
20088
20089         * ecore.cs : The error message was correct, it's the variable's names that
20090         were misleading ;-) Make the code more readable.
20091
20092         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20093         the correct type etc.
20094
20095         (ConvertExplicit): Handle Enum types by examining the underlying type.
20096
20097 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20098
20099         * parameter.cs (GetCallingConvention): Always return
20100         CallingConventions.Standard for now.
20101
20102 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20103
20104         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20105         and `r' after calling DoNumericPromotions.
20106
20107         * ecore.cs: Fix error message (the types were in the wrong order).
20108
20109         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20110         BindingFlags.Instance as well 
20111
20112         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20113         implicit int literal conversion in an empty cast so that we
20114         propagate the right type upstream.
20115
20116         (UnboxCast): new class used to unbox value types.
20117         (Expression.ConvertExplicit): Add explicit type conversions done
20118         by unboxing.
20119
20120         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20121         the target type before applying the implicit LongLiterals to ULong
20122         literal cast.
20123
20124 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * cs-parser.jay (for_statement): Reworked the way For works: now
20127         we declare manually any variables that are introduced in
20128         for_initializer to solve the problem of having out-of-band code
20129         emition (that is what got for broken).
20130
20131         (declaration_statement): Perform the actual variable declaration
20132         that used to be done in local_variable_declaration here.
20133
20134         (local_variable_declaration): Do not declare anything, just pass
20135         the information on a DictionaryEntry
20136
20137 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20138
20139         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20140         re-write of the logic to now make it recursive.
20141
20142         (UpdateIndices): Re-write accordingly.
20143
20144         Store element data in a separate ArrayData list in the above methods.
20145
20146         (MakeByteBlob): Implement to dump the array data into a byte array.
20147
20148 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20149
20150         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20151         into CheckIndices.
20152
20153         * constant.cs (Define): Implement.
20154
20155         (EmitConstant): Re-write fully.
20156
20157         Pass in location info.
20158
20159         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20160         respectively.
20161
20162         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20163         DictionaryEntry since we need location info too.
20164
20165         (constant_declaration): Update accordingly.
20166
20167         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20168         code into another method : UpdateIndices.
20169
20170 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20171
20172         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20173         some type checking etc.
20174
20175 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20176
20177         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20178         bits to provide dimension info if the user skips doing that.
20179
20180         Update second constructor to store the rank correctly.
20181
20182 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20183
20184         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20185         and try to implement.
20186
20187         * ../errors/cs0150.cs : Add.
20188
20189         * ../errors/cs0178.cs : Add.
20190
20191 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20192
20193         * statement.cs: Implement foreach on multi-dimensional arrays. 
20194
20195         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20196         name of the params argument.
20197
20198         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20199         initializing the array.
20200
20201         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20202         we can use this elsewhere.
20203
20204         * statement.cs: Finish implementation of foreach for single
20205         dimension arrays.
20206
20207         * cs-parser.jay: Use an out-of-band stack to pass information
20208         around, I wonder why I need this.
20209
20210         foreach_block: Make the new foreach_block the current_block.
20211
20212         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20213         function used to return a static Parameters structure.  Used for
20214         empty parameters, as those are created very frequently.
20215
20216         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20217
20218 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20219
20220         * interface.cs : Default modifier is private, not public. The
20221         make verify test passes again.
20222
20223 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20224
20225         * support.cs (ReflectionParameters): Fix logic to determine
20226         whether the last parameter is a params one. Test 9 passes again.
20227
20228         * delegate.cs (Populate): Register the builders we define with
20229         RegisterParameterForBuilder. Test 19 passes again.
20230
20231         * cs-parser.jay (property_declaration): Reference $6 instead
20232         of $$ to get at the location.
20233
20234         (indexer_declaration): Similar stuff.
20235
20236         (attribute): Ditto.
20237
20238         * class.cs (Property): Register parameters for the Get and Set methods
20239         if they exist. Test 23 passes again.
20240
20241         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20242         call to EmitArguments as we are sure there aren't any params arguments. 
20243         Test 32 passes again.
20244
20245         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20246         IndexOutOfRangeException. 
20247
20248         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20249         Test 33 now passes again.
20250
20251 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20254         broke a bunch of things.  Will have to come up with a better way
20255         of tracking locations.
20256
20257         * statement.cs: Implemented foreach for single dimension arrays.
20258
20259 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20262         an error.  This removes the lookup from the critical path.
20263
20264         * cs-parser.jay: Removed use of temporary_loc, which is completely
20265         broken. 
20266
20267 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * support.cs (ReflectionParameters.ParameterModifier): Report
20270         whether the argument is a PARAMS argument or not.
20271
20272         * class.cs: Set the attribute `ParamArrayAttribute' on the
20273         parameter argument.
20274
20275         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20276         and cons_param_array_attribute (ConstructorInfo for
20277         ParamArrayAttribute)., 
20278
20279         * codegen.cs: Emit the return using the `Return' statement, that
20280         way we can report the error correctly for missing return values. 
20281
20282         * class.cs (Method.Emit): Clean up.
20283
20284         * expression.cs (Argument.Resolve): Take another argument: the
20285         location where this argument is used.  Notice that this is not
20286         part of the "Argument" class as to reduce the size of the
20287         structure (we know the approximate location anyways).
20288
20289         Test if the argument is a variable-reference, if not, then
20290         complain with a 206.
20291
20292         (Argument.Emit): Emit addresses of variables.
20293
20294         (Argument.FullDesc): Simplify.
20295
20296         (Invocation.DoResolve): Update for Argument.Resolve.
20297
20298         (ElementAccess.DoResolve): ditto.
20299
20300         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20301         method should be virtual, as this method is always virtual.
20302
20303         (NewDelegate.DoResolve): Update for Argument.Resolve.
20304
20305         * class.cs (ConstructorInitializer.DoResolve): ditto.
20306
20307         * attribute.cs (Attribute.Resolve): ditto.
20308
20309 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20312
20313         * expression.cs (ParameterReference): Drop IStackStorage and implement
20314         IAssignMethod instead. 
20315
20316         (LocalVariableReference): ditto.
20317
20318         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20319         IAssignMethod instead. 
20320
20321 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20322
20323         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20324         enumerations that are used in heavily used structures derive from
20325         byte in a laughable and pathetic attempt to reduce memory usage.
20326         This is the kind of pre-optimzations that you should not do at
20327         home without adult supervision.
20328
20329         * expression.cs (UnaryMutator): New class, used to handle ++ and
20330         -- separatedly from the other unary operators.  Cleans up the
20331         code, and kills the ExpressionStatement dependency in Unary.
20332
20333         (Unary): Removed `method' and `Arguments' from this class, making
20334         it smaller, and moving it all to SimpleCall, so I can reuse this
20335         code in other locations and avoid creating a lot of transient data
20336         strucutres when not required.
20337
20338         * cs-parser.jay: Adjust for new changes.
20339
20340 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20341
20342         * enum.cs (Enum.Populate): If there is a failure during
20343         definition, return
20344
20345         * cs-parser.jay (opt_enum_base): we used to catch type errors
20346         here, but this is really incorrect.  The type error should be
20347         catched during semantic analysis.
20348
20349 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20350
20351         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20352         current_local_parameters as expected since I, in my stupidity, had forgotten
20353         to do this :-)
20354
20355         * attribute.cs (GetValidPlaces): Fix stupid bug.
20356
20357         * class.cs (Method::Emit): Perform check on applicability of attributes.
20358
20359         (Constructor::Emit): Ditto.
20360
20361         (Field::Emit): Ditto.
20362
20363         (Field.Location): Store location information.
20364
20365         (Property, Event, Indexer, Operator): Ditto.
20366
20367         * cs-parser.jay (field_declaration): Pass in location for each field.
20368
20369         * ../errors/cs0592.cs : Add.
20370
20371 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20372
20373         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20374
20375         (InitCoreTypes): Update accordingly.
20376
20377         (RegisterAttrType, LookupAttr): Implement.
20378
20379         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20380         info about the same.
20381
20382         (Resolve): Update to populate the above as necessary.
20383
20384         (Error592): Helper.
20385
20386         (GetValidPlaces): Helper to the above.
20387
20388         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20389
20390         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20391
20392 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20393
20394         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20395
20396         * ../errors/cs0617.cs : Add.
20397
20398 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20399
20400         * enum.cs (Emit): Rename to Populate to be more consistent with what
20401         we expect it to do and when exactly it is called.
20402
20403         * class.cs, rootcontext.cs : Update accordingly.
20404
20405         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20406         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20407
20408         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20409
20410         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20411         of a fieldinfo using the above, when dealing with a FieldBuilder.
20412
20413 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20414
20415         * ../errors/cs0031.cs : Add.
20416
20417         * ../errors/cs1008.cs : Add.
20418
20419         * ../errrors/cs0543.cs : Add.
20420
20421         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20422         enum type.
20423
20424         (FindMembers): Implement.
20425
20426         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20427         enums and delegates too.
20428
20429         (enum_types): Rename to builder_to_enum.
20430
20431         (delegate_types): Rename to builder_to_delegate.
20432
20433         * delegate.cs (FindMembers): Implement.
20434
20435 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20436
20437         * typemanager.cs (IsEnumType): Implement.
20438
20439         * enum.cs (Emit): Re-write parts to account for the underlying type
20440         better and perform checking etc.
20441
20442         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20443         of the underlying type.
20444
20445         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20446         value
20447
20448         * enum.cs (error31): Helper to report error #31.
20449
20450         * cs-parser.jay (enum_declaration): Store location of each member too.
20451
20452         * enum.cs (member_to_location): New hashtable. 
20453
20454         (AddEnumMember): Update location hashtable.
20455
20456         (Emit): Use the location of each member while reporting errors.
20457
20458 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20459
20460         * cs-parser.jay: A for_initializer if is a
20461         local_variable_declaration really ammount to have an implicit
20462         block with the variable declaration and no initializer for for.
20463
20464         * statement.cs (For.Emit): Cope with null initializers.
20465
20466         This fixes the infinite loop on for initializers.
20467
20468 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20469
20470         * enum.cs: More cleanup.
20471
20472         * ecore.cs: Remove dead code.
20473
20474         * class.cs (Property.Emit): More simplification.
20475         (Event.Emit): ditto.
20476
20477         Reworked to have less levels of indentation.
20478
20479 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20480
20481         * class.cs (Property): Emit attributes.
20482
20483         (Field): Ditto.
20484
20485         (Event): Ditto.
20486
20487         (Indexer): Ditto.
20488
20489         (Operator): Ditto.
20490
20491         * enum.cs (Emit): Ditto.
20492
20493         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20494         Enums too.
20495
20496         * class.cs (Field, Event, etc.): Move attribute generation into the
20497         Emit method everywhere.
20498
20499         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20500         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20501         as we had no way of defining nested enums !
20502
20503         * rootcontext.cs : Adjust code accordingly.
20504
20505         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20506
20507 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20508
20509         * expression.cs (EvalConstantExpression): Move into ecore.cs
20510
20511         * enum.cs (Enum): Rename some members and make them public and readonly
20512         according to our convention.
20513
20514         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20515         nothing else.
20516
20517         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20518
20519         (Enum::Emit): Write a simple version for now which doesn't try to compute
20520         expressions. I shall modify this to be more robust in just a while.
20521
20522         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20523
20524         (TypeContainer::CloseType): Create the Enum types too.
20525
20526         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20527
20528         * expression.cs (EvalConstantExpression): Get rid of completely.
20529
20530         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20531         user-defined values and other cases.
20532
20533         (IsValidEnumLiteral): Helper function.
20534
20535         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20536         out there in the case we had a literal FieldExpr.
20537
20538         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20539
20540         (Literalize): Revamp a bit to take two arguments.
20541
20542         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20543
20544 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20545
20546         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20547
20548         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20549
20550         (Resolve): Use the above to ensure we have proper initializers.
20551
20552 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20553
20554         * expression.cs (Expression::EvalConstantExpression): New method to 
20555         evaluate constant expressions.
20556
20557         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20558
20559 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20560
20561         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20562         in an array.
20563
20564         (Binary.ResolveOperator): Handle operator != (object a, object b)
20565         and operator == (object a, object b);
20566
20567         (Binary.DoNumericPromotions): Indicate whether the numeric
20568         promotion was possible.
20569
20570         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20571         Implement.  
20572
20573         Made the ArrayAccess implement interface IAssignMethod instead of
20574         IStackStore as the order in which arguments are passed reflects
20575         this.
20576
20577         * assign.cs: Instead of using expr.ExprClass to select the way of
20578         assinging, probe for the IStackStore/IAssignMethod interfaces.
20579
20580         * typemanager.cs: Load InitializeArray definition.
20581
20582         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20583         static data that can be used to initialize arrays. 
20584
20585 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20586
20587         * expression.cs: Handle operator== and operator!= for booleans.
20588
20589         (Conditioal.Reduce): Implement reducer for the ?: operator.
20590
20591         (Conditional.Resolve): Implement dead code elimination.
20592
20593         (Binary.Resolve): Catch string literals and return a new
20594         concatenated string.
20595
20596         (Unary.Reduce): Implement reduction of unary expressions.
20597
20598         * ecore.cs: Split out the expression core handling here.
20599
20600         (Expression.Reduce): New method used to perform constant folding
20601         and CSE.  This is needed to support constant-expressions. 
20602
20603         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20604         targets, and optimize for !x.
20605
20606 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20607
20608         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20609         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20610         set custom atttributes.
20611
20612         * literal.cs (Literal::GetValue): New abstract method to return the actual
20613         value of the literal, cast as an object.
20614
20615         (*Literal): Implement GetValue method.
20616
20617         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20618         expressions to the arraylist but objects of type Argument.
20619
20620         * class.cs (TypeContainer::Emit): Emit our attributes too.
20621
20622         (Method::Emit, Constructor::Emit): Ditto.
20623
20624         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20625         to be ignoring earlier.
20626
20627 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20628
20629         * attribute.cs (AttributeSection::Define): Implement to do the business
20630         of constructing a CustomAttributeBuilder.
20631
20632         (Attribute): New trivial class. Increases readability of code.  
20633
20634         * cs-parser.jay : Update accordingly.
20635
20636         (positional_argument_list, named_argument_list, named_argument): New rules
20637
20638         (attribute_arguments): Use the above so that we are more correct.
20639
20640 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20641
20642         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20643         to perform all checks for a method with a params parameter.
20644
20645         (Invocation::OverloadResolve): Update to use the above method and therefore
20646         cope correctly with params method invocations.
20647
20648         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20649         params too.
20650
20651         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20652         constructors in our parent too because we can't afford to miss out on 
20653         protected ones ;-)
20654
20655         * attribute.cs (AttributeSection): New name for the class Attribute
20656
20657         Other trivial changes to improve readability.
20658
20659         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20660         use the new class names.
20661
20662 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20663
20664         * class.cs (Method::Define): Complete definition for params types too
20665
20666         (Indexer::Define): Ditto.
20667
20668         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20669         Cope everywhere with a request for info about the array parameter.
20670
20671 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20672
20673         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20674
20675         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20676         local_variable_type to extract the string corresponding to the type.
20677
20678         (local_variable_type): Fixup the action to use the new helper method.
20679
20680         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20681         go.
20682
20683         * expression.cs : Clean out code which uses the above.
20684
20685 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20686
20687         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20688         and bale out if necessary by returning a false.
20689
20690         (RegisterProperty): Ditto.
20691
20692         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20693         and print out appropriate error messages.
20694
20695         * interface.cs (everywhere): Ditto.
20696
20697         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20698         location to constructor.
20699
20700         * class.cs (Property, Event, Indexer): Update accordingly.
20701
20702         * ../errors/cs111.cs : Added.
20703
20704         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20705         of a method, as laid down by the spec.
20706
20707         (Invocation::OverloadResolve): Use the above method.
20708
20709 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20710
20711         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20712         now take a TypeContainer and a Parameters object.
20713
20714         (ParameterData): Modify return type of ParameterModifier method to be 
20715         Parameter.Modifier and not a string.
20716
20717         (ReflectionParameters, InternalParameters): Update accordingly.
20718
20719         * expression.cs (Argument::GetParameterModifier): Same here.
20720
20721         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20722         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20723         symbol in it at all so maybe this is only for now.
20724
20725 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20726
20727         * support.cs (InternalParameters): Constructor now takes an extra argument 
20728         which is the actual Parameters class.
20729
20730         (ParameterDesc): Update to provide info on ref/out modifiers.
20731
20732         * class.cs (everywhere): Update call to InternalParameters to pass in
20733         the second argument too.
20734
20735         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20736         to return the modifier info [ref/out etc]
20737
20738         (InternalParameters, ReflectionParameters): Implement the above.
20739
20740         * expression.cs (Argument::ParameterModifier): Similar function to return
20741         info about the argument's modifiers.
20742
20743         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20744         too.
20745
20746         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20747         a new SetFormalParameters object which we pass to InternalParameters.
20748
20749 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20750
20751         * expression.cs (NewArray): Merge into the ArrayCreation class.
20752
20753 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20754
20755         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20756         NewUserdefinedArray into one as there wasn't much of a use in having
20757         two separate ones.
20758
20759         * expression.cs (Argument): Change field's name to ArgType from Type.
20760
20761         (Type): New readonly property which returns the proper type, taking into 
20762         account ref/out modifiers.
20763
20764         (everywhere): Adjust code accordingly for the above.
20765
20766         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20767         whether we are emitting for a ref or out parameter.
20768
20769         * expression.cs (Argument::Emit): Use the above field to set the state.
20770
20771         (LocalVariableReference::Emit): Update to honour the flag and emit the
20772         right stuff.
20773
20774         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20775
20776         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20777
20778         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20779
20780         (ReflectionParameters, InternalParameters): Implement the above method.
20781
20782         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20783         reporting errors.
20784
20785         (Invocation::FullMethodDesc): Ditto. 
20786
20787 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * cs-parser.jay: Add extra production for the second form of array
20790         creation. 
20791
20792         * expression.cs (ArrayCreation): Update to reflect the above
20793         change. 
20794
20795         * Small changes to prepare for Array initialization.
20796
20797 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * typemanager.cs (ImplementsInterface): interface might be null;
20800         Deal with this problem;
20801
20802         Also, we do store negative hits on the cache (null values), so use
20803         this instead of calling t.GetInterfaces on the type everytime.
20804
20805 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20806
20807         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20808
20809         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20810         split functionality out into different classes.
20811
20812         (New::FormArrayType): Move into NewBuiltinArray.
20813
20814         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20815         quite useless.
20816
20817         (NewBuiltinArray): New class to handle creation of built-in arrays.
20818
20819         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20820         account creation of one-dimensional arrays.
20821
20822         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20823
20824         (NewUserdefinedArray::DoResolve): Implement.
20825
20826         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20827
20828         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20829         we maintain inside the TypeManager. This is necessary to perform lookups on the
20830         module builder.
20831
20832         (LookupType): Update to perform GetType on the module builders too.     
20833
20834         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20835
20836         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20837
20838 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20839
20840         * expression.cs (New::DoResolve): Implement guts of array creation.
20841
20842         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20843
20844 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * expression.cs: Fix bug I introduced lsat night that broke
20847         Delegates. 
20848
20849         (Expression.Resolve): Report a 246 error (can not resolve name)
20850         if we find a SimpleName in the stream.
20851
20852         (Expression.ResolveLValue): Ditto.
20853
20854         (Expression.ResolveWithSimpleName): This function is a variant of
20855         ResolveName, this one allows SimpleNames to be returned without a
20856         warning.  The only consumer of SimpleNames is MemberAccess
20857
20858 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20859
20860         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20861         might arrive here.  I have my doubts that this is correct.
20862
20863         * statement.cs (Lock): Implement lock statement.
20864
20865         * cs-parser.jay: Small fixes to support `lock' and `using'
20866
20867         * cs-tokenizer.cs: Remove extra space
20868
20869         * driver.cs: New flag --checked, allows to turn on integer math
20870         checking. 
20871
20872         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20873         Threading.Monitor.Exit 
20874
20875 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20876
20877         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20878         Expression Class to be IndexerAccess.
20879
20880         Notice that Indexer::DoResolve sets the eclass to Value.
20881
20882 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20883
20884         * class.cs (TypeContainer::Emit): Emit code for indexers.
20885
20886         * assign.cs (IAssignMethod): New interface implemented by Indexers
20887         and Properties for handling assignment.
20888
20889         (Assign::Emit): Simplify and reuse code. 
20890
20891         * expression.cs (IndexerAccess, PropertyExpr): Implement
20892         IAssignMethod, clean up old code. 
20893
20894 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20895
20896         * typemanager.cs (ImplementsInterface): New method to determine if a type
20897         implements a given interface. Provides a nice cache too.
20898
20899         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20900         method.
20901
20902         (ConvertReferenceExplicit): Ditto.
20903
20904         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20905         various methods, with correct names etc.
20906
20907         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20908         Operator.UnaryNegation.
20909
20910         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20911         we have a unary plus or minus operator.
20912
20913         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20914         UnaryMinus.
20915
20916         * everywhere : update accordingly.
20917
20918         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20919         respectively.
20920
20921         * class.cs (Method::Define): For the case where we are implementing a method
20922         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20923         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20924
20925 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20926
20927         * interface.cs (FindMembers): Implement to work around S.R.E
20928         lameness.
20929
20930         * typemanager.cs (IsInterfaceType): Implement.
20931
20932         (FindMembers): Update to handle interface types too.
20933
20934         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20935         use IsAssignableFrom as that is not correct - it doesn't work.
20936
20937         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20938         and accordingly override EmitStatement.
20939
20940         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20941         using the correct logic :-)
20942
20943 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20944
20945         * ../errors/cs-11.cs : Add to demonstrate error -11 
20946
20947 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20950         then pass this as a hint to ResolveLValue.
20951
20952         * expression.cs (FieldExpr): Add Location information
20953
20954         (FieldExpr::LValueResolve): Report assignment to readonly
20955         variable. 
20956
20957         (Expression::ExprClassFromMemberInfo): Pass location information.
20958
20959         (Expression::ResolveLValue): Add new method that resolves an
20960         LValue. 
20961
20962         (Expression::DoResolveLValue): Default invocation calls
20963         DoResolve. 
20964
20965         (Indexers): New class used to keep track of indexers in a given
20966         Type. 
20967
20968         (IStackStore): Renamed from LValue, as it did not really describe
20969         what this did.  Also ResolveLValue is gone from this interface and
20970         now is part of Expression.
20971
20972         (ElementAccess): Depending on the element access type
20973
20974         * typemanager.cs: Add `indexer_name_type' as a Core type
20975         (System.Runtime.CompilerServices.IndexerNameAttribute)
20976
20977         * statement.cs (Goto): Take a location.
20978
20979 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20980
20981         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20982         if two delegates are compatible.
20983
20984         (NewDelegate::DoResolve): Update to take care of the case when
20985         we instantiate a delegate from another delegate.
20986
20987         * typemanager.cs (FindMembers): Don't even try to look up members
20988         of Delegate types for now.
20989
20990 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20991
20992         * delegate.cs (NewDelegate): New class to take care of delegate
20993         instantiation.
20994
20995         * expression.cs (New): Split the delegate related code out into 
20996         the NewDelegate class.
20997
20998         * delegate.cs (DelegateInvocation): New class to handle delegate 
20999         invocation.
21000
21001         * expression.cs (Invocation): Split out delegate related code into
21002         the DelegateInvocation class.
21003
21004 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21005
21006         * expression.cs (New::DoResolve): Implement delegate creation fully
21007         and according to the spec.
21008
21009         (New::DoEmit): Update to handle delegates differently.
21010
21011         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21012         because of which we were printing out arguments in reverse order !
21013
21014         * delegate.cs (VerifyMethod): Implement to check if the given method
21015         matches the delegate.
21016
21017         (FullDelegateDesc): Implement.
21018
21019         (VerifyApplicability): Implement.
21020
21021         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21022         delegate invocations too.
21023
21024         (Invocation::Emit): Ditto.
21025
21026         * ../errors/cs1593.cs : Added.
21027
21028         * ../errors/cs1594.cs : Added.
21029
21030         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21031
21032 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21033
21034         * typemanager.cs (intptr_type): Core type for System.IntPtr
21035
21036         (InitCoreTypes): Update for the same.
21037
21038         (iasyncresult_type, asynccallback_type): Ditto.
21039
21040         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21041         correct.
21042
21043         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21044         too.
21045
21046         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21047         the builders for the 4 members of a delegate type :-)
21048
21049         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21050         type.
21051
21052         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21053
21054         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21055
21056 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21057
21058         * statement.cs (Break::Emit): Implement.   
21059         (Continue::Emit): Implement.
21060
21061         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21062         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21063         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21064         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21065         end loop
21066
21067         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21068         properties that track the label for the current loop (begin of the
21069         loop and end of the loop).
21070
21071 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21072
21073         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21074         use of emitting anything at all.
21075
21076         * class.cs, rootcontext.cs : Get rid of calls to the same.
21077
21078         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21079
21080         (Populate): Define the constructor correctly and set the implementation
21081         attributes.
21082
21083         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21084         have been defined.
21085
21086         (AddDelegateType): Implement.
21087
21088         (IsDelegateType): Implement helper method.
21089
21090         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21091
21092         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21093         and accordingly handle it.
21094
21095         * delegate.cs (Populate): Take TypeContainer argument.
21096         Implement bits to define the Invoke method. However, I still haven't figured out
21097         how to take care of the native int bit :-(
21098
21099         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21100         Qualify the name of the delegate, not its return type !
21101
21102         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21103         conversion.
21104
21105         (StandardConversionExists): Checking for array types turns out to be recursive.
21106
21107         (ConvertReferenceExplicit): Implement array conversion.
21108
21109         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21110
21111 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21112
21113         * cs-parser.jay (delegate_declaration): Store the fully qualified
21114         name as it is a type declaration.
21115
21116         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21117         readonly.
21118
21119         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21120         as TypeContainer::DefineType.
21121
21122         (Populate): Method in which all the definition of the various methods (Invoke)
21123         etc is done.
21124
21125         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21126         see.
21127
21128         (CloseDelegate): Finally creates the delegate.
21129
21130         * class.cs (TypeContainer::DefineType): Update to define delegates.
21131         (Populate, Emit and CloseType): Do the same thing here too.
21132
21133         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21134         delegates in all these operations.
21135
21136 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21137
21138         * expression.cs: LocalTemporary: a new expression used to
21139         reference a temporary that has been created.
21140
21141         * assign.cs: Handle PropertyAccess back here, so that we can
21142         provide the proper semantic access to properties.
21143
21144         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21145         a few more explicit conversions. 
21146
21147         * modifiers.cs: `NEW' modifier maps to HideBySig.
21148
21149         * expression.cs (PropertyExpr): Make this into an
21150         ExpressionStatement, and support the EmitStatement code path. 
21151
21152         Perform get/set error checking, clean up the interface.
21153
21154         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21155         them into toplevel access objects.
21156
21157 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21158
21159         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21160         SRE.
21161
21162         * typemanager.cs: Keep track here of our PropertyBuilders again to
21163         work around lameness in SRE.
21164
21165 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21166
21167         * expression.cs (LValue::LValueResolve): New method in the
21168         interface, used to perform a second resolution pass for LValues. 
21169
21170         (This::DoResolve): Catch the use of this in static methods.
21171
21172         (This::LValueResolve): Implement.
21173
21174         (This::Store): Remove warning, assigning to `this' in structures
21175         is 
21176
21177         (Invocation::Emit): Deal with invocation of
21178         methods on value types.  We need to pass the address to structure
21179         methods rather than the object itself.  (The equivalent code to
21180         emit "this" for structures leaves the entire structure on the
21181         stack instead of a pointer to it). 
21182
21183         (ParameterReference::DoResolve): Compute the real index for the
21184         argument based on whether the method takes or not a `this' pointer
21185         (ie, the method is static).
21186
21187         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21188         value types returned from functions when we need to invoke a
21189         method on the sturcture.
21190
21191
21192 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21193
21194         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21195         defining the type in the Modulebuilder or Typebuilder. This is to take
21196         care of nested types which need to be defined on the TypeBuilder using
21197         DefineNestedMethod.
21198
21199         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21200         methods in RootContext, only ported to be part of TypeContainer.
21201
21202         (TypeContainer::GetInterfaceOrClass): Ditto.
21203
21204         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21205
21206         * interface.cs (Interface::DefineInterface): New method. Does exactly
21207         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21208         too.
21209
21210         (Interface::GetInterfaces): Move from RootContext here and port.
21211
21212         (Interface::GetInterfaceByName): Same here.
21213
21214         * rootcontext.cs (ResolveTree): Re-write.
21215
21216         (PopulateTypes): Re-write.
21217
21218         * class.cs (TypeContainer::Populate): Populate nested types too.
21219         (TypeContainer::Emit): Emit nested members too.
21220
21221         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21222         instead just use the name argument passed in as it is already fully
21223         qualified.
21224
21225         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21226         to TypeContainer mapping to see if a type is user-defined.
21227
21228         * class.cs (TypeContainer::CloseType): Implement. 
21229
21230         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21231         the default constructor.
21232
21233         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21234         twice.
21235
21236         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21237
21238         * interface.cs (CloseType): Create the type here.
21239
21240         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21241         the hierarchy.
21242
21243         Remove all the methods which are now in TypeContainer.
21244
21245 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21246
21247         * delegate.cs (Define): Re-write bits to define the delegate
21248         correctly.
21249
21250 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21253
21254         * expression.cs (ImplicitReferenceConversion): handle null as well
21255         as a source to convert to any reference type.
21256
21257         * statement.cs (Return): Perform any implicit conversions to
21258         expected return type.  
21259
21260         Validate use of return statement.  
21261
21262         * codegen.cs (EmitContext): Pass the expected return type here.
21263
21264         * class.cs (Method, Constructor, Property): Pass expected return
21265         type to EmitContext.
21266
21267 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21268
21269         * expression.cs: Make DoResolve take an EmitContext instead of a
21270         TypeContainer.
21271
21272         Replaced `l' and `location' for `loc', for consistency.
21273
21274         (Error, Warning): Remove unneeded Tc argument.
21275
21276         * assign.cs, literal.cs, constant.cs: Update to new calling
21277         convention. 
21278
21279         * codegen.cs: EmitContext now contains a flag indicating whether
21280         code is being generated in a static method or not.
21281
21282         * cs-parser.jay: DecomposeQI, new function that replaces the old
21283         QualifiedIdentifier.  Now we always decompose the assembled
21284         strings from qualified_identifier productions into a group of
21285         memberaccesses.
21286
21287 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21288
21289         * rootcontext.cs: Deal with field-less struct types correctly now
21290         by passing the size option to Define Type.
21291
21292         * class.cs: Removed hack that created one static field. 
21293
21294 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21295
21296         * statement.cs: Moved most of the code generation here. 
21297
21298 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21299
21300         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21301         seem very right.
21302
21303         (ElementAccess): Remove useless bits for now - keep checks as the spec
21304         says.
21305
21306 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21307
21308         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21309         and start performing checks according to the spec.
21310
21311 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21312
21313         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21314         rank_specifiers instead.
21315
21316         (rank_specifiers): Change the order in which the rank specifiers are stored
21317
21318         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21319
21320         * expression.cs (ElementAccess): Implement the LValue interface too.
21321
21322 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21323
21324         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21325         except that user defined conversions are not included.
21326
21327         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21328         perform the conversion of the return type, if necessary.
21329
21330         (New::DoResolve): Check whether we are creating an array or an object
21331         and accordingly do the needful.
21332
21333         (New::Emit): Same here.
21334
21335         (New::DoResolve): Implement guts of array creation.
21336
21337         (New::FormLookupType): Helper function.
21338
21339 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21340
21341         * codegen.cs: Removed most of the code generation here, and move the
21342         corresponding code generation bits to the statement classes. 
21343
21344         Added support for try/catch/finalize and throw.
21345
21346         * cs-parser.jay: Added support for try/catch/finalize.
21347
21348         * class.cs: Catch static methods having the flags override,
21349         virtual or abstract.
21350
21351         * expression.cs (UserCast): This user cast was not really doing
21352         what it was supposed to do.  Which is to be born in fully resolved
21353         state.  Parts of the resolution were being performed at Emit time! 
21354
21355         Fixed this code.
21356
21357 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21358
21359         * expression.cs: Implicity convert the result from UserCast.
21360
21361 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21362
21363         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21364         prevented it from working correctly. 
21365
21366         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21367         merely ConvertImplicit.
21368
21369 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21370
21371         * typemanager.cs: Make the LookupTypeContainer function static,
21372         and not per-instance.  
21373
21374         * class.cs: Make static FindMembers (the one that takes a Type
21375         argument). 
21376
21377         * codegen.cs: Add EmitForeach here.
21378
21379         * cs-parser.jay: Make foreach a toplevel object instead of the
21380         inline expansion, as we need to perform semantic analysis on it. 
21381
21382 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21383
21384         * expression.cs (Expression::ImplicitUserConversion): Rename to
21385         UserDefinedConversion.
21386
21387         (Expression::UserDefinedConversion): Take an extra argument specifying 
21388         whether we look for explicit user conversions too.
21389
21390         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21391
21392         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21393
21394         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21395         with the appropriate arguments.
21396
21397         * cs-parser.jay (cast_expression): Record location too.
21398
21399         * expression.cs (Cast): Record location info.
21400
21401         (Expression::ConvertExplicit): Take location argument.
21402
21403         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21404         to determine if we are doing explicit conversions.
21405
21406         (UserCast::Emit): Update accordingly.
21407
21408         (Expression::ConvertExplicit): Report an error if everything fails.
21409
21410         * ../errors/cs0030.cs : Add.
21411
21412 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21413
21414         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21415         virtual and newslot bits. 
21416
21417         * class.cs (TypeContainer::RegisterRequiredImplementations):
21418         Record methods we need.
21419
21420         (TypeContainer::MakeKey): Helper function to make keys for
21421         MethodBases, since the Methodbase key is useless.
21422
21423         (TypeContainer::Populate): Call RegisterRequiredImplementations
21424         before defining the methods.   
21425
21426         Create a mapping for method_builders_to_methods ahead of time
21427         instead of inside a tight loop.
21428
21429         (::RequireMethods):  Accept an object as the data to set into the
21430         hashtable so we can report interface vs abstract method mismatch.
21431
21432 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21433
21434         * report.cs: Make all of it static.
21435
21436         * rootcontext.cs: Drop object_type and value_type computations, as
21437         we have those in the TypeManager anyways.
21438
21439         Drop report instance variable too, now it is a global.
21440
21441         * driver.cs: Use try/catch on command line handling.
21442
21443         Add --probe option to debug the error reporting system with a test
21444         suite. 
21445
21446         * report.cs: Add support for exiting program when a probe
21447         condition is reached.
21448
21449 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21450
21451         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21452         we do a forcible conversion regardless of type, to check if 
21453         ForceConversion returns a null.
21454
21455         (Binary::error19): Use location to report error.
21456
21457         (Unary::error23): Use location here too.
21458
21459         * ../errors/cs0019.cs : Check in.
21460
21461         * ../errors/cs0023.cs : Check in.
21462
21463         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21464         case of a non-null MethodInfo object with a length of 0 !
21465
21466         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21467         an applicable member - according to the spec :-)
21468         Also fix logic to find members in base types.
21469
21470         (Unary::ResolveOperator): Same here.
21471
21472         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21473         as I was getting thoroughly confused between this and error19 :-)
21474
21475         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21476         (::FindMostEncompassedType): Implement.
21477         (::FindMostEncompassingType): Implement.
21478         (::StandardConversionExists): Implement.
21479
21480         (UserImplicitCast): Re-vamp. We now need info about most specific
21481         source and target types so that we can do the necessary conversions.
21482
21483         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21484         mathematical union with no duplicates.
21485
21486 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21487
21488         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21489         in order from base classes to child classes, so that we can in
21490         child classes look up in our parent for method names and
21491         attributes (required for handling abstract, virtual, new, override
21492         constructs: we need to instrospect our base class, and if we dont
21493         populate the classes in order, the introspection might be
21494         incorrect.  For example, a method could query its parent before
21495         the parent has any methods and would determine that the parent has
21496         no abstract methods (while it could have had them)).
21497
21498         (RootContext::CreateType): Record the order in which we define the
21499         classes.
21500
21501 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21502
21503         * class.cs (TypeContainer::Populate): Also method definitions can
21504         fail now, keep track of this.
21505
21506         (TypeContainer::FindMembers): Implement support for
21507         DeclaredOnly/noDeclaredOnly flag.
21508
21509         (Constructor::Emit) Return the ConstructorBuilder.
21510
21511         (Method::Emit) Return the MethodBuilder. 
21512         Check for abstract or virtual methods to be public.
21513
21514         * rootcontext.cs (RootContext::CreateType): Register all the
21515         abstract methods required for the class to be complete and the
21516         interface methods that must be implemented. 
21517
21518         * cs-parser.jay: Report error 501 (method requires body if it is
21519         not marked abstract or extern).
21520
21521         * expression.cs (TypeOf::Emit): Implement.
21522
21523         * typemanager.cs: runtime_handle_type, new global type.
21524
21525         * class.cs (Property::Emit): Generate code for properties.
21526
21527 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21528
21529         * expression.cs (Unary::ResolveOperator): Find operators on base type
21530         too - we now conform exactly to the spec.
21531
21532         (Binary::ResolveOperator): Same here.
21533
21534         * class.cs (Operator::Define): Fix minor quirk in the tests.
21535
21536         * ../errors/cs0215.cs : Added.
21537
21538         * ../errors/cs0556.cs : Added.
21539
21540         * ../errors/cs0555.cs : Added.
21541
21542 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21543
21544         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21545         single integer which is really efficient
21546
21547 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21548
21549         *  expression.cs (Expression::ImplicitUserConversion): Use location
21550         even in the case when we are examining True operators.
21551  
21552         * class.cs (Operator::Define): Perform extensive checks to conform
21553         with the rules for operator overloading in the spec.
21554
21555         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21556         some of the other conversions mentioned in the spec.
21557
21558         * typemanager.cs (array_type): New static member for the System.Array built-in
21559         type.
21560
21561         (cloneable_interface): For System.ICloneable interface.
21562
21563         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21564         we start resolving the tree and populating types.
21565
21566         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21567  
21568 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21569
21570         * expression.cs (Expression::ExprClassFromMemberInfo,
21571         Expression::Literalize): Create literal expressions from
21572         FieldInfos which are literals.
21573
21574         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21575         type casts, because they were wrong.  The test suite in tests
21576         caught these ones.
21577
21578         (ImplicitNumericConversion): ushort to ulong requires a widening
21579         cast. 
21580
21581         Int32 constant to long requires widening cast as well.
21582
21583         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21584         for integers because the type on the stack is not i4.
21585
21586 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21587
21588         * expression.cs (report118): require location argument. 
21589
21590         * parameter.cs: Do not dereference potential null value.
21591
21592         * class.cs: Catch methods that lack the `new' keyword when
21593         overriding a name.  Report warnings when `new' is used without
21594         anything being there to override.
21595
21596         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21597
21598         * class.cs: Only add constructor to hashtable if it is non-null
21599         (as now constructors can fail on define).
21600
21601         (TypeManager, Class, Struct): Take location arguments.
21602
21603         Catch field instance initialization in structs as errors.
21604
21605         accepting_filter: a new filter for FindMembers that is static so
21606         that we dont create an instance per invocation.
21607
21608         (Constructor::Define): Catch errors where a struct constructor is
21609         parameterless 
21610
21611         * cs-parser.jay: Pass location information for various new
21612         constructs. 
21613
21614         * delegate.cs (Delegate): take a location argument.
21615
21616         * driver.cs: Do not call EmitCode if there were problesm in the
21617         Definition of the types, as many Builders wont be there. 
21618
21619         * decl.cs (Decl::Decl): Require a location argument.
21620
21621         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21622         into integers, and find the most appropiate integer for it.
21623
21624         * literal.cs: Implement ULongLiteral.
21625
21626         * rootcontext.cs: Provide better information about the location of
21627         failure when CreateType fails.
21628
21629 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21630
21631         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21632         as well.
21633
21634         * expression.cs (Binary::CheckShiftArguments): Add missing type
21635         computation.
21636         (Binary::ResolveOperator): Add type to the logical and and logical
21637         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21638         before.
21639
21640         (Binary::DoNumericPromotions): In the case where either argument
21641         is ulong (and most signed types combined with ulong cause an
21642         error) perform implicit integer constant conversions as well.
21643
21644 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21645
21646         * expression.cs (UserImplicitCast): Method should always be
21647         non-null. 
21648         (Invocation::BetterConversion): Simplified test for IntLiteral.
21649
21650         (Expression::ImplicitNumericConversion): Split this routine out.
21651         Put the code that performs implicit constant integer conversions
21652         here. 
21653
21654         (Expression::Resolve): Become a wrapper around DoResolve so we can
21655         check eclass and type being set after resolve.
21656
21657         (Invocation::Badness): Remove this dead function
21658
21659         (Binary::ResolveOperator): Do not compute the expensive argumnets
21660         unless we have a union for it.
21661
21662         (Probe::Emit): Is needs to do an isinst and then
21663         compare against null.
21664
21665         (::CanConvert): Added Location argument.  If the Location argument
21666         is null (Location.Null), then we do not report errors.  This is
21667         used by the `probe' mechanism of the Explicit conversion.  We do
21668         not want to generate an error for something that the user
21669         explicitly requested to be casted.  But the pipeline for an
21670         explicit cast first tests for potential implicit casts.
21671
21672         So for now, if the Location is null, it means `Probe only' to
21673         avoid adding another argument.   Might have to revise this
21674         strategy later.
21675
21676         (ClassCast): New class used to type cast objects into arbitrary
21677         classes (used in Explicit Reference Conversions).
21678
21679         Implement `as' as well.
21680
21681         Reverted all the patches from Ravi below: they were broken:
21682
21683                 * The use of `level' as a mechanism to stop recursive
21684                   invocations is wrong.  That was there just to catch the
21685                   bug with a strack trace but not as a way of addressing
21686                   the problem.
21687
21688                   To fix the problem we have to *understand* what is going
21689                   on and the interactions and come up with a plan, not
21690                   just get things going.
21691
21692                 * The use of the type conversion cache that I proposed
21693                   last night had an open topic: How does this work across
21694                   protection domains.  A user defined conversion might not
21695                   be public in the location where we are applying the
21696                   conversion, a different conversion might be selected
21697                   (ie, private A->B (better) but public B->A (worse),
21698                   inside A, A->B applies, but outside it, B->A will
21699                   apply).
21700
21701                 * On top of that (ie, even if the above is solved),
21702                   conversions in a cache need to be abstract.  Ie, `To
21703                   convert from an Int to a Short use an OpcodeCast', not
21704                   `To convert from an Int to a Short use the OpcodeCast on
21705                   the variable 5' (which is what this patch was doing).
21706
21707 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21708
21709         * expression.cs (Invocation::ConversionExists): Re-write to use
21710         the conversion cache
21711
21712         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21713         cache all conversions done, not just user-defined ones.
21714
21715         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21716         to determine if a conversion exists instead of acutually trying to 
21717         perform the conversion. It's faster too.
21718
21719         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21720         and only then attempt the implicit conversion.
21721
21722 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21723
21724         * expression.cs (ConvertImplicit): Use a cache for conversions
21725         already found. Check level of recursion and bail out if necessary.
21726
21727 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21728
21729         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21730         Export standard methods that we expect for string operations.
21731
21732         * statement.cs (Block::UsageWarning): Track usage of variables and
21733         report the errors for not used variables.
21734
21735         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21736         operator. 
21737
21738 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * codegen.cs: remove unnneded code 
21741
21742         * expression.cs: Removed BuiltinTypeAccess class
21743
21744         Fix the order in which implicit conversions are
21745         done.  
21746
21747         The previous fixed dropped support for boxed conversions (adding a
21748         test to the test suite now)
21749
21750         (UserImplicitCast::CanConvert): Remove test for source being null,
21751         that code is broken.  We should not feed a null to begin with, if
21752         we do, then we should track the bug where the problem originates
21753         and not try to cover it up here.
21754
21755         Return a resolved expression of type UserImplicitCast on success
21756         rather than true/false.  Ravi: this is what I was talking about,
21757         the pattern is to use a static method as a "constructor" for
21758         objects. 
21759
21760         Also, do not create arguments until the very last minute,
21761         otherwise we always create the arguments even for lookups that
21762         will never be performed. 
21763
21764         (UserImplicitCast::Resolve): Eliminate, objects of type
21765         UserImplicitCast are born in a fully resolved state. 
21766
21767         * typemanager.cs (InitCoreTypes): Init also value_type
21768         (System.ValueType). 
21769
21770         * expression.cs (Cast::Resolve): First resolve the child expression.
21771
21772         (LValue): Add new method AddressOf to be used by
21773         the `&' operator.  
21774
21775         Change the argument of Store to take an EmitContext instead of an
21776         ILGenerator, because things like FieldExpr need to be able to call
21777         their children expression to generate the instance code. 
21778
21779         (Expression::Error, Expression::Warning): Sugar functions for
21780         reporting errors.
21781
21782         (Expression::MemberLookup): Accept a TypeContainer instead of a
21783         Report as the first argument.
21784
21785         (Expression::ResolvePrimary): Killed.  I still want to improve
21786         this as currently the code is just not right.
21787
21788         (Expression::ResolveMemberAccess): Simplify, but it is still
21789         wrong. 
21790
21791         (Unary::Resolve): Catch errors in AddressOf operators.
21792
21793         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21794         index to a byte for the short-version, or the compiler will choose
21795         the wrong Emit call, which generates the wrong data.
21796
21797         (ParameterReference::Emit, ::Store): same.
21798
21799         (FieldExpr::AddressOf): Implement.
21800
21801         * typemanager.cs: TypeManager: made public variable instead of
21802         property.
21803
21804         * driver.cs: document --fatal.
21805
21806         * report.cs (ErrorMessage, WarningMessage): new names for the old
21807         Error and Warning classes.
21808
21809         * cs-parser.jay (member_access): Turn built-in access to types
21810         into a normal simplename
21811
21812 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21813
21814         * expression.cs (Invocation::BetterConversion): Fix to cope
21815         with q being null, since this was introducing a bug.
21816
21817         * expression.cs (ConvertImplicit): Do built-in conversions first.
21818
21819 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21820
21821         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21822
21823 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21824
21825         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21826         I had introduced long ago (what's new ?).
21827
21828         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21829         the work of all the checking. 
21830         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21831         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21832
21833         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21834         that is the right way. 
21835
21836         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21837         overloading resolution. Use everywhere instead of cutting and pasting code.
21838
21839         (Binary::ResolveOperator): Use MakeUnionSet.
21840
21841         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21842         we have to convert to bool types. Not complete yet.
21843
21844 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * typemanager.cs (TypeManager::CSharpName): support ushort.
21847
21848         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21849         to provide an expression that performsn an implicit constant int
21850         conversion (section 6.1.6).
21851         (Expression::ConvertImplicitRequired): Reworked to include
21852         implicit constant expression conversions.
21853
21854         (Expression::ConvertNumericExplicit): Finished.
21855
21856         (Invocation::Emit): If InstanceExpression is null, then it means
21857         that we perform a call on this.
21858
21859 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * expression.cs (Unary::Emit): Remove some dead code.
21862         (Probe): Implement Resolve and Emit for `is'.
21863         (Expression::ConvertImplicitRequired): Attempt to do constant
21864         expression conversions here.  Maybe should be moved to
21865         ConvertImplicit, but I am not sure.
21866         (Expression::ImplicitLongConstantConversionPossible,
21867         Expression::ImplicitIntConstantConversionPossible): New functions
21868         that tell whether is it possible to apply an implicit constant
21869         expression conversion.
21870
21871         (ConvertNumericExplicit): Started work on explicit numeric
21872         conversions.
21873
21874         * cs-parser.jay: Update operator constants.
21875
21876         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21877         (Parameters::GetSignature): Hook up VerifyArgs here.
21878         (Parameters::VerifyArgs): Verifies that no two arguments have the
21879         same name. 
21880
21881         * class.cs (Operator): Update the operator names to reflect the
21882         ones that the spec expects (as we are just stringizing the
21883         operator names).
21884
21885         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21886         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21887         previous usage did only work for our methods.
21888         (Expression::ConvertImplicit): Handle decimal implicit numeric
21889         conversions as well.
21890         (Expression::InternalTypeConstructor): Used to invoke constructors
21891         on internal types for default promotions.
21892
21893         (Unary::Emit): Implement special handling for the pre/post
21894         increment/decrement for overloaded operators, as they need to have
21895         the same semantics as the other operators.
21896
21897         (Binary::ResolveOperator): ditto.
21898         (Invocation::ConversionExists): ditto.
21899         (UserImplicitCast::Resolve): ditto.
21900
21901 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21902
21903         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21904         operator, return after emitting body. Regression tests pass again !
21905
21906         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21907         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21908         (Invocation::OverloadResolve): Ditto.
21909         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21910
21911         * everywhere : update calls to the above methods accordingly.
21912
21913 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21914
21915         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21916
21917         * expression.cs (ExpressionStatement): New base class used for
21918         expressions that can appear in statements, so that we can provide
21919         an alternate path to generate expression that do not leave a value
21920         on the stack.
21921
21922         (Expression::Emit, and all the derivatives): We no longer return
21923         whether a value is left on the stack or not.  Every expression
21924         after being emitted leaves a single value on the stack.
21925
21926         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21927         facilties of ExpressionStatement if possible.
21928
21929         * cs-parser.jay: Update statement_expression.
21930
21931 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21932
21933         * driver.cs: Change the wording of message
21934
21935 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21936
21937         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21938         the type of the expression to the return type of the method if
21939         we have an overloaded operator match ! The regression tests pass again !
21940         (Unary::ResolveOperator): Ditto.
21941
21942         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21943         to find "op_Implicit", not "implicit" ;-)
21944         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21945         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21946
21947         * everywhere : Correct calls to the above accordingly.
21948
21949         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21950         (ConvertImplicit): Do user-defined conversion if it exists.
21951
21952 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * assign.cs: track location.
21955         (Resolve): Use implicit conversions on assignment.
21956
21957         * literal.cs: Oops.  Not good, Emit of short access values should
21958         pass (Bytes) or the wrong argument will be selected.
21959
21960         * expression.cs (Unary::Emit): Emit code for -expr.
21961
21962         (Unary::ResolveOperator): Handle `Substract' for non-constants
21963         (substract from zero from the non-constants).
21964         Deal with Doubles as well. 
21965
21966         (Expression::ConvertImplicitRequired): New routine that reports an
21967         error if no implicit conversion exists. 
21968
21969         (Invocation::OverloadResolve): Store the converted implicit
21970         expressions if we make them
21971
21972 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21973
21974         * class.cs (ConstructorInitializer): Take a Location argument.
21975         (ConstructorBaseInitializer): Same here.
21976         (ConstructorThisInitializer): Same here.
21977
21978         * cs-parser.jay : Update all calls accordingly.
21979
21980         * expression.cs (Unary, Binary, New): Take location argument.
21981         Update accordingly everywhere.
21982
21983         * cs-parser.jay : Update all calls to the above to take a location
21984         argument.
21985
21986         * class.cs : Ditto.
21987
21988 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21989
21990         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21991         (Invocation::BetterConversion): Same here
21992         (Invocation::ConversionExists): Ditto.
21993
21994         (Invocation::ConversionExists): Implement.
21995
21996 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21997
21998         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21999         Also take an additional TypeContainer argument.
22000
22001         * All over : Pass in TypeContainer as argument to OverloadResolve.
22002
22003         * typemanager.cs (CSharpName): Update to check for the string type and return
22004         that too.
22005
22006         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22007         a given method.
22008
22009 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22010
22011         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22012         (Invocation::BetterFunction): Implement.
22013         (Invocation::BetterConversion): Implement.
22014         (Invocation::ConversionExists): Skeleton, no implementation yet.
22015
22016         Okay, things work fine !
22017
22018 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22019
22020         * typemanager.cs: declare and load enum_type, delegate_type and
22021         void_type. 
22022
22023         * expression.cs (Expression::Emit): Now emit returns a value that
22024         tells whether a value is left on the stack or not.  This strategy
22025         might be reveted tomorrow with a mechanism that would address
22026         multiple assignments.
22027         (Expression::report118): Utility routine to report mismatches on
22028         the ExprClass.
22029
22030         (Unary::Report23): Report impossible type/operator combination
22031         utility function.
22032
22033         (Unary::IsIncrementableNumber): Whether the type can be
22034         incremented or decremented with add.
22035         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22036         complemented. 
22037         (Unary::ResolveOperator): Implement ++, !, ~,
22038
22039         (Invocation::Emit): Deal with new Emit convetion.
22040
22041         * All Expression derivatives: Updated their Emit method to return
22042         whether they leave values on the stack or not.
22043
22044         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22045         stack for expressions that are statements. 
22046
22047 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * expression.cs (LValue): New interface.  Must be implemented by
22050         LValue objects.
22051         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22052         LValue interface.
22053
22054         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22055         interface for generating code, simplifies the code.
22056
22057 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22058
22059         * expression.cs (everywhere): Comment out return statements in ::Resolve
22060         methods to avoid the warnings.
22061
22062 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22063
22064         * driver.cs (parse): Report error 2001 if we can not open the
22065         source file.
22066
22067         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22068         not resolve it.
22069
22070         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22071         object. 
22072
22073         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22074         otherwise nested blocks end up with the same index.
22075
22076         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22077
22078         * expression.cs:  Instead of having FIXMEs in the Resolve
22079         functions, throw exceptions so it is obvious that we are facing a
22080         bug. 
22081
22082         * cs-parser.jay (invocation_expression): Pass Location information.
22083
22084         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22085         Use a basename for those routines because .NET does not like paths
22086         on them. 
22087
22088         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22089         already defined.
22090
22091 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22092
22093         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22094         are loading the correct data types (throws an exception if not).
22095         (TypeManager::InitCoreTypes): Use CoreLookupType
22096
22097         * expression.cs (Unary::ResolveOperator): return the child
22098         expression for expressions which are just +expr.
22099         (Unary::ResolveOperator): Return negative literals for -LITERAL
22100         expressions (otherwise they are Unary {Literal}).
22101         (Invocation::Badness): Take into account `Implicit constant
22102         expression conversions'.
22103
22104         * literal.cs (LongLiteral): Implement long literal class.
22105         (IntLiteral): export the `Value' of the intliteral. 
22106
22107 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22108
22109         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22110
22111         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22112         instead of 'Operator'
22113
22114         * expression.cs (Binary::ResolveOperator): Update accordingly.
22115         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22116         and 'Minus'
22117
22118         * cs-parser.jay (unary_expression): Update to use the new names.
22119
22120         * gen-treedump.cs (GetUnary): Same here.
22121
22122         * expression.cs (Unary::Resolve): Implement.
22123         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22124         operators are found instead of making noise ;-)
22125         (Unary::ResolveOperator): New method to do precisely the same thing which
22126         Binary::ResolveOperator does for Binary expressions.
22127         (Unary.method, .Arguments): Add.
22128         (Unary::OperName): Implement.   
22129         (Unary::ForceConversion): Copy and Paste !
22130
22131         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22132         a unary operator.
22133
22134         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22135         for the inbuilt operators. Only overloading works for now ;-)
22136
22137 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22138
22139         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22140         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22141
22142         * expression.cs (This::Emit): Implement. 
22143         (This::Resolve): Implement.
22144         (TypeOf:Resolve): Implement.
22145         (Expression::ResolveSimpleName): Add an implicit this to instance
22146         field references. 
22147         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22148         Bind instance variable to Field expressions.
22149         (FieldExpr::Instance): New field used to track the expression that
22150         represents the object instance.
22151         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22152         binding 
22153         (FieldExpr::Emit): Implement.
22154
22155         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22156         the last instruction contains a return opcode to avoid generating
22157         the last `ret' instruction (this generates correct code, and it is
22158         nice to pass the peverify output).
22159
22160         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22161         initializer for static and instance variables.
22162         (Constructor::Emit): Allow initializer to be null in the case of
22163         static constructors.  Only emit initializer for instance
22164         constructors. 
22165
22166         (TypeContainer::FindMembers): Return a null array if there are no
22167         matches.
22168
22169         Also fix the code for the MemberTypes.Method branch, as it was not
22170         scanning that for operators (or tried to access null variables before).
22171
22172         * assign.cs (Assign::Emit): Handle instance and static fields. 
22173
22174         * TODO: Updated.
22175
22176         * driver.cs: Stop compilation if there are parse errors.
22177
22178         * cs-parser.jay (constructor_declaration): Provide default base
22179         initializer for non-static constructors.
22180         (constructor_declarator): Do not provide a default base
22181         initializers if none was specified.
22182         Catch the fact that constructors should not have parameters.
22183
22184         * class.cs: Do not emit parent class initializers for static
22185         constructors, that should be flagged as an error.
22186
22187 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22188
22189         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22190         Move back code into TypeContainer::Populate.
22191
22192 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22193
22194         * class.cs (TypeContainer::AddConstructor): Fix the check to
22195         compare against Name, not Basename. 
22196         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22197
22198         * cs-parser.jay : Update accordingly.
22199
22200         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22201         for methods, don't forget to look into the operators too.
22202         (RegisterMethodBuilder): Helper method to take care of this for
22203         methods, constructors and operators.
22204         (Operator::Define): Completely revamp.
22205         (Operator.OperatorMethod, MethodName): New fields.
22206         (TypeContainer::Populate): Move the registering of builders into
22207         RegisterMethodBuilder.
22208         (Operator::Emit): Re-write.
22209
22210         * expression.cs (Binary::Emit): Comment out code path to emit method
22211         invocation stuff for the case when we have a user defined operator. I am
22212         just not able to get it right !
22213
22214 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22215
22216         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22217         argument. 
22218
22219         (Expression::MemberLookup): Provide a version that allows to
22220         specify the MemberTypes and BindingFlags. 
22221
22222         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22223         so it was not fetching variable information from outer blocks.
22224
22225         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22226         Beforefieldinit as it was buggy.
22227
22228         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22229         that Ravi put here.  
22230
22231         * class.cs (Constructor::Emit): Only emit if block is not null.
22232         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22233         deal with this by semantically definining it as if the user had
22234         done it.
22235
22236         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22237         constructors as we now "emit" them at a higher level.
22238
22239         (TypeContainer::DefineDefaultConstructor): Used to define the
22240         default constructors if none was provided.
22241
22242         (ConstructorInitializer): Add methods Resolve and Emit. 
22243
22244         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22245
22246 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22247
22248         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22249         the default constructor builder with our hashtable for methodbuilders
22250         to methodcores.
22251
22252         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22253         and argument_count is 0 in which case we have a match.
22254         (Binary::ResolveOperator): More null checking and miscellaneous coding
22255         style cleanup.
22256
22257 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22258
22259         * rootcontext.cs (IsNameSpace): Compare against null.
22260
22261         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22262
22263         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22264         and Unary::Operator.
22265
22266         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22267         accordingly.
22268
22269         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22270         we have overloaded operators.
22271         (Binary::ResolveOperator): Implement the part which does the operator overload
22272         resolution.
22273
22274         * class.cs (Operator::Emit): Implement.
22275         (TypeContainer::Emit): Emit the operators we have too.
22276
22277         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22278         the case when we have a user-defined operator.
22279
22280 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22281
22282         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22283
22284 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22285
22286         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22287         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22288         (Constructor::Emit): Implement.
22289         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22290         if we have no work to do. 
22291         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22292         Emit method.
22293
22294         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22295         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22296
22297         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22298         of parent.parent.
22299
22300 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22301
22302         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22303         in the source.
22304         (Tree::RecordNamespace): Method to do what the name says ;-)
22305         (Tree::Namespaces): Property to get at the namespaces hashtable.
22306
22307         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22308         keep track.
22309
22310         * rootcontext.cs (IsNamespace): Fixed it :-)
22311
22312 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22313
22314         * class.cs (TypeContainer::FindMembers): Add support for
22315         constructors. 
22316         (MethodCore): New class that encapsulates both the shared aspects
22317         of a Constructor and a Method.  
22318         (Method, Constructor): Factored pieces into MethodCore.
22319
22320         * driver.cs: Added --fatal which makes errors throw exceptions.
22321         Load System assembly as well as part of the standard library.
22322
22323         * report.cs: Allow throwing exceptions on errors for debugging.
22324
22325         * modifiers.cs: Do not use `parent', instead use the real type
22326         container to evaluate permission settings.
22327
22328         * class.cs: Put Ravi's patch back in.  He is right, and we will
22329         have to cope with the
22330
22331 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22332
22333         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22334         FamORAssem, not FamANDAssem.
22335
22336 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22337
22338         * driver.cs: Added --parse option that only parses its input files
22339         and terminates.
22340
22341         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22342         incorrect.  IsTopLevel is not used to tell whether an object is
22343         root_types or not (that can be achieved by testing this ==
22344         root_types).  But to see if this is a top-level *class* (not
22345         necessarly our "toplevel" container). 
22346
22347 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22348
22349         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22350         parent instead of a direct call to GetType.
22351
22352 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22353
22354         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22355         Modifiers.TypeAttr. This should just be a call to that method.
22356
22357         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22358         object so that we can determine if we are top-level or not.
22359
22360         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22361         TypeContainer too.
22362
22363         * enum.cs (Enum::Define): Ditto.
22364
22365         * modifiers.cs (FieldAttr): Re-write.
22366
22367         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22368         (TypeContainer::HaveStaticConstructor): New property to provide access
22369         to precisely that info.
22370
22371         * modifiers.cs (MethodAttr): Re-write.
22372         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22373
22374         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22375         of top-level types as claimed.
22376
22377 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * expression.cs (MemberLookup): Fruitless attempt to lookup
22380         constructors.  Maybe I need to emit default constructors?  That
22381         might be it (currently .NET emits this for me automatically).
22382         (Invocation::OverloadResolve): Cope with Arguments == null.
22383         (Invocation::EmitArguments): new function, shared by the new
22384         constructor and us.
22385         (Invocation::Emit): Handle static and instance methods.  Emit
22386         proper call instruction for virtual or non-virtual invocations.
22387         (New::Emit): Implement.
22388         (New::Resolve): Implement.
22389         (MemberAccess:Resolve): Implement.
22390         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22391         to track instances.
22392         (FieldExpr::Resolve): Set type.
22393
22394         * support.cs: Handle empty arguments.
22395                 
22396         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22397         SimpleLookup): Auxiliary routines to help parse a qualifier
22398         identifier.  
22399
22400         Update qualifier_identifier rule.
22401
22402         * codegen.cs: Removed debugging messages.
22403
22404         * class.cs: Make this a global thing, this acts just as a "key" to
22405         objects that we might have around.
22406
22407         (Populate): Only initialize method_builders_to_methods once.
22408
22409         * expression.cs (PropertyExpr): Initialize type from the
22410         PropertyType. 
22411
22412         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22413         Resolve pattern.  Attempt to implicitly convert value to boolean.
22414         Emit code.
22415
22416         * expression.cs: Set the type for the int32/int32 argument case.
22417         (Binary::ResolveOperator): Set the return type to boolean for
22418         comparission operators
22419
22420         * typemanager.cs: Remove debugging print code.
22421
22422         (Invocation::Resolve): resolve type.
22423
22424         * class.cs: Allocate a MemberInfo of the correct size, as the code
22425         elsewhere depends on the test to reflect the correct contents.
22426
22427         (Method::) Keep track of parameters, due to System.Reflection holes
22428
22429         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22430         mapping here.
22431
22432         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22433         of the exact size and return that.
22434
22435         (Class::LookupMethodByBuilder): New function that maps
22436         MethodBuilders to its methods.  Required to locate the information
22437         on methods because System.Reflection bit us again.
22438
22439         * support.cs: New file, contains an interface ParameterData and
22440         two implementations: ReflectionParameters and InternalParameters
22441         used to access Parameter information.  We will need to grow this
22442         as required.
22443
22444         * expression.cs (Invocation::GetParameterData): implement a cache
22445         and a wrapper around the ParameterData creation for methods. 
22446         (Invocation::OverloadResolve): Use new code.
22447
22448 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22449
22450         * class.cs (TypeContainer::EmitField): Remove and move into 
22451         (Field::Define): here and modify accordingly.
22452         (Field.FieldBuilder): New member.
22453         (TypeContainer::Populate): Update accordingly.
22454         (TypeContainer::FindMembers): Implement.
22455
22456 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22457
22458         * statement.cs: (VariableInfo::VariableType): New field to be
22459         initialized with the full type once it is resolved. 
22460
22461 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22462
22463         * parameter.cs (GetParameterInfo): Use a type cache to compute
22464         things only once, and to reuse this information
22465
22466         * expression.cs (LocalVariableReference::Emit): Implement.
22467         (OpcodeCast::Emit): fix.
22468
22469         (ParameterReference::Resolve): Implement.
22470         (ParameterReference::Emit): Implement.
22471
22472         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22473         that are expressions need to stay as Expressions.
22474
22475         * typemanager.cs (CSharpName): Returns the C# name of a type if
22476         possible. 
22477
22478         * expression.cs (Expression::ConvertImplicit): New function that
22479         implements implicit type conversions.
22480
22481         (Expression::ImplicitReferenceConversion): Implements implicit
22482         reference conversions.
22483
22484         (EmptyCast): New type for transparent casts.
22485
22486         (OpcodeCast): New type for casts of types that are performed with
22487         a sequence of bytecodes.
22488
22489         (BoxedCast): New type used for casting value types into reference
22490         types.  Emits a box opcode.
22491
22492         (Binary::DoNumericPromotions): Implements numeric promotions of
22493         and computation of the Binary::Type.
22494
22495         (Binary::EmitBranchable): Optimization.
22496
22497         (Binary::Emit): Implement code emission for expressions.
22498
22499         * typemanager.cs (TypeManager): Added two new core types: sbyte
22500         and byte.
22501
22502 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22503
22504         * class.cs (TypeContainer::FindMembers): Method which does exactly
22505         what Type.FindMembers does, only we don't have to use reflection. No
22506         implementation yet.
22507
22508         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22509         typecontainer objects as we need to get at them.
22510         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22511
22512         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22513         typecontainer object.
22514
22515         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22516         of just a Report object.
22517
22518 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22519
22520         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22521         "remove_"
22522         (TypeContainer::Populate): Now define the delegates of the type too.
22523         (TypeContainer.Delegates): Property to access the list of delegates defined
22524         in the type.
22525
22526         * delegates.cs (Delegate::Define): Implement partially.
22527
22528         * modifiers.cs (TypeAttr): Handle more flags.
22529
22530 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22531
22532         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22533         and not <=
22534         (Operator::Define): Re-write logic to get types by using the LookupType method
22535         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22536         (Indexer::Define): Ditto.
22537         (Event::Define): Ditto.
22538         (Property::Define): Ditto.
22539
22540 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22541
22542         * class.cs (TypeContainer::Populate): Now define operators too. 
22543         (TypeContainer.Operators): New property to access the list of operators
22544         in a type.
22545         (Operator.OperatorMethodBuilder): New member to hold the method builder
22546         for the operator we are defining.
22547         (Operator::Define): Implement.
22548
22549 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22550
22551         * class.cs (Event::Define): Make the prefixes of the accessor methods
22552         addOn_ and removeOn_ 
22553
22554         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22555         of the location being passed in too. Ideally, this should go later since all
22556         error reporting should be done through the Report object.
22557
22558         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22559         (Populate): Iterate thru the indexers we have and define them too.
22560         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22561         for the get and set accessors.
22562         (Indexer::Define): Implement.
22563
22564 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22565
22566         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22567         my previous implementation, did not work.
22568
22569         * typemanager.cs: Add a couple of missing types (the longs).
22570
22571         * literal.cs: Use TypeManager.bool_type instead of getting it.
22572
22573         * expression.cs (EventExpr): New kind of expressions.
22574         (Expressio::ExprClassFromMemberInfo): finish
22575
22576 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22577
22578         * assign.cs: Emit stores to static fields differently.
22579
22580 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22581
22582         * Merge in changes and adjust code to tackle conflicts. Backed out my
22583         code in Assign::Resolve ;-) 
22584
22585 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22586
22587         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22588         instead Report.Error and also pass in the location.
22589         (CSharpParser::Lexer): New readonly property to return the reference
22590         to the Tokenizer object.
22591         (declare_local_variables): Use Report.Error with location instead of plain 
22592         old error.
22593         (CheckDef): Ditto.
22594
22595         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22596         (Operator.CheckBinaryOperator): Ditto.
22597
22598         * cs-parser.jay (operator_declarator): Update accordingly.
22599
22600         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22601         (CheckBinaryOperator): Same here.
22602
22603         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22604         on the name without any prefixes of namespace names etc. This is because we
22605         already might have something already fully qualified like 
22606         'System.Console.WriteLine'
22607
22608         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22609
22610 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22611
22612         * cs-tokenizer.cs (location): Return a string which also contains
22613         the file name.
22614
22615         * expression.cs (ElementAccess): New class for expressions of the
22616         type 'element access.'
22617         (BaseAccess): New class for expressions of the type 'base access.'
22618         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22619         respectively.
22620
22621         * cs-parser.jay (element_access): Implement action.
22622         (base_access): Implement actions.
22623         (checked_expression, unchecked_expression): Implement.
22624
22625         * cs-parser.jay (local_variable_type): Correct and implement.
22626         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22627
22628         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22629
22630         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22631         name and the specifiers.
22632
22633         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22634
22635         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22636         making them all public ;-)
22637
22638         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22639         class anyways.
22640
22641 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22642
22643         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22644         PropertyExprs.
22645         (FieldExpr, PropertyExprs): New resolved expressions.
22646         (SimpleName::MemberStaticCheck): Perform static checks for access
22647         to non-static fields on static methods. Maybe this should be
22648         generalized for MemberAccesses. 
22649         (SimpleName::ResolveSimpleName): More work on simple name
22650         resolution. 
22651
22652         * cs-parser.jay (primary_expression/qualified_identifier): track
22653         the parameter index.
22654
22655         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22656         (EmitContext::EmitBoolExpression): Chain to expression generation
22657         instead of temporary hack.
22658         (::EmitStatementExpression): Put generic expression code generation.
22659
22660         * assign.cs (Assign::Emit): Implement variable assignments to
22661         local variables, parameters and fields.
22662
22663 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22664
22665         * statement.cs (Block::GetVariableInfo): New method, returns the
22666         VariableInfo for a variable name in a block.
22667         (Block::GetVariableType): Implement in terms of GetVariableInfo
22668
22669         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22670         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22671
22672 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22673
22674         * cs-parser.jay (operator_declaration): Continue on my quest : update
22675         to take attributes argument.
22676         (event_declaration): Ditto.
22677         (enum_declaration): Ditto.
22678         (indexer_declaration): Ditto.
22679
22680         * class.cs (Operator::Operator): Update constructor accordingly.
22681         (Event::Event): Ditto.
22682
22683         * delegate.cs (Delegate::Delegate): Same here.
22684
22685         * enum.cs (Enum::Enum): Same here.
22686
22687 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22688
22689         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22690
22691         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22692
22693         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22694         being passed around as an arraylist.
22695         (Attributes::AddAttribute): Method to add attribute sections.
22696
22697         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22698         (struct_declaration): Update accordingly.
22699         (constant_declaration): Update.
22700         (field_declaration): Update.
22701         (method_header): Update.
22702         (fixed_parameter): Update.
22703         (parameter_array): Ditto.
22704         (property_declaration): Ditto.
22705         (destructor_declaration): Ditto.
22706
22707         * class.cs (Struct::Struct): Update constructors accordingly.
22708         (Class::Class): Ditto.
22709         (Field::Field): Ditto.
22710         (Method::Method): Ditto.
22711         (Property::Property): Ditto.
22712         (TypeContainer::OptAttribute): update property's return type.
22713
22714         * interface.cs (Interface.opt_attributes): New member.
22715         (Interface::Interface): Update to take the extra Attributes argument.
22716
22717         * parameter.cs (Parameter::Parameter): Ditto.
22718
22719         * constant.cs (Constant::Constant): Ditto.
22720
22721         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22722         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22723         the attributes as a parameter.
22724         (InterfaceProperty): Update constructor call.
22725         (InterfaceEvent): Ditto.
22726         (InterfaceMethod): Ditto.
22727         (InterfaceIndexer): Ditto.
22728
22729         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22730         pass the attributes too.
22731         (interface_event_declaration): Ditto.
22732         (interface_property_declaration): Ditto.
22733         (interface_method_declaration): Ditto.
22734         (interface_declaration): Ditto.
22735
22736 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22737
22738         * class.cs (Method::Define): Track the "static Main" definition to
22739         create an entry point. 
22740
22741         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22742         EntryPoint if we find it. 
22743
22744         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22745         (EmitContext::ig): Make this variable public.
22746
22747         * driver.cs: Make the default output file be the first file name
22748         with the .exe extension.  
22749
22750         Detect empty compilations
22751
22752         Handle various kinds of output targets.  Handle --target and
22753         rename -t to --dumper.
22754
22755         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22756         methods inherited from Expression return now an Expression.  This
22757         will is used during the tree rewriting as we resolve them during
22758         semantic analysis.
22759
22760         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22761         the spec.  Missing entirely is the information about
22762         accessability of elements of it.
22763
22764         (Expression::ExprClassFromMemberInfo): New constructor for
22765         Expressions that creates a fully initialized Expression based on
22766         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22767         a Type.
22768
22769         (Invocation::Resolve): Begin implementing resolution of invocations.
22770
22771         * literal.cs (StringLiteral):  Implement Emit.
22772
22773 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22774
22775         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22776         member.
22777
22778 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22779
22780         * cs-parser.jay (attribute_arguments): Implement actions.
22781         (attribute): Fix bug in production. Implement action.
22782         (attribute_list): Implement.
22783         (attribute_target): Implement.
22784         (attribute_target_specifier, opt_target_specifier): Implement
22785         (CheckAttributeTarget): New method to check if the attribute target
22786         is valid.
22787         (attribute_section): Implement.
22788         (opt_attributes): Implement.
22789
22790         * attribute.cs : New file to handle attributes.
22791         (Attribute): Class to hold attribute info.
22792
22793         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22794         (attribute_section): Modify production to use 2 different rules to 
22795         achieve the same thing. 1 s/r conflict down !
22796         Clean out commented, useless, non-reducing dimension_separator rules.
22797
22798         * class.cs (TypeContainer.attributes): New member to hold list
22799         of attributes for a type.
22800         (Struct::Struct): Modify to take one more argument, the attribute list.
22801         (Class::Class): Ditto.
22802         (Field::Field): Ditto.
22803         (Method::Method): Ditto.
22804         (Property::Property): Ditto.
22805
22806         * cs-parser.jay (struct_declaration): Update constructor call to
22807         pass in the attributes too.
22808         (class_declaration): Ditto.
22809         (constant_declaration): Ditto.
22810         (field_declaration): Ditto.
22811         (method_header): Ditto.
22812         (fixed_parameter): Ditto.
22813         (parameter_array): Ditto.
22814         (property_declaration): Ditto.
22815
22816         * constant.cs (Constant::Constant): Update constructor similarly.
22817         Use System.Collections.
22818
22819         * parameter.cs (Parameter::Parameter): Update as above.
22820
22821 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22822
22823         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22824         (TypeContainer.delegates): New member to hold list of delegates.
22825
22826         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22827         this time as I seem to be on crack ;-)
22828
22829 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22830
22831         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22832         tell whether an identifier represents a namespace.
22833
22834         * expression.cs (NamespaceExpr): A namespace expression, used only
22835         temporarly during expression resolution.
22836         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22837         utility functions to resolve names on expressions.
22838
22839 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22840
22841         * codegen.cs: Add hook for StatementExpressions. 
22842
22843         * class.cs: Fix inverted test for static flag in methods.
22844
22845 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22846
22847         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22848         to make it coincide with MS' number.
22849         (Operator::CheckBinaryOperator): Ditto.
22850
22851         * ../errors/errors.txt : Remove error numbers added earlier.
22852
22853         * ../errors/cs1019.cs : Test case for error # 1019
22854
22855         * ../errros/cs1020.cs : Test case for error # 1020
22856
22857         * cs-parser.jay : Clean out commented cruft.
22858         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22859         used anywhere - non-reducing rule.
22860         (namespace_declarations): Non-reducing rule - comment out.
22861
22862         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22863         with TypeContainer::AddEnum.
22864
22865         * delegate.cs : New file for delegate handling classes.
22866         (Delegate): Class for declaring delegates.
22867
22868         * makefile : Update.
22869
22870         * cs-parser.jay (delegate_declaration): Implement.
22871
22872 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22873
22874         * class.cs (Event::Define): Implement.
22875         (Event.EventBuilder): New member.
22876
22877         * class.cs (TypeContainer::Populate): Update to define all enums and events
22878         we have.
22879         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22880         readonly fields for all these cases ?
22881
22882 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22883
22884         * class.cs (Property): Revamp to use the convention of making fields readonly.
22885         Accordingly modify code elsewhere.
22886
22887         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22888         the Define method of the Property class.
22889
22890         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22891         trivial bug.
22892         (TypeContainer::Populate): Update to define all the properties we have. Also
22893         define all enumerations.
22894
22895         * enum.cs (Define): Implement.
22896
22897 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22898
22899         * cs-parser.jay (overloadable_operator): The semantic value is an
22900         enum of the Operator class.
22901         (operator_declarator): Implement actions.
22902         (operator_declaration): Implement.
22903
22904         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22905         validity of definitions.
22906         (Operator::CheckBinaryOperator): Static method to check for binary operators
22907         (TypeContainer::AddOperator): New method to add an operator to a type.
22908
22909         * cs-parser.jay (indexer_declaration): Added line to actually call the
22910         AddIndexer method so it gets added ;-)
22911
22912         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22913         already taken care of by the MS compiler ?  
22914
22915 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22916
22917         * class.cs (Operator): New class for operator declarations.
22918         (Operator::OpType): Enum for the various operators.
22919
22920 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22921
22922         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22923         ostensibly handle this in semantic analysis.
22924
22925         * cs-parser.jay (general_catch_clause): Comment out
22926         (specific_catch_clauses, specific_catch_clause): Ditto.
22927         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22928         (catch_args, opt_catch_args): New productions.
22929         (catch_clause): Rewrite to use the new productions above
22930         (catch_clauses): Modify accordingly.
22931         (opt_catch_clauses): New production to use in try_statement
22932         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22933         and re-write the code in the actions to extract the specific and
22934         general catch clauses by being a little smart ;-)
22935
22936         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22937         Hooray, try and catch statements parse fine !
22938
22939 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22940
22941         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22942         string from the hashtable of variables.
22943
22944         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22945         I end up making that mistake ;-)
22946         (catch_clauses): Fixed gross error which made Key and Value of the 
22947         DictionaryEntry the same : $1 !!
22948
22949 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22950
22951         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22952
22953         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22954         when the add and remove accessors are specified. 
22955
22956 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22957
22958         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22959         information about indexer_declarator.
22960         (indexer_declarator): Implement actions.
22961         (parsing_indexer): New local boolean used to keep track of whether
22962         we are parsing indexers or properties. This is necessary because 
22963         implicit_parameters come into picture even for the get accessor in the 
22964         case of an indexer.
22965         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22966
22967         * class.cs (Indexer): New class for indexer declarations.
22968         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22969         (TypeContainer::indexers): New member to hold list of indexers for the
22970         type.
22971
22972 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22973
22974         * cs-parser.jay (add_accessor_declaration): Implement action.
22975         (remove_accessor_declaration): Implement action.
22976         (event_accessors_declaration): Implement
22977         (variable_declarators): swap statements for first rule - trivial.
22978
22979         * class.cs (Event): New class to hold information about event
22980         declarations.
22981         (TypeContainer::AddEvent): New method to add an event to a type
22982         (TypeContainer::events): New member to hold list of events.
22983
22984         * cs-parser.jay (event_declaration): Implement actions.
22985
22986 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22987
22988         * cs-parser.jay (dim_separators): Implement. Make it a string
22989         concatenating all the commas together, just as they appear.
22990         (opt_dim_separators): Modify accordingly
22991         (rank_specifiers): Update accordingly. Basically do the same
22992         thing - instead, collect the brackets here.
22993         (opt_rank_sepcifiers): Modify accordingly.
22994         (array_type): Modify to actually return the complete type string
22995         instead of ignoring the rank_specifiers.
22996         (expression_list): Implement to collect the expressions
22997         (variable_initializer): Implement. We make it a list of expressions
22998         essentially so that we can handle the array_initializer case neatly too.
22999         (variable_initializer_list): Implement.
23000         (array_initializer): Make it a list of variable_initializers
23001         (opt_array_initializer): Modify accordingly.
23002
23003         * expression.cs (New::NType): Add enumeration to help us
23004         keep track of whether we have an object/delegate creation
23005         or an array creation.
23006         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23007         members to hold data about array creation.
23008         (New:New): Modify to update NewType
23009         (New:New): New Overloaded contructor for the array creation
23010         case.
23011
23012         * cs-parser.jay (array_creation_expression): Implement to call
23013         the overloaded New constructor.
23014
23015 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23016
23017         * class.cs (TypeContainer::Constructors): Return member
23018         constructors instead of returning null.
23019
23020 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23021
23022         * typemanager.cs (InitCoreTypes): Initialize the various core
23023         types after we have populated the type manager with the user
23024         defined types (this distinction will be important later while
23025         compiling corlib.dll)
23026
23027         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23028         on Expression Classification.  Now all expressions have a method
23029         `Resolve' and a method `Emit'.
23030
23031         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23032         generation from working.     Also add some temporary debugging
23033         code. 
23034
23035 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23036
23037         * codegen.cs: Lots of code generation pieces.  This is only the
23038         beginning, will continue tomorrow with more touches of polish.  We
23039         handle the fundamentals of if, while, do, for, return.  Others are
23040         trickier and I need to start working on invocations soon.
23041
23042         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23043         s.InitStatement. 
23044
23045         * codegen.cs (EmitContext): New struct, used during code
23046         emission to keep a context.   Most of the code generation will be
23047         here. 
23048
23049         * cs-parser.jay: Add embedded blocks to the list of statements of
23050         this block.  So code generation proceeds in a top down fashion.
23051
23052 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23053
23054         * statement.cs: Add support for multiple child blocks.
23055
23056 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23057
23058         * codegen.cs (EmitCode): New function, will emit the code for a
23059         Block of code given a TypeContainer and its ILGenerator. 
23060
23061         * statement.cs (Block): Standard public readonly optimization.
23062         (Block::Block constructors): Link children. 
23063         (Block::Child): Child Linker.
23064         (Block::EmitVariables): Emits IL variable declarations.
23065
23066         * class.cs: Drop support for MethodGroups here, delay until
23067         Semantic Analysis.
23068         (Method::): Applied the same simplification that I did before, and
23069         move from Properties to public readonly fields.
23070         (Method::ParameterTypes): Returns the parameter types for the
23071         function, and implements a cache that will be useful later when I
23072         do error checking and the semantic analysis on the methods is
23073         performed.
23074         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23075         and made a method, optional argument tells whether this is a class
23076         or a structure to apply the `has-this' bit.
23077         (Method::GetCallingConvention): Implement, returns the calling
23078         convention. 
23079         (Method::Define): Defines the type, a second pass is performed
23080         later to populate the methods.
23081
23082         (Constructor::ParameterTypes): implement a cache similar to the
23083         one on Method::ParameterTypes, useful later when we do semantic
23084         analysis. 
23085
23086         (TypeContainer::EmitMethod):  New method.  Emits methods.
23087
23088         * expression.cs: Removed MethodGroup class from here.
23089
23090         * parameter.cs (Parameters::GetCallingConvention): new method.
23091
23092 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23093
23094         * class.cs (TypeContainer::Populate): Drop RootContext from the
23095         argument. 
23096
23097         (Constructor::CallingConvention): Returns the calling convention.
23098         (Constructor::ParameterTypes): Returns the constructor parameter
23099         types. 
23100
23101         (TypeContainer::AddConstructor): Keep track of default constructor
23102         and the default static constructor.
23103
23104         (Constructor::) Another class that starts using `public readonly'
23105         instead of properties. 
23106
23107         (Constructor::IsDefault): Whether this is a default constructor. 
23108
23109         (Field::) use readonly public fields instead of properties also.
23110
23111         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23112         track of static constructors;  If none is used, turn on
23113         BeforeFieldInit in the TypeAttributes. 
23114
23115         * cs-parser.jay (opt_argument_list): now the return can be null
23116         for the cases where there are no arguments. 
23117
23118         (constructor_declarator): If there is no implicit `base' or
23119         `this', then invoke the default parent constructor. 
23120
23121         * modifiers.cs (MethodAttr): New static function maps a set of
23122         modifiers flags into a MethodAttributes enum
23123         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23124         MethodAttr, TypeAttr to represent the various mappings where the
23125         modifiers are used.
23126         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23127
23128 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23129
23130         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23131         method arguments.
23132
23133         * interface.cs (PopulateIndexer): Implemented the code generator
23134         for interface indexers.
23135
23136 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * interface.cs (InterfaceMemberBase): Now we track the new status
23139         here.  
23140
23141         (PopulateProperty): Implement property population.  Woohoo!  Got
23142         Methods and Properties going today. 
23143
23144         Removed all the properties for interfaces, and replaced them with
23145         `public readonly' fields. 
23146
23147 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23148
23149         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23150         initialize their hashtables/arraylists only when they are needed
23151         instead of doing this always.
23152
23153         * parameter.cs: Handle refs and out parameters.
23154
23155         * cs-parser.jay: Use an ArrayList to construct the arguments
23156         instead of the ParameterCollection, and then cast that to a
23157         Parameter[] array.
23158
23159         * parameter.cs: Drop the use of ParameterCollection and use
23160         instead arrays of Parameters.
23161
23162         (GetParameterInfo): Use the Type, not the Name when resolving
23163         types. 
23164
23165 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23166
23167         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23168         and instead use public readonly fields.
23169
23170         * class.cs: Put back walking code for type containers.
23171
23172 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * class.cs (MakeConstant): Code to define constants.
23175
23176         * rootcontext.cs (LookupType): New function.  Used to locate types 
23177
23178
23179 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23180
23181         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23182         this System.Reflection code is.  Kudos to Microsoft
23183
23184         * typemanager.cs: Implement a type cache and avoid loading all
23185         types at boot time.  Wrap in LookupType the internals.  This made
23186         the compiler so much faster.  Wow.  I rule!
23187
23188         * driver.cs: Make sure we always load mscorlib first (for
23189         debugging purposes, nothing really important).
23190
23191         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23192         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23193
23194         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23195         on namespaces that have been imported using the `using' keyword.
23196
23197         * class.cs (TypeContainer::TypeAttr): Virtualize.
23198         (Class::TypeAttr): Return attributes suitable for this bad boy.
23199         (Struct::TypeAttr): ditto.
23200         Handle nested classes.
23201         (TypeContainer::) Remove all the type visiting code, it is now
23202         replaced with the rootcontext.cs code
23203
23204         * rootcontext.cs (GetClassBases): Added support for structs. 
23205
23206 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23207
23208         * interface.cs, statement.cs, class.cs, parameter.cs,
23209         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23210         Drop use of TypeRefs, and use strings instead.
23211
23212 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23213
23214         * rootcontext.cs: 
23215
23216         * class.cs (Struct::Struct): set the SEALED flags after
23217         checking the modifiers.
23218         (TypeContainer::TypeAttr): new property, returns the
23219         TypeAttributes for a class.  
23220
23221         * cs-parser.jay (type_list): Oops, list production was creating a
23222         new list of base types.
23223
23224         * rootcontext.cs (StdLib): New property.
23225         (GetInterfaceTypeByName): returns an interface by type name, and
23226         encapsulates error handling here.
23227         (GetInterfaces): simplified.
23228         (ResolveTree): Encapsulated all the tree resolution here.
23229         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23230         types. 
23231
23232         * driver.cs: Add support for --nostdlib, to avoid loading the
23233         default assemblies.
23234         (Main): Do not put tree resolution here. 
23235
23236         * rootcontext.cs: Beginning of the class resolution.
23237
23238 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23239
23240         * rootcontext.cs: Provide better error reporting. 
23241
23242         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23243
23244         * rootcontext.cs (CreateInterface): Handle the case where there
23245         are no parent interfaces.
23246
23247         (CloseTypes): Routine to flush types at the end.
23248         (CreateInterface): Track types.
23249         (GetInterfaces): Returns an array of Types from the list of
23250         defined interfaces.
23251
23252         * typemanager.c (AddUserType): Mechanism to track user types (puts
23253         the type on the global type hash, and allows us to close it at the
23254         end). 
23255
23256 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23257
23258         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23259         RecordInterface instead.
23260
23261         * cs-parser.jay: Updated to reflect changes above.
23262
23263         * decl.cs (Definition): Keep track of the TypeBuilder type that
23264         represents this type here.  Not sure we will use it in the long
23265         run, but wont hurt for now.
23266
23267         * driver.cs: Smaller changes to accomodate the new code.
23268
23269         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23270         when done. 
23271
23272         * rootcontext.cs (CreateInterface):  New method, used to create
23273         the System.TypeBuilder type for interfaces.
23274         (ResolveInterfaces): new entry point to resolve the interface
23275         hierarchy. 
23276         (CodeGen): Property, used to keep track of the code generator.
23277
23278 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23279
23280         * cs-parser.jay: Add a second production for delegate_declaration
23281         with `VOID'.
23282
23283         (enum_body): Put an opt_comma here instead of putting it on
23284         enum_body or enum_member_declarations so we can handle trailing
23285         commas on enumeration members.  Gets rid of a shift/reduce.
23286
23287         (type_list): Need a COMMA in the middle.
23288
23289         (indexer_declaration): Tell tokenizer to recognize get/set
23290
23291         * Remove old targets.
23292
23293         * Re-add the parser target.
23294
23295 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23296
23297         * cs-parser.jay: Add precendence rules for a number of operators
23298         ot reduce the number of shift/reduce conflicts in the grammar.
23299
23300 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23301
23302         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23303         and put it here.
23304
23305         Get rid of old crufty code.
23306
23307         * rootcontext.cs: Use this to keep track of the parsed
23308         representation and the defined types available to the program. 
23309
23310         * gen-treedump.cs: adjust for new convention.
23311
23312         * type.cs: Split out the type manager, and the assembly builder
23313         from here. 
23314
23315         * typemanager.cs: the type manager will live here now.
23316
23317         * cil-codegen.cs: And the code generator here. 
23318
23319 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23320
23321         * makefile: Fixed up for easy making.
23322
23323 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23324
23325         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23326         the 
23327
23328         (unary_expression): Expand pre_increment_expression and
23329         post_decrement_expression to reduce a shift/reduce.
23330
23331 2001-07-11  Simon Cozens
23332
23333         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23334
23335         Improve allow_keyword_as_indent name.
23336
23337 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23338
23339         * Adjustments for Beta2. 
23340
23341 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23342
23343         * decl.cs: Added `Define' abstract method.
23344         (InTransit): new property, used to catch recursive definitions. 
23345
23346         * interface.cs: Implement `Define'. 
23347
23348         * modifiers.cs: Map Modifiers.constants to
23349         System.Reflection.TypeAttribute flags.
23350
23351         * class.cs: Keep track of types and user-defined types.
23352         (BuilderInit): New method for creating an assembly
23353         (ResolveType): New function to launch the resolution process, only
23354         used by interfaces for now.
23355
23356         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23357         that are inserted into the name space. 
23358
23359 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23360
23361         * ARGH.  I have screwed up my tree so many times due to the use of
23362         rsync rather than using CVS.  Going to fix this at once. 
23363
23364         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23365         load types.
23366
23367 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23368
23369         * Experiment successful: Use System.Type rather that our own
23370         version of Type.  
23371
23372 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * cs-parser.jay: Removed nsAliases from here.
23375
23376         Use new namespaces, handle `using XXX;' 
23377
23378         * namespace.cs: Reimplemented namespace handling, use a recursive
23379         definition of the class.  Now we can keep track of using clauses
23380         and catch invalid using clauses.
23381
23382 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23383
23384         * gen-treedump.cs: Adapted for all the renaming.
23385
23386         * expression.cs (Expression): this class now has a Type property
23387         which returns an expression Type.
23388
23389         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23390         `Type', as this has a different meaning now in the base
23391
23392 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23393
23394         * interface.cs, class.cs: Removed from all the sources the
23395         references to signature computation, as we can not do method
23396         signature computation during the parsing time, as we are not
23397         trying to solve at that point distinguishing:
23398
23399         class X {
23400                 void a (Blah x) {}
23401                 void a (NS.Blah x) {}
23402         }
23403
23404         Which depending on the context might be valid or not, as we do not
23405         know if Blah is the same thing as NS.Blah at that point.
23406
23407         * Redid everything so the code uses TypeRefs now instead of
23408         Types.  TypeRefs are just temporary type placeholders, that need
23409         to be resolved.  They initially have a pointer to a string and the
23410         current scope in which they are used.  This is used later by the
23411         compiler to resolve the reference to an actual Type. 
23412
23413         * DeclSpace is no longer a CIR.Type, and neither are
23414         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23415         are all DeclSpaces, but no Types. 
23416
23417         * type.cs (TypeRefManager): This implements the TypeRef manager,
23418         which keeps track of all the types that need to be resolved after
23419         the parsing has finished. 
23420
23421 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * ARGH.  We are going to have to store `foreach' as a class rather
23424         than resolving it, as we need to verify error 1579 after name
23425         resolution.   *OR* we could keep a flag that says `This request to
23426         IEnumerator comes from a foreach statement' which we can then use
23427         to generate the error.
23428
23429 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23430
23431         * class.cs (TypeContainer.AddMethod): we now add methods to the
23432         MethodGroup instead of the method hashtable.  
23433
23434         * expression.cs: Add MethodGroup abstraction, which gets us one
23435         step closer to the specification in the way we handle method
23436         declarations.  
23437
23438         * cs-parser.jay (primary_expression): qualified_identifier now
23439         tried to match up an identifier to a local variable reference or
23440         to a parameter reference.
23441
23442         current_local_parameters is now a parser global variable that
23443         points to the current parameters for the block, used during name
23444         lookup.
23445
23446         (property_declaration): Now creates an implicit `value' argument to
23447         the set accessor.
23448
23449 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * parameter.cs: Do not use `param' arguments as part of the
23452         signature, per the spec.
23453
23454 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23455
23456         * decl.cs: Base class for classes, structs and interfaces.  This
23457         is the "Declaration Space" 
23458
23459         * cs-parser.jay: Use CheckDef for checking declaration errors
23460         instead of having one on each function.
23461
23462         * class.cs: Factor out some code for handling error handling in
23463         accordance to the "Declarations" section in the "Basic Concepts"
23464         chapter in the ECMA C# spec.
23465
23466         * interface.cs: Make all interface member classes derive from
23467         InterfaceMemberBase.
23468
23469 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23470
23471         * Many things: all interfaces are parsed and generated in
23472         gen-treedump.  Support for member variables, constructors,
23473         destructors, properties, constants is there.
23474
23475         Beginning of the IL backend, but very little done, just there for
23476         testing purposes. 
23477
23478 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23479
23480         * cs-parser.jay: Fix labeled statement.
23481
23482         * cs-tokenizer.cs (escape): Escape " and ' always.
23483         ref_line, ref_name: keep track of the line/filename as instructed
23484         by #line by the compiler.
23485         Parse #line.
23486
23487 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23488
23489         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23490         to match the values in System.CodeDOM.
23491
23492         Divid renamed to Divide.
23493
23494         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23495         statements. 
23496         (Statements.set): remove.
23497
23498         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23499         statements. 
23500
23501         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23502         falseStatements always have valid values. 
23503
23504         * cs-parser.jay: Use System.CodeDOM now.
23505