2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4           Mono.C5.
5
6 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7
8         * doc.cs : so it turned out that we cannot skip override check for 
9           interface members. Fixed bug #76954.
10
11 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
12
13         * cs-tokenizer.cs : fixed bug #75984:
14           - #warning and #error should not be handled when the source line
15             is disabled.
16           - #line is not checked strictly when the source line is disabled.
17           - #define and #undef is on the other hand checked strictly at any
18             state.
19
20 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
21
22         * cs-tokenizer.cs : missing Location (actually, filename) in one of
23           CS1027 report.
24
25 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
26
27         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
28
29         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
30         event initializers.
31         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
32         (FieldBase.Initializer): Initializer is now optional.
33         (EventField.Define): Only event field can have initializer.
34
35         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
36
37         * const.cs (Const): Reuse initializer.
38
39         * cs-parser.jay: Updated after FieldBase changes.
40         Added current_array_type to simplify array initializers.
41
42         * ecore.cs (NullCast.IsDefaultValue): Implemented.
43
44         * expression.cs, iterators.cs: Updated.
45
46         * namespace.cs (NamespaceEntry): Made UsingFound private.
47
48 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
49
50         * parameterCollection.cs: Obsolete, removed.
51         * parser.cs: Obsolete, removed.
52
53 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
54
55         Fix #76849.
56         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
57
58         * enum.cs (Enum.Define): Set obsolete context here.
59
60 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
61
62         * doc.cs :
63           - FindDocumentedMember() now expects 1) paramList as null
64             when "we don't have to check the number of parameters" and
65             2) Type.EmptyTypes when "there is no arguments".
66           - Introduced FoundMember struct to hold the exact type which was
67             used to find the documented member (the above change broke
68             test-xml-044; it might be better just to use DeclaringType than
69             what MS does, like this change does, but it depends on usage.)
70
71 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
72
73         * doc.cs : documented member might be from DeclaringType for nested
74           types. Fixed bug #76782.
75
76 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
77
78         * anonymous.cs: Have the param code handle leaving copies on the
79         stack etc. Allows anonymous params to take part in the assignment
80         code (++, +=, etc). Fixes bug #76550
81
82         * expression.cs: Handle the prepare_for_load/leave_copy by passing
83         it down to the anon code.
84
85         * iterators.cs: Use dummy var here
86
87         * codegen.cs: Handle new vars
88
89 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
90
91         Fix #76849.
92         * class.cs (MethodData.Define): Set proper Obsolete context.
93
94         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
95         obsolete context.
96         (FieldExpr.DoResolve): Ditto.
97
98 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
99
100         Fix #76849.
101         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
102         parent is not obsolete.
103
104 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
105
106         * doc.cs : (FindDocumentedMember) find parameterless members first
107           and get CS0419 in the early stage. Fixed first case of bug #76727.
108
109 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
110
111         Fix #76859.
112         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
113         no error was reported.
114
115         *expression.cs (Binary.DoResolve): left can be null.
116
117 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
118
119         Fix #76783.
120         * class.cs (MethodData.Emit): Parameters should be labeled first.
121
122 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
123
124         Fix #76761.
125         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
126
127 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
128
129         * attribute.cs (AreParametersCompliant): Moved to Parameter.
130
131         * class.cs (MethodCore): Parameter clean up.
132         (IMethodData): Added ParameterInfo.
133         (MethodData): Parameter clean up.
134         (Indexer.Define): Parameter clean up.
135
136         * anonymous.cs,
137         * codegen.cs,
138         * cs-parser.jay,
139         * decl.cs,
140         * doc.cs,
141         * ecore.cs,
142         * flowanalysis.cs,
143         * iterators.cs,
144         * pending.cs,
145         * statement.cs,
146         * typemanager.cs: Parameter clean up.
147
148         * delegate.cs (Define): Get rid of duplicated code.
149
150         * expression.cs (ParameterReference): Removed useless parameters
151         and simplified.
152         (Invocation): Ditto.
153
154         * parameter.cs (ParamsParameter): New class, params specialization.
155         (ArglistParameter): Attemp to separate arglist.
156         (Parameter): Refactored to be reusable and faster.
157         (Parameter.Modifier): Made understandable.
158         (Parameters): Changed to be used as a class for `this' assembly
159         parameters. Refactored to use new specialized classes.
160
161         * support.cs (ParameterData): Added Types property.
162         (InternalParameters): Deleted.
163
164 2005-08-20  Martin Baulig  <martin@ximian.com>
165
166         Merging this patch from GMCS to fix #75867.
167
168         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
169         scope if we don't already have it.
170
171 2005-11-17  Martin Baulig  <martin@ximian.com>
172
173         * anonymous.cs
174         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
175         inherit the scope from our parent.  Fixes #76653.
176
177 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
178
179         * doc.cs : the previous patch does not actually fix the bug.
180           PropertyInfo override check is now implemented and really fixed it.
181         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
182
183 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
184
185         * doc.cs : apply "override filter" also to properties.
186           Fixed bug #76730.
187
188 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
189
190         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
191           no need to check overrides. For classes, omit those results from 
192           interfaces since they must exist in the class. Fixed bug #76726.
193
194 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
195
196         * typemanager.cs : (GetFullNameSignature) differentiate indexers
197           with different parameters. Fixed the second problem in #76685.
198
199 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
200
201         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
202           get expected 'protected' access in CheckValidFamilyAccess()).
203           Fixed bug #76692.
204
205 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
206
207         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
208           Fixed bug #76705.  CS1569 was incorrectly commented out.
209
210 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
211
212         * doc.cs : use Invocation.IsOverride() to do real override check.
213         * expression.cs : made Invocation.IsOverride() internal.
214
215 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
216
217         * doc.cs : use TypeManager.FindMembers() instead of (possible)
218           TypeBuilder.FindMembers() and filter overriden base members out.
219           Fixed bug #76990.
220
221 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
222
223         * doc.cs : ref/out parameters are represented as '@' (instead of
224           '&' in type FullName). Fixed bug #76630 (additionally crefs).
225
226 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
227
228         * doc.cs : when there was no '.' in cref to methods in doc comment,
229           then parameters were missing in the output. Fixed bug #76691.
230
231 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
232
233         * driver.cs : don't output docs when there is an error.
234           Fixed bug #76693.
235
236 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
237
238         * doc.cs :
239           Now it should detect indexers. Fixed primary concern in bug #76685.
240           Fixed CS0419 message to not show the identical member signature in
241           the message.
242
243 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
244
245         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
246           instead of Type.FindMembers() since it does not handle events.
247           Fixed bug #71604.
248
249 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
250
251         * codegen.cs: Fixed typo (speficied -> specified).
252
253 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
254
255         Fix #76369.
256         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
257
258 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
259
260         * attribute.cs: Changed error message.
261
262         * cs-tokenizer.cs: One more check.
263
264 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
265
266         * statement.cs (Block.Resolve): Ignore empty statement.
267
268 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
269
270         * report.cs: Made error/warning methods more strict to avoid
271         their misuse.
272
273         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
274         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
275         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
276         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
277
278 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
279
280         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
281         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
282
283         * class.cs (TypeContainer.IsComImport): New property.
284         (Constructor.Define): Create proper ctor for ComImport types.
285
286         * expression.cs (New.CheckComImport): Fixed.
287
288 2005-11-07  Miguel de Icaza  <miguel@novell.com>
289
290         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
291         that a parameter has been captured does not mean that we do not
292         have to do the rest of the processing.  This fixes the second part
293         of #76592.  If there was another anonymous method capturing
294         values in the past, the Scope would never be set for the second
295         method that captured the same parameter.
296
297         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
298         properly manipulate the stack.   Second part of fix for #76592.
299
300         * expression.cs (New): Add support for invoking "new" on
301         interfaces that have been flagged with the ComImport attribute and
302         the CoClass.  Fixes #76637 
303
304         * statement.cs (Try.DoEmit): When a variable is captured, do not
305         try to emit the vi.LocalBuilder variable as it has been captured.
306         Create a temporary variable and store the results on the
307         FieldBuilder.  Fixes #76642
308
309 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
310
311         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
312
313         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
314
315         * expression.cs (Binary.DoResolve): Added && optimalization.
316     
317         * typemanager.cs (AddUserType): Removed useless argument.
318
319 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
320
321         * statement.cs (Block.variables): Uses ListDictionary.
322
323 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
324
325         Fix #75969.
326         * class.cs (PartialContainer.EmitType): Customized to emit
327         security attributes.
328         (ClassPart.ApplyAttributeBuilder): Transform security attribute
329         for partial classes.
330
331 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
332
333         Fix #76599.
334         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
335         access has to be fixed.
336         
337         * typemanager.cs (IsUnmanagedType): Wrong common field type.
338
339 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
340
341         Fix #76590.
342         * ecore.cs (NullCast.Reduce): Implemented.
343
344         * expression.cs (ArrayCreation.CheckIndices): Correcly check
345         constant type.
346         
347         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
348         properly.
349         (Foreach.Resolve): Catch null properly.
350
351 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
352  
353         * cs-tokenizer.cs: Warning text fix.
354
355         * driver.cs: AllWarningNumbers exposed on public interface.
356
357         * report.cs (): Reviewed warning numbers.
358         (IsValidWarning): Use binary search.
359
360 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
361  
362         * driver.cs: Implemeted resource visibility.
363         (Resources): New class for code sharing between /res: and
364         /linkres:
365  
366 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
367
368         Fix #76568.
369         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
370         folding.
371         
372         * convert (Convert.ImplicitReferenceConversion): NullCast holds
373         contants only.
374         
375         * ecore.cs (NullCast): Child is contant only.
376         
377         * literal.cs (NullLiteral.Reduce): null can be converted to any
378         reference type.
379
380 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
381
382         * driver.cs: Use Encoding.Default as default code page instead
383           of ISO-28591.
384
385 2005-10-27  Raja R Harinath  <rharinath@novell.com>
386
387         Fix #76085.
388         * expression.cs (Invocation.Error_InvalidArguments): Handle
389         __arglist parameters.
390         (Invocation.VerifyArgumentsCompat): Likewise.
391         * support.cs (ReflectionParameters.GetSignatureForError): Print
392         __arglist parameters.
393         (InternalParamters.GetSignatureForError): Likewise.
394         * parameter.cs (Parameters.GetSignatureForError): Likewise.
395
396 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
397
398         * attribute.cs (GetPropertyValue): Made public.
399
400         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
401         Resolve.
402         Add new property WrapNonExceptionThrows to handle 2.0 assembly
403         attribute.
404         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
405         is not defined.
406         
407         * driver.cs: Reflect method name change.
408         
409         * statement.cs (Try.Resolve): Warn when try has both general
410         exception handlers.
411         
412         * typemanager.cs: runtime_compatibility_attr_type new predefined
413         type.
414
415 2005-10-26  Raja R Harinath  <harinath@gmail.com>
416
417         Fix #76419.
418         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
419         treat it as an empty parameter list.
420
421 2005-10-26  Raja R Harinath  <rharinath@novell.com>
422
423         Fix #76271.     
424         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
425         ResolveAsTypeStep silent.
426         * statement.cs (Block.AddConstant): Mark block as used.
427         (Block.ResolveMeta): Avoid piling on error messages
428         if a constant initializer resolution fails.
429
430 2005-10-25  Raja R Harinath  <rharinath@novell.com>
431
432         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
433         Remove.
434         (NamespaceEntry.VerifyAllUsing): New.
435         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
436         behaviour.  Delegates actual resolution of alias to ...
437         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
438         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
439         Update.
440         * driver.cs (Driver.MainDriver): Update.
441         
442         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
443         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
444         property.
445         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
446         Remove.
447         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
448         RootNamespace.DefineNamespacesForAll.
449
450 2005-10-24  Raja R Harinath  <harinath@gmail.com>
451
452         * typemanager.cs (assemblies, external_aliases, modules)
453         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
454         (ComputeNamespaces, GetRootNamespace): Remove extra staging
455         overhead.  Move resposibility ...
456         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
457         * driver.cs, attribute.cs, codegen.cs: Update to changes.
458
459 2005-10-23  Raja R Harinath  <harinath@gmail.com>
460
461         * namespace.cs (RootNamespace.all_namespaces): Renamed from
462         cached_namespaces.  Improve usage.
463         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
464         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
465         Move from GlobalRootNamespace and simplify.
466         (RootNamespace.Global): Make instance variable.
467         (RootNamespace.RootNamespace): Add "alias name" parameter.
468         (GlobalRootNamespace): Simplify drastically.
469         (Namespace.Lookup): Don't use GetNamespace.
470         * typemanager.cs (GetRootNamespace): Rename from
471         ComputeNamespaceForAlias.
472         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
473
474 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
475
476         * anonymous.cs (AnonymousContainer): Don't crash when container
477         doesn't exist.
478
479 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
480
481         * expression.cs (Binary.DoResolve): Warn when comparing same
482         values.
483
484 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
485
486         Fix #76486.
487         * expression.cs (Binary.DoResolve): It looks like there are no
488         convetsion rules in enum context.
489
490 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
491
492         Add support for extern alias qualifiers.
493         * typemanager.cs: Move some LookupTypeReflection code
494         to namespace.cs, to have cleaner code. Added some methods
495         to help us keep track of the extern aliased references.
496         * driver.cs: Add suport for extern alias assemblies on command
497         line and check for their warnings/errors. Also keep track of the
498         extern aliased assemblies.
499         * namespace.cs: Move the global functionality of Namespace
500         to GlobalRootNamespace/RootNamespace. Now the global namespace
501         is GlobalRootNamespace.Globa. Also the code moved from 
502         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
503         Finally added LocalAliasEntry (AliasEntry before) and
504         ExternAliasEntry, to handle alias statements.
505         * cs-parser.jay: Add support in the grammar for extern alias
506         statement.
507         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
508         Update callings to Namespace (now in GlobalRootNamespace).
509
510 2005-10-18  Raja R Harinath  <rharinath@novell.com>
511
512         Fix #76371.
513         * class.cs (TypeContainer.DefineType): Move updating of
514         topological sort earlier in the code.
515         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
516
517 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
518
519         Fix #76273.
520         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
521         
522         * constant.cs (Constant.TryReduce): Moved from Cast class.
523         (Reduce): Made little bit more OO and fixed missing conversions.
524         
525         * ecore.cs (Reduce): Implemented.
526         (Binary.EnumLiftUp): New method to upgrade values to enum values.
527         
528         * literal.cs (Reduce): Implemented.
529         
530         * class.cs: Reverted Miguel's wrong commit.
531
532 2005-10-14  Miguel de Icaza  <miguel@novell.com>
533
534         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
535
536 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
537
538         * cs-parser.jay, expression.cs : CS0214 was missing error location
539           for constants. Fixed bug #76404.
540
541 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
542
543         Fix #76370.
544         * convert.cs (ExplicitConversionCore): Fixed object->enum
545         conversion.
546
547 2005-10-10  Raja R Harinath  <rharinath@novell.com>
548
549         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
550         InstanceExpression.
551         (PropertyExpr.EmitCall): Likewise.
552         * expression.cs (Invocation.EmitArguments): Handle case where
553         arguments == null.
554         (Invocation.EmitCall): Avoid allocating temporary variable if
555         there are no arguments.
556
557 2005-10-07  Raja R Harinath  <rharinath@novell.com>
558
559         Fix #76323.
560         * convert.cs (ImplicitConversionStandard): Move conversion of
561         void* to arbitrary pointer types ...
562         (ExplicitConversionStandard): .. here.
563         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
564         error to always print typenames.
565
566 2005-10-07  Raja R Harinath  <rharinath@novell.com>
567
568         * convert.cs (GetConversionOperator): Rename from
569         GetConversionOperators.  Move operator selection code from ...
570         (UserDefinedConversion): ... here.
571
572 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
573
574         * convert.cs (ExplicitConversionCore): Removed duplicate enum
575         conversion.
576
577 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
578
579         * assign.cs (Assign.DoResolve): Error method changed.
580
581         * cfold.cs (DoConstantNumericPromotions): Error method changed.
582         
583         * const.cs (ResolveValue): Reset in_transit immediately.
584         
585         * constant.cs: Error method changed.
586         
587         * convert.cs: Removed useless location parameter.
588         (ExplicitNumericConversion): Don't do double enum check.
589         (ExplicitConversionCore): Renamed from ExplicitConversion.
590         (ExplicitUnsafe): Extracted from ExplicitConversion.
591         (ExplicitConversion): Uses for error reporting.
592         
593         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
594         error messages.
595         (ResolveBoolean): Uses common error method.
596         (CastToDecimal): Get rid of ec.
597         (CastFromDecimal): Optimized.
598         (ConvCast): Get rid of ec.
599         
600         * enum.cs (ResolveValue): Reset in_transit immediately.
601         (Emit): Return after first error.
602         
603         * expression.cs: Convert changes.
604         
605         * literal.cs: Error method changed.
606         
607         * statement.cs: Error method changed.
608
609 2005-10-03  Raja R Harinath  <rharinath@novell.com>
610
611         * support.cs (SeekableStreamReader.Position): Don't error out when
612         the requested position is just beyond the end of the current
613         buffered data.
614
615 2005-09-28  Raja R Harinath  <rharinath@novell.com>
616
617         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
618         try to keep in sync with the byte count of the underlying Stream.
619         However, this limits us to a window size of 2048 characters: i.e.,
620         the maximum lookahead of our lexer/parser can be 2048 characters.
621
622 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
623
624         Fix #76255.
625         * driver.cs: Fix compilation files with full root path.
626
627 2005-09-25  Miguel de Icaza  <miguel@novell.com>
628
629         * report.cs (SymbolRelatedToPreviousError): Format the output so
630         it does not use an open parenthesis that is never closed. 
631
632         * driver.cs: Follow coding guidelines
633
634 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
635
636         Fix #72930.
637         * const.cs (Const.ResolveValue): Check for assigning non-null
638         value to reference type.
639
640 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
641
642         * anonymous.cs: Implemented ExprClassName.
643         
644         * assign.cs (Assign.DoResolve): Don't chrash when type is not
645         delegate.
646         
647         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
648         check.
649         
650         * class.cs (StaticClass.DefineContainerMembers): Report protected
651         members as error.
652         
653         * codegen.cs: if(ed) PRODUCTION.
654         
655         * convert.cs (Error_CannotImplicitConversion): Better error
656         distinction.
657         
658         * cs-parser.jay: More error checks.
659         
660         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
661         
662         * driver.cs (CSCParseOption): Enabled wrong option check.
663         
664         * ecore.cs (Expression.ExprClassName): Turned to property.
665         (MemberExpr.CheckIntermediateModification): For checking boxed
666         value types     modification.
667         
668         * statement.cs (Fixed.Resolve): Expression type must be
669         convertible to fixed type.
670         (CollectionForeach.GetEnumeratorFilter,TryType):
671         Small refactoring for easier error checking.
672
673 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
674
675         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
676         attributes.
677         
678         * class.cs (GeneratedBaseInitializer): New class for customization
679         compiler generated initializers.
680         (MemberBase.DoDefine): Check Obsolete attribute here.
681         (FieldMember.DoDefine): Ditto.
682         
683         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
684         constants.
685         
686         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
687         (MemberCore.GetObsoleteAttribute): Removed argument.
688         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
689         (MemberCore.CheckObsoleteType): New helper.
690         
691         * delegate.cs,
692         * enum.cs,
693         * statement.cs: Updates after MemberCore changes.
694         
695         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
696         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
697         
698         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
699         obsolete attribute for compiler construct.
700         (As.DoResolve): Cache result.
701         
702         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
703
704 2005-09-26  Raja R Harinath  <rharinath@novell.com>
705
706         Fix #76133.
707         * expression.cs (This.VerifyFixed): In a value type T, the type of
708         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
709         value type R, 'this' is treated as a value parameter.
710
711 2005-09-22  Miguel de Icaza  <miguel@novell.com>
712
713         * statement.cs (Lock): Use the TemporaryVariable class instead of
714         manually using local variables as those do not work when variables
715         are captured.
716
717         * ecore.cs: Moved the TemporaryVariable class from being a nested
718         class inside Foreach to be a public class that can be employed in
719         other places. 
720
721 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
722
723         * cs-parser.jay: interface_accessors replaced by
724         accessor_declarations.
725
726         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
727         location.
728         
729         * statement.cs (GotoCase.Resolve): Convert null constant to
730         null case.
731         (SwitchLabel.ResolveAndReduce): Ditto.
732         (SwitchLabel.NullStringCase): Custom null stamp.
733         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
734         
735         typemanager.cs (CSharpSignature): Don't skip first argument
736         for full names.
737
738 2005-09-18  Miguel de Icaza  <miguel@novell.com>
739
740         * driver.cs: Set InEmacs based on the environment variable EMACS. 
741
742         * location.cs (InEmacs): in this mode, do not report column
743         location as it confuses Emacs.
744
745 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
746
747         * cfold.cs, constant.cs, convert.cs, ecore.cs,
748         expression.cs, iterators.cs, literal.cs: Store constants and
749         literals location.
750         
751         * class.cs (MemberBase.ShortName): Pass location.
752         
753         * cs-parser.jay: Some location fixes.
754         
755         * ecore.cs (Expression.Location): Made virtual.
756
757 2005-09-05  Miguel de Icaza  <miguel@novell.com>
758
759         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
760         if the underlying types are the same, otherwise we need to produce
761         code that will do the proper cast.
762
763         This was exposed by Marek's constant rewrite which produced
764         invalid code for the call site:
765
766         enum X : long { a }
767         void Method (X v) {}
768
769         Method ((X) 5)
770
771         This fixes test-49.cs
772
773 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
774
775         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
776           Type/Object should be allowed as well. Fixed bug #75968.
777
778 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
779
780         * expression.cs : (Binary.DoResolve): when one is enum constant and
781           another is constant 0, then return enum one *as enum type*.
782           Fixed bug 74846.
783
784 2005-09-02  Raja R Harinath  <rharinath@novell.com>
785
786         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
787         internal.
788
789         Fix #75941.
790         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
791         flow-branching for LocalVariableReferences in case we were invoked
792         from a MemberAccess.
793         * expression.cs (LocalVariableReference.VerifyAssigned): New.
794         Carved out of ...
795         (LocalVariableReference.DoResolveBase): ... this.
796         (MemberAccess.Resolve): Do the check that was disabled during
797         SimpleNameResolve.
798
799 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
800
801         * class.cs :
802           (PartialContainer.Create): check abstract/sealed/static strictly
803           but abstract/sealed can exist only at one side. Fixed bug #75883.
804
805 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
806
807         Fix #75945.
808         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
809         specified, don't default to UnmanagedType.I4.
810
811 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
812
813         * expression.cs : conditional operator should check possibly
814           incorrect assign expression. Fixed bug #75946.
815
816 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
817
818         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
819           Reverting the change. gmcs is much complex than mcs on this matter.
820
821 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
822
823         * cs-tokenizer.cs : To read another token ahead of the actual 
824           consumption, use new SavedToken and cache token instead of moving
825           back the stream with SeekableStreamReader (it seemed problematic).
826         * cs-parser.jay,
827           driver.cs : Thus use StreamReader directly.
828         * support.cs : Thus removed SeekableStreamReader.
829
830 2005-08-30  Raja R Harinath  <rharinath@novell.com>
831
832         Fix #75934.
833         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
834         (ScopeInfo.EmitScopeType): Use it to construct field names from
835         names of captured locals.
836
837         Fix #75929.
838         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
839         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
840         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
841         (ExplicitConversion): Remove enum cases already handled by
842         implicit conversion.  Move implicit conversion check to the beginning.
843         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
844         * expression.cs (ArrayCreation.EmitDynamicInitializers):
845         Don't treat System.Enum as a struct.
846
847 2005-08-30  Jb Evain  <jbevain@gmail.com>
848
849         * attribute.cs: handles as expression in parameters.
850
851 2005-08-30  Raja R Harinath  <rharinath@novell.com>
852
853         Fix #75802.
854         * class.cs (TypeContainer.VerifyClsName): Don't use a
855         PartialContainer when verifying CLS compliance.
856         (AbstractPropertyEventMethod): Set Parent here, ...
857         (PropertyMethod): ... not here.
858
859 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
860
861         * attribute.cs : escaped attribute name should not be allowed to be
862           resolved (e.g. @class as classAttribute). Fixed bug #75930.
863
864 2005-08-29  Raja R Harinath  <rharinath@novell.com>
865
866         Fix #75927.
867         * convert.cs (ImplicitStandardConversionExists): Allow zero also
868         when converting a long constant to unsigned long.
869         * expression.cs (Invocation.OverloadResolve): Add sanity check to
870         detect where IsApplicable and VerifyArgumentsCompat disagree.
871
872 2005-08-29  Raja R Harinath  <rharinath@novell.com>
873         and Carlos Alberto Cortez  <carlos@unixmexico.org>
874
875         Fix #75848.
876         * class.cs (TypeContainer.CanElideInitializer): New helper.
877         (TypeContainer.EmitFieldInitializers): Use it to determine if we
878         can safely emitting the initializer of a field.
879
880 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
881
882         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
883           allowed inside a switch (without loop). Fixed bug #75433.
884
885 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
886
887         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
888         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
889
890 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
891
892         * driver.cs : kinda reverting the default encoding changes (not exact 
893           revert since I noticed that "codepage:reset" might not work fine).
894
895 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
896
897         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
898           Location. Now getter and setter store location correctly.
899           (errors/cs0111-12.cs now reports the expected location.)
900
901 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
902
903         * driver.cs : Use default encoding on the environment.
904           Removed (now that) extra parameter for SeekableStreamReader.
905         * support.cs : (SeekableStreamReader) third .ctor() argument for
906           StreamReader is not required (always true). preamble size could
907           be acquired in simpler and safe way.
908
909 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
910
911         * cs-parser.jay: report CS0642 at warning level 3
912           and report CS0642 for an if else statement also
913           fixes bug #74745. Patch by John Luke (and a bit
914           modified by me).
915           Removed extra CS0642 warning check for "while",
916           "for" and "fixed".
917         * statement.cs: In Block.Resolve(), CS0642 check
918           is reimplemented to check a sequence of an empty
919           statement and a block.
920
921           Both fix bug #66777.
922
923 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
924
925         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
926         detection until I fix it.
927         
928         * cs-tokenizer.cs: Changed error message.
929         
930         * cs-parser.jay: Fixed 2 error locations.
931         
932         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
933         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
934         properties.
935         
936         * enum.cs (GetSignatureForError): Fixed.
937         
938         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
939         method detection.
940         
941         * class.cs,
942         * typemanager.cs (RegisterProperty): Removed.
943         
944         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
945
946 2005-08-24  Raja R Harinath  <rharinath@novell.com>
947
948         Fix #75874.
949         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
950         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
951
952 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
953
954         * expression.cs : tiny fix is required for not warning positive ulong.
955           See test-441.cs.
956
957 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
958
959         * expression.cs : add CS0652 check for constant and integral
960           expression. Fixed bug #53974.
961
962 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
963
964         * expression.cs : in DoNumericPromotions(), check if there is implicit
965           conversion overload for string (to check CS0034). Fixed bug #52492.
966
967 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
968
969         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
970
971 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
972
973         * ecore.cs : report location when it is *not* Null.
974
975 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
976
977         * codegen.cs,
978           ecore.cs,
979           flowanalysis.cs,
980           expression.cs:
981           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
982           correctly. Fixed bug #75721.
983
984 2005-08-23  Raja R Harinath  <rharinath@novell.com>
985
986         * support.cs (SeekableStreamReader.Position): Avoid an expensive
987         loop that performs 'min (pos, char_count)'.
988
989         Fix #75862.
990         * expression.cs (Unary.ResolveOperator): Don't discard implicit
991         converted value in Operator.OnesComplement.
992
993 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
994
995         * anonymous.cs: If the anon method is pulled into a helper class,
996         it needs to be `internal' not `private'. Fixes runtime behavior on
997         msft. bug #75704
998
999 2005-08-20  Martin Baulig  <martin@ximian.com>
1000
1001         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1002         scope if we don't already have it.
1003
1004         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1005         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1006         fixes #75867.
1007
1008 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1009
1010         Fix #75803
1011         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1012         is a partial class.
1013
1014 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1015
1016         The big constants rewrite
1017         Fix #75746, #75685 and more
1018         As a side effect saved 1MB for MWF ;-)
1019         
1020         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1021         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1022         enum based for corlib compilation.
1023         
1024         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1025         subtractions.
1026         
1027         * class.cs (FixedField.Define): Use ResolveAsConstant.
1028         
1029         * const.cs (IConstant): Interface constants and enums.
1030         (Const.ResolveValue): New method for constant resolvning.
1031         (ExternalConstant): Constants from imported assemblies.
1032         
1033         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1034         conversion; like enums.
1035         (Constant.ToType): Converts this constant to different type.
1036         (Constant.Increment): Adds 1.
1037         
1038         * convert.cs (ImplicitConversionRequired): Simplified.
1039         
1040         * cs-parser.jay: Create EnumMember directly.
1041         
1042         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1043         
1044         * doc.cs (GenerateEnumDocComment): Removed.
1045         
1046         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1047         (ConvertIntLiteral): Removed.
1048         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1049         
1050         * enum.cs (EnumMember): Implement IConstant.
1051         (Enum.IsValidEnumConstant): Removed.
1052         (Enum.GetNextDefaultValue): Removed.
1053         (Enum.FindMembers): Updated.
1054         (Enum.GenerateDocComment): Iterate enum members.
1055         
1056         * expression.cs (Cast.TryReduce): Handle enums correctly.
1057         (New.Constantify): Made public.
1058         (MemberAccess.DoResolve): Removed contant specific if(s).
1059         
1060         * literal.cs (NullLiteral): Implement new abstract methods.
1061         
1062         * statement.cs (GotoCase.Resolve): Use new constant methods.
1063         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1064         
1065         * typemanager.cs (LookupEnum): Removed.
1066         (IsEnumType): Fixed to work with corlib.
1067         (RegisterConstant): Removed.
1068         (LookupConstant): Removed.
1069         (GetConstant): Changed to work with IConstant.
1070
1071 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1072
1073         * location.cs : Fixed overflown (>255) column number.
1074
1075 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1076
1077         First cut of the qualified-alias-member feature.
1078         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1079         token.
1080         * cs-parser.jay (DOUBLE_COLON): New token.
1081         (namespace_or_type_name): Add rule for recognizing
1082         qualified-alias-members.
1083         (primary_expression): Likewise.
1084         (element_access): Allow QualifiedAliasMember as a possible
1085         type-bearing expression.
1086         (local_variable_type, local_variable_pointer_type): Likewise.
1087         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1088         aliases in the current and enclosing namespace declarations.
1089         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1090         * decl.cs (MemberName.is_double_colon): New.
1091         (MemberName.MemberName): Add new constructor for alias-member.
1092         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1093         * expression.cs (QualifiedAliasMember): New expression type.
1094
1095 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1096
1097         * location.cs : it borked when no argument was specified.
1098
1099 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1100
1101         * location.cs : tiny ToString() format fix.
1102
1103 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1104
1105         * statement.cs : oops, it was missing.
1106
1107 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1108
1109         A set of fixes for precise line/column location.
1110
1111         * location.cs :
1112           "token" field now holds a file/line "delta", a line number offset 
1113           from the segment, and a column number. See also:
1114           http://lists.ximian.com/pipermail/mono-devel-list/2004-
1115           December/009508.html
1116           Removed static IsNull. Use instance IsNull property instead.
1117         * cs-tokenizer.cs :
1118           For some tokens it stores Location. For Identifier it stores
1119           LocatedToken which is a pair of string name and location.
1120           Column numbers are adjusted only at getChar().
1121         * report.cs :
1122           Use Location.ToString() for reporting (it now contains column).
1123         * cs-parser.jay :
1124           Largely modified to use LocatedToken instead of
1125           string (IDENTIFIER), and to acquire Location from some tokens.
1126         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1127           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1128           codegen.cs :
1129           Now MemberName holds Location. DeclSpace.ctor() receives Location
1130           as a parameter. Removed extra parameters to all derived classes.
1131           Replaced Location.IsNull() with instance property.
1132         * assign.cs, expression.cs :
1133           Added .ctor() overload that omits Location.
1134         * attribute.cs :
1135           Added "nameEscaped" flag that indicates the identifier was escaped
1136           in the source file. This fixes bug #57047.
1137
1138 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
1139
1140         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1141         New method, looking for lo-case imported cls type.
1142
1143         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1144         here.
1145
1146         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1147
1148         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1149
1150         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1151         all_imported_types.
1152         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1153
1154         Optimized to save 3.5 MB for SWF compilation.
1155
1156 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1157
1158         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1159         (PartialContainer.Create): Moved logic AddToContainer.
1160         (PartialContainer.MarkForDuplicationCheck): Shares name.
1161         
1162         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1163         place.
1164         
1165         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1166         initialization.
1167         (Namespace.GetSignatureForError): New method.
1168         
1169         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1170         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1171
1172 2005-08-01  Raja R Harinath  <rharinath@novell.com>
1173
1174         Fix #75669.
1175         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1176         member lookup rather than qualifier_type, since qualifier_type can
1177         be null.
1178
1179 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
1180
1181         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1182         enum member.
1183
1184 2005-07-31  Miguel de Icaza  <miguel@novell.com>
1185
1186         * statement.cs: Copy the local exception into the exception
1187         captured local.  Fixes 75674
1188
1189 2005-07-31  Raja R Harinath  <harinath@gmail.com>
1190
1191         Fix #75658.
1192         * expression.cs (Invocation.OverloadResolve): Don't report error
1193         CS1501 if error CS1502 has been reported.
1194         (New.DoResolve): Delegate CS1501 reporting to
1195         Invocation.OverloadResolve.
1196
1197         Fix #75656.
1198         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1199         invariant-meaning-in-block property in an enclosing block if
1200         necessary.
1201
1202 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
1203
1204         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1205         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1206         (Switch.CheckSwitch): Just save 50kb for SWF.
1207
1208 2005-07-27  Martin Baulig  <martin@ximian.com>
1209
1210         * anonymous.cs (CaptureContext.AddField): Added
1211         `AnonymousContainer am' argument; compute its toplevel scope if
1212         it's not already computed.  Fixes #75649.
1213
1214 2005-07-26  Raja R Harinath  <rharinath@novell.com>
1215
1216         Fix #75628.
1217         * class.cs (Constructor.Emit): Reset block to null if the block
1218         resolve fails.
1219
1220 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1221
1222         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1223
1224 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
1225
1226         * class.cs (MethodData.Define): Check whether accessor implementing
1227         interface is public.
1228
1229         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1230
1231 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
1232
1233         Fix #57245
1234         * namespace.cs (LookupType): Moved same type check to...
1235         
1236         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1237         with the same name.
1238
1239 2005-07-21  Raja R Harinath  <rharinath@novell.com>
1240
1241         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1242         already found a typebuilder.
1243         * class.cs (MethodCore.IsDuplicateImplementation): Compare
1244         MemberNames, not strings.
1245
1246         * const.cs (Error_ExpressionMustBeConst): 
1247         Rename from Error_EpressionMustBeConst.
1248         * const.cs, class.cs, statement.cd: Update.
1249
1250 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
1251
1252         Fix #65573
1253
1254         * const.cs (Const.LookupConstantValue): Report missing contant expression
1255         everytime.
1256         (Error_EpressionMustBeConstant): Only one error method.
1257
1258         * class.cs, statement.c: Updated.
1259
1260 2005-07-20  Raja R Harinath  <rharinath@novell.com>
1261
1262         * statement.cs (Block.Flags): Add back HasVarargs.
1263         (Block.flags): Make protected.
1264         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1265
1266         * typemanager.cs (types, typecontainers, user_types): Remove.
1267         (UserTypes, TypeContainers): Likewise.
1268         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1269         (CleanUp, Reset): Update.
1270         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
1271         (GetNestedType): Use Type.GetNestedType.
1272         (CoreLookupType): Take two arguments, the namespace and the
1273         basename of the type.  Update to use the Namespace.Lookup
1274         mechanism.
1275         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1276         (RealMemberLookup): Use IsNestedChildOf instead of playing with
1277         string concatenation and substring matches.
1278         * class.cs, enum.cs, delegate.cs: Update to changes.
1279
1280 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
1281
1282         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1283         Expression and made virtual.
1284
1285         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1286         (ImplicitStandardConversionExists): Fixed `byte' typo ?
1287
1288         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1289
1290         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1291         error message.
1292
1293         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1294         change.
1295
1296 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
1297
1298         Fix #57707
1299         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1300         AssemblyCultureAttribute is not used on executable.
1301
1302         * rootcontext.cs,
1303         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1304
1305 2005-07-16  Raja R Harinath  <rharinath@novell.com>
1306
1307         Fix #60638.
1308         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1309         New.  Reports CS0252/CS0253.
1310         Mostly taken from preliminary patch by Duncak Mak.
1311         (Binary.DoResolveOperator): Store results of operator lookup.
1312         Use them to detect if we need to warn about unintended reference
1313         comparisons.
1314
1315 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1316
1317         Fix #72969.
1318         * namespace.cs (Namespace.Lookup): Add back location parameter.
1319         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
1320         * delegate.cs, ecore.cs, expression.cs: Update to changes.
1321
1322         * codegen.cs (EmitContext.DeclSpace): Make readonly.
1323         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1324         (Namespace.LookupType): ... this.
1325         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1326         of namespaces.
1327         * typemanager.cs (LookupTypeReflection): Remove buggy code that
1328         purported to handle pointers.
1329         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1330         CoreLookupType.
1331
1332 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
1333
1334         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1335         type as namespace.
1336
1337 2005-07-15  Raja R Harinath  <rharinath@novell.com>
1338
1339         * namespace.cs (Namespace.Lookup): Drop location parameter.
1340         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
1341         (NamespaceEntry.Lookup): ... this.
1342         (NamespaceEntry.Error_AmbiguousTypeReference):
1343         Move here from DeclSpace.
1344         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1345         names ...
1346         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1347         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1348         Move to NamespaceEntry.
1349         * delegate.cs, expression.cs: Update to changes.
1350
1351 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
1352
1353         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1354         CheckAttributeType and refactored.
1355         (Attribute.ResolvePossibleAttributeType): Changed to reuse
1356         ResolveAsTypeTerminal error handling.
1357         (ResolveAsTypeTerminal): Introduced because of global attributes extra
1358         handling.
1359         (GetSignatureForError): Print errors in same way.
1360
1361         * class.cs,
1362         * codegen.cs: Reflect attribute GetSignatureForError change.
1363
1364         * ecore.cs,
1365         * expression.cs: Add silent parameter to ResolveAsTypeStep.
1366
1367         * namespace.cs (UsingEntry): Refactored to make fields private.
1368
1369         * assign.cs,
1370         statement.cs: Error_UnexpectedKind has extra parameter.
1371
1372 2005-07-14  Raja R Harinath  <rharinath@novell.com>
1373
1374         * ecore.cs (IAlias): Remove.
1375         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
1376         that implement the interface.
1377         * namespace.cs (Namespace): Likewise.
1378         (Namespace.declspaces): Renamed from 'defined_names'.
1379         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
1380         DeclSpace instead of an IAlias.
1381         * tree.cs (Tree.AddDecl): Update.
1382
1383 2005-07-12  Raja R Harinath  <rharinath@novell.com>
1384
1385         * statement.cs (Block.Flags); Remove HasVarargs.
1386         (Block.HasVarargs): Move to ToplevelBlock.
1387         (Block.ThisVariable, Block.AddThisVariable): Likewise.
1388         (Block.Variables): Make protected.  Initialize variable hashtable
1389         if necessary.
1390         (Block.AddVariable): Update.
1391         (Block.Resolve): Update to changes.
1392         (ToplevelBlock.HasVarargs): New boolean.
1393         (ToplevelBlock.ThisVariable): Move here from Block.
1394         (ToplevelBlock.AddThisVariable): Likewise.
1395         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
1396         * expression.cs (This.ResolveBase): Update to changes.
1397         (ArglistAccess.DoResolve): Likewise.
1398
1399 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1400
1401         Fix #75321
1402         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
1403
1404         * class.cs (TypeContainer.VerifyMembers): Distinguish between
1405         not used and not used & assigned.
1406         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
1407
1408 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
1409
1410         Fix #75053
1411         * expression.cs (Is.DoResolve): null is never provided type.
1412
1413 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
1414
1415         Fix #52496
1416         * cs-parser.jay: Less strict event error rule to catch more errors.
1417
1418 2005-07-08  Martin Baulig  <martin@ximian.com>
1419
1420         Fix test-iter-10.cs - distinguish whether we `yield' in a property
1421         gettter (allowed) or setter (not allowed).
1422
1423         * class.cs (Accessor): Implement IIteratorContainer.
1424         (Accessor.Yields): New public field.
1425         (PropertyBase.PropertyMethod.Define): Handle iterators on a
1426         per-accessor basis.
1427
1428         * cs-parser.jay
1429         (get_accessor_declaration, set_accessor_declaration): Set the
1430         `yields' flag on the accessor, not the property.
1431         (property_declaration): Do the iterators check on a per-accessor
1432         basis and not for the whole property.
1433
1434 2005-07-08  Martin Baulig  <martin@ximian.com>
1435
1436         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
1437         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
1438
1439 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
1440
1441         Fix #74975
1442         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
1443         (ExtractSecurityPermissionSet): Cope with self referencing security
1444         attributes properly.
1445
1446         * driver.cs (SetOutputFile): Made public property OutputFile.
1447
1448 2005-07-07  Raja R Harinath  <rharinath@novell.com>
1449
1450         Fix #75486.
1451         * class.cs (TypeContainer.first_nonstatic_field): Rename from
1452         has_nonstatic_fields.  Make into a FieldBase pointer.
1453         (TypeContainer.AddField): Add CS0282 check.
1454         (TypeContainer.EmitType): Update.
1455
1456 2005-07-06  Miguel de Icaza  <miguel@novell.com>
1457
1458         * cs-tokenizer.cs (consume_identifier): Do not create strings to
1459         compare if they start with __.
1460
1461 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1462
1463         * statement.cs (Switch.SwitchGoverningType): Only look at
1464         UserCasts that don't need implicit standard conversions to one of
1465         the allowed switch types (Fixes test-322.cs).
1466         (LocalInfo.Resolve): Re-enable sanity-test.
1467
1468 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
1469
1470         * cs-tokenizer.cs (consume_identifier): Detect double undescores
1471         
1472         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
1473         
1474         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
1475
1476 2005-07-06  Raja R Harinath  <rharinath@novell.com>
1477
1478         Fix #75472.
1479         * ecore.cs (SimpleName.GetSignatureForError): Add.
1480         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
1481         (MemberAccess.GetSignatureForError): Add.
1482
1483 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
1484  
1485         The big error and warning messages review.
1486         
1487         * anonymous.cs,
1488         * assign.cs,
1489         * attribute.cs,
1490         * class.cs,
1491         * codegen.cs,
1492         * convert.cs,
1493         * cs-parser.jay,
1494         * cs-tokenizer.cs,
1495         * decl.cs,
1496         * delegate.cs,
1497         * doc.cs,
1498         * driver.cs,
1499         * ecore.cs,
1500         * enum.cs,
1501         * expression.cs,
1502         * flowanalysis.cs,
1503         * iterators.cs,
1504         * literal.cs,
1505         * location.cs,
1506         * modifiers.cs,
1507         * namespace.cs,
1508         * parameter.cs,
1509         * pending.cs,
1510         * report.cs,
1511         * rootcontext.cs,
1512         * statement.cs,
1513         * support.cs,
1514         * tree.cs,
1515         * typemanager.cs: Updated.
1516         
1517         * class.cs: (MethodCore.SetYields): Moved here to share.
1518         (PropertyMethod.Define): Moved iterator setup here.
1519         
1520         * iterators.cs: Add orig_method to have full access to parent
1521         container.
1522
1523 2005-07-05  Raja R Harinath  <rharinath@novell.com>
1524
1525         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
1526         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
1527         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
1528         variable of struct type.
1529         * expression.cs (Unary.ResolveOperator): Update to change.
1530         (Indirection.VerifyFixed): Likewise.
1531         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
1532         (ParameterReference.VerifyFixed): Value parameters are fixed.
1533         (This.VerifyFixed): Treat 'this' as a value parameter.
1534         * statement.cs (LocalInfo.IsFixed): Remove.
1535
1536 2005-07-01  Martin Baulig  <martin@ximian.com>
1537
1538         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
1539         `ec.EmitThis ()' to get the correct scope.
1540
1541 2005-07-01  Martin Baulig  <martin@ximian.com>
1542
1543         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
1544         instance is a ParameterReference; fixes #75299.
1545
1546 2005-07-01  Martin Baulig  <martin@ximian.com>
1547
1548         Reverted Marek's latest patch (r46725):
1549         - it contains structural changes which are neither mentioned in
1550           the ChangeLog nor explained anywhere; for example the additional
1551           argument of EmitContext's and Iterator's .ctor's and the
1552           TypeContainer.DefineMembers() change.
1553         - structural changes like this should go in in seperate patches
1554           and not be hidden in a huge patch which just seems to affect
1555           warnings and errors.
1556           a big and hard to understand patch.
1557         - it breaks iterators and causes regressions, for instance in
1558           test-iter-03.cs.      
1559
1560 2005-06-30  Raja R Harinath  <rharinath@novell.com>
1561
1562         Fix #75412.
1563         * expression.cs (Indexers.map): Remove.
1564         (Indexers.Append): Filter out inaccessible setters and getters.
1565         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
1566
1567         Fix #75283.
1568         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
1569         Refactored from ...
1570         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
1571         (FieldExpr.Emit, PropertyExpr.Emit): Update.
1572         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
1573         * expression.cs (Invocation.EmitCall): Add CS0120 check.
1574
1575 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
1576
1577         Fix #75322
1578         * class.cs (FieldBase.GetInitializerExpression): One more field
1579         for backup.
1580
1581 2005-06-28  Miguel de Icaza  <miguel@novell.com>
1582
1583         * pending.cs: Do not define a proxy if the base method is virtual,
1584         it will be picked up by the runtime (bug 75270).
1585
1586 2005-06-08  Martin Baulig  <martin@ximian.com>
1587
1588         The big Iterators rewrite :-)
1589
1590         * iterators.cs: Rewrite this to use the anonymous methods framework.
1591
1592         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
1593         before the TypeContainers; see 2test-21.cs.
1594
1595         * class.cs
1596         (TypeContainer.DefineType): Don't create a new EmitContext if we
1597         already have one (this only happens if we're an Iterator).
1598         (TypeContainer.Define): Also call Define() on all our iterators.
1599         (Method.CreateEmitContext): Added support for iterators.
1600
1601         * anonymous.cs
1602         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
1603         (AnonymousContainer.CreateMethodHost): Moved here from
1604         AnonymousMethod and made abstract.
1605         (AnonymousContainer.CreateScopeType): New abstract method.
1606         (AnonymousContainer.IsIterator): New public property.
1607         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
1608         get the ScopeTypeBuilder rather than manually defining it here. 
1609         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
1610         iterators here.
1611
1612         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
1613         before RootContext.DefineTypes().
1614
1615         * codegen.cs (EmitContext.RemapToProxy): Removed.
1616         (EmitContext.CurrentAnonymousMethod): Changed type from
1617         AnonymousMethod -> AnonymousContainer.
1618         (EmitContext.ResolveTopBlock): Protect from being called twice.
1619         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
1620         (EmitContext.EmitThis): Removed the iterators hacks; use the
1621         anonymous methods framework for that.
1622
1623         * statement.cs
1624         (ToplevelBlock.Container): Make this a property, not a field.
1625         (ToplevelBlock.ReParent): New public method; move the
1626         ToplevelBlock into a new container.
1627         (Foreach.TemporaryVariable): Simplify.
1628
1629 2005-06-05  Martin Baulig  <martin@ximian.com>
1630
1631         * statement.cs (LocalInfo.CompilerGenerated): New flag.
1632         (Block.AddTemporaryVariable): New public method; creates a new
1633         `LocalInfo' for a temporary variable.
1634         (Block.EmitMeta): Create the LocalBuilders for all the temporary
1635         variables here.
1636         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
1637         non-iterator variables.
1638
1639 2005-06-05  Martin Baulig  <martin@ximian.com>
1640
1641         * statement.cs (Foreach.TemporaryVariable): Create the
1642         LocalBuilder in the Emit phase and not in Resolve since in some
1643         situations, we don't have an ILGenerator during Resolve; see
1644         2test-19.cs for an example.
1645
1646 2005-06-04  Martin Baulig  <martin@ximian.com>
1647
1648         **** Merged r45395 from GCS ****
1649
1650         The big Foreach rewrite - Part II.
1651
1652         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
1653         with `PropertyInfo ienumerator_getcurrent'.
1654
1655         * codegen.cs (VariableStorage): Removed.
1656
1657         * statement.cs
1658         (Foreach): Derive from Statement, not ExceptionStatement.
1659         (Foreach.CollectionForeach): New nested class.  Moved all the code
1660         dealing with collection foreach here.
1661         (Foreach.ForeachHelperMethods): Removed.
1662         (Foreach.TemporaryVariable): Implement IMemoryLocation.
1663
1664 2005-05-23  Martin Baulig  <martin@ximian.com>
1665
1666         * statement.cs (Try.DoResolve): Don't create a `finally' if we
1667         don't need to.  Fix #75014.
1668
1669 2005-05-20  Martin Baulig  <martin@ximian.com>
1670
1671         Merged r44808 from GMCS.
1672
1673         * class.cs (TypeContainer.CircularDepException): Removed.
1674         (TypeContainer.DefineType): Removed the `InTransit' stuff.
1675         (TypeContainer.CheckRecursiveDefinition): Check for circular class
1676         (CS0146) and interface (CS0529) dependencies here.
1677
1678 2005-06-21  Raja R Harinath  <rharinath@novell.com>
1679
1680         * expression.cs (Invocation.EmitCall): Fix initialization
1681         'this_call' to reflect current behaviour.  Fix indentation.
1682
1683         * convert.cs (FindMostEncompassedType): Add two trivial special
1684         cases (number_of_types == 0 || number_of_types == 1).
1685         (FindMostEncompasingType): Likewise.
1686
1687 2005-06-17  Raja R Harinath  <rharinath@novell.com>
1688
1689         Some cleanups preparing for the fix of #75283.
1690         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
1691         error testing.
1692         (EventExpr.InstanceResolve): Likewise.
1693         (EventExpr.DoResolve): Remove redundant checks.
1694
1695 2005-06-10  Duncan Mak  <duncan@novell.com>
1696
1697         * cs-tokenizer.cs (process_directives): New flag for controlling
1698         the processing of preprocessor directives.
1699         (x_token): After seeing a '#', return Token.NONE instead of going
1700         to handle_preprocessing_directive() when not processing
1701         directives. This avoids unnecessary processing during the token peek in
1702         is_punct().
1703
1704         This fixes #74939.
1705
1706         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
1707         the existing error reporting methods instead of Report.Error.
1708
1709         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
1710         after Raja's rewrite.
1711
1712 2005-06-08  Miguel de Icaza  <miguel@novell.com>
1713
1714         * class.cs: Small fix.
1715
1716 2005-06-08  Raja R Harinath  <rharinath@novell.com>
1717
1718         Fix #75160.
1719         * class.cs (GetPartialBases): Fix return value check of
1720         part.GetClassBases.
1721
1722 2005-06-07  Raja R Harinath  <rharinath@novell.com>
1723
1724         Ensure that partial classes are registered in their enclosing
1725         namespace.  Initial part of fix of #75160.
1726         * tree.cs (Tree.RecordDecl): Add new namespace argument.
1727         Register declspace with namespace here, not in
1728         DeclSpace.RecordDecl.
1729         * cs-parser.jay: Pass namespace to RecordDecl.
1730         * class.cs (PartialContainer.Create): Likewise.
1731         (ClassPart.DefineType): New sanity-check.  Throws an exception if
1732         called.
1733         * decl.cs (Declspace.RecordDecl): Remove.
1734         * namespace.cs (NamespaceEntry.DefineName): Remove.
1735
1736 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
1737
1738         * rootcontext.cs: Reset TargetExt as well.
1739
1740 2005-06-03  Raja R Harinath  <rharinath@novell.com>
1741
1742         * ecore.cs (Expression.Resolve): Emit CS0654 error when
1743         -langversion:ISO-1.
1744
1745 2005-06-02  Raja R Harinath  <rharinath@novell.com>
1746
1747         Fix #75080, cs0119.cs.
1748         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
1749         of ...
1750         (Expression.Resolve): ... this.  Use it.  Remove bogus code
1751         allowing ExprClass.Type and ExprClass.Namespace for
1752         ResolveFlags.VariableOrValue.
1753         (Expression.Resolve) [1-argument variant]: Change default resolve
1754         flags based on language version.
1755         (Expression.Error_UnexpectedKind): Use a simple string array
1756         rather than an ArrayList.
1757         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
1758         not ExprClass.Type.
1759         (TypeOfVoid.DoResolve): Likewise.
1760         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
1761         flags argument -- it always has the same value.
1762
1763 2005-05-31  Raja R Harinath  <rharinath@novell.com>
1764
1765         Fix #75081.
1766         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
1767         Use it in the error message.
1768         * assign.cs, expression.cs, statement.cs: Update.
1769
1770 2005-05-30  Raja R Harinath  <rharinath@novell.com>
1771
1772         Fix #75088.
1773         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
1774         the "almostMatchedMember" case too.
1775         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
1776         that failed the accessibility checks to 'almost_match'.
1777
1778 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
1779
1780         * attribute.cs: Use internal MethodBuilder methods to set
1781         ExactSpelling and SetLastError on PInvoke methods, instead
1782         of passing them via charset.  Fixes #75060.
1783
1784 2005-05-27  Raja R Harinath  <rharinath@novell.com>
1785
1786         * parameter.cs (Parameter): Remove TODO comment.
1787         (Parameter.DefineParameter): Remove Location parameter.
1788         (Parameters.LabelParameters): Likewise.
1789         * class.cs (Constructor.Emit): Update to change.
1790         (MethodData.Emit): Likewise.
1791         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
1792         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
1793
1794 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
1795
1796         * parameter.cs,
1797           Removed Parameters.Location and added Parameter.Location instead.
1798           Removed Location parameter from Emit() and GetSignature().
1799         * anonymous.cs,
1800           class.cs,
1801           cs-parser.jay,
1802           delegate.cs,
1803           iterators.cs,
1804           statement.cs :
1805           Modified all related calls.
1806
1807 2005-05-26  Raja R Harinath  <rharinath@novell.com>
1808
1809         Improve user-defined conversion handling.
1810         * convert.cs (GetConversionOperators): Rewrite.  Return only the
1811         applicable operators.
1812         (AddConversionOperators): New.  Helper for GetConversionOperators.
1813         (FindMostEncompassedType, FindMostEncompassingType): Verify that
1814         there is only one most encompassed/encompassing type.
1815         (FindMostSpecificSource, FindMostSpecificTarget): Remove
1816         "applicable operator" handling.
1817         (UserConversion): Move cache here from GetConversionOperators.
1818         Directly cache the chosen operator, rather than the whole
1819         MethodGroup.
1820         (ExplicitNumericConversion): Fix buggy implementation of Decimal
1821         case.  Allow conversion of decimal to sbyte and byte too.
1822         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1823         New static methods.  Used to avoid allocating EmptyExpressions in
1824         convert.cs.
1825
1826 2005-05-24  Duncan Mak  <duncan@novell.com>
1827
1828         * ecore.cs (CastFromDecimal): New class for casting a decimal to
1829         another class, used in Convert.ExplicitNumericConversion.
1830         (CastToDecimal): New class, similar to above, but casts to
1831         System.Decimal, used in Convert.ImplicitNumericConversion and also
1832         in explicit convesion from double/float to decimal.
1833
1834         * convert.cs (ImplicitNumericConversion): Handle implicit
1835         conversions to System.Decimal.
1836         (ExplicitNumericConversion): handle explicit conversions to
1837         System.Decimal.
1838
1839         This fixes #68711.
1840         
1841 2005-05-20  Miguel de Icaza  <miguel@novell.com>
1842
1843         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
1844         know the type at this stage, just break through.   Fixes #75008 
1845
1846 2005-05-19  Martin Baulig  <martin@ximian.com>
1847
1848         * delegate.cs
1849         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
1850         to disable error reporting.
1851
1852         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
1853         here since we don't want to report an error; see the new test-336.cs.
1854
1855 2005-05-19  Raja R Harinath  <rharinath@novell.com>
1856
1857         * statement.cs (ToplevelBlock.GetParameterReference)
1858         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
1859         Move here from class Block.
1860         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
1861         * expression.cs (ParameterReference.DoResolveBase): Likewise.
1862
1863 2005-05-18  Martin Baulig  <martin@ximian.com>
1864
1865         Fix #74978.
1866
1867         * flowanalysis.cs
1868         (FlowBranching.Reachability): Add non-static public And() and Or()
1869         methods.
1870         (FlowBranchingSwitch): New class; do the `break_origins' thing
1871         like in FlowBranchingLoop.
1872         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
1873         reachability, not just locals and parameters.
1874         (FlowBranching.MergeChild): Remove some of the hacks for loop and
1875         switch; MergeBreakOrigins() now takes care of that.
1876
1877 2005-05-18  Martin Baulig  <martin@ximian.com>
1878
1879         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1880         a loop and may leave it, reset the barrier; fixes #74974.
1881
1882 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
1883         
1884         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
1885         is back.
1886         
1887         * cs-parser.jay: Catch more lexical errors.
1888         
1889         * report.cs: Add one more Error method.
1890         
1891         * rootcontext.cs,
1892         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
1893
1894 2005-05-17  Martin Baulig  <martin@ximian.com>
1895
1896         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
1897         #70970. 
1898
1899 2005-05-16  Raja R Harinath  <rharinath@novell.com>
1900
1901         Fix test-382.cs.  Emit values of decimal constants.
1902         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
1903         Carved out of ...
1904         (TypeContainer.AddField): ... this.
1905         (TypeContainer.EmitFieldInitializers): Allow the list of fields
1906         with initializers to include 'Const's.
1907         (ClassPart.RegisterFieldForInitialization): Forward to
1908         PartialContainer.
1909         * const.cs (Const.Const): Pass initializer to base class.
1910         (Const.Define): In case of decimal constants, register them for
1911         initialization in a static constructor.
1912
1913 2005-05-14  Martin Baulig  <martin@ximian.com>
1914
1915         * statement.cs (Block.Resolve): Correctly handle unreachable code;
1916         do not call ResolveUnreachable() on unreachable statements in
1917         here, see the comment in the source code.
1918
1919 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1920
1921         Fix #74934.
1922         * expression.cs (BinaryResolveOperator): If one of the operands of
1923         an equality comparison is 'null' and the other is a pointer type,
1924         convert the null to a NullPointer.
1925         * convert.cs (ImplicitReferenceConversion): If the expression is a
1926         NullLiteral and the target type is a pointer type, return a
1927         NullPointer instead.
1928         (ImplicitConversionStandard): Likewise.
1929
1930 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
1931         
1932         * cs-parser.jay: Set readonly context based on special constructs.
1933         
1934         * expression.cs (LocalVariableReference.DoResolveBase): Improved
1935         readonly variable error handling.
1936         
1937         * rootcontext.cs (EmitCode): Don't verify members when error
1938         occurred.
1939         
1940         * statement.cs (LocalInfo): Add reaodnly context information.
1941         (SetReadOnlyContext, GetReadOnlyContext): New methods.
1942
1943 2005-05-13  Raja R Harinath  <rharinath@novell.com>
1944
1945         * statement.cs (Block.Resolve): Revert change below.  Modify fix
1946         for #74041 to initialize 'resolved' to false only for explicit
1947         blocks.  Fixes #74873.
1948
1949 2005-05-12  Raja R Harinath  <harinath@gmail.com>
1950
1951         Fix #74920.
1952         * typemanager.cs (unmanaged_enclosing_types): New.
1953         (IsUnmanagedType): Avoid infloops by using
1954         'unmanaged_enclosing_types' to talk with recursive invocations.
1955
1956 2005-05-13  Martin Baulig  <martin@ximian.com>
1957
1958         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
1959         instance variable, not a local.  Fix #74873.
1960         (Block.ResolveUnreachable): Set it to true here.
1961
1962 2005-05-11  Duncan Mak  <duncan@novell.com>
1963
1964         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
1965         continuing to process for 'arg'.
1966         (handle_preprocessing_directive): Check the argument of the #endif
1967         directive and report error CS1025 if there are any trailing
1968         characters.
1969
1970         According to the C# spec, having even whitespace after the #endif
1971         directive is illegal; however, because we call arg.TrimEnd ()
1972         beforehand, we have the same behavior as csc, allowing whitespace
1973         after the directive.
1974
1975         Fixes #74892.
1976
1977 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
1978
1979         Fix #74863.
1980         
1981         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
1982         (Constructor.GetObsoleteAttribute): Implemented correctly.
1983
1984 2005-05-10  Martin Baulig  <martin@ximian.com>
1985
1986         * support.cs (ReflectionParameters.ParameterModifier): Use
1987         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
1988         and `ParameterAttributes.In'.  Fixes #74884.
1989
1990 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
1991
1992         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
1993         
1994         * expression.cs (Argument.GetParameterModifier): Turned to property.
1995         (Invocation.Error_InvalidArguments): Add more descriptive errors.
1996         
1997         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
1998         its C# equivalent.
1999         
2000 2005-05-09  Raja R Harinath  <rharinath@novell.com>
2001
2002         Fix #74852.
2003         * decl.cs (MemberCache.AddMethods): Register override methods,
2004         rather than non-override methods.
2005         * typemanager.cs (RegisterOverride): New.
2006         (IsOverride): Update.
2007
2008 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
2009
2010         Fix #73105.
2011         
2012         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2013         recursive declaration.
2014         
2015         * statement.cs (Block.ResolveMeta): Report any error in resolving.
2016         
2017 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
2018
2019         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2020         
2021         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2022
2023 2005-05-05  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix #74797.
2026         * decl.cs (DeclSpace.FamilyAccessible): 
2027         Use TypeManager.IsNestedFamilyAccessible.
2028
2029         Fix reopened #64812.
2030         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2031         internal'.
2032
2033 2005-05-04  Raja R Harinath  <rharinath@novell.com>
2034             Abin Thomas  <projectmonokochi@rediffmail.com>
2035             Anoob V E  <projectmonokochi@rediffmail.com>
2036             Harilal P R  <projectmonokochi@rediffmail.com>
2037
2038         Fix #64812.
2039         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2040         allow access to all static members.
2041
2042 2005-05-04  Martin Baulig  <martin@ximian.com>
2043
2044         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2045
2046 2005-05-04  Martin Baulig  <martin@ximian.com>
2047
2048         Fix #74655.
2049
2050         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2051         section at the end; make things work if `default' is not the last
2052         section.        
2053
2054 2005-05-04  Martin Baulig  <martin@ximian.com>
2055
2056         Fix #70400.
2057
2058         * statement.cs (Switch): Replaced the `got_default' field with a
2059         `default_section' one.
2060         (Switch.CheckSwitch): Set `default_section' here.
2061         (Switch.Resolve): If we're a constant switch and the constant is
2062         not found, use the default section.
2063
2064 2005-05-03  Martin Baulig  <martin@ximian.com>
2065
2066         * expression.cs (ArrayAccess.EmitGetLength): New public method.
2067
2068         * statement.cs (Foreach.ArrayForeach): New nested class.
2069         (Foreach.TemporaryVariable): New nested class.
2070         (Foreach.EmitArrayForeach): Removed; this is now in the new
2071         ArrayForeach class.
2072
2073 2005-05-03  Raja R Harinath  <rharinath@novell.com>
2074
2075         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
2076         more conservative.
2077         (VerifyPendingMethods): Revert change below.
2078
2079         * typemanager.cs (IsOverride, RegisterNonOverride): New.
2080         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2081         that used to trigger warning -28.  Remove warning -28.
2082         * expression.cs (Invocation.OverloadResolve): Use
2083         TypeManager.IsOverride to distinguish override methods.
2084
2085         Fix #74773.
2086         * pending.cs (VerifyPendingMethods): If a base type implements the
2087         requested interface, don't bother checking individual methods of
2088         the base type.  As a side-effect, this prevents the creation of
2089         unnecessary proxies.
2090
2091 2005-05-02  Martin Baulig  <martin@ximian.com>
2092
2093         Fix #70182.
2094
2095         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2096         Also `And' the locals if the old vector is null.
2097         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2098         null; in this case we basically reset all the variables.        
2099
2100 2005-05-02  Martin Baulig  <martin@ximian.com>
2101
2102         Fix #74529.
2103
2104         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2105         Added `FlowBranching branching' argument; always `and' the
2106         variables instead of `or'ing them unless we're an infinite loop.
2107
2108         * statement.cs (While.Resolve): Create a new sibling unless we're
2109         infinite.       
2110
2111 2005-05-02  Martin Baulig  <martin@ximian.com>
2112
2113         Fix #70140.
2114
2115         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2116         arguments; use it instead of creating a new TopLevelBlock.
2117         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2118         our ConstructorInitializer.
2119
2120         * statement.cs
2121         (TopLevelBlock.TopLevelBranching): New public property.
2122         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2123         and create our `TopLevelBranching'.
2124
2125         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2126         anonymous method host, use `block.TopLevelBranching' rather than
2127         creating a new branching.
2128
2129 2005-04-20  Miguel de Icaza  <miguel@novell.com>
2130
2131         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2132         a ScopeInfo, if any of the current children is a child of the new
2133         entry, move those children there.
2134
2135 2005-04-30  Martin Baulig  <martin@ximian.com>
2136
2137         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2138         at the beginning of a SwitchSection.  Fix #73335.
2139
2140 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
2141
2142         Fix #74378
2143         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2144         
2145         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2146         (FieldExpr.DoResolve): Obsolete members are ignored for field
2147         initializers.
2148         
2149 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
2150
2151         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2152         of arrays detection.
2153
2154         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2155         verification.
2156         (Field.VerifyClsCompliance): Volatile fields are not compliant.
2157
2158         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2159         arrays report.
2160
2161 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
2162
2163         * cs-parser.jay: Use the prefered version of -unsafe in error
2164         message.
2165
2166 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
2167
2168         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2169         circumstances.
2170
2171 2005-04-20  John Luke  <john.luke@gmail.com>
2172
2173         * driver.cs: fix typo in error message, --outout to --output
2174
2175 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
2176
2177         * codegen.cs (InRefOutArgumentResolving): New field.
2178         
2179         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
2180         fields outside contructor.
2181         
2182         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
2183         
2184 2005-04-19  Miguel de Icaza  <miguel@novell.com>
2185
2186         * anonymous.cs (CaptureContext.EmitParameterInstance): The
2187         parameter code was not completed ever, so it was not as up-to-date
2188         as local variables.  Must finish it.
2189
2190         The bug fix was to compare the Toplevel of the block, not the
2191         current block.  Thanks for Ben for pointing this out. 
2192
2193 2005-04-19  Raja R Harinath  <rharinath@novell.com>
2194
2195         * decl.cs (AddMethods): Use the declaring type of the problem
2196         method to determine if we want to squash a warning.
2197
2198 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
2199
2200         * attribute.cs: Removed debug output.
2201
2202         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
2203         
2204         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
2205         Report.Stderr.
2206         
2207 2005-04-18  Raja R Harinath  <rharinath@novell.com>
2208
2209         Fix #74481.
2210         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
2211         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
2212         all null comparisons against reference types.
2213
2214 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
2215
2216         Fix# 74565
2217         * class.cs (TypeContainer.CircularDepException) New nested
2218         exception class.
2219         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
2220         (TypeContainer.DefineType): Removed error, reset InTransit before
2221         exit.
2222         (Class.DefineType): Throw exception when is in Transit.
2223         Catch exception and report error.
2224         (Struct.DefineType): Throw exception when is in Transit.
2225         Catch exception and report error.
2226         (Interface.DefineType): Throw exception when is in Transit.
2227         Catch exception and report error.
2228
2229         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
2230         handle nested exception handlers.
2231
2232         * flowanalysis.cs (InTryWithCatch): New method, search for try with
2233         a catch.
2234
2235         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
2236         InFinally and InCatch storage.
2237
2238         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
2239         (Catch.Resolve): Set and Restore ec.InCatch.
2240         (Try.Resolve): Set and Restore ec.InFinally.
2241         (Try.HasCatch): True when try has catch.
2242
2243 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
2244
2245         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
2246           for the same event member, so exclude such cases from warning 419.
2247           Fixed bug #74633.
2248
2249 2005-04-16  Miguel de Icaza  <miguel@novell.com>
2250
2251         * expression.cs (Binary.ResolveOperator): Apply patch from John
2252         Luke to fix bug 59864: operators &, | and ^ on enumerations
2253         require that the same enum type on both sides.
2254
2255         * driver.cs: Add warnings to old flag usage, this is to assist
2256         people who produce Makefiles and hope that the Makefiles will be
2257         used on Windows.
2258
2259         * class.cs (TypeContainer.EmitType): Moved the definition of the
2260         special $PRIVATE$ field from the resolve phase to the Emit phase.
2261         During resolve we do not know if we are a struct with
2262         HasExplicitLayout, we know this only after the attributes for the
2263         type are emitted.
2264
2265         Set the FieldOffset to zero on the dummy field that we create for
2266         the class.   Fixes 74590.
2267
2268 2005-04-16  Raja R Harinath  <rharinath@novell.com>
2269
2270         Fix #73834.
2271         * ecore.cs (PropertyExpr.resolved): New.
2272         (DoResolve): Use it to handle a case of double resolution here.
2273         Handle a case of identical-name-and-type-name.
2274         * expression.cs (ArrayCreation.CheckIndices): Avoid double
2275         resolution by storing the results of expression resolution back
2276         into the "probes" array.
2277
2278 2005-04-15  Raja R Harinath  <rharinath@novell.com>
2279
2280         Fix cs0208-7.cs and cs0208-8.cs.
2281         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
2282         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
2283         error reporting to point out the reason a struct is not unmanaged.
2284
2285 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2286
2287         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
2288           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
2289
2290 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2291
2292         Fix #74528.
2293         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
2294         IdenticalNameAndTypeName here.
2295         (EventExpr.InstanceResolve): Likewise.
2296
2297 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
2298
2299         C# 2.0 DefaultCharSetAttribute implementation
2300         
2301         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
2302         which allows us to set GlobalNamespace for every resolve.
2303         (Attribute.ResolveArguments): Cut from Resolve.
2304         (Attribute.GetCharSetValue): Returns CharSet named argument.
2305         (Attribute.DefinePInvokeMethod): Gets default charset from
2306         module settings.
2307         (GlobalAttribute.ResolveAsTypeStep): Override.
2308         (GlobalAttribute.ResolveArguments): Override.
2309         
2310         * class.cs (TypeAttr): Is protected.
2311         
2312         * codegen.cs (ModuleClass.DefaultCharSet): New member.
2313         (ModuleClass.DefaultCharSetType): New memeber.
2314         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
2315         
2316         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
2317         charset from module.
2318         
2319         * delegate.cs (TypeAttr): Override.
2320         (Delegate.DefineType): Use this TypeAttr.
2321         
2322         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
2323         at very early stage (before types are defined) to resolve model
2324         module attributes. It will probably not work with corlib but it
2325         should be ok.
2326         
2327         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
2328         charset from module.
2329         
2330         * typemanager.cs (default_charset_type): New type.
2331
2332 2005-04-13  Raja R Harinath  <rharinath@novell.com>
2333
2334         * decl.cs (MemberCache.AddMethods): Don't warn if
2335         System.Object.Finalize has buggy MethodAttributes.
2336
2337         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
2338         removed below.
2339
2340 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2341
2342         * doc.cs : detect ambiguous reference to overloaded members.
2343           Fixed bug #71603. MS 1.1 csc does not detect it.
2344
2345 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
2346
2347         * doc.cs : delegates must not be referenced with parameters.
2348           Fixed bug #71605.
2349
2350 2005-04-12  Miguel de Icaza  <miguel@novell.com>
2351
2352         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
2353
2354 2005-04-10  Miguel de Icaza  <miguel@novell.com>
2355
2356         * driver.cs (MainDriver): Stop processing if the CLS stage found
2357         errors. 
2358
2359         (CompilerCallableEntryPoint.InvokeCompiler): Always
2360         reset after execution;   Take a TextWriter argument for the
2361         output.
2362
2363         * report.cs: Use the error stream instead of hardcoding stderr. 
2364
2365 2005-04-09  Miguel de Icaza  <miguel@novell.com>
2366
2367         * class.cs: Reduce code paths to test, too small of an
2368         optimization to make it worth the extra testing.  Always perform
2369         it. 
2370
2371 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2372
2373         Fix #74510.
2374         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
2375         operators that had errors reported on them.
2376
2377 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
2378
2379         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
2380         argument types.
2381         (Attribute.Resolve): Add named argument type checking.
2382         
2383         * class.cs (FixedField.Define): Use IsPrimitiveType
2384         
2385         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
2386         
2387         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
2388         unsafe parameter types.
2389         
2390         * statement.cs (Using.ResolveExpression): Add better error description.
2391         
2392         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
2393         
2394 2005-04-08  Raja R Harinath  <rharinath@novell.com>
2395
2396         Fix #74484.
2397         * attribute.cs (Attribute.GetAttributeUsage): Resolve
2398         AttributeUsageAttribute in the emitcontext of the attribute class,
2399         not in the emitcontext of the attributable entity it was attached to.
2400         * cs-parser.jay: Use 'current_class', not 'current_container',
2401         when creating a GlobalAttribute.
2402
2403 2005-04-08  Alp Toker  <alp@atoker.com>
2404
2405         * pending.cs: The fix to #58413 failed to compile methods implementing
2406         interfaces with/without params modifiers and vice versa, even though
2407         params modifiers aren't part of the signature. Make the modifier check
2408         less strict as in csc.
2409
2410 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
2411             Anoob V E  <projectmonokochi@rediffmail.com>
2412             Harilal P R  <projectmonokochi@rediffmail.com>
2413
2414         Fix #58413.
2415         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
2416         modifiers of pending methods.
2417         (PendingImplementation.PendingImplementation): Initialize it.
2418         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
2419         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
2420         with ParameterData.  Add check for modifiers.
2421         * class.cs (MethodData.Define): Update to changes.
2422
2423 2005-04-07  Raja R Harinath  <rharinath@novell.com>
2424
2425         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
2426
2427 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
2428
2429         * class.cs (PropertyMethod.Define): Check private accessor in abstract
2430         property.
2431         
2432         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
2433         
2434         * rootcontext.cs,
2435         * typemanager.cs: Registered RequiredAttributeAttribute.
2436         
2437 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
2438
2439         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
2440         Warning CS0169 is back at level 3.
2441         (IMethodData.SetMemberIsUsed): New method.
2442         
2443         * decl.cs (IsUsed): New value; moved from FieldBase.Status
2444         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
2445         
2446         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
2447
2448         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
2449         contants.
2450         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
2451         is used.
2452         
2453         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
2454         is used.
2455         
2456         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
2457         to avoid the problems with nested types.
2458
2459 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
2460             Anoob V.E  <projectmonokochi@rediffmail.com>
2461             Harilal P.R  <projectmonokochi@rediffmail.com>
2462             Raja R Harinath  <rharinath@novell.com>
2463
2464         Fix #73820.
2465         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
2466         attribute.
2467         * typemanager (GetConstructor): Make public.
2468
2469 2005-04-05  John Luke  <john.luke@gmail.com>
2470             Raja R Harinath  <rharinath@novell.com>
2471
2472         Fix #62232.
2473         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
2474         struct too.  Return false quicker in a few cases.
2475         (VerifyUnManaged): Use it.
2476
2477 2005-04-05  Raja R Harinath  <rharinath@novell.com>
2478
2479         Fix #74041.
2480         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
2481         not 'unreachable_seen'.
2482
2483 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
2484
2485         * attribute.cs (Attribute.GetValue): Removed unused.
2486         
2487         * codegen.cs (CodeGen.TrimExt): Removed unused.
2488         
2489         * cs-parser.jay (output): Removed unused.
2490         
2491         * cs-tokenizer.cs (hex_digits): Removed unused.
2492         
2493         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
2494         
2495         * expression.cs (Indirection.LoadExprValue): Removed unused.
2496         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
2497         
2498         * iterators.cs (Iterator.param_types): Removed unused.
2499         
2500         * statement.cs (Goto.block): Removed unused.
2501         (ToplevelBlock.did): Removed unused.
2502         (Switch.ResolveConstantSwitch): Removed unused.
2503
2504 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
2505
2506         * rootcontext.cs: Allow mcs to bootstrap with the compilation
2507         resetting thingy.
2508
2509 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2510
2511         Fix #74232 and cs0208-3.cs.
2512         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
2513         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
2514         unmanaged type.  Don't use FieldBuilders when 't' is a
2515         TypeBuilder.  Use ModFlags and MemberType fields.
2516         * class.cs (MemberBase.member_type): Rename from MemberType.
2517         (MemberBase.MemberType): New property.  Determines member_type on
2518         demand.
2519         (MemberBase.DoDefine): Don't initialize MemberType here.
2520         (FieldMember.Define): Likewise.
2521
2522 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
2523
2524         Fix #74241
2525         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
2526         Attributes are emitted there.
2527         
2528 2005-04-01  Raja R Harinath  <rharinath@novell.com>
2529
2530         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
2531         keyword in 'partial enum' too.
2532         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
2533         is not allowed).
2534         Report from Kamil Skalski <nazgul@omega.pl>.
2535
2536         Fix #74309.
2537         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
2538         have partial containers too.
2539
2540         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
2541         in block' checks to Block.CheckInvariantMeaningInBlock.
2542         * statement.cs (Block.GetKnownVariableInfo): Make private.
2543         (Block.IsVariableUsedInChildBlock): Remove.
2544         (Block.IsVariableUsedInBlock): Likewise.
2545         (Block.CheckInvariantMeaningInBlock): New.  Show location of
2546         conflicting declaration.
2547         (Block.AddVariable): Make error messages less long-winded and more
2548         specific.  Show location of conflicting declaration.
2549         * parameter.cs (Parameters.Location): New readonly property.
2550
2551 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2552
2553         Clean up semantics of invoking ResolveMemberAccess.
2554         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
2555         can have an instance, ensure that we pass in a non-TypeExpression
2556         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
2557         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
2558         argument.  Update to changes and simplify.
2559         (FieldExpr.Emitinstance): Remove CS0120 check.
2560         (PropertyExpr.EmitInstance): Likewise.
2561         * expression.cs (Argument.Resolve): Likewise.
2562         (Invocation.DoResolve): Update to changes in semantics of
2563         InstanceExpression.
2564
2565 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
2566
2567         Fix #74241
2568         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
2569         customization.
2570         
2571         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
2572
2573 2005-03-31  Raja R Harinath  <rharinath@novell.com>
2574
2575         Fix difference in behaviour with commandline invocation.
2576         * driver.cs (Driver.Reset): New.
2577         (CompilerCallableEntryPoint): Call it.
2578
2579         * statement.cs (If.Resolve): Avoid spurious "uninitialized
2580         variable" warnings if the boolean expression failed to resolve.
2581
2582 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
2583
2584         * attribute.cs: Fix the union of several permissions when some of them
2585         are unrestricted (so the result isn't an unrestricted permission set).
2586         Fix #74036.
2587
2588 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2589
2590         * ecore.cs (MemberExpr): New class.  Convert from interface
2591         IMemberExpr.
2592         (MemberExpr.ResolveMemberAccess): Refactor and move here from
2593         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
2594         error checks.
2595         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
2596         (MethodGroupExpr.IsExplicitImpl): Remove.
2597         (Expression.GetFieldFromEvent): Remove.
2598         (SimpleName.MemberStaticCheck): Remove.
2599         (SimpleName.DoSimpleNameResolve): Update to changes.
2600         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
2601         (MemberAccess.IdenticalNameAndTypeName): Remove.
2602         (MemberAccess.error176): Move to MemberExpr.
2603         (MemberAccess.DoResolve): Update to changes.
2604         (BaseAccess.DoResolve): Likewise.
2605
2606 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
2607
2608         C# 2.0 Conditional attribute class implementation
2609         
2610         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
2611         Analyzes class whether it has attribute which has ConditionalAttribute
2612         and its condition is not defined.
2613         
2614         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
2615         (Class.IsExcluded): New method. Search for at least one defined
2616         condition in ConditionalAttribute of attribute class.
2617
2618 2005-03-30  Raja R Harinath  <rharinath@novell.com>
2619
2620         * ecore.cs (PropertyExpr): Derive from Expression, not
2621         ExpressionStatement.
2622         (PropertyExpr.EmitStatement): Remove.
2623
2624 2005-03-29  Raja R Harinath  <rharinath@novell.com>
2625
2626         Fix #74060.
2627         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
2628         internal field "value__" of an enum be private.  The examples for
2629         "value__" that I found on MSDN all used FieldAttributes.Private.
2630
2631         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
2632         Don't mention IL method attribute names.
2633
2634         Fix #47991.  Remove a TODO.
2635         * statement.cs (Block.Toplevel): Make into a field.
2636         (Block.Parameters): Move into ToplevelBlock.
2637         (Block.known_variables): Rename from child_variable_names.
2638         (Block.Block): Remove variants that take Parameters.  Initialize
2639         'Toplevel' with the immediately surrounding toplevel block.
2640         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
2641         LocalInfo parameter.
2642         (Block.GetKnownVariableInfo): New.
2643         (Block.IsVariableNameUsedInChildBlock): Update.
2644         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
2645         the block, even though it may not be in scope.
2646         (Block.AddVariable): Remove Parameters parameter.  Use
2647         Toplevel.Parameters instead.
2648         (Block.AddConstant): Remove Parameters parameter.
2649         (Block.GetParameterReference): Update to use Toplevel.Parameters.
2650         (Block.IsParamaterReference): Likewise.
2651         (Block.IsLocalParameter): Likewise.  Simplify a lot.
2652         (ToplevelBlock.Parameters): New.  Moved from Block.
2653         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
2654         initialize Parameters to a non-null value.
2655         * cs-parser.jay: Update to changes.
2656         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
2657         simple names that mean different things in the same block.  Use
2658         Block.IsVariableNameUsedInBlock.
2659
2660 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2661
2662         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2663         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2664         GetTypeHandle.  It is possible for a reflected type to derive from
2665         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2666         System.Array during mscorlib compilation).
2667         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2668         contain a method_hash, don't create one either.  Don't create a
2669         deep copy of the base cache's method_hash.
2670         (MemberCache.SetupCache): Rename back from DeepCopy.
2671         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2672         already initialized.  If we see an override function, add its
2673         underlying base virtual function to the member_hash too.
2674
2675         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
2676
2677 2005-03-26  Raja R Harinath  <harinath@acm.org>
2678
2679         Fix #73038.
2680         * assign.cs (Assign.DoResolve): When the RHS of an assignment
2681         fails to resolve, ensure that the LHS is still resolved as an
2682         lvalue.
2683
2684 2005-03-25  Raja R Harinath  <harinath@acm.org>
2685
2686         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
2687         ec.ContainerType.
2688         (Enum.current_ec): Remove.
2689         (Enum.LookupEnumValue): Remove EmitContext argument.
2690         Just uses the one created during DefineType.
2691         (Enum.FindMembers): Update.
2692         * expression.cs (MemberAccess.DoResolve): Update.
2693
2694 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
2695
2696         * assign.cs (Assign.DoResolve): Check for CS1717 when
2697         source and target are same (uses Equals).
2698
2699         * expression.cs (LocalVariableReference, ParameterReference,
2700         This): Implemented Equals, GetHashCode.
2701
2702         * statement.cs (Block.GetParameterReference): Removed useless
2703         local variable.
2704
2705 2005-03-22  Raja R Harinath  <rharinath@novell.com>
2706
2707         Fix cs0128.cs
2708         * statement.cs (Block.AddVariable): Ensure that we skip implicit
2709         blocks before deciding whether the error is cs0136 or cs0128.
2710
2711         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
2712         (using_alias_directive, using_namespace_directive): Pass
2713         MemberName, not an expression to Namespace.UsingAlias and
2714         Namespace.Using.
2715         (MakeName): Use the MemberName of the namespace.
2716         * namespace.cs (Namespace.MemberName): New.
2717         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
2718         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
2719         Likewise.
2720         * decl.cs (MemberName.Name): Make readonly.
2721         (MemberName.FromDotted): New "constructor".
2722         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
2723         (MemberCore.Name): Compute from MemberName on demand.
2724         (MemberCore.SetMemberName): Provide a way to change the
2725         MemberName.
2726         (MemberCore.AddToContainer): Don't take a fullname parameter.
2727         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
2728         fully qualified name of the container to the member name.
2729         (TypeContainer.AddToTypeContainer): Use a fully qualified name
2730         only if the type is a member of the root container.
2731         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
2732         MemberName.Left rather than searching for an embedded ".".
2733         (PartialContainer.CreatePart): Update to changes in RootContext.
2734         (MemberBase.ShortName): Turn into a property.  Use
2735         MemberCore.SetMemberName.
2736         (MemberBase.ExplicitInterfaceName): Remove.
2737         (MemberBase.UpdateMemberName): Remove.
2738         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
2739         (PropertyBase.SetMemberName): New override.
2740         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
2741         (Tree.GetDecl): New.
2742         (Tree.AllDecls): Rename from Decls.
2743         * attribute.cs, enum.cs, report.cs: Update to changes.
2744         * driver.cs (MainDriver): Use MemberName.FromDotted on
2745         RootContext.MainClass.
2746
2747 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
2748
2749         * class.cs (FixedField.Define): Check for CS1664 and more sanity
2750         checks.
2751
2752         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
2753
2754 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
2755
2756         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
2757         property accessor modifiers.
2758
2759         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
2760         fixed buffer attribute (CS1716).
2761         (PropertyMethod.HasCustomAccessModifier): When property accessor
2762         has custom modifier.
2763
2764         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
2765         modifiers.
2766         (PropertyExpr.DoResolveLValue): Add CS0272.
2767
2768 2005-03-17  Miguel de Icaza  <miguel@novell.com>
2769
2770         * convert.cs: When converting to a pointer, use the proper Conv.U
2771         or Conv.I depending on the source data type.
2772
2773         * cs-tokenizer.cs: Make the size for large decimal constants,
2774         fixes #72957.
2775
2776 2005-03-17  Martin Baulig  <martin@ximian.com>
2777
2778         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2779         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2780
2781 2005-03-17  Martin Baulig  <martin@ximian.com>
2782
2783         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2784         to bool so we can return an error condition.
2785         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2786         returned an error.
2787
2788 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
2789
2790         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
2791         attributes.
2792
2793 2005-03-16  Raja R Harinath  <rharinath@novell.com>
2794
2795         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
2796         Refactor to avoid traversing the list of assemblies, and to avoid
2797         string concatenation.
2798         * typemanager.cs (guid_attr_type): Remove.
2799         (negative_hits, pointers, references): Remove hashes.
2800         (type_hash): New.
2801         (GetConstructedType): New.  Uses type_hash to handle constructed
2802         types (arrays, references, pointers).
2803         (GetReferenceType, GetPointerType): Use it.
2804         (GetNestedType): New.  Uses type_hash to handle nested types of
2805         reflected types.
2806         (LookupType, LookupTypeDirect): Remove.
2807         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
2808         'types' hash and LookupTypeReflection directly.
2809         (params_string, params_object): Use GetConstructedType.
2810         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
2811         top-level types.
2812         (Namespace.Lookup): Use cached_types.
2813         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
2814         provided by old TypeManager.LookupType.
2815         * rootcontext.cs (MakeFQN): Remove.
2816         * decl.cs (DeclSpace.MakeFQN): Likewise.
2817         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
2818         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
2819         TypeManager.GetConstructedType.
2820         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
2821
2822 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
2823
2824         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
2825         indexers.
2826
2827         * cs-parser.jay: Reports CS1527 for any namespace element.
2828
2829         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
2830         Added CS0407.
2831
2832         * expression.cs (ParameterReference.IsAssigned): Changed error to
2833         CS0269.
2834         (Error_WrongNumArguments): Moved CS0245 detection here.
2835
2836         * statement.cs (Return.Resolve): Add CS1622 report.
2837
2838 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
2839
2840         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
2841
2842 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
2843
2844         * attribute.cs expression.cs: Get rid of some allocations.
2845
2846 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
2847
2848         * doc.cs : just eliminate the latest change.
2849
2850 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2851
2852         * doc.cs : commented out the latest change. It breaks xml-030.cs
2853
2854 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2855
2856         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
2857           fail. So invoke CreateType() in FindDocumentedType().
2858
2859 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
2860
2861         * cs-tokenizer.cs : added IsKeyword().
2862         * doc.cs : Detect keyword incorrectly used as identifier.
2863           Allow identifiers prefixed by @.
2864
2865 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
2866
2867         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
2868         It caused exception in namespace resolving (again!).
2869         
2870         * class.cs (Class.ctor): Removed exit.
2871         (PropertyMethod.ctor): ditto.
2872         
2873         * codegen.cs (Codegen.Reset): Reset static data.
2874         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
2875         
2876         * cs-tokenizer.cs (Cleanup): Removed.
2877         
2878         * driver.cs (GetSystemDir): Rewrote to one line command.
2879         It caused problem with unloaded dynamic modules.
2880         (UnixParseOption): Removed Exit.
2881         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
2882         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
2883         Now can be mcs used as library.
2884         
2885         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
2886         empty location.
2887         
2888         * location.cs (Reset): Reset static data.
2889         
2890         * namespace.cs (Reset): Reset static data.
2891         
2892         * report.cs (Report.Reset): Reset static data.
2893         
2894         * rootcontext.cs (RootContext.Reset): Reset static data.
2895         
2896         * tree.cs (RootTypes.ctor): Use Location.Null
2897         
2898         * typemanager.cs (TypeManager.Reset): Reset static data.
2899         (CoreLookupType): Removed Exit.
2900         (TypeHandle.Reset): Reset static data.
2901         
2902 2005-03-10  Raja R Harinath  <rharinath@novell.com>
2903
2904         Fix #73516.
2905         * typemanager.cs (ComputeNamespaces): Import namespaces from
2906         referenced modules too.
2907
2908 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2909
2910         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
2911         than '.'.
2912
2913 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2914
2915         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
2916         enclosing DeclSpace.  This ensures that a name-lookup populates
2917         more caches and there are fewer 'TypeExpression's.  Carve out
2918         nested type lookup into ...
2919         (LookupNestedTypeInHierarchy): ... this.
2920
2921 2005-03-09  Raja R Harinath  <rharinath@novell.com>
2922
2923         Clean up a few partial-class semantics.  
2924         Fixes test-357.cs and cs1618-2.cs.
2925         * cs-parser.jay (struct_declaration): Use 'current_class' as
2926         parent of newly-created struct.  Remove call to Register ().
2927         Use 'pop_current_class' to complete handing the current struct.
2928         (interface_declaration): Likewise.
2929         (class_declaration): Likewise.
2930         (enum_declaration): Use 'current_class' as parent of newly created
2931         enum.
2932         (delegate_declaration): Likewise.
2933         (pop_current_class): New function.  This is used to handle closing
2934         up the 'current_class' and 'current_container', and pointing them
2935         to the enclosing class/container.
2936         (CSharpParser): Initialize 'current_class' too.
2937         * decl.cs (MemberCore): Add check for invariant: a partial
2938         container is not a parsed entity, and thus does not enclose any
2939         parsed members.
2940         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
2941         (DeclSpace.BaseTypeExpr): Use it.
2942         (DeclSpace.LookupType): Add check for invariant.
2943         * class.cs (TypeContainer): Add check for invariant: a nested
2944         class should have the same NamespaceEntry as its enclosing class.
2945         (TypeContainer.EmitFieldInitializers): Make virtual.
2946         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
2947         MemberCore.
2948         (TypeContainer.Register): Remove.
2949         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
2950         null.  Use TypeResolveEmitContext for resolving base types and
2951         interfaces.  Move initialization of Parts.TypeBuilder here from
2952         ...
2953         (TypeContainer.DefineNestedTypes): ... here.
2954         (PartialContainer): Take a Namespace not a NamespaceEntry.
2955         (PartialContainer.Create): Don't use Register.  Call the
2956         appropriate Add... function directly.
2957         (ClassPart): Take both the PartialContainer and the enclosing
2958         class as constructor arguments.
2959         (ClassPart.EmitFieldInitializers): Override.
2960         (ClassPart.PartFindNestedTypes): Remove.
2961         (FieldBase.GetInitializerExpression): Resolve the initializer
2962         expression in the emit context of the enclosing class.
2963         * tree.cs (RootTypes): Remove Register ().
2964         
2965 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
2966
2967         * cs-parser.jay: Removed CS0134.
2968         
2969         * driver.cs: Removed CS1901.
2970         
2971         * expression.cs (SizeOf.DoResolve): Don't report CS0233
2972         for predefined types.
2973
2974 2005-03-07  Duncan Mak  <duncan@novell.com>
2975
2976         * codegen.cs (Save):  Catch UnauthorizedAccessException as
2977         well. Fixes bug #73454.
2978
2979 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
2980
2981         * cs-tokenizer.cs (xtoken): Add CS1035.
2982         
2983         * class.cs (MethodData.Define): Add CS0683.
2984         (FieldMember.ctor): Add CS0681.
2985
2986 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2987
2988         * ecore.cs (SimpleName.DoResolve): Rename from
2989         SimpleName.DoResolveAllowStatic.
2990         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
2991         Pass 'intermediate' flag to MemberStaticCheck.
2992         (SimpleName.MemberStaticCheck): Skip "static check" only in case
2993         of "intermediate" lookups via MemberAccess.
2994         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
2995         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
2996
2997 2005-03-07  Raja R Harinath  <rharinath@novell.com>
2998
2999         Fix #73394.
3000         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3001         slipped in because of variable names that are identical to a
3002         builtin type's BCL equivalent ('string String;', 'int Int32;').
3003         (PropertyExpr.EmitInstance): Likewise.
3004
3005 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
3006
3007         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3008         
3009         * report.cs (warning_ignore_table): Made public.
3010
3011 2005-03-04  Raja R Harinath  <rharinath@novell.com>
3012
3013         Fix #73282.
3014         * class.cs (MethodData.Emit): Pass 'container' to
3015         container.GetObsoleteAttribute instead of 'container.Parent'.
3016
3017 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
3018
3019         * cs-parser.jay: Add 1534 error test.
3020
3021         * iterators.cs (Yield.CheckContext): Add error 1629.
3022         (Iterator.ctor): Save unsafe modifier.
3023         (MoveNextMethod.DoEmit): Restore unsafe context.
3024
3025         * namespace.cs (UsingAlias): Better error message.
3026
3027 2005-03-03  Dan Winship  <danw@novell.com>
3028
3029         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3030         the warning message [#73219]
3031
3032 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3033
3034         Fix compile with MCS 1.0.0.0.
3035         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3036         w_restore to not depend on string constant folding.
3037
3038 2005-03-03  Raja R Harinath  <rharinath@novell.com>
3039
3040         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
3041         CS0246 check to users who passed 'silent = false'.
3042         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3043         check.
3044         (SimpleName.SimpleNameResolve): Update.
3045         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3046         (MemberAccess.IdenticalNameAndTypeName): Update.
3047         * doc.cs (FindDocumentedTypeNonArray): Update.
3048
3049 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
3050
3051         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3052         * parameters.cs (ComputeAndDefineParameters): Remove.
3053         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3054         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3055         Use GetParameterInfo.
3056
3057 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
3058
3059         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3060
3061 2005-03-02  Raja R Harinath  <rharinath@novell.com>
3062
3063         Unify DeclSpace.LookupType and DeclSpace.FindType.
3064         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
3065         is in charge of defining nested types on demand.
3066         (DeclSpace.LookupType): Use it when the current_type is a
3067         TypeBuilder.  Use LookupTypeDirect for reflected types.
3068         (DeclSpace.FindType): Remove.
3069         (DeclSpace.LookupInterfaceOrClass): Likewise.
3070         (DeclSpace.DefineTypeAndParents): Likewise.
3071         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3072         DeclSpace.LookupType.
3073         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3074         * typemanager.cs (LookupType): Simplify.
3075         (AddUserType): Remove type from negative_hits.
3076         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3077         * class.cs (TypeContainer.FindMembers): Move handling of nested
3078         types ...
3079         (TypeContainer.FindMembers_NestedTypes): ... here.
3080         (TypeContainer.FindNestedType): Implement override.
3081         (ClassPart.FindNestedType): Delegate to PartialContainer.
3082         (ClassPart.PartFindNestedType): Looks up the nested types of the
3083         part alone.
3084
3085 2005-03-02  Martin Baulig  <martin@ximian.com>
3086
3087         * class.cs (TypeContainer.DoDefineMembers): We also need a default
3088         static constructor in static classes.
3089
3090 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
3091
3092         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3093         sizeParamIndex is not specified.
3094
3095 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
3096
3097         Fix #73117
3098         * report.cs (WarningMessage.IsEnabled): Missing null check.
3099
3100 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3101
3102         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3103         in the fields and not in the properties.
3104
3105 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
3106
3107         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
3108         fields as well.
3109
3110 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3111
3112         * attribute.cs: Small refactoring (improved robustness).
3113         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3114         (ValidateGuid): Removed.
3115         (Resolve): Removed referenced to above mentioned.
3116         (GetAttributeUsage): Made private and changed to work without
3117         class assistance.
3118         (GetIndexerAttributeValue): Don't crash.
3119         (GetConditionalAttributeValue): Ditto.
3120         (GetClsCompliantAttributeValue): Ditto.
3121         (ExtractSecurityPermissionSet): All attributes exceptions are
3122         error 648.
3123         (GetPropertyValue): New helper.
3124         (GetMethodImplOptions): New method.
3125         (DefinePInvokeMethod): Reuse common code. Implemented handling of
3126         some missing properties.
3127         
3128         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3129         (Method.ApplyAttributeBuilder): Updated.
3130         
3131         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
3132         exception.
3133
3134 2005-02-28  Raja R Harinath  <rharinath@novell.com>
3135
3136         Fix #73052.
3137         * report.cs (Report.SymbolRelatedToPreviousError): Handle
3138         non-simple types (array, pointer, reference).
3139
3140 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
3141
3142         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
3143
3144         * class.cs (MethodCore.IsDuplicateImplementation): Special error
3145         for operators.
3146         (Method.CheckBase): Catch wrong destructor here.
3147         (MethodData.Define): Add errors 550, 668.
3148
3149         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
3150
3151         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
3152
3153         * pending.cs (VerifyPendingMethods): Add error 551.
3154
3155         * typemanager.cs (CSharpName): Next error report helper.
3156
3157 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
3158
3159         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
3160         attributes. Removed useless attribute double check.
3161         It saves almost 2MBs for corlib.
3162
3163 2005-02-25  Raja R Harinath  <rharinath@novell.com>
3164
3165         Fix #72924.
3166         * statement.cs (ExpressionStatement.Resolve): Make robust to being
3167         called twice in case of error.
3168
3169 2005-02-23  Chris Toshok  <toshok@ximian.com>
3170
3171         Fix compiler portions of #72827.
3172         * statement.cs (Block.Emit): call Begin/EndScope on the
3173         EmitContext instead of the ILGenerator.
3174
3175         * codegen.cs (EmitContext.BeginScope): new method, call
3176         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
3177         we have one.)
3178         (EmitContext.BeginScope): same, but EndScope and CloseScope
3179
3180         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
3181         offset and call the superclass's OpenScope(int) with it.
3182         (SymbolWriter.CloseScope): get the current il
3183         offset and call superclass's CloseScope(int) with it.
3184
3185 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
3186
3187         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
3188         CS1677 for out and ref as well.
3189
3190         * class.cs (Method.Define): Add error CS1599 detection.
3191         
3192         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
3193         
3194         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
3195         
3196         * delegate.cs (Delegate.Define): Add error CS1599 detection.
3197         
3198         * support.cs.cs (ModifierDesc): New helper method.
3199
3200 2005-02-23  Raja R Harinath  <rharinath@novell.com>
3201             Abin Thomas  <projectmonokochi@rediffmail.com>
3202             Anoob V E  <projectmonokochi@rediffmail.com>
3203             Harilal P R  <projectmonokochi@rediffmail.com>
3204
3205         Fix #57851, #72718.
3206         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
3207         MemberLookup (used for error reporting) actually returns a result.
3208         Fix error report number (122, not 112).
3209
3210 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
3211             Anoob V E  <projectmonokochi@rediffmail.com>
3212             Harilal P R  <projectmonokochi@rediffmail.com>
3213
3214         Fix #71134.
3215         * pending.cs (PendingImplementation.GetAbstractMethods):
3216         Find NonPublic members too.
3217
3218 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
3219
3220         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
3221         Fixed error 217.
3222         
3223         * class.cs (MethodCore.CheckMethodAgainstBase):
3224         Add error 239 report.
3225
3226 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3227
3228         Fix #68955.
3229         * expression.cs (Invocation.IsApplicable): Make public.
3230         (Invocation.IsParamsMethodApplicable): Likewise.
3231         * delegate.cs (Delegate.VerifyApplicability): Don't use
3232         Invocation.VerifyArgumentCompat for parameter applicability
3233         testing.  Use Invocation.IsApplicable and
3234         Invocation.IsParamsMethodApplicable.
3235
3236 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3237
3238         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
3239         
3240         * class.cs (Operator.Define): Add error 217 report.
3241         
3242 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3243
3244         * namespace.cs (UsingEntry.Resolve): Undo change below.
3245
3246 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3247
3248         Fix #72756.
3249         * ecore.cs (Expression.MemberLookupFailed): Add argument to
3250         disable the error message when the extended MemberLookup also
3251         fails.
3252         (Expression.MemberLookupFinal): Update.
3253         (SimpleName.DoSimpleNameResolve): Update.
3254         * expression.cs (MemberAccess.ResolveNamespaceOrType):
3255         Don't use MemberLookupFinal.
3256         (New.DoResolve): Update.
3257         (BaseAccess.CommonResolve): Update.
3258
3259 2005-02-21  Raja R Harinath  <rharinath@novell.com>
3260
3261         Fix #72732.
3262         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
3263         occured previously, don't resolve again.
3264
3265 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
3266
3267         Fix #69949
3268         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
3269         argument. Call ResolveAttributeUsage for unresolved.
3270         when types doesn't match ctor arguments.
3271         
3272         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
3273         for nested attribute classes.
3274         (Class.attribute_usage): Removed.
3275         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
3276         for attribute class.
3277         
3278         * ecore.cs (IsAttribute): Removed.
3279         
3280         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
3281         
3282         * rootcontext.cs (RegisterAttribute): Removed, attributes are
3283         now normal types.
3284         (attribute_types): Removed.
3285         (EmitCode): Global attributes are emited as the latest.
3286
3287 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
3288
3289         * class.cs (EmitFieldInitializers): Don't emit field initializer
3290         for default values when optimilization is on.
3291         
3292         * constant.cs (Constant.IsDefaultValue): New property.
3293         
3294         * driver.cs: Add /optimize handling.
3295         
3296         * constant.cs,
3297         * ecore.cs,
3298         * literal.cs: Implement new IsDefaultValue property.
3299         
3300         * rootcontext.cs (Optimize): New field, holds /optimize option.
3301
3302 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3303
3304         Fix crasher in re-opened #72347.
3305         * namespace.cs (Namespace.Lookup): Return null if
3306         DeclSpace.DefineType returns null.
3307
3308         Fix #72678.
3309         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
3310
3311 2005-02-18  Raja R Harinath  <rharinath@novell.com>
3312
3313         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
3314         now returns null if it cannot resolve to an lvalue.
3315         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
3316         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
3317         returned null.  Remove check for SimpleName.
3318         (EventExpr.DoResolveLValue): New.
3319         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
3320         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
3321         error from ...
3322         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
3323         avoid CS0131 error.
3324         (Unary.ResolveOperator): Move CS0211 check ...
3325         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
3326         CS0131 error.
3327         (Unary.DoResolveLValue): Simplify.
3328         (AddressOf.DoResolveLValue): New.
3329         (ArrayAccess.DoResolveLValue): New.
3330
3331 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
3332
3333         * attribute.cs (Attribute.Resolve): Add arguments casting for
3334         when types doesn't match ctor arguments.
3335
3336 2005-02-16  Raja R Harinath  <rharinath@novell.com>
3337
3338         Fix parts of #63202.
3339         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
3340         lookup of operator in base type.  Ensure that all checks happen
3341         when the operator resolves to an "op_..." method.
3342
3343 2005-02-15  Raja R Harinath  <rharinath@novell.com>
3344
3345         Fix #71992.
3346         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
3347         'ignore_cs0104' parameter.  Pass it to ...
3348         (NamespaceEntry.Lookup): ... this.
3349         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
3350         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
3351         (TypeLookupExpression.DoResolveAsTypeStep): Update.
3352         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
3353         Update.  Request that cs0104 errors be ignored.
3354         (ComposedCast.ResolveAsTypeStep): Update.
3355
3356 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3357
3358         Fix #59209.
3359         * expression.cs (Invocation.BetterFunction): Remove support for
3360         comparing virtual functions and their overrides.
3361         (Invocation.IsOverride): New.
3362         (Invocation.OverloadResolve): Don't consider 'override' functions
3363         during candidate selection.  Store them in a lookaside list.
3364         If the selected method is a 'virtual' function, use the list to
3365         find any overrides that are closer to the LHS type.
3366
3367 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
3368
3369         * expression.cs (New.DoResolve): Add complex core type reduction.
3370         (New.Constantify): Converts complex core type syntax like 'new int ()'
3371         to simple constant.
3372         
3373 2005-02-14  Raja R Harinath  <rharinath@novell.com>
3374
3375         * decl.cs (EntryType.EntryType): New constructor to create an
3376         updated copy of a cache entry.
3377         (MemberCache.AddMethods): Use it.
3378         (MemberCache.ClearDeclaredOnly): Remove.
3379         (MemberCache.MemberCache): Update.
3380
3381 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3382
3383         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
3384         variable.  This one is represents the actual low-level declaration
3385         of the method, as opposed to the semantic level `IsStatic'.   
3386
3387         An anonymous method which is hosted into a static method might be
3388         actually an instance method.  IsStatic would reflect the
3389         container, while MethodIsStatic represents the actual code
3390         generated.
3391
3392         * expression.cs (ParameterReference): Use the new MethodIsStatic
3393         instead of IsStatic.
3394
3395         * anonymous.cs (AnonymousMethod.Compatible): Pass the
3396         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
3397         set on the current EmitContext. 
3398
3399         * expression.cs (Cast): Overload DoResolveLValue so we can pass
3400         resolve our casted expression as an LValue.  This triggers the
3401         proper LValue processing that is later required by Assign.
3402
3403         This fixes 72347.
3404
3405         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
3406
3407 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
3408
3409         C# 2.0 Fixed buffer implementation
3410
3411         * anonymous.cs: Update after RegisterHelperClass renaming.
3412
3413         * attribute.cs (AttributeTester.fixed_buffer_cache):
3414         Cache of external fixed buffers.
3415         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
3416         implementation if field is fixed buffer else null.
3417
3418         * class.cs
3419         (TypeContainer.AddField): Accept FieldMember instead of Field.
3420         (FieldBase.IsFieldClsCompliant): Extracted code from
3421         VerifyClsCompliance descendant customization.
3422         (FixedField): New class handles fixed buffer fields.
3423         (FixedFieldExternal): Keeps information about imported fixed
3424         buffer.
3425         (IFixedField): Make access to internal or external fixed buffer
3426         same.
3427
3428         * cs-parser.jay: Add fixed buffer parsing.
3429
3430         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
3431         buffer.
3432
3433         * expression.cs (Indirection): Extended implementation to accept
3434         fixed buffer field.
3435         (PointerArithmetic.Emit): Get element from fixed buffer as well.
3436         (ElementAccess.MakePointerAccess): Get type as parameter.
3437         (DoResolve): Add fixed buffer field expression conversion.
3438         (DoResolveLValue): Ditto.
3439         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
3440         (ArrayPtr): Derives from FixedBufferPtr.
3441         (ArrayPtr.Emit): Add extra emit for array elements.
3442
3443         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
3444
3445         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
3446         for compiler generated types.
3447         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
3448
3449         * statement.cs (Fixed): Refactored to be easier add fixed buffer
3450         and consume less memory.
3451         (Fixed.Resolve): Add fixed buffer case.
3452
3453         * typemanager.cs (compiler_generated_attr_ctor,
3454         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
3455         (HasElementType): Add our own implementation to work on every
3456         runtime.
3457
3458 2005-02-11  Miguel de Icaza  <miguel@novell.com>
3459
3460         * anonymous.cs (CaptureContext): Track whether `this' has been
3461         referenced.   
3462
3463         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
3464         only captured `this' if it was implicitly done (instance
3465         methods/variables were used). 
3466
3467         * codegen.cs (EmitContext.CaptureThis): New method to flag that
3468         `this' must be captured.
3469
3470 2005-01-30  Miguel de Icaza  <miguel@novell.com>
3471  
3472         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
3473         is null it means that there has been no need to capture anything,
3474         so we just create a sibling.
3475
3476         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
3477
3478         Just a partial fix.  The other half is fairly elusive.
3479         
3480 2005-02-10  Raja R Harinath  <rharinath@novell.com>
3481
3482         Fix #52586, cs0121-4.cs.
3483         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
3484         and return a hashtable.
3485         (MemberCache.ClearDeclaredOnly): New.
3486         (MemberCache.MemberCache): Update to change.  Make a deep copy of
3487         the method_hash of a base type too.
3488         (MemberCache.AddMethods): Adapt to having a deep copy of the base
3489         type methods.  Overwrite entries with the same MethodHandle so
3490         that the ReflectedType is correct.  The process leaves in base
3491         virtual functions and their overrides as distinct entries.
3492         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
3493         matters since it was boxed in a ArrayList before.
3494         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
3495         modifier.
3496         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
3497         case of a virtual function and its override (choose the overload
3498         as better).
3499         (Invocation.OverloadResolve): Avoid 'override' members during
3500         'applicable_type' calculation.
3501
3502 2005-02-09  Raja R Harinath  <rharinath@novell.com>
3503
3504         Combine two near-redundant caches.
3505         * typemanager.cs (method_params): Rename from method_internal_params.
3506         (TypeManager.GetParameterData): New.  Replace
3507         Invocation.GetParameterData.
3508         (TypeManager.LookupParametersByBuilder): Remove.
3509         * expression.cs (Invocation.method_parameter_cache): Remove.
3510         (Invocation.GetParameterData): Remove.
3511         Update to changes.
3512         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
3513         Update to changes.
3514
3515 2005-02-08  Raja R Harinath  <rharinath@novell.com>
3516
3517         Fix #72015.
3518         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
3519         TypeManager.multicast_delegate_type is null, resolve it by looking
3520         up "System.MulticastDelegate".
3521         * rootcontext.cs (RootContext.ResolveCore): Simplify.
3522
3523 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
3524             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
3525             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
3526
3527         Fix cs0164.cs.
3528         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
3529         (LabeledStatement.AddReference): New.  Set 'referenced'.
3530         (Goto.Resolve): Use it.
3531
3532 2005-02-05  John Luke  <john.luke@gmail.com>
3533
3534         * driver.cs: remove duplicate -doc line in Usage ()
3535
3536 2005-02-04  Raja R Harinath  <rharinath@novell.com>
3537
3538         * location.cs (Location.AddFile): Fix CS2002 error report.
3539
3540 2005-02-02  Martin Baulig  <martin@ximian.com>
3541
3542         * delegate.cs (Delegate.DefineType): Report an internal error if
3543         TypeManager.multicast_delegate_type is null.  See bug #72015 for
3544         details.        
3545
3546 2005-02-02  Raja R Harinath  <rharinath@novell.com>
3547
3548         Fix a crasher in a variant of #31984.
3549         * const.cs (Constant.CheckBase): New override that defers the
3550         new-or-override check in case the base type hasn't been populated
3551         yet.
3552         (Constant.Define): Ensure the new-or-override check is performed.
3553
3554 2005-02-01  Duncan Mak  <duncan@ximian.com>
3555
3556         * const.cs (LookupConstantValue): Check that `ce' is not null
3557         before calling GetValue ().
3558
3559 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3560
3561         Fix test-334.cs (#69519).
3562         * cs-parser.jay (using_alias_directive): Pass in an expression to
3563         NamespaceEntry.UsingAlias.
3564         (using_namespace_directive): Pass in an expression to
3565         NamespaceEntry.Using.
3566         (namespace_name): Don't flatten to a string.
3567         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
3568         (NamespaceEntry.AliasEntry.Resolve): Lookup using
3569         ResolveAsTypeStep.
3570         (NamespaceEntry.UsingEntry): Likewise.
3571         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
3572         changes.
3573         (NamespaceEntry.LookupForUsing): Remove.
3574         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
3575         names.
3576         (NamespaceEntry.Lookup): Remove support for dotted names.
3577
3578 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3579
3580         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
3581         split into two.
3582         (NamespaceEntry.ImplicitParent): Compute on demand.
3583         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
3584         parallels the current.
3585         (NamespaceEntry.LookupForUsing): Use it.
3586         (NamespaceEntry.Lookup): If the current namespace-entry is
3587         implicit, don't search aliases and using tables.
3588
3589 2005-02-01  Raja R Harinath  <rharinath@novell.com>
3590
3591         Fix #31984.
3592         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
3593         BaseCache here.
3594         (TypeContainer.BaseCache): Compute on demand.
3595         (TypeContainer.FindMembers): Define constants and types if they're
3596         not already created.
3597         (FieldMember.Define): Move resetting of ec.InUnsafe before error
3598         check.
3599         * const.cs (Constant.Define): Make idempotent.
3600
3601 2005-01-29  Miguel de Icaza  <miguel@novell.com>
3602
3603         * pending.cs: Produce better code (no nops produced by using Ldarg
3604         + value).
3605         
3606         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
3607         i - 1' it should be arg + 1.
3608
3609         Fixes bug #71819.
3610
3611 2005-01-28  Raja R Harinath  <rharinath@novell.com>
3612
3613         * attribute.cs (Attribute.CheckAttributeType): Make private
3614         non-virtual.
3615         (Attribute.ResolveType): Make virtual.
3616         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
3617         handling of RootContext.Tree.Types.
3618
3619 2005-01-27  Raja R Harinath  <rharinath@novell.com>
3620
3621         Update attribute-handling to use the SimpleName/MemberAccess
3622         mechanisms.
3623         * cs-parser.jay (attribute): Pass in an expression to the
3624         constructors of Attribute and GlobalAttribute.
3625         * attribute.cs (Attribute): Take an expression for the name.
3626         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
3627         passed in attribute name expression.
3628         (Attribute.CheckAttributeType): Use it.
3629         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
3630         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
3631         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
3632         argument to prevent error messages if the lookup fails.
3633
3634 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
3635
3636         * expression.cs (Indirection): Implemented IVariable interface
3637         to support indirection in AddressOf operator.
3638         (PointerArithmetic.Emit): Add optimalization for case where
3639         result can be precomputed.
3640
3641 2005-01-26  Martin Baulig  <martin@ximian.com>
3642
3643         * class.cs (TypeContainer.AttributeTargets): Return the correct
3644         AttributeTargets depending on our `Kind' instead of throwing an
3645         exception; fixes #71632.
3646
3647 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
3648
3649         Fix #71257
3650         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
3651         constant members.
3652
3653 2005-01-25  Raja R Harinath  <rharinath@novell.com>
3654
3655         Fix #71602.
3656         * expression.cs (MemberAccess.DoResolve): Don't complain with
3657         cs0572 when the LHS of a member access has identical name and type
3658         name.
3659
3660 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
3661
3662         Fix #71651, #71675
3663         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
3664         CreatePermission.
3665         Create custom PermissionSet only for PermissionSetAttribute.
3666
3667 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
3668
3669         Fix #71649
3670         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
3671         delegates in static class.
3672
3673 2005-01-24  Martin Baulig  <martin@ximian.com>
3674
3675         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3676         merging an implicit block, just use its reachability.
3677
3678         * statement.cs (Block.Resolve): Make the unreachable code check
3679         work wrt. implicit blocks; see test-337 from #63842.
3680
3681 2005-01-21  Alp Toker  <alp@atoker.com>
3682  
3683         * cs-parser.jay: destructor_declaration's container is PartialContainer
3684         not Class when partial types are used, so use Kind prop instead of
3685         'is'.
3686         
3687 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
3688
3689         * cs-parser.jay: Improve error reporting when an interface
3690         declares new types.
3691
3692 2005-01-20  Dick Porter  <dick@ximian.com>
3693
3694         * support.cs: SeekableStreamReader fix from Sandor Dobos
3695         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
3696         chars are read.  Fixes bug 70369.
3697
3698 2005-01-20  Raja R Harinath  <rharinath@novell.com>
3699
3700         * cs-parser.jay (catch_clause): Simplify current_block handling
3701         somewhat.
3702
3703 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
3704
3705         * convert.cs (ImplicitStandardConversionExists): Synchronize the
3706         code with ImplicitStandardConversion to handle the implicit
3707         conversion of method groups into valid delegate invocations. 
3708
3709         The problem is that in parameter handling we were using this code
3710         path.  Fixes bug #64698
3711
3712 2005-01-19  Raja R Harinath  <rharinath@novell.com>
3713
3714         * cs-parser.jay: Fix several infelicities.
3715         - Avoid assigning to the parser value stack.  Code like 
3716           '$3 = null' is unclean.  Synthesize a value for the code block
3717           instead. 
3718         - Avoid using oob_stack for storing location information.  Use ...
3719         (_mark_): ... this.  New (empty) rule.  Saves the current location
3720         in $$.
3721         (foreach_statement): Avoid using oob_stack for current_block
3722         handling.  Use technique used in for_statement and
3723         using_statement.  Synthesize a value for the code block to store
3724         additional intermediate information.
3725
3726 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
3727
3728         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
3729         of a different type is only allowed to private fields of a
3730         containing type, not on fields of a base class.
3731
3732         See test-174.cs and error cs0122-9.cs
3733
3734 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3735
3736         Fix test-335.cs (bug #58126).
3737         * cs-parser.jay (argument): Split out non-expression parts of the
3738         rule into 'non_simple_argument'.
3739         (invocation_expression): Support parenthesized invocations with
3740         multiple arguments, and with single non-simple arguments.
3741
3742 2005-01-13  Raja R Harinath  <rharinath@novell.com>
3743
3744         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
3745         places.
3746
3747 2005-01-12  Raja R Harinath  <rharinath@novell.com>
3748
3749         Fix cs0038-1.cs, cs1640-6.cs.
3750         * ecore.cs (Expression.Resolve): Remove special-case for
3751         SimpleName in error-handling.
3752         (Expression.almostMatchedMembers): Relax access permission to
3753         protected.
3754         (Expression.MemberLookupFailed): Handle duplicates in
3755         almostMatchedMembers list.
3756         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3757         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3758         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3759         overload if the passed in MemberInfo is a MethodBase.
3760
3761 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3762
3763         Fix #70749
3764         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3765         for non-CAS & merge permission sets properly.
3766
3767 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3768
3769         Improve standard-compliance of simple name and member access 
3770         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3771         * ecore.cs (FullNamedExpression): New abstract base class 
3772         for Namespaces and TypeExpressions.
3773         (ResolveFlags.SimpleName): Remove.
3774         (SimpleName): Remove support for dotted names.
3775         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3776         DeclSpace.FindType and DeclSpace.LookupType.
3777         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3778         (Expression.ExprClassName): Make member function.
3779         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3780         a namespace.  Remove creation of dotted "SimpleName"s.
3781         (MemberAccess.DoResolve): Likewise.
3782         * decl.cs (DeclSpace.Cache): Make private.
3783         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3784         (DeclSpace.FindType): Update.
3785         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3786         FullNamedExpression.
3787         * namespace.cs (Namespace): Derive from FullNamedExpression
3788         so that it can be part of expression resolution.
3789         (Namespace.Lookup): Return an FullNamedExpression.
3790         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3791         namespace.
3792         * rootcontext.cs (NamespaceLookup): Remove.
3793         (LookupType): Move to DeclSpace.
3794         * attribute.cs (CheckAttributeType): Update.
3795         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3796         (FindDocumentedTypeNonArray): Likewise.
3797
3798 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3799
3800         Fix cs0509.cs, cs1632.cs.
3801         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3802         is the same as IsInterface.
3803         (TypeContainer.GetClassBases): Likewise.
3804         * statement.cs (LabeledStatement.ig): New field.
3805         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3806         label.
3807         (LabeledStatement.DoEmit): Check that the label was created with
3808         the same ILGenerator.
3809
3810 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3811
3812         Fix #71058
3813         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3814         accessors to its properties.
3815
3816         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3817         from accessors to property.
3818         
3819 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3820
3821         Fix #70722
3822         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3823         only for overrides.
3824         
3825 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3826
3827         * attribute.cs: Check for null and empty strings.  
3828
3829         I have lost another battle to Paolo.
3830
3831 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3832
3833         Fix #70942
3834         * class.cs (PropertyMethod): Set Parent field in ctors.
3835         (SetMethod.InternalParameters): Add unsafe switch hack.
3836         Override MarkForDuplicationCheck where it is appropriate.
3837
3838         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3839         It says whether container allows members with the same name.
3840         Base default is no.
3841         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3842         Removed is_method parameter.
3843
3844 2005-01-06  Duncan Mak  <duncan@ximian.com>
3845
3846         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3847         because the previous change led to incorrect reporting of CS1032
3848         ("Cannot define/undefine preprocessor symbols after first token in
3849         file"). Instead of using `tokens_seen' as the only flag that
3850         triggers CS1040, introduce `comments_seen'. This new flag is used
3851         to signify having seen comments on the current line, so it is
3852         unset after a newline.
3853
3854 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3855
3856         * doc.cs : When searching for a type, find nested type too.
3857           This fixes bug #71040.
3858
3859 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3860
3861         * doc.cs :
3862           - Warn missing member comment on those classes which also does not
3863             have doc comments. Fixed bug #71041.
3864           - Don't warn missing doc comment on default constructor.
3865             Fixed bug #71042.
3866
3867 2005-01-06  Duncan Mak  <duncan@ximian.com>
3868
3869         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3870         comments, set `tokens_seen' to true. This allows us to detect
3871         misplaced preprocessor directives (i.e. not at the beginning of
3872         the a line, nor after whitespaces). In that case, report error
3873         CS1040. This fixes bug #56460.
3874
3875         * cs-parser.jay (interface_member_declaration): Add checks for
3876         IsExplicitImpl, and report CS0541 error if an interface member is
3877         defined as an explicit interface declaration.
3878
3879 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3880
3881         Fix #70817
3882         * class.cs (PropertyMethod): Set Parent field in ctors.
3883         (SetMethod.InternalParameters): Add unsafe switch hack.
3884         
3885         * decl.cs (MemberCore.Parent): Cannot be readonly.
3886
3887 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3888
3889         * decl.cs (DeclSpace.ResolveType): Remove.
3890         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3891         Merge in code from ...
3892         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3893         * class.cs, enum.cs: Update to changes.
3894
3895 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3896
3897         * anonymous.cs: Ensure that we init the scope of our parent if it
3898         has not been initialized yet.
3899
3900 2004-12-30  Duncan Mak  <duncan@ximian.com>
3901
3902         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3903         if field.FieldBuilder is null. Fixes #70758.
3904
3905         * convert.cs: Fixed some typos and updated some of the comments.
3906         (ImplicitStandardConversionExists):
3907         (TryImplicitIntConversion): If `target_type' is an interface and
3908         the type of `ic' implements this interface, return true or a new
3909         BoxedCast instead of null. This fixes #70468.
3910
3911 2004-12-29  Duncan Mak  <duncan@ximian.com>
3912
3913         * expression.cs (Argument.Emit): Check that Expr is
3914         IMemoryLocation before casting to it, and report CS1510 otherwise.
3915
3916         This fixes #70402.
3917
3918 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3919
3920         * statement.cs (Block.ThisVariable): remove the recursion here, to
3921         make the --profile more sane.
3922
3923 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3924
3925         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3926         assembly, by JB Evain.
3927
3928 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3929
3930         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3931           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3932         "parent" refers to enclosing type/class.  "base" refers to superclass.
3933
3934 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3935
3936         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3937         Ensure that we only have GlobalAttributes.
3938         * attribute.cs (Attribute.Emit): Make non-virtual.
3939         (GlobalAttribute.Emit): Remove.
3940         (Attribute.Resolve): Make virtual.
3941         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3942         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3943         the argument. Don't create one.
3944         (Attribute.GetObsoleteAttribute): Likewise.
3945         (Attribute.GetClsCompliantAttributeValue): Likewise.
3946         * class.cs, decl.cs: Update to changes.
3947
3948 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3949
3950         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3951         
3952         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3953         
3954         * statement.cs (Foreach.Resolve): Add error 186 report.
3955
3956 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3957
3958         * expression.cs (Conditional.DoResolve): Add warning 429.
3959         
3960         * statement.cs (If.Resolve): Add warning 665.
3961
3962 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3963
3964         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3965         except when in the parser, and in GlobalAttribute.
3966         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3967         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3968         RootContext.Tree.Types.NamespaceEntry once work is done.
3969         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3970         and resets RootContext.Tree.Types.NamespaceEntry.
3971
3972 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3973
3974         * cs-parser.jay: Don't create a block for every variable.
3975
3976 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3977
3978         * location.cs: Provide extra information.
3979
3980         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3981         variables from the captured environment, it is the ldarg_0.
3982
3983 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3984
3985         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3986         find a conclusion.
3987         
3988         * class.cs: Changed warning level for 169 to avoid developer
3989         displeasure from warning flooding. It will be changed back when they
3990         fix most of current BCL warnings.
3991         
3992         * RootContext.cs: Pushed default WarningLevel to 3.
3993         
3994         * statement.cs: Removed unused variable.
3995
3996 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3997
3998         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3999         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
4000         Add error 502 report.
4001         (StaticClass.DefineType): Add error 441 report.
4002         (Class.AllowedModifiersProp): New virtual property as temporary
4003         extension to AllowedModifiers.
4004         (Class.DefineType): Add error 418 report. Moved ModFlags check here
4005         to share implementation with StaticClass and don't call virtual
4006         methods from ctor.
4007         
4008         * driver.cs (MainDriver): Add error 1558 test.
4009
4010         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
4011         report. Moved error 36 test here.
4012
4013         * statement.cs (Throw.Resolve): Add error 724 report.
4014
4015         * typemanager.cs: Add out_attribute_type core type.
4016         
4017 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
4018
4019         * class.cs (TypeContainer.VerifyClsCompliance): Add error
4020         3018 report.
4021         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
4022
4023         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
4024         3017 report.
4025         
4026         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
4027
4028         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
4029         Add error 3023 report.
4030         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
4031
4032         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
4033         implementation.
4034
4035 2004-12-12  John Luke  <john.luke@gmail.com>
4036
4037         * driver.cs (AddArgs): take -- into account when
4038         adding arguments, fixes bug 65710 
4039
4040 2004-12-12  Martin Baulig  <martin@ximian.com>
4041
4042         * expression.cs (Unary.TryReduceNegative): Added support for
4043         SByteConstant and ByteConstant.
4044         (Unary.Reduce): Check error values from TryReduceNegative().
4045
4046 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
4047
4048         * attributes.cs (Attribute.Resolve): Avoid multiple error report
4049         and report exception as error 182.
4050
4051 2004-12-10  Raja R Harinath  <rharinath@novell.com>
4052
4053         * driver.cs (Main): Fix message when there are warnings.
4054
4055 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
4056
4057         * delegate.cs: Fixed my fix from yesterday, sorry about that.
4058
4059 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
4060
4061         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
4062         Reduced number of warnings.
4063         
4064         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
4065
4066 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
4067
4068         * driver.cs: Removed message.
4069
4070         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
4071
4072 2004-12-08    <vargaz@freemail.hu>
4073
4074         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
4075
4076 2004-12-08  Martin Baulig  <martin@ximian.com>
4077
4078         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
4079         instead of a CS3002 for properties and indexer.
4080
4081 2004-12-08  Martin Baulig  <martin@ximian.com>
4082
4083         * decl.cs (MemberName.ToString): Make this work again.
4084
4085 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
4086
4087         * attribute.cs (Resolve): Add error 591 detection.
4088
4089         * class.cs (FieldMember.Define): Add error 1547 detection.
4090         (Indexer.Define): Add error 620 detection.
4091         (Operator.Define): Add error 590 detection.
4092
4093         * ecore.cs: Missing argument for error 79.
4094
4095         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
4096         detection.
4097
4098 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
4099
4100         Fix #70106
4101         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
4102         only.
4103
4104 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
4105
4106         * cs-parser.jay : handle doc comments on implicit/explicit operators.
4107           Some operator comments were suppressed.
4108         * doc.cs : Implicit/explicit operator name in doc comments are like
4109           "op_Explicit(type)~returnType", so added suffix handling.
4110
4111 2004-12-07  Martin Baulig  <martin@ximian.com>
4112
4113         * decl.cs
4114         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4115         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4116         (DeclSpace.ec): New protected field; store the EmitContext here.
4117         (DeclSpace.EmitContext): New public property; moved here from
4118         `TypeContainer'.
4119         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4120         EmitContext.
4121
4122         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4123         (Enum.Emit): Don't create a new EmitContext.
4124
4125         * delegate.cs (Delegate.DefineType): Always create the
4126         EmitContext.
4127
4128         * iterators.cs (Iterators.DefineIterator): Create a new
4129         EmitContext and store it in `ec'.
4130
4131 2004-08-24  Martin Baulig  <martin@ximian.com>
4132
4133         * typemanager.cs
4134         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4135         this for accessibility checks.
4136         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4137         IsNestedFamilyAccessible.
4138         (TypeManager.IsSubclassOf): New method, do what the name actually
4139         says.   
4140
4141 2004-12-06  Raja R Harinath  <rharinath@novell.com>
4142
4143         Fix crash on cs0657-17.cs.
4144         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4145         Use RootContext.Tree.Types, not 'new RootTypes ()'.
4146         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
4147         the case where the NamespaceEntry gets overwritten.
4148
4149 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
4150
4151         Fixed #69195, #56821
4152         * ecore.cs (ResolveBoolean): Tiny refactoring.
4153
4154         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
4155         of right expression resolving when left is false constant and
4156         operator is LogicalAnd OR true constant and operator is LogicalOr.
4157
4158         * statement.cs (ResolveUnreachable): Always reports warning.
4159
4160 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
4161
4162         * class.cs: Distinguish between 1721 and 1722 (just a little help
4163         for the programmer).
4164
4165 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
4166
4167         * delegate.cs: Only allow this on new versions of the language. 
4168
4169 2004-12-02  Duncan Mak  <duncan@ximian.com>
4170
4171         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
4172         Expression class.
4173         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
4174         here as a static method. Take an additional bool out parameter
4175         `must_do_cs1540_check' for signaling to InstanceResolve.
4176         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
4177         member field from PropertyExpr class and made it an argument of
4178         the method instead.
4179         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
4180         check for MarshalByRefObject, and report CS0122 instead of CS1540.
4181         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
4182         and `remove_accessor' as well as InstanceResolve: report CS0122
4183         where applicable.
4184
4185         Fixes #70129.
4186
4187 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4188
4189         Fix test-327.cs, test-328.cs, and put in early infrastructure
4190         for eventually fixing #52697.
4191         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
4192         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
4193         from other methods.
4194         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
4195         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
4196         (VerifyUsing, error246): Update.
4197         * rootcontext.cs (RootContext.NamespaceLookup): Just use
4198         'NamespaceEntry.LookupNamespaceOrType'.
4199
4200 2004-12-03  Martin Baulig  <martin@ximian.com>
4201
4202         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4203         method as our child, call AnonymousMethod.Compatible() on it.
4204
4205 2004-12-03  Raja R Harinath  <rharinath@novell.com>
4206
4207         Disable XML documentation support in 'basic' profile.
4208         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
4209         Redirect XmlElement to System.Object.
4210         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
4211         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
4212         * mcs.exe.sources: Add doc-bootstrap.cs.
4213         * doc-bootstrap.cs: New file.  Contains empty stub implementation
4214         of doc.cs.
4215
4216 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
4217
4218         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
4219           comments are allowed.
4220
4221 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4222
4223         * delegate.cs: Add checks for subtypes in paramaters and return values
4224         in VerifyMethod () to add support for Covariance/Contravariance
4225         in delegates.
4226         
4227 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
4228
4229         * report.cs: Remove extra closing parenthesis.
4230
4231         * convert.cs (Error_CannotImplicitConversion): If the name of the
4232         types are the same, provide some extra information.
4233
4234         * class.cs (FieldBase): Use an unused bit field from the field to
4235         encode the `has_offset' property from the FieldMember.  This saves
4236         a couple of Ks on bootstrap compilation.
4237
4238         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
4239         method as our child, return the AnonymousMethod resolved
4240         expression.
4241
4242         * expression.cs (New.DoResolve): Allow return values from
4243         NewDelegate to also include AnonymousMethods.
4244
4245         Fixes #70150.
4246
4247 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
4248
4249         Fix bug #70102
4250         * attribute.cs (Resolve): Improved implementation of params
4251         attribute arguments.
4252
4253         * support.cs (ParameterData): Add HasParams to be faster.
4254
4255 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
4256
4257         all things are for /doc support:
4258
4259         * doc.cs: new file that supports XML documentation generation.
4260         * mcs.exe.sources: added doc.cs.
4261         * driver.cs:
4262           Handle /doc command line option.
4263           Report error 2006 instead of 5 for missing file name for /doc.
4264           Generate XML documentation when required, after type resolution.
4265         * cs-tokenizer.cs:
4266           Added support for picking up documentation (/// and /** ... */),
4267           including a new XmlCommentState enumeration.
4268         * cs-parser.jay:
4269           Added lines to fill Documentation element for field, constant,
4270           property, indexer, method, constructor, destructor, operator, event
4271           and class, struct, interface, delegate, enum.
4272           Added lines to warn incorrect comment.
4273         * rootcontext.cs :
4274           Added Documentation field (passed only when /doc was specified).
4275         * decl.cs:
4276           Added DocComment, DocCommentHeader, GenerateDocComment() and
4277           OnGenerateDocComment() and some supporting private members for
4278           /doc feature to MemberCore.
4279         * class.cs:
4280           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
4281         * delegate.cs:
4282           Added overriden DocCommentHeader.
4283         * enum.cs:
4284           Added overriden DocCommentHeader and GenerateDocComment().
4285
4286 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
4287
4288         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
4289         unwrapping the enumeration values, chain to
4290         DoConstantNumericPromotions again, so we can promote things to the
4291         fundamental types (takes care of enums that are bytes, sbytes).
4292
4293         Fixes bug #62054.
4294
4295 2004-12-01  Raja R Harinath  <rharinath@novell.com>
4296
4297         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
4298         Fix long-standing bug in type-lookup.  Use FindType instead of
4299         LookupType when ec.ResolvingTypeTree.
4300         (Attribute.ResolveType, Attribute.Resolve)
4301         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
4302         Update to changes.
4303         (Attributes.Search): Remove internal version.  Update.
4304         (Attributes.SearchMulti): Update.
4305         (Attributes.GetClsCompliantAttribute): Remove.
4306         (Attributes.GetIndexerNameAttribute): Remove.
4307         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
4308         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
4309         * class.cs (Indexer.Define): Likewise.
4310
4311 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
4312
4313         Fix bug #68790
4314         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
4315         MarshallByReference members access.
4316
4317         * expression.cs: Use CheckMarshallByRefAccess;
4318         Better error CS0197 message.
4319
4320         * report.cs: Print whole related error message.
4321
4322 2004-11-30  Raja R Harinath  <rharinath@novell.com>
4323
4324         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
4325         the current directory to help debugging.
4326
4327 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4328
4329         * class (GetClassBases): Better error 60 report.
4330         (EventProperty): Disabled warning 67 detection.
4331
4332 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4333
4334         Fix bug #60324
4335         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
4336
4337         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
4338         precise values.
4339
4340 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
4341
4342         Fix bug #49488
4343         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
4344
4345         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
4346
4347 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
4348
4349         * attribute.cs (Attribute.Resolve): Refine error reporting and
4350         report a cs0117 if the identifier does not exist, to distinguish
4351         from 0617 which is a miss-use of the actual identifier.
4352
4353         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
4354         between cs0070 and cs0079.
4355
4356         * class.cs (MemberBase.DoDefine): When reporting a wrong
4357         accessibility level, we use MethodCore to compare instead of
4358         Method (this was a regression in some refactoring effort).
4359
4360         So now we correctly report cs0056 again.
4361
4362         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
4363         testing the target_type (which was known to be object_type) and
4364         not the source type (which is anonymous_method).
4365
4366         Fixed reporting of error cs1660.
4367
4368         * expression.cs (UserCast.Source): Expose the underlying cast.
4369
4370         * statement.cs (Switch.SwitchGoverningType): Sort the list of
4371         allowed types to find a match to int32 first (most common).
4372
4373         In addition, it ignores any ImplicitUserConversions that did an
4374         internal implicit conversion (as the switch statement allows only
4375         one integral conversion to exist).
4376
4377         * class.cs (PartialContainer.Create): rename `name' to
4378         `member_name' for clarity.  Then replace the string calls with a
4379         call to MemberName.GetPartialName, as now using
4380         MemberName.ToString is an error (this is due to the side effects
4381         it had, that were fixed in the past).
4382
4383         This will restore the error reporting on a number of partial class
4384         errors that were missusing this (and getting an exception as a
4385         results, which is now just a plain textual warning, because
4386         yyparse debug output would crash otherwise).
4387
4388 2004-11-26  Raja R Harinath  <rharinath@novell.com>
4389
4390         * Makefile (PROGRAM_INSTALL_DIR): Remove.
4391
4392 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4393
4394         * rootcontext.cs (LookupType): Make sure to cache lookups that
4395         don't give us a negative result. This saves about 5% of corlib
4396         compilation time.
4397
4398 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4399
4400         * report.cs (AbstractMessage.Print): messages are sent to stderr
4401
4402         * class.cs (TypeContainer.GetClassBases): It is an error to have a
4403         non-interface in the list of interfaces (at this point, either
4404         parent was properly set, or a base class is being listed in the
4405         interfaces section).
4406
4407         This flags error 1722, and resolves the crash from bug 69259.
4408
4409 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
4410
4411         * statement.cs (Using.EmitExpressionFinally): make this work right
4412         for valuetypes. Fixes 69926.
4413
4414 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
4415
4416         * const.cs (Const.ChangeType): Cope with the "0 literal can be
4417         converted to an enum" here, before we try to change the underlying
4418         type.  This code exists, but it is a different code path than the
4419         one used while encoding constants.
4420
4421         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
4422         old bug: when converting from the null literal to a pointer,
4423         return an EmptyCast, not the NullLiteral.
4424
4425         This fixes #69921, the recent null_type changes probably made this
4426         bug more prominent.
4427
4428         (ImplicitReferenceConversionExists): In addition, resynchronized
4429         the code here, so it matches the same code in
4430         ImplicitReferenceConversionExists for the `from any class-type S
4431         to any interface-type T'.
4432         
4433
4434 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
4435
4436         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
4437
4438 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
4439
4440         * cs-parser.jay: Use verbosity accordingly. 
4441
4442 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4443
4444         * expression.cs (Unary.ResolveOperator): Do not report warning;
4445         AddressOf reads from variable.
4446         
4447         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
4448
4449 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
4450
4451         Fix bug #69462
4452
4453         * attribute.cs (Attributable): Removed CheckTargets.
4454         (Attributes.Emit): Explicit attribute targets are tested here.
4455
4456         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
4457         not enabled for interfaces.
4458
4459         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
4460         (GetAssemblyName): Ouch next bug there.
4461
4462 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4463
4464         * expression.cs: Error 275 added.
4465         
4466 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
4467
4468         Fix bug #69177 (Implemented decimal constant support)
4469
4470         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
4471         (BinaryFold): Add DecimalConstant.
4472
4473         * const.cs (Define): Decimal constant 
4474         (is not constant.
4475         (ChangeType): Add decimal type handling.
4476         (LookupConstantValue): Don't set value for decimal type but
4477         emit DecimalConstantAttribute. Needed for constant optimization.
4478
4479         * constant.cs (ToDecimal): New method.
4480         (ConvertToDecimal): New method.
4481         (IntConstant): Implemented ConvertToDecimal.
4482         (DecimalConstant.Emit): Emit optimized version for decimals in
4483         int range.
4484
4485         * expression.cs (ResolveOperator): Changed order of constant
4486         reduction to work correctly with native types which have
4487         overloaded operators.
4488         (ResolveMemberAccess): Extract constant value from attribute
4489         for decimal type.
4490
4491         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
4492
4493         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
4494         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
4495         (ChangeType): Decimal is special.
4496         (TypeToCoreType): Add decimal type.
4497
4498 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4499
4500         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
4501         decimal types.
4502
4503 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
4504
4505         * class.cs (EventField.ApplyAttributeBuilder): Fix error
4506         test cs1667-5.cs.
4507
4508 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4509
4510         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
4511
4512         * pending.cs (PendingImplementation): Grab only interfaces.
4513
4514 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
4515
4516         * statement.cs (ForeachHelperMethods): Add location member and
4517         error 202 detection.
4518
4519 2004-11-19  Raja R Harinath  <rharinath@novell.com>
4520
4521         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
4522         automatically handled by executable.make.
4523         (PROGRAM): Make profile-specific.
4524
4525 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
4526
4527         * expression.cs (DoResolveBase): Fixed wrong warning for out
4528         variables.
4529
4530 2004-11-18  Martin Baulig  <martin@ximian.com>
4531
4532         Merged latest changes into gmcs.  Please keep this comment in
4533         here, it makes it easier for me to see what changed in MCS since
4534         the last time I merged.
4535
4536 2004-11-17  Raja R Harinath  <rharinath@novell.com>
4537
4538         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
4539         (TypeHandle.GetMemberCache): New.
4540         (TypeHandle.TypeHandle): Update.
4541         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
4542         (TypeManager.LookupParentInterfacesCache):
4543         Rename from LookupInterfaceCache.  Optimize slightly.
4544         (TypeManager.MemberLookup_FindMembers): Update.
4545         * decl.cs (MemberCache.MemberCache): Set Container to null in the
4546         multi-type variant.
4547         (AddCacheContents): Rename from AddHashtable.
4548         * class.cs (TypeContainer.parent_container): Remove.
4549         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
4550         (TypeContainer.DoDefineMembers): Don't initialize it.
4551         Update to name changes.
4552         
4553 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
4554
4555         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
4556         that factors the code to check access modifiers on override.  
4557
4558         (PropertyBase): Use the code here.
4559
4560         Patch from Lluis S'anchez, fixes bug #69361.
4561
4562 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
4563
4564         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
4565         routine that is used to report the use of a captured variable
4566         whose address has been taken.
4567
4568         There are two checks: one when variables are being captured and
4569         the other check is when the address of a variable is taken. 
4570         
4571         (because an anonymous methods might be resolved before *or* after
4572         the address has been taken) and 
4573
4574         * expression.cs (Conditional.DoResolve): Remove the special
4575         casing that Martin added to trueExpr and falseExpr being both
4576         NullLiteral.  We get the right behavior now just by introducing
4577         the null_type into the compiler. 
4578
4579         * convert.cs (ExplicitConversion): Change the code to use
4580         null_type instead of testing `expr is NullLiteral'.
4581         (ImplicitConversionStandard): use null_type too.
4582         (ImplicitReferenceConversionExists): use null_type too.
4583         (ImplicitReferenceConversion): use null_type too.
4584
4585         * literal.cs: The type of `NullLiteral' is now null_type instead
4586         of object_type. 
4587         (Resolve): Set the type here.
4588
4589         * typemanager.cs: Introduce null_type.
4590
4591 2004-11-17  Martin Baulig  <martin@ximian.com>
4592
4593         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4594         direction, like FindMembers() does.  Fixes #69546, testcase is in
4595         test-315.cs.    
4596
4597 2004-11-16  Martin Baulig  <martin@ximian.com>
4598
4599         This is based on a patch from Marek Safar, see bug #69082.
4600         Fixes bugs #63705 and #67130.
4601
4602         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4603         method; create a MemberCache for an interface type and cache the
4604         result.
4605
4606         * decl.cs (IMemberContainer.ParentContainer): Removed.
4607         (IMemberContainer.ParentCache): New property.
4608         (MemberCache.SetupCacheForInterface): Removed.
4609         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4610         to create a cache for an interface's "parent".
4611
4612         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4613         interfaces too.
4614
4615 2004-11-16  Martin Baulig  <martin@ximian.com>
4616
4617         Merged back from gmcs; these changes already went into gmcs a
4618         couple of weeks ago.
4619
4620         * typemanager.cs
4621         (TypeManager.AddUserType): Removed the `ifaces' argument.
4622         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
4623         `TypeExpr []'.
4624         (TypeManager.AddUserInterface): Removed.
4625         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
4626         `TypeExpr []'.
4627         (TypeManager.GetInterfaces): Likewise.
4628         (TypeManager.GetExplicitInterfaces): Likewise.
4629
4630         * ecore.cs (TypeExpr.GetInterfaces): Removed.
4631
4632         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
4633         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
4634
4635 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4636
4637         * statement.cs: Avoid adding bools to a hashtable.
4638
4639 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4640
4641         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4642         calling an unsafe method from a safe location.
4643
4644 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4645
4646         Fix #69167
4647         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4648
4649 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4650
4651         * namespace.cs (VerifyUsing): use GetPartialName instead of
4652         ToString. 
4653
4654 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4655
4656         * statement.cs (Return.Resolve): Fix regression in typo: if
4657         `in_exc', we have to request a NeedReturnLabel, this was a typo
4658         introduced in the anonymous method check-in.  Fixes #69131.
4659
4660         * Indexers were using the ShortName when defining themselves,
4661         causing a regression in the compiler bootstrap when applying the
4662         patch from 2004-11-02 (first part), now they use their full name
4663         and the bug is gone.
4664
4665 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4666
4667         * driver.cs: Strip the path from the names of embedded resources. Fixes
4668         #68519.
4669
4670 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4671
4672         Fix error message regression: cs0104-2.cs.
4673         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4674         (AliasEntry.Resolve): Update.
4675         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4676         'silent' flag.
4677         (RootContext.LookupType): Update.
4678
4679 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4680
4681         * cs-parser.jay: Add support for handling accessor modifiers
4682         * class: Add support port accessor modifiers and error checking,
4683         define PropertyMethod.Define as virtual (not abstract anymore)
4684         * ecore.cs: Add checking for proeprties access with access modifiers
4685         * iterators.cs: Modify Accessor constructor call based in the modified
4686         constructor
4687 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4688
4689         * expression.cs (StringConcat): Handle being called twice,
4690         as when we have a concat in a field init with more than two
4691         ctors in the class
4692
4693 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4694
4695         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4696         special case explicit implementations, we should always produce
4697         the .property or .event declaration.
4698         
4699         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4700         since it will not return correct data if people use this
4701         unresolved in the presence of using statements (see test-313).
4702
4703         * class.cs (MethodData.Define): If we are an explicit interface
4704         implementation, set the method name to the full name of the
4705         interface plus the name of the method.  
4706
4707         Notice that using the method.MethodName.GetFullName() does not
4708         work, as it will only contain the name as declared on the source
4709         file (it can be a shorthand in the presence of using statements)
4710         and not the fully qualifed type name, for example:
4711
4712         using System;
4713
4714         class D : ICloneable {
4715                 object ICloneable.Clone ()  {
4716                 }
4717         }
4718
4719         Would produce a method called `ICloneable.Clone' instead of
4720         `System.ICloneable.Clone'.
4721
4722         * namespace.cs (Alias.Resolve): Use GetPartialName.
4723         
4724 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4725
4726         * cs-parser.jay: Add error 1055 report.
4727
4728 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4729
4730         * assign.cs (Assign.DoResolve): Only do the transform of
4731         assignment into a New if the types are compatible, if not, fall
4732         through and let the implicit code deal with the errors and with
4733         the necessary conversions. 
4734
4735 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4736
4737         * cs-parser.jay: Add error 1031 report.
4738
4739         * cs-tokenizer.cs: Add location for error 1038.
4740
4741 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4742
4743         * cs-parser.jay: Add error 1016 report.
4744
4745 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4746
4747         * cs-parser.jay: Add errors 1575,1611 report.
4748
4749 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4750
4751         * cs-parser.jay: Add error 1001 report.
4752
4753 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4754
4755         Fix #68850
4756         * attribute.cs (GetMarshal): Add method argument for
4757         caller identification.
4758
4759         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4760         agument for GetMarshal and RuntimeMissingSupport.
4761
4762 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4763
4764         * attribute.cs (ExtractSecurityPermissionSet): Removed
4765         TypeManager.code_access_permission_type.
4766
4767         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4768
4769 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4770
4771         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4772         for obsolete use of a variable here.   Fixes regression on errors
4773         cs0619-25 and cs0619-26.
4774
4775 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4776
4777         Fix #62358, implemented security attribute encoding.
4778
4779         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4780         Tests permitted SecurityAction for assembly or other types.
4781         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4782         data from SecurityPermissionAttribute to PermisionSet class.
4783
4784         * class.cs (ApplyAttributeBuilder): Added special handling
4785         for System.Security.Permissions.SecurityAttribute based types.
4786
4787         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4788         special handling for System.Security.Permissions.SecurityAttribute
4789         based types.
4790
4791         * enum.cs (ApplyAttributeBuilder): Added special handling
4792         for System.Security.Permissions.SecurityAttribute based types.
4793
4794         * parameter.cs (ApplyAttributeBuilder): Added special handling
4795         for System.Security.Permissions.SecurityAttribute based types.
4796
4797         * rootcontext.cs: Next 2 core types.
4798
4799         * typemanager.cs (TypeManager.security_permission_attr_type):
4800         Built in type for the SecurityPermission Attribute.
4801         (code_access_permission_type): Build in type.
4802
4803 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4804
4805         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4806         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4807         all of this information into
4808         EmitContext.EmitCapturedVariableInstance.
4809         
4810         * codegen.cs (EmitCapturedVariableInstance): move here the
4811         funcionality of emitting an ldarg.0 in the presence of a
4812         remapping.   This centralizes the instance emit code.
4813
4814         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4815         then emit a load of this: it means that we have reached the
4816         topmost ScopeInfo: the one that contains the pointer to the
4817         instance of the class hosting the anonymous method.
4818
4819         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4820         captures to the topmost CaptureContext.
4821
4822 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4823
4824         * expression.cs (LocalVariableReference): Move the knowledge about
4825         the iterators into codegen's EmitCapturedVariableInstance.
4826
4827 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4828
4829         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4830         all code paths return a value from an anonymous method (it is the
4831         same as the 161 error, but for anonymous methods).
4832
4833 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4834
4835         The introduction of anonymous methods in the compiler changed
4836         various ways of doing things in the compiler.  The most
4837         significant one is the hard split between the resolution phase
4838         and the emission phases of the compiler.
4839
4840         For instance, routines that referenced local variables no
4841         longer can safely create temporary variables during the
4842         resolution phase: they must do so from the emission phase,
4843         since the variable might have been "captured", hence access to
4844         it can not be done with the local-variable operations from the runtime.
4845         
4846         * statement.cs 
4847
4848         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4849         is a toplevel block.
4850
4851         (ToplevelBlock): A new kind of Block, these are the blocks that
4852         are created by the parser for all toplevel method bodies.  These
4853         include methods, accessors and anonymous methods.
4854
4855         These contain some extra information not found in regular blocks:
4856         A pointer to an optional CaptureContext (for tracking captured
4857         local variables and parameters).  A pointer to the parent
4858         ToplevelBlock.
4859         
4860         (Return.Resolve): Catch missmatches when returning a value from an
4861         anonymous method (error 1662).
4862         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4863         phase.
4864
4865         (Break.Resolve): ditto.
4866
4867         (SwitchLabel): instead of defining the labels during the
4868         resolution phase, we now turned the public ILLabel and ILLabelCode
4869         labels into methods called GetILLabelCode() and GetILLabel() that
4870         only define the label during the Emit phase.
4871
4872         (GotoCase): Track the SwitchLabel instead of the computed label
4873         (its contained therein).  Emit the code by using
4874         SwitchLabel.GetILLabelCode ().
4875
4876         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4877         whether the Local has been captured or not.
4878
4879         (LocalInfo.IsCaptured): New property, used to tell whether the
4880         local has been captured.
4881         
4882         * anonymous.cs: Vastly updated to contain the anonymous method
4883         support.
4884
4885         The main classes here are: CaptureContext which tracks any
4886         captured information for a toplevel block and ScopeInfo used to
4887         track the activation frames for various local variables.   
4888
4889         Each toplevel block has an optional capture context associated
4890         with it.  When a method contains an anonymous method both the
4891         toplevel method and the anonymous method will create a capture
4892         context.   When variables or parameters are captured, they are
4893         recorded on the CaptureContext that owns them, for example:
4894
4895         void Demo () {
4896              int a;
4897              MyDelegate d = delegate {
4898                  a = 1;
4899              }
4900         }
4901
4902         Here `a' will be recorded as captured on the toplevel
4903         CapturedContext, the inner captured context will not have anything
4904         (it will only have data if local variables or parameters from it
4905         are captured in a nested anonymous method.
4906
4907         The ScopeInfo is used to track the activation frames for local
4908         variables, for example:
4909
4910         for (int i = 0; i < 10; i++)
4911                 for (int j = 0; j < 10; j++){
4912                    MyDelegate d = delegate {
4913                         call (i, j);
4914                    }
4915                 }
4916
4917         At runtime this captures a single captured variable `i', but it
4918         captures 10 different versions of the variable `j'.  The variable
4919         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4920         recorded on a child.  
4921
4922         The toplevel ScopeInfo will also track information like the `this'
4923         pointer if instance variables were referenced (this is necessary
4924         as the anonymous method lives inside a nested class in the host
4925         type of the method). 
4926
4927         (AnonymousMethod): Expanded to track the Toplevel, implement
4928         `AnonymousMethod.Compatible' to tell whether an anonymous method
4929         can be converted to a target delegate type. 
4930
4931         The routine now also produces the anonymous method content
4932
4933         (AnonymousDelegate): A helper class that derives from
4934         DelegateCreation, this is used to generate the code necessary to
4935         produce the delegate for the anonymous method that was created. 
4936
4937         * assign.cs: API adjustments for new changes in
4938         Convert.ImplicitStandardConversionExists.
4939
4940         * class.cs: Adjustments to cope with the fact that now toplevel
4941         blocks are of type `ToplevelBlock'. 
4942
4943         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4944         insteda of standard blocks.
4945
4946         Flag errors if params arguments are passed to anonymous methods.
4947
4948         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4949         `CurrentAnonymousMethod' which points to the current Anonymous
4950         Method.  The variable points to the AnonymousMethod class that
4951         holds the code being compiled.  It is set in the new EmitContext
4952         created for the anonymous method.
4953
4954         (EmitContext.Phase): Introduce a variable and an enumeration to
4955         assist in enforcing some rules about when and where we are allowed
4956         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4957         only one that enfonces this right now).
4958
4959         (EmitContext.HaveCaptureInfo): new helper method that returns
4960         whether we have a CapturedContext initialized.
4961
4962         (EmitContext.CaptureVariable): New method used to register that a
4963         LocalInfo must be flagged for capturing. 
4964
4965         (EmitContext.CapturedParameter): New method used to register that a
4966         parameters must be flagged for capturing. 
4967         
4968         (EmitContext.CapturedField): New method used to register that a
4969         field must be flagged for capturing. 
4970
4971         (EmitContext.HaveCapturedVariables,
4972         EmitContext.HaveCapturedFields): Return whether there are captured
4973         variables or fields. 
4974
4975         (EmitContext.EmitMethodHostInstance): This is used to emit the
4976         instance for the anonymous method.  The instance might be null
4977         (static methods), this (for anonymous methods that capture nothing
4978         and happen to live side-by-side with the current method body) or a
4979         more complicated expression if the method has a CaptureContext.
4980
4981         (EmitContext.EmitTopBlock): Routine that drives the emission of
4982         code: it will first resolve the top block, then emit any metadata
4983         and then emit the code.  The split is done so that we can extract
4984         any anonymous methods and flag any captured variables/parameters.
4985         
4986         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4987         during this phase, the ILGenerator should not be used as labels
4988         and local variables declared here might not be accessible to any
4989         code that is part of an anonymous method.  
4990
4991         Exceptions to this include the temporary variables that are
4992         created by some statements internally for holding temporary
4993         variables. 
4994         
4995         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4996         metadata for a cb
4997
4998         (EmitContext.TemporaryReturn): This method is typically called
4999         from the Emit phase, and its the only place where we allow the
5000         ReturnLabel to be defined other than the EmitMeta.  The reason is
5001         that otherwise we would have to duplicate a lot of logic in the
5002         Resolve phases of various methods that today is on the Emit
5003         phase. 
5004
5005         (EmitContext.NeedReturnLabel): This no longer creates the label,
5006         as the ILGenerator is not valid during the resolve phase.
5007
5008         (EmitContext.EmitThis): Extended the knowledge in this class to
5009         work in anonymous methods in addition to iterators. 
5010
5011         (EmitContext.EmitCapturedVariableInstance): This emits whatever
5012         code is necessary on the stack to access the instance to a local
5013         variable (the variable will be accessed as a field).
5014
5015         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
5016         EmitContext.EmitAddressOfParameter): Routines to support
5017         parameters (not completed at this point). 
5018         
5019         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
5020         will also remove the parameters.
5021
5022         * convert.cs (Convert): Define a `ConstantEC' which points to a
5023         null.  This is just to prefity some code that uses
5024         ImplicitStandardConversion code and do not have an EmitContext
5025         handy.
5026
5027         The idea is to flag explicitly that at that point in time, it is
5028         known that the conversion will not trigger the delegate checking
5029         code in implicit conversions (which requires a valid
5030         EmitContext). 
5031
5032         Everywhere: pass new EmitContext parameter since
5033         ImplicitStandardConversionExists now requires it to check for
5034         anonymous method conversions. 
5035
5036         (Convert.ImplicitStandardConversionExists): If the type of an
5037         expression is the anonymous_method_type, and the type is a
5038         delegate, we invoke the AnonymousMethod.Compatible method to check
5039         whether an implicit conversion is possible. 
5040
5041         (Convert.ImplicitConversionStandard): Only do implicit method
5042         group conversions if the language level is not ISO_1.
5043
5044         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
5045         MethodInfo for the Invoke method.  used by Delegate and
5046         AnonymousDelegate.
5047
5048         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
5049         method conversions if the target type is a delegate.
5050
5051         Removed extra debugging nops.
5052
5053         (LocalVariableReference): Turn the `local_info' into a public
5054         field. 
5055
5056         Add `prepared' field, the same hack used for FieldExprs to cope
5057         with composed assignments, as Local variables do not necessarily
5058         operate purely on the stack as they used to: they can be captured
5059         fields. 
5060
5061         Add `temp' for a temporary result, like fields.
5062
5063         Refactor DoResolve and DoResolveLValue into DoResolveBase.
5064
5065         It now copes with Local variables that are captured and emits the
5066         proper instance variable to load it from a field in the captured
5067         case. 
5068
5069         (ParameterReference.DoResolveBase): During the resolve phase,
5070         capture parameters if we are in an anonymous method.
5071
5072         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
5073         anonymous method, use the EmitContext helper routines to emit the
5074         parameter reference.
5075
5076         * iterators.cs: Set RemapToProxy to true/false during the
5077         EmitDispose class.
5078
5079         * parameters.cs (GetParameterByName): New helper method. 
5080
5081         * typemanager.cs (anonymous_method_type) a new type that
5082         represents an anonyous method.  This is always an internal type,
5083         used as a fencepost to test against the anonymous-methodness of an
5084         expression. 
5085         
5086 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
5087
5088         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
5089         561 report.
5090         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
5091
5092 2004-10-18  Martin Baulig  <martin@ximian.com>
5093
5094         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
5095         `Type' directly, but call ResolveType() on it.
5096         (Catch.Resolve): Likewise.
5097         (Foreach.Resolve): Likewise.
5098
5099 2004-10-18  Martin Baulig  <martin@ximian.com>
5100
5101         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
5102         `Type' directly, but call ResolveType() on it.
5103         (Probe.DoResolve): Likewise.
5104         (ArrayCreation.LookupType): Likewise.
5105         (TypeOf.DoResolve): Likewise.
5106         (SizeOf.DoResolve): Likewise.
5107
5108 2004-10-18  Martin Baulig  <martin@ximian.com>
5109
5110         * expression.cs (Invocation.BetterFunction): Put back
5111         TypeManager.TypeToCoreType().
5112
5113 2004-10-18  Raja R Harinath  <rharinath@novell.com>
5114
5115         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
5116         the ResolveType.
5117
5118 2004-10-18  Martin Baulig  <martin@ximian.com>
5119
5120         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
5121         `Type' directly, but call ResolveType() on it.
5122
5123 2004-10-18  Martin Baulig  <martin@ximian.com>
5124
5125         * class.cs (FieldMember.Define): Don't access the TypeExpr's
5126         `Type' directly, but call ResolveType() on it.
5127         (MemberBase.DoDefine): Likewise.
5128
5129         * expression.cs (New.DoResolve): Don't access the TypeExpr's
5130         `Type' directly, but call ResolveType() on it.
5131         (ComposedCast.DoResolveAsTypeStep): Likewise.
5132
5133         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
5134         `Type' directly, but call ResolveType() on it.
5135
5136 2004-10-17  John Luke  <john.luke@gmail.com>
5137
5138         * class.cs (Operator.GetSignatureForError): use CSharpName
5139
5140         * parameter.cs (Parameter.GetSignatureForError): Returns
5141         correct name even if was not defined.
5142
5143 2004-10-13  Raja R Harinath  <rharinath@novell.com>
5144
5145         Fix #65816.
5146         * class.cs (TypeContainer.EmitContext): New property.
5147         (DefineNestedTypes): Create an emitcontext for each part.
5148         (MethodCore.DoDefineParameters): Use container's emitcontext.
5149         Pass type array to InternalParameters.
5150         (MemberBase.DoDefine): Use container's emitcontext.
5151         (FieldMember.Define): Likewise.
5152         (Event.Define): Likewise.
5153         (SetMethod.GetParameterInfo): Change argument to EmitContext.
5154         Pass type array to InternalParameters.
5155         (SetIndexerMethod.GetParameterInfo): Likewise.
5156         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
5157         * delegate.cs (Define): Pass emitcontext to
5158         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
5159         array to InternalParameters.
5160         * expression.cs (ParameterReference.DoResolveBase): Pass
5161         emitcontext to GetParameterInfo.
5162         (ComposedCast.DoResolveAsTypeStep): Remove check on
5163         ec.ResolvingTypeTree.
5164         * parameter.cs (Parameter.Resolve): Change argument to
5165         EmitContext.  Use ResolveAsTypeTerminal.
5166         (Parameter.GetSignature): Change argument to EmitContext.
5167         (Parameters.ComputeSignature): Likewise.
5168         (Parameters.ComputeParameterTypes): Likewise.
5169         (Parameters.GetParameterInfo): Likewise.
5170         (Parameters.ComputeAndDefineParameterTypes): Likewise.
5171         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
5172         * support.cs (InternalParameters..ctor): Remove variant that takes
5173         a DeclSpace.
5174         * typemanager.cs (system_intptr_expr): New.
5175         (InitExpressionTypes): Initialize it.
5176
5177 2004-10-12  Chris Toshok  <toshok@ximian.com>
5178
5179         * cs-parser.jay: fix location for try_statement and catch_clause.
5180
5181 2004-10-11  Martin Baulig  <martin@ximian.com>
5182
5183         * report.cs: Don't make --fatal abort on warnings, we have
5184         -warnaserror for that.
5185
5186 2004-10-07  Raja R Harinath  <rharinath@novell.com>
5187
5188         More DeclSpace.ResolveType avoidance.
5189         * decl.cs (MemberCore.InUnsafe): New property.
5190         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
5191         with newly created EmitContext.
5192         (FieldMember.Define): Likewise.
5193         * delegate.cs (Delegate.Define): Likewise.
5194         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
5195         only if normal name-lookup fails.
5196         (TypeExpr.DoResolve): Enable error-checking.
5197         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
5198         (SizeOf.DoResolve): Likewise.
5199         (ComposedCast.DoResolveAsTypeStep): Likewise.
5200         (StackAlloc.DoResolve): Likewise.
5201         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
5202         (Block.Unsafe): New property.
5203         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
5204         (Unsafe): Set 'unsafe' flag of contained block.
5205         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
5206         (Fixed.Resolve): Likewise.
5207         (Catch.Resolve): Likewise.
5208         (Using.ResolveLocalVariableDecls): Likewise.
5209         (Foreach.Resolve): Likewise.
5210
5211 2004-10-05  John Luke <john.luke@gmail.com>
5212
5213         * cs-parser.jay: add location to error CS0175
5214
5215 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
5216
5217         * ecore.cs (Expression.Constantity): Add support for turning null
5218         into a constant.
5219
5220         * const.cs (Const.Define): Allow constants to be reference types
5221         as long as the value is Null.
5222
5223 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
5224
5225         * namespace.cs (NamespaceEntry.Using): No matter which warning
5226         level is set, check if this namespace name has already been added.
5227
5228 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
5229
5230         * expression.cs: reftype [!=]= null should always use br[true,false].
5231         # 67410
5232
5233 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
5234
5235         Fix #67108
5236         * attribute.cs: Enum conversion moved to 
5237         GetAttributeArgumentExpression to be applied to the all
5238         expressions.
5239
5240 2004-10-01  Raja R Harinath  <rharinath@novell.com>
5241
5242         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
5243         * class.c (TypeContainer.DefineType): Flag error if
5244         base types aren't accessible due to access permissions.
5245         * decl.cs (DeclSpace.ResolveType): Move logic to
5246         Expression.ResolveAsTypeTerminal.
5247         (DeclSpace.ResolveTypeExpr): Thin layer over
5248         Expression.ResolveAsTypeTerminal.
5249         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
5250         Refactor code into NestedAccess.  Use it.
5251         (DeclSpace.NestedAccess): New.
5252         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
5253         argument to silence errors.  Check access permissions.
5254         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
5255         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
5256         (Cast.DoResolve): Likewise.
5257         (New.DoResolve): Likewise.
5258         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
5259         (TypeOf.DoResolve): Likewise.
5260
5261         * expression.cs (Invocation.BetterConversion): Return the Type of
5262         the better conversion.  Implement section 14.4.2.3 more faithfully.
5263         (Invocation.BetterFunction): Make boolean.  Make correspondence to
5264         section 14.4.2.2 explicit.
5265         (Invocation.OverloadResolve): Update.
5266         (Invocation): Remove is_base field.
5267         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
5268         (Invocation.Emit): Likewise.
5269
5270 2004-09-27  Raja R Harinath  <rharinath@novell.com>
5271
5272         * README: Update to changes.
5273
5274 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
5275
5276         * cs-parser.jay: Reverted 642 warning fix.
5277
5278 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5279
5280         Fix bug #66615
5281         * decl.cs (FindMemberWithSameName): Indexer can have more than
5282         1 argument.
5283
5284 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5285
5286         * expression.cs (LocalVariableReference.DoResolveLValue):
5287         Do not report warning 219 for out values.
5288         (EmptyExpression.Null): New member to avoid extra allocations.
5289
5290 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5291
5292         * cs-parser.jay: Fix wrong warning 642 report.
5293
5294         * cs-tokenizer.cs (CheckNextToken): New helper;
5295         Inspect next character if is same as expected.
5296
5297 2004-09-23  Martin Baulig  <martin@ximian.com>
5298
5299         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
5300         (Convert.ImplicitReferenceConversionExists): Likewise.
5301
5302 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
5303
5304         * class.cs (Operator.Define): Add error 448 and 559 report.
5305
5306 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5307
5308         * class.cs (MemberBase.IsTypePermitted): New protected
5309         method for checking error CS0610.
5310
5311 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5312
5313         * class.cs (TypeContainer.HasExplicitLayout): New property
5314         Returns whether container has StructLayout attribute set Explicit.
5315         (FieldMember): New abstract class for consts and fields.
5316         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
5317         (Field): Reuse FieldMember.
5318
5319         * const.cs (Const): Reuse FieldMember.
5320
5321         * rootcontext.cs: EmitConstants call moved to class.
5322
5323 2004-09-22  Martin Baulig  <martin@ximian.com>
5324
5325         Thanks to Peter Sestoft for this bug report.
5326
5327         * expression.cs (Conditional): If both the `trueExpr' and the
5328         `falseExpr' is a NullLiteral, return a NullLiteral.
5329
5330 2004-09-22  Martin Baulig  <martin@ximian.com>
5331
5332         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
5333         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
5334         for the "get_Current" call.
5335
5336 2004-09-22  Martin Baulig  <martin@ximian.com>
5337
5338         Marek and me just fixed one of our oldest bugs: #28562 :-)
5339
5340         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
5341
5342         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
5343         we're an EnumConstant, just return that.
5344         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
5345         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
5346         to get the value which'll actually be written into the attribute.
5347         However, we have to use GetValue() to access the attribute's value
5348         in the compiler.        
5349
5350 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
5351
5352         * constant.cs (Constant.IsNegative): New abstract property
5353         IsNegative.
5354
5355         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
5356         (StackAlloc.DoResolve): Reused IsNegative.
5357
5358 2004-09-21  Martin Baulig  <martin@ximian.com>
5359
5360         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
5361         if we're used in an iterator, we may be called from different
5362         methods.
5363
5364         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
5365         we actually have an exception block.
5366
5367 2004-09-20  John Luke <jluke@cfl.rr.com>
5368
5369         * class.cs, cs-parser.jay: Improve the error report for 1520:
5370         report the actual line where the error happens, not where the
5371         class was declared.
5372
5373         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
5374         Pass location information that was available elsewhere.
5375
5376 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
5377
5378         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
5379         runtime to delay sign assemblies.
5380
5381 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5382
5383         * cs-parser.jay: Do not report the stack trace, this is barely
5384         used nowadays.
5385
5386 2004-08-22  John Luke  <john.luke@gmail.com>
5387  
5388         * driver.cs : check that a resource id is not already used
5389         before adding it, report CS1508 if it is, bug #63637
5390
5391 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
5392
5393         * ecore.cs: Removed dead code.
5394
5395 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
5396
5397         * class.cs: Do not report warning CS0067 on the interfaces.
5398
5399 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5400
5401         * cs-parser.jay: Add error 504 report.
5402
5403 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5404
5405         * rootcontext.cs: WarningLevel is 4 by default now.
5406
5407         * statement.cs (Fixed.Resolve): Do not null
5408         VariableInfo.
5409
5410 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
5411
5412         Fixed bug #55780
5413         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
5414         deep search when property is not virtual.
5415         (PropertyExpr.ResolveAccessors): Make one call for both
5416         accessors.
5417
5418 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5419
5420         Fixed bug #65766
5421         * statement.cs: Error 152 report constains also location.
5422
5423 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5424
5425         Fixed bug #65766
5426         * const.cs: Explicitly set constant as static.
5427
5428 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5429
5430         Fixed bug #64226
5431         * cs-parser.jay: Add error 1017 report.
5432
5433 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
5434
5435         Fixed bug #59980, #64224
5436         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
5437
5438         * typemanager.cs (IsSpecialMethod): Simplified
5439
5440 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5441
5442         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
5443         condition with better params.
5444
5445 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5446
5447         Fixed bug #65238
5448         * attribute.cs (Resolve): Property has to have both
5449         accessors.
5450
5451 2004-09-14  Martin Baulig  <martin@ximian.com>
5452
5453         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5454
5455 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5456
5457         Fixed bug #61902
5458         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5459         called and is obsolete then this member suppress message
5460         when call is inside next [Obsolete] method or type.
5461
5462         * expression.cs: Use TestObsoleteMethodUsage member.
5463
5464 2004-09-14  Martin Baulig  <martin@ximian.com>
5465
5466         * cs-parser.jay: Sync a bit with the GMCS version.
5467
5468 2004-09-14  Martin Baulig  <martin@ximian.com>
5469
5470         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
5471         (CSharpParser.yacc_verbose_flag): New public field.
5472
5473         * genericparser.cs: Removed.
5474
5475 2004-09-14  Raja R Harinath  <rharinath@novell.com>
5476
5477         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
5478
5479 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5480
5481         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5482
5483 2004-09-10  Martin Baulig  <martin@ximian.com>
5484
5485         Backported my MemberName changes from GMCS into MCS.
5486
5487         - we are now using a special `MemberName' class instead of using
5488         strings; in GMCS, the `MemberName' also contains the type
5489         arguments.
5490
5491         - changed the grammar rules a bit:
5492           * the old `member_name' is now a `namespace_or_type_name':
5493             The rule is that we use `namespace_or_type_name' everywhere
5494             where we expect either a "member name" (GetEnumerator) or a
5495             "member name" with an explicit interface name
5496             (IEnumerable.GetEnumerator).
5497             In GMCS, the explicit interface name may include type arguments
5498             (IEnumerable<T>.GetEnumerator).
5499           * we use `member_name' instead of just `IDENTIFIER' for
5500             "member names":
5501             The rule is that we use `member_name' wherever a member may
5502             have type parameters in GMCS.       
5503
5504         * decl.cs (MemberName): New public class.
5505         (MemberCore.MemberName): New public readonly field.
5506         (MemberCore.ctor): Take a `MemberName' argument, not a string.
5507         (DeclSpace): Likewise.
5508
5509         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
5510         * enum.cs (Enum.ctor): Likewise.
5511
5512         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
5513         MemberName.     
5514         (AliasEntry.ctor): Take a MemberName, not an Expression.
5515         (AliasEntry.UsingAlias): Likewise.
5516
5517         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
5518         (IMethodData.MemberName): Changed type from string to MemberName.
5519         (MemberBase.ExplicitInterfaceName): Likewise.
5520         (AbstractPropertyEventMethod.SetupName): Make this private.
5521         (AbstractPropertyEventMethod.ctor): Added `string prefix'
5522         argument; compute the member name here.
5523         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
5524         on the `member.MemberName' and the `prefix'.
5525
5526         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
5527         not `type_name'.
5528         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
5529         thus, we get a `MemberName' instead of a `string'.  These
5530         declarations may have type parameters in GMCS.
5531         (interface_method_declaration, delegate_declaration): Likewise.
5532         (class_declaration, interface_declaration): Likewise.
5533         (method_header): Use `namespace_or_type_name' instead of
5534         `member_name'.  We may be an explicit interface implementation.
5535         (property_declaration, event_declaration): Likewise.
5536         (member_name): This is now just an `IDENTIFIER', not a
5537         `namespace_or_type_name'.
5538         (type_name, interface_type): Removed.
5539         (namespace_or_type_name): Return a MemberName, not an Expression.
5540         (primary_expression): Use `member_name' instead of `IDENTIFIER';
5541         call GetTypeExpression() on the MemberName to get an expression.
5542         (IndexerDeclaration.interface_type): Changed type from string to
5543         MemberName.
5544         (MakeName): Operate on MemberName's instead of string's.
5545
5546 2004-09-13  Raja R Harinath  <rharinath@novell.com>
5547
5548         Fix bug #55770.
5549         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
5550         (NamespaceEntry.Lookup): Add new argument to flag if we want the
5551         lookup to avoid symbols introduced by 'using'.
5552         * rootcontext.cs (NamespaceLookup): Update.
5553
5554 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5555
5556         * class.cs (TypeContainer.DoDefineMembers): Do not call
5557         DefineDefaultConstructor for static classes.
5558
5559 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5560
5561         * attribute.cs (Attribute.Resolve): Add error 653 report.
5562
5563         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5564         report.
5565         (Method.ApplyAttributeBuilder): Add error 685 report.
5566         (Operator.Define): Add error 564 report.
5567
5568         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5569
5570         * expression.cs (Invocation.DoResolve): Add error
5571         245 and 250 report.
5572
5573         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5574         error 674 report.
5575
5576 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5577
5578         * class.cs (ConstructorInitializer.Resolve):
5579         Wrong error number (515->516).
5580
5581 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5582
5583         * class.cs (Indexer.Define): Add error 631 report.
5584
5585 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5586
5587         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5588
5589 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5590
5591         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5592
5593 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5594
5595         * cs-parser.jay: Added error CS0241 report.
5596
5597 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5598
5599         * cs-parser.jay (fixed_statement): Introduce a scope for the
5600         declaration in the 'fixed' statement.
5601
5602 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5603
5604         * cs-parser.jay: Added CS0230 error report.
5605
5606 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5607
5608         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5609
5610 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5611
5612         * expression.cs (Argument.Resolve): Added error CS0192 and
5613         CS0199 report.
5614
5615 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5616
5617         C# 2.0 #pragma warning feature
5618
5619         * cs-tokenizer.cs (PreProcessPragma): New method; 
5620         Handles #pragma directive.
5621
5622         * report.cs (WarningRegions): New class; Support
5623         class for #pragma warning directive. It tests whether
5624         warning is enabled for a given line.
5625
5626 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5627
5628         * const.cs: Add more descriptive error report, tahnks to
5629         Sebastien. 
5630
5631 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5632
5633         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5634
5635 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5636
5637         * expression.cs: Apply patch from Ben: Remove dead code from
5638         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5639         as that code just threw an exception anwyays.
5640
5641         * const.cs: Remove the call to the turnintoconstant, for details
5642         see bug: #63144
5643         
5644         * literal.cs: The type of the null-literal is the null type;  So
5645         we use a placeholder type (literal.cs:System.Null, defined here)
5646         for it.
5647
5648         * expression.cs (Conditional.DoResolve): Remove some old code that
5649         is no longer needed, conversions have been fixed.
5650
5651         (ArrayCreationExpression.DoResolve): Return false if we fail to
5652         resolve the inner expression.
5653
5654 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5655
5656         Fix test-290.cs.
5657         * cs-parser.jay (delegate_declaration): Record a delegate
5658         declaration as a type declaration.
5659         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5660
5661 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5662
5663         * parameter.cs: Do not crash if the type can not be resolved. 
5664
5665         * expression.cs: Report errors with unsafe pointers, fixes #64896
5666
5667 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5668
5669         * expression.cs: Pointer arith always needs to do a conv.i
5670         if the operand is a long. fix 65320
5671
5672 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5673
5674         Fixed cs0619-37.cs, cs0619-38.cs
5675
5676         * enum.cs (GetObsoleteAttribute): Removed.
5677
5678         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5679         on Enum member is double staged. The first is tested member
5680         and then enum.
5681
5682 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5683
5684         Fixed #56986, #63631, #65231
5685
5686         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5687         adds member to name container.
5688         (TypeContainer.AddToTypeContainer): New method, adds type to
5689         name container.
5690         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5691         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5692         AddOperator): Simplified by reusing AddToMemberContainer.
5693         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5694         instead of field.
5695         (Method.CheckForDuplications): Fixed implementation to test all
5696         possibilities.
5697         (MemberBase): Detection whether member is explicit interface
5698         implementation is now in constructor.
5699         (MemberBase.UpdateMemberName): Handles IndexerName.
5700         (Accessor): Changed to keep also location information.
5701         (AbstractPropertyEventMethod): Is derived from MemberCore.
5702         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5703         will be emited or not.
5704         (PropertyBase.AreAccessorsDuplicateImplementation):
5705         Tests whether accessors are not in collision with some method.
5706         (Operator): Is derived from MethodCore to simplify common
5707         operations.
5708
5709         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5710         must be performed.
5711         (DeclSpace.AddToContainer): Adds the member to defined_names
5712         table. It tests for duplications and enclosing name conflicts.
5713
5714         * enum.cs (EnumMember): Clean up to reuse the base structures
5715
5716 2004-09-03  Martin Baulig  <martin@ximian.com>
5717
5718         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5719         into TypeContainer, to make partial classes work again.
5720
5721 2004-09-03  Martin Baulig  <martin@ximian.com>
5722
5723         * rootcontext.cs (RootContext.V2): Removed.
5724
5725 2004-03-23  Martin Baulig  <martin@ximian.com>
5726
5727         * expression.cs (Invocation.OverloadResolve): Added `bool
5728         may_fail' argument and use it instead of the Location.IsNull() hack.
5729
5730 2004-09-03  Martin Baulig  <martin@ximian.com>
5731
5732         Merged latest changes into gmcs.  Please keep this comment in
5733         here, it makes it easier for me to see what changed in MCS since
5734         the last time I merged.
5735
5736 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5737
5738         Fix #61128.
5739         * expression.cs (BetterConversion): Don't allow either conversion 
5740         to be null.  Remove redundant implicit conversion test when 'q ==
5741         null' -- when this function is invoked, we already know that the
5742         implicit conversion exists.
5743         (BetterFunction): Assume that 'best' is non-null.  Remove
5744         redundant reimplementation of IsApplicable when 'best' is null.
5745         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5746         number of arguments.
5747         (IsAncestralType): Extract from OverloadResolve.
5748         (OverloadResolve): Make robust to the MethodGroupExpr being
5749         unsorted.  Implement all the logic of Section 14.5.5.1, and
5750         support overloading of methods from multiple applicable types.
5751         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5752
5753         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5754         (RealError, Warning): Append type of report to related symbol.
5755
5756 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5757
5758         * enum.cs: Fixed CLS-Compliance checks for enum members.
5759         Error tests cs3008-8.cs, cs3014-8.cs
5760
5761 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5762
5763         Fixed bug #62342, #63102
5764         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5765         like ImplementMethod.
5766
5767 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5768
5769         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5770         Fixed bug #65170.
5771
5772 2004-09-02  Martin Baulig  <martin@ximian.com>
5773
5774         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5775         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5776         on the MethodBase.
5777
5778 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5779
5780         C# 2.0 Static classes implemented
5781
5782         * class.cs (TypeContainer): instance_constructors,
5783         initialized_fields, initialized_static_fields,
5784         default_constructor, base_inteface_types are protected to be
5785         accessible from StaticClass.
5786         (TypeContainer.DefineDefaultConstructor): New virtual method
5787         for custom default constructor generating
5788         (StaticClass): New class to handle "Static classes" feature.
5789
5790         * cs-parser.jay: Handle static keyword on class like instance
5791         of StaticClass.
5792
5793         * driver.cs: Added "/langversion" command line switch with two
5794         options (iso-1, default).
5795
5796 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5797
5798         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5799
5800 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5801
5802         * delegate.cs: Style.
5803
5804 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5805
5806         * delegate.cs: Add seperate instance expr field for miguel.
5807
5808 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5809
5810         * PointerArithmetic (Resolve): make sure we are not doing
5811         pointer arith on void*. Also, make sure we are resolved
5812         by not setting eclass until resolve.
5813
5814         All callers: Make sure that PointerArithmetic gets resolved.
5815
5816 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5817
5818         * ArrayCreation (LookupType): If the type does not resolve 
5819         to an array, give an error.
5820
5821 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5822
5823         * statement.cs (Try.Resolve): Fixed bug #64222
5824
5825 2004-08-27  Martin Baulig  <martin@ximian.com>
5826
5827         * class.cs
5828         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5829         crash here.     
5830
5831 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5832
5833         * ecore.cs (Constantify): Get underlying type via
5834         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5835         Windows in special cases.
5836
5837 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5838
5839         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5840         for obtaining also private methods.
5841         (GetRemoveMethod): Used GetRemoveMethod (true)
5842         for obtaining also private methods.
5843
5844 2004-08-24  Martin Baulig  <martin@ximian.com>
5845
5846         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5847         MethodAttributes.HideBySig for operators.
5848
5849 2004-08-23  Martin Baulig  <martin@ximian.com>
5850
5851         Back to the old error reporting system :-)
5852
5853         * report.cs (Message): Removed.
5854         (Report.MessageData, ErrorData, WarningData): Removed.
5855         (Report.Error, Warning): Back to the old system.
5856
5857 2004-08-23  Martin Baulig  <martin@ximian.com>
5858
5859         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5860
5861         * class.cs (TypeContainer.ParentContainer): New public virtual
5862         method; replaces the explicit interface implementation.
5863         (ClassPart.ParentContainer): Override.
5864
5865 2004-08-23  Martin Baulig  <martin@ximian.com>
5866
5867         * statement.cs (Switch): Added support for constant switches; see
5868         #59428 or test-285.cs.
5869
5870 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5871
5872         Fixed bug #62740.
5873         * statement.cs (GetEnumeratorFilter): Removed useless
5874         logic because C# specs is strict. GetEnumerator must be
5875         public.
5876
5877 2004-08-22  Martin Baulig  <martin@ximian.com>
5878
5879         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5880         a switch and may break, reset the barrier.  Fixes #59867.
5881
5882 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5883
5884         CLS-Compliance speed up (~5% for corlib)
5885
5886         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5887         New method. Tests container for CLS-Compliant names
5888
5889         * class.cs (TypeContainer.VerifyClsName): New method.
5890         Checks whether container name is CLS Compliant.
5891         (Constructor): Implements IMethodData.
5892
5893         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5894         low-case table for CLS Compliance test.
5895         (MemberCache.VerifyClsParameterConflict): New method.
5896         Checks method parameters for CS3006 error.
5897
5898         * enum.cs (EnumMember): Is derived from MemberCore.
5899         (Enum.VerifyClsName): Optimized for better performance.
5900
5901 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5902
5903         * report.cs: Renamed Error_T to Error and changed all
5904         references.
5905
5906 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5907
5908         * class.cs (TypeContainer.IndexerArrayList): New inner class
5909         container for indexers.
5910         (TypeContainer.DefaultIndexerName): New constant for default
5911         indexer name. Replaced all "Item" with this constant.
5912         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5913
5914         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5915         DefaultMemberAttribute constructor.
5916
5917 2004-08-05  Martin Baulig  <martin@ximian.com>
5918
5919         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5920         Fix bug #59429.
5921
5922 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5923
5924         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5925         multi platforms problem.
5926
5927         * compiler.csproj: Included shared files.
5928
5929 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5930
5931         Fix bug 60333, 55971 in the more general way
5932         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5933         Added arg_type argument for constant conversion.
5934         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5935
5936 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5937
5938         Fix bug #59760
5939         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5940         OperatorArrayList, MethodCoreArrayList for typecontainer
5941         containers. Changed class member types to these new types.
5942         (MethodArrayList.DefineMembers): Added test for CS0659.
5943
5944 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5945
5946         * cfold.cs: Synchronize the folding with the code in expression.cs
5947         Binary.DoNumericPromotions for uint operands.
5948
5949         * attribute.cs: Revert patch from Raja, it introduced a regression
5950         while building Blam-1.2.1 (hard to isolate a test case).
5951
5952 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5953
5954         Fix for #55382
5955         * class.cs:
5956         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5957         name collision.
5958         (MethodCore.parent_method): New member. The method we're overriding
5959         if this is an override method.
5960         (MethodCore.CheckBase): Moved from Method class and made common.
5961         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5962         private.
5963         (MethodCore.CheckForDuplications): New abstract method. For custom
5964         member duplication search in a container
5965         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5966         method and its return type.
5967         (Event.conflict_symbol): New member. Symbol with same name in the
5968         parent class.
5969
5970         * decl.cs:
5971         (MemberCache.FindMemberWithSameName): New method. The method
5972         is looking for conflict with inherited symbols.
5973
5974 2004-08-04  Martin Baulig  <martin@ximian.com>
5975
5976         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5977
5978         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5979
5980 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5981
5982         * report.cs (Message): New enum for better error, warning reference in
5983         the code.
5984         (MessageData): New inner abstract class. It generally handles printing of
5985         error and warning messages.
5986         Removed unused Error, Warning, Message methods.
5987
5988 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5989
5990         Fix for cs0592-8.cs test
5991         * attribute.cs
5992         (Attributable.ValidAttributeTargets): Made public.
5993         (Attribute.ExplicitTarget): New member for explicit target value.
5994         (Attribute.CheckTargets): Now we translate explicit attribute
5995         target to Target here.
5996
5997 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5998
5999         * ecore.cs (MethodGroupExpr): new IsBase property.
6000
6001         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
6002
6003         * delegate.cs (DelegateCreation): store a MethodGroupExpr
6004         rather than an instance expr.
6005
6006         (DelegateCreation.Emit): Use the method group rather than
6007         the instance expression. Also, if you have base.Foo as the
6008         method for a delegate, make sure to emit ldftn, not ldftnvirt.
6009
6010         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
6011
6012         (NewDelegate.DoResolve): Only check for the existance of Invoke
6013         if the method is going to be needed. Use MethodGroupExpr.
6014
6015         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
6016
6017         * expression.cs: For pointer arith., make sure to use
6018         the size of the type, not the size of the pointer to
6019         the type.
6020
6021 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
6022
6023         Fix for #60722
6024         * class.cs (Class): Added error CS0502 test.
6025
6026 2004-08-03  John Luke  <jluke@cfl.rr.com>
6027             Raja R Harinath  <rharinath@novell.com>
6028
6029         Fix for #60997.
6030         * attribute.cs (Attribute.complained_before): New flag.
6031         (Attribute.ResolveType, Attribute.Resolve),
6032         (Attribute.DefinePInvokeMethod): Set it.
6033         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
6034         
6035 2004-08-03  Martin Baulig  <martin@ximian.com>
6036
6037         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
6038         use a user-defined operator; we still need to do numeric
6039         promotions in case one argument is a builtin type and the other
6040         one has an implicit conversion to that type.  Fixes #62322.
6041
6042 2004-08-02  Martin Baulig  <martin@ximian.com>
6043
6044         * statement.cs (LocalInfo.Flags): Added `IsThis'.
6045         (LocalInfo.IsThis): New public property.
6046         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
6047
6048 2004-08-01  Martin Baulig  <martin@ximian.com>
6049
6050         * class.cs (TypeContainer.GetClassBases): Don't set the default
6051         here since we may get called from GetPartialBases().
6052         (TypeContainer.DefineType): If GetClassBases() didn't return a
6053         parent, use the default one.
6054
6055 2004-07-30  Duncan Mak  <duncan@ximian.com>
6056
6057         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
6058
6059 2004-07-30  Martin Baulig  <martin@ximian.com>
6060
6061         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
6062
6063         * class.cs (SourceMethod): New public class, derive from the
6064         symbol writer's ISourceMethod.
6065         (Method): Use the new symbol writer API.
6066
6067         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
6068         as argument and use the new symbol writer.
6069
6070         * location.cs
6071         (SourceFile): Implement the symbol writer's ISourceFile.
6072         (Location.SymbolDocument): Removed.
6073         (Location.SourceFile): New public property.
6074
6075         * symbolwriter.cs: Use the new symbol writer API.
6076
6077 2004-07-30  Raja R Harinath  <rharinath@novell.com>
6078
6079         * Makefile (install-local): Remove.  Functionality moved to
6080         executable.make.
6081
6082 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
6083
6084         * Makefile: Install mcs.exe.config file together with mcs.exe.
6085         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
6086         correct runtime version.
6087         
6088 2004-07-25  Martin Baulig  <martin@ximian.com>
6089
6090         * class.cs
6091         (TypeContainer.RegisterOrder): Removed, this was unused.
6092         (TypeContainer, interface_order): Removed.
6093         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
6094         TypeContainer as argument since we can also be called with a
6095         `PartialContainer' for a partial class/struct/interface.
6096         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
6097         of checking whether we're an `Interface' - we could be a
6098         `PartialContainer'.
6099         (PartialContainer.Register): Override; call
6100         AddClass()/AddStruct()/AddInterface() on our parent.
6101
6102         * cs-parser.jay (interface_member_declaration): Add things to the
6103         `current_container', not the `current_class'.
6104
6105         * rootcontext.cs (RegisterOrder): The overloaded version which
6106         takes an `Interface' was unused, removed.
6107
6108         * typemanager.cs (TypeManager.LookupInterface): Return a
6109         `TypeContainer', not an `Interface'.
6110         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
6111         contain a `PartialContainer' for an interface, so check it's
6112         `Kind' to figure out what it is.
6113
6114 2004-07-25  Martin Baulig  <martin@ximian.com>
6115
6116         * class.cs (Class.DefaultTypeAttributes): New public constant.
6117         (Struct.DefaultTypeAttributes): Likewise.
6118         (Interface.DefaultTypeAttributes): Likewise.
6119         (PartialContainer.TypeAttr): Override this and add the
6120         DefaultTypeAttributes.
6121
6122 2004-07-25  Martin Baulig  <martin@ximian.com>
6123
6124         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
6125         we can just use the `Parent' field instead.
6126
6127 2004-07-25  Martin Baulig  <martin@ximian.com>
6128
6129         * class.cs (TypeContainer.Emit): Renamed to EmitType().
6130
6131 2004-07-25  Martin Baulig  <martin@ximian.com>
6132
6133         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
6134         our parts before defining any methods.
6135         (TypeContainer.VerifyImplements): Make this virtual.
6136         (ClassPart.VerifyImplements): Override and call VerifyImplements()
6137         on our PartialContainer.
6138
6139 2004-07-25  Martin Baulig  <martin@ximian.com>
6140
6141         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
6142
6143         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
6144         argument, we can just use the `Parent' field instead.
6145
6146         * class.cs
6147         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
6148         (MemberBase.DoDefine): Likewise.
6149
6150 2004-07-24  Martin Baulig  <martin@ximian.com>
6151
6152         * decl.cs (MemberCore.Parent): New public field.
6153         (DeclSpace.Parent): Moved to MemberCore.
6154
6155         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
6156         (MemberBase.ctor): Added TypeContainer argument, pass it to our
6157         parent's .ctor.
6158         (FieldBase, Field, Operator): Likewise.
6159         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
6160         (EventField, Event): Likewise.
6161
6162 2004-07-23  Martin Baulig  <martin@ximian.com>
6163
6164         * class.cs (PartialContainer): New public class.
6165         (ClassPart): New public class.
6166         (TypeContainer): Added support for partial classes.
6167         (TypeContainer.GetClassBases): Splitted some of the functionality
6168         out into GetNormalBases() and GetPartialBases().
6169
6170         * cs-tokenizer.cs (Token.PARTIAL): New token.
6171         (Tokenizer.consume_identifier): Added some hacks to recognize
6172         `partial', but only if it's immediately followed by `class',
6173         `struct' or `interface'.
6174
6175         * cs-parser.jay: Added support for partial clases.
6176
6177 2004-07-23  Martin Baulig  <martin@ximian.com>
6178
6179         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
6180         a `DeclSpace' and also made it readonly.
6181         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
6182         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
6183         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
6184
6185         * cs-parser.jay: Pass the `current_class', not the
6186         `current_container' (at the moment, this is still the same thing)
6187         to a new Method, Property, Event, Indexer or Constructor.
6188
6189 2004-07-23  Martin Baulig  <martin@ximian.com>
6190
6191         * cs-parser.jay (CSharpParser): Added a new `current_class' field
6192         and removed the `current_interface' one.
6193         (struct_declaration, class_declaration, interface_declaration):
6194         Set `current_class' to the newly created class/struct/interface;
6195         set their `Bases' and call Register() before parsing their body.
6196
6197 2004-07-23  Martin Baulig  <martin@ximian.com>
6198
6199         * class.cs (Kind): New public enum.
6200         (TypeContainer): Made this class abstract.
6201         (TypeContainer.Kind): New public readonly field.
6202         (TypeContainer.CheckDef): New public method; moved here from
6203         cs-parser.jay.
6204         (TypeContainer.Register): New public abstract method.
6205         (TypeContainer.GetPendingImplementations): New public abstract
6206         method.
6207         (TypeContainer.GetClassBases): Removed the `is_class' and
6208         `is_iface' parameters.
6209         (TypeContainer.DefineNestedTypes): Formerly known as
6210         DoDefineType().
6211         (ClassOrStruct): Made this class abstract.
6212
6213         * tree.cs (RootTypes): New public type. 
6214
6215 2004-07-20  Martin Baulig  <martin@ximian.com>
6216
6217         * tree.cs (Tree.RecordNamespace): Removed.
6218         (Tree.Namespaces): Removed.
6219
6220         * rootcontext.cs (RootContext.IsNamespace): Removed.
6221
6222         * cs-parser.jay (namespace_declaration): Just create a new
6223         NamespaceEntry here.
6224
6225 2004-07-20  Martin Baulig  <martin@ximian.com>
6226
6227         * statement.cs (ExceptionStatement): New abstract class.  This is
6228         now used as a base class for everyone who's using `finally'.
6229         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
6230         our local variables before using them.
6231
6232         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
6233         virtual method.  This is used by Yield.Resolve() to "steal" an
6234         outer block's `finally' clauses.
6235         (FlowBranchingException): The .ctor now takes an ExceptionStatement
6236         argument.
6237
6238         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
6239         version which takes an ExceptionStatement.  This version must be
6240         used to create exception branchings.
6241
6242         * iterator.cs
6243         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
6244         (Iterator.EmitMoveNext): Added exception support; protect the
6245         block with a `fault' clause, properly handle 'finally' clauses.
6246         (Iterator.EmitDispose): Run all the `finally' clauses here.
6247
6248 2004-07-20  Martin Baulig  <martin@ximian.com>
6249
6250         * iterator.cs: This is the first of a set of changes in the
6251         iterator code.  Match the spec more closely: if we're an
6252         IEnumerable, then GetEnumerator() must be called.  The first time
6253         GetEnumerator() is called, it returns the current instance; all
6254         subsequent invocations (if any) must create a copy.
6255
6256 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
6257
6258         * expression.cs: Resolve the constant expression before returning
6259         it. 
6260
6261 2004-07-19  Martin Baulig  <martin@ximian.com>
6262
6263         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
6264         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
6265         the return type of the new EmitContext.
6266
6267 2004-07-18  Martin Baulig  <martin@ximian.com>
6268
6269         * class.cs (Property.Define): Fix iterators.
6270
6271         * iterators.cs (Iterator.Define): Moved the
6272         `container.AddInterator (this)' call here from the .ctor; only do
6273         it if we resolved successfully.
6274
6275 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
6276
6277         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
6278         `true' for preprocessing directives that we parse.  The return
6279         value indicates whether we should return to regular tokenizing or
6280         not, not whether it was parsed successfully.
6281
6282         In the past if we were in: #if false ... #line #endif, we would
6283         resume parsing after `#line'.  See bug 61604.
6284
6285         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
6286         building: IsEnumType should return true only for enums, not for
6287         enums or System.Enum itself.  This fixes #61593.
6288
6289         Likely what happened is that corlib was wrong: mcs depended on
6290         this bug in some places.  The bug got fixed, we had to add the
6291         hack, which caused bug 61593.
6292
6293         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
6294         that was a workaround for the older conditions.
6295
6296 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
6297
6298         * assign.cs: IAssignMethod has a new interface, as documented
6299         inline. All assignment code now uses this new api.
6300
6301         * ecore.cs, expression.cs: All classes which implement
6302         IAssignMethod now use the new interface.
6303
6304         * expression.cs (Invocation): add a hack to EmitCall so that
6305         IndexerAccess can be the target of a compound assignment without
6306         evaluating its arguments twice.
6307
6308         * statement.cs: Handle changes in Invocation api.
6309
6310 2004-07-16  Martin Baulig  <martin@ximian.com>
6311
6312         * iterators.cs: Rewrote this.  We're now using one single Proxy
6313         class for both the IEnumerable and the IEnumerator interface and
6314         `Iterator' derives from Class so we can use the high-level API.
6315
6316         * class.cs (TypeContainer.AddIterator): New method.
6317         (TypeContainer.DoDefineType): New protected virtual method, which
6318         is called from DefineType().
6319         (TypeContainer.DoDefineMembers): Call DefineType() and
6320         DefineMembers() on all our iterators.
6321         (TypeContainer.Emit): Call Emit() on all our iterators.
6322         (TypeContainer.CloseType): Call CloseType() on all our iterators.
6323
6324         * codegen.cs (EmitContext.CurrentIterator): New public field.
6325
6326 2004-07-15  Martin Baulig  <martin@ximian.com>
6327
6328         * typemanager.cs
6329         (TypeManager.not_supported_exception_type): New type.   
6330
6331 2004-07-14  Martin Baulig  <martin@ximian.com>
6332
6333         * iterators.cs: Use real error numbers.
6334
6335 2004-07-14  Martin Baulig  <martin@ximian.com>
6336
6337         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
6338         requires this to be a System.Collection.IEnumerable and not a
6339         class implementing that interface.
6340         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
6341
6342 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * class.cs: Fixed previous fix, it broke some error tests.
6345
6346 2004-07-12  Martin Baulig  <martin@ximian.com>
6347
6348         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
6349         Fixes #61293.
6350
6351 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6352
6353         * assign.cs (LocalTemporary): Add new argument: is_address,If
6354         `is_address' is true, then the value that we store is the address
6355         to the real value, and not the value itself.
6356         
6357         * ecore.cs (PropertyExpr): use the new local temporary
6358         stuff to allow us to handle X.Y += z (where X is a struct)
6359
6360 2004-07-08  Martin Baulig  <martin@ximian.com>
6361
6362         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6363         not always return, just like we're doing in Using.Resolve().
6364
6365 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6366
6367         * cs-parser.jay (fixed_statement): flag this as Pinned.
6368
6369 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6370
6371         * typemanager.cs (TypeManager): Removed MakePinned method, this
6372         mechanism is replaced with the .NET 2.x compatible mechanism of
6373         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6374
6375         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6376         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6377         `IsFixed' property which has a different meaning.
6378
6379 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6380
6381         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6382         visible from inside a nested class, not just the names of the
6383         immediately enclosing class.
6384         Fix for bug #60730.
6385
6386 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6387
6388         * expression.cs (BetterConversion): Remove buggy special-case
6389         handling of "implicit constant expression conversions".  At this
6390         point, we already know that the conversion is possible -- we're
6391         only checking to see which is better.
6392
6393 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * cs-parser.jay: Added error CS0210 test.
6396
6397 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6398
6399         * cs-parser.jay: Added error CS0134 test.
6400
6401 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6402
6403         Fix bug #52507
6404         * cs-parser.jay: Added error CS0145 test.
6405
6406 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6407
6408         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6409
6410 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6411         
6412         * expression.cs (StackAlloc.Resolve): The argument may not
6413         be a constant; deal with this case.
6414         
6415 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6416
6417         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6418         GetIndexerAttributeValue.
6419         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6420
6421         * class.cs (Indexer.Define): Added error tests for CS0415,
6422         CS0609.
6423
6424 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6425
6426         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6427         property code.
6428
6429 2004-06-23  Martin Baulig  <martin@ximian.com>
6430
6431         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6432         neither return nor throw, reset the barrier as well.  Fixes #60457.
6433
6434 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6435
6436         * class.cs : EventAttributes is now set to None by default.
6437           This fixes bug #60459.
6438
6439 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6440
6441         Fix bug #60219
6442         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6443         Don't throw exception but return null (it's sufficient now).
6444
6445 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6446
6447         * typemanager.cs (GetArgumentTypes): Faster implementation.
6448
6449 2004-06-18  Martin Baulig  <martin@ximian.com>
6450
6451         * attribute.cs (Attribute.Resolve): Check whether we're an
6452         EmptyCast which a Constant child.  Fixes #60333.
6453
6454 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6455
6456         * statement.cs (EmitCollectionForeach): Account for the fact that
6457         not all valuetypes are in areas which we can take the address of.
6458         For these variables, we store to a temporary variable. Also, make
6459         sure that we dont emit a `callvirt' on a valuetype method.
6460
6461 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6462
6463         * expression.cs (StackAlloc.DoReSolve): Added test for
6464         negative parameter (CS0247).
6465
6466 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6467
6468         Fix bug #59792
6469         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6470
6471 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6472
6473         Fix bug #59781
6474         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6475         ulong.
6476
6477 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6478
6479         Fix bug #58254 & cs1555.cs, cs1556.cs
6480         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6481
6482 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6483
6484         * cs-parser.jay: Added error CS1669 test for indexers.
6485
6486 2004-06-11  Martin Baulig  <martin@ximian.com>
6487
6488         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6489         call this twice: for params and varargs methods.
6490
6491 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6492
6493         * class.cs:
6494         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6495
6496 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6497
6498         * attribute.cs (Attribute.GetValidTargets): Made public.
6499
6500         * class.cs: 
6501         (AbstractPropertyEventMethod): New class for better code sharing.
6502         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6503         CS1667 report.
6504         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6505
6506 2004-06-11  Raja R Harinath  <rharinath@novell.com>
6507
6508         Fix bug #59477.
6509         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
6510         that the call to Resolve is part of a MemberAccess.
6511         (Expression.Resolve): Use it for SimpleName resolution.
6512         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
6513         Add 'intermediate' boolean argument.
6514         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
6515         error message when the SimpleName can be resolved ambiguously
6516         between an expression and a type.
6517         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
6518         public.
6519         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
6520         call on the left-side.
6521
6522 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6523
6524         * class.cs:
6525         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
6526
6527 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6528
6529         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
6530
6531 2004-06-11  Martin Baulig  <martin@ximian.com>
6532
6533         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
6534         varargs methods if applicable.
6535
6536 2004-06-11  Martin Baulig  <martin@ximian.com>
6537
6538         * expression.cs (Invocation.EmitCall): Don't use
6539         `method.CallingConvention == CallingConventions.VarArgs' since the
6540         method could also have `CallingConventions.HasThis'.
6541
6542 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6543
6544         * class.cs (Event.GetSignatureForError): Implemented.
6545         Fixed crash in error test cs3010.cs
6546
6547 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
6548
6549         * cs-tokenizer.cs: Change the way we track __arglist to be
6550         consistent with the other keywords.
6551
6552 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
6553
6554         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
6555         tomorrow.
6556
6557 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
6558
6559         * codegen.cs: Check that all referenced assemblies have a strongname
6560         before strongnaming the compiled assembly. If not report error CS1577.
6561         Fix bug #56563. Patch by Jackson Harper.
6562         * typemanager.cs: Added a method to return all referenced assemblies.
6563         Fix bug #56563. Patch by Jackson Harper.
6564
6565 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * class.cs:
6568         (Method.ApplyAttributeBuilder): Moved and added conditional
6569         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
6570
6571         * delegate.cs:
6572         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
6573
6574 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
6575
6576         Fixed #59640
6577         * class.cs: (EventField.attribute_targets): Changed default target.
6578
6579 2004-06-08  Martin Baulig  <martin@ximian.com>
6580
6581         * expression.cs (Invocation.EmitCall): Enable varargs methods.
6582
6583 2004-06-08  Martin Baulig  <martin@ximian.com>
6584
6585         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
6586
6587 2004-06-07  Martin Baulig  <martin@ximian.com>
6588
6589         Added support for varargs methods.
6590
6591         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
6592         keyword.
6593
6594         * cs-parser.jay: Added support for `__arglist'.
6595
6596         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
6597
6598         * expression.cs (Argument.AType): Added `ArgList'.
6599         (Invocation): Added support for varargs methods.
6600         (ArglistAccess): New public class.
6601         (Arglist): New public class.
6602
6603         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
6604
6605         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
6606         a method's top-level block if the method has varargs.
6607
6608         * support.cs (ReflectionParameters, InternalParameters): Added
6609         support for varargs methods.    
6610
6611 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * class.cs: Provide location in indexer error report.
6614
6615         * driver.cs: Use standard names.
6616
6617         * namespace.cs: Catch the use of using after a namespace has been
6618         declared also on using aliases.
6619
6620 2004-06-03  Raja R Harinath  <rharinath@novell.com>
6621
6622         Bug #50820.
6623         * typemanager.cs (closure_private_ok, closure_invocation_type)
6624         (closure_qualifier_type, closure_invocation_assembly)
6625         (FilterWithClosure): Move to ...
6626         (Closure): New internal nested class.
6627         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
6628         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
6629         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
6630         (MemberLookup, MemberLookupFailed): Use it.
6631         * expression.cs (New.DoResolve): Treat the lookup for the
6632         constructor as being qualified by the 'new'ed type.
6633         (Indexers.GetIndexersForTypeOrInterface): Update.
6634
6635 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
6636
6637         * attribute.cs
6638         (GetConditionalAttributeValue): New method. Returns
6639         condition of ConditionalAttribute.
6640         (SearchMulti): New method.  Returns all attributes of type 't'.
6641         Use it when attribute is AllowMultiple = true.
6642         (IsConditionalMethodExcluded): New method.
6643
6644         * class.cs
6645         (Method.IsExcluded): Implemented. Returns true if method has conditional
6646         attribute and the conditions is not defined (method is excluded).
6647         (IMethodData): Extended interface for ConditionalAttribute support.
6648         (PropertyMethod.IsExcluded): Implemented.
6649
6650         * decl.cs
6651         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
6652
6653         * expression.cs
6654         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
6655         on the method.
6656
6657 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6658
6659         * expression.cs (ArrayCreationExpression): Make this just an
6660         `expression'. It can't be a statement, so the code here was
6661         dead.
6662
6663 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6664
6665         Fixed #59072
6666         * typemanager.cs (GetFullNameSignature): New method for
6667         MethodBase types.
6668
6669 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
6670
6671         Fixed #56452
6672         * class.cs (MemberBase.GetSignatureForError): New virtual method.
6673         Use this method when MethodBuilder is null.
6674         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
6675         Added test for error CS0626 (MONO reports error for this situation).
6676         (IMethodData.GetSignatureForError): Extended interface.
6677
6678 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6679
6680         * attribute.cs
6681         (AttributeTester.GetObsoleteAttribute): Returns instance of
6682         ObsoleteAttribute when type is obsolete.
6683
6684         * class.cs
6685         (TypeContainer.VerifyObsoleteAttribute): Override.
6686         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6687         (MethodCode.VerifyObsoleteAttribute): Override.
6688         (MemberBase.VerifyObsoleteAttribute): Override.
6689
6690         * decl.cs
6691         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6692         and report proper error.
6693
6694         *delegate.cs
6695         Delegate.VerifyObsoleteAttribute): Override.
6696
6697         * ecore.cs
6698         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6699         and report proper error.
6700         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6701
6702         * enum.cs
6703         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6704         and enum member.
6705
6706         * expression.cs
6707         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6708         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6709         Added test for ObsoleteAttribute.
6710
6711         * statement.cs
6712         (Catch): Derived from Statement.
6713
6714 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
6715  
6716         Fixed bug #59071 & cs0160.cs
6717  
6718         * statement.cs (Try.Resolve): Check here whether order of catch
6719         clauses matches their dependencies.
6720
6721 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
6722
6723         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
6724         caused a regression: #59343.  Referencing nested classes from an
6725         assembly stopped working.
6726
6727 2004-05-31  Martin Baulig  <martin@ximian.com>
6728
6729         MCS is now frozen for beta 2.
6730
6731 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6732
6733         * convert.cs: add a trivial cache for overload operator resolution.
6734
6735 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6736
6737         * decl.cs: If possible, use lookuptypedirect here. We can only do
6738         this if there is no `.' after the namespace. Avoids using
6739         LookupType, which does lots of slow processing.
6740         (FindNestedType) New method, does what it says :-).
6741         * namespace.cs: use LookupTypeDirect.
6742         * rootcontext.cs: use membercache, if possible.
6743         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6744
6745 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6746
6747         * expression.cs:
6748         According to the spec, 
6749
6750         In a member access of the form E.I, if E is a single identifier,
6751         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6752         field, property, localvariable, or parameter with the same type as
6753         the meaning of E as a type-name (§3.8), then both possible
6754         meanings of E are permitted.
6755
6756         We did not check that E as a simple-name had the same type as E as
6757         a type name.
6758
6759         This trivial check gives us 5-7% on bootstrap time.
6760
6761 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6762
6763         * expression.cs (Invocation.OverloadResolve): Avoid the
6764         use of hashtables and boxing here by allocating on demand.
6765
6766 2004-05-30  Martin Baulig  <martin@ximian.com>
6767
6768         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6769         we're doing a silent lookup.  Don't try to lookup nested types in
6770         TypeManager.object_type (thanks to Ben Maurer).
6771
6772 2004-05-30  Martin Baulig  <martin@ximian.com>
6773
6774         Committing a patch from Ben Maurer.
6775
6776         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6777
6778 2004-05-29  Martin Baulig  <martin@ximian.com>
6779
6780         * class.cs (IMethodData.ShouldIgnore): New method.
6781
6782         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6783         `Location' argument, we don't need it anywhere.  Use
6784         `IMethodData.ShouldIgnore ()' instead of
6785         `MethodData.GetMethodFlags ()'.
6786         (TypeManager.AddMethod): Removed.
6787         (TypeManager.AddMethod2): Renamed to AddMethod.
6788
6789 2004-05-29  Martin Baulig  <martin@ximian.com>
6790
6791         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6792
6793         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6794         converting from a class type S to an interface type and we already
6795         have an object on the stack, don't box it again.  Fixes #52578.
6796
6797 2004-05-29  Martin Baulig  <martin@ximian.com>
6798
6799         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6800         Added support for `params' parameters.  Fixes #59267.
6801
6802 2004-05-29  Martin Baulig  <martin@ximian.com>
6803
6804         * literal.cs (NullPointer): Provide a private .ctor which sets
6805         `type' to TypeManager.object_type.  Fixes #59048.
6806
6807 2004-05-29  Martin Baulig  <martin@ximian.com>
6808
6809         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6810         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6811
6812         * ecore.cs (EventExpr.instance_expr): Make the field private.
6813
6814 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6815
6816         Fixed bug #50080 & cs0214-2.cs
6817         * expression.cs (Cast.DoResolve): Check unsafe context here.
6818         
6819         * statement.cs (Resolve.DoResolve): Likewise.
6820
6821 2004-05-26  Martin Baulig  <martin@ximian.com>
6822
6823         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6824
6825         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6826         (RootContext.LookupType): Pass down the `silent' flag.
6827
6828 2004-05-25  Martin Baulig  <martin@ximian.com>
6829
6830         * expression.cs
6831         (MethodGroupExpr.IdenticalTypeName): New public property.
6832         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6833         expression actually refers to a type.
6834
6835 2004-05-25  Martin Baulig  <martin@ximian.com>
6836
6837         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6838         for #56176 and made it actually work.
6839
6840 2004-05-25  Martin Baulig  <martin@ximian.com>
6841
6842         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6843         (FieldExpr, PropertyExpr): Override and implement
6844         CacheTemporaries.  Fixes #52279.
6845
6846 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6847
6848         * location.cs: In the new compiler listing a file twice is a
6849         warning, not an error.
6850
6851 2004-05-24  Martin Baulig  <martin@ximian.com>
6852
6853         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6854         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6855
6856 2004-05-24  Martin Baulig  <martin@ximian.com>
6857
6858         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6859         walking the `using' list.  Fixes #53921.
6860
6861 2004-05-24  Martin Baulig  <martin@ximian.com>
6862
6863         * const.cs (Const.LookupConstantValue): Added support for
6864         EmptyCast's; fixes #55251.
6865
6866 2004-05-24  Martin Baulig  <martin@ximian.com>
6867
6868         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6869         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6870         which does the CS0135 check.  The reason is that we first need to
6871         check whether the variable actually exists.
6872
6873 2004-05-24  Martin Baulig  <martin@ximian.com>
6874
6875         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6876         than RootContext.LookupType() to find the explicit interface
6877         type.  Fixes #58584.
6878
6879 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6880
6881         * Makefile: Simplify.  Use executable.make.
6882         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6883
6884 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6885
6886         * decl.cs:
6887         * enum.cs:
6888         Use the invariant culture when doing String.Compare for CLS case
6889         sensitivity.
6890         
6891 2004-05-23  Martin Baulig  <martin@ximian.com>
6892
6893         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6894         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6895
6896         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6897         
6898 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6899
6900         * class.cs (MemberBase.Define): Reuse MemberType member for 
6901         resolved type. Other methods can use it too.
6902
6903 2004-05-23  Martin Baulig  <martin@ximian.com>
6904
6905         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6906         the variable also exists in the current block (otherwise, we need
6907         to report a CS0103).  Fixes #58670.
6908
6909 2004-05-23  Martin Baulig  <martin@ximian.com>
6910
6911         * flowanalysis.cs (Reachability.Reachable): Compute this
6912         on-the-fly rather than storing it as a field.
6913
6914 2004-05-23  Martin Baulig  <martin@ximian.com>
6915
6916         * flowanalysis.cs (Reachability.And): Manually compute the
6917         resulting `barrier' from the reachability.      
6918        
6919 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6920
6921         Fix bug #57835
6922         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6923         instance of ObsoleteAttribute when symbol is obsolete.
6924
6925         * class.cs
6926         (IMethodData): Extended interface for ObsoleteAttribute support.
6927
6928 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6929
6930         * attribute.cs: Fix bug #55970
6931
6932 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6933
6934         Fix bug #52705
6935         * attribute.cs
6936         (GetObsoleteAttribute): New method. Creates the instance of
6937         ObsoleteAttribute.
6938         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6939         ObsoleteAttribute when member is obsolete.
6940         (AttributeTester.Report_ObsoleteMessage): Common method for
6941         Obsolete error/warning reporting.
6942
6943         * class.cs
6944         (TypeContainer.base_classs_type): New member for storing parent type.
6945
6946         * decl.cs
6947         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6948         for this MemberCore.
6949
6950 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6951
6952         * attribute.cs, const.cs: Fix bug #58590
6953
6954 2004-05-21  Martin Baulig  <martin@ximian.com>
6955
6956         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6957         out parameters if the end of the method is unreachable.  Fixes
6958         #58098. 
6959
6960 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6961
6962         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6963         Hari was right, why extra method.
6964
6965 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6966
6967         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6968
6969 2004-05-20  Martin Baulig  <martin@ximian.com>
6970
6971         Merged this back from gmcs to keep the differences to a minumum.
6972
6973         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
6974         instead of a Declspace.
6975         (Attribute.ResolveType): Likewise.
6976         (Attributes.Search): Likewise.
6977         (Attributes.Contains): Likewise.
6978         (Attributes.GetClsCompliantAttribute): Likewise.
6979
6980         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
6981         argument.
6982         (MethodData.ApplyAttributes): Take an EmitContext instead of a
6983         DeclSpace.
6984
6985 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6986
6987         Fix bug #58688 (MCS does not report error when the same attribute
6988         is assigned twice)
6989
6990         * attribute.cs (Attribute.Emit): Distinction between null and default.
6991
6992 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6993
6994         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6995         of a top-level attribute without an attribute target.
6996         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6997         Make non-static.
6998         (Attribute.Conditional_GetConditionName), 
6999         (Attribute.Obsolete_GetObsoleteMessage): Update.
7000         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
7001         part of ScanForIndexerName.
7002         (Attribute.CanIgnoreInvalidAttribute): New function.
7003         (Attribute.ScanForIndexerName): Move to ...
7004         (Attributes.ScanForIndexerName): ... here.
7005         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
7006         (Attributes.Search): New internal variant that can choose not to
7007         complain if types aren't resolved.  The original signature now
7008         complains.
7009         (Attributes.GetClsCompliantAttribute): Use internal variant, with
7010         complaints suppressed.
7011         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
7012         only if it not useful.
7013         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
7014         top-level for attributes that are shared between the assembly
7015         and a top-level class.
7016         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
7017         * class.cs: Update to reflect changes.
7018         (DefineIndexers): Fuse loops.
7019         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
7020         a couple more variants of attribute names.
7021
7022 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
7023
7024         Fix bug #52585 (Implemented explicit attribute declaration)
7025
7026         * attribute.cs:
7027         (Attributable.ValidAttributeTargets): New abstract method. It gets
7028         list of valid attribute targets for explicit target declaration.
7029         (Attribute.Target): It holds target itself.
7030         (AttributeSection): Removed.
7031         (Attribute.CheckTargets): New method. It checks whether attribute
7032         target is valid for the current element.
7033
7034         * class.cs:
7035         (EventProperty): New class. For events that are declared like
7036         property (with add and remove accessors).
7037         (EventField): New class. For events that are declared like field.
7038         class.cs
7039
7040         * cs-parser.jay: Implemented explicit attribute target declaration.
7041
7042         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
7043         Override ValidAttributeTargets.
7044
7045         * parameter.cs:
7046         (ReturnParameter): Class for applying custom attributes on 
7047         the return type.
7048         (ParameterAtribute): New class. Class for applying custom
7049         attributes on the parameter type.
7050
7051 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
7052
7053         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
7054         definitions. 
7055
7056         (Method): Allow UNSAFE here.
7057
7058         * modifiers.cs: Support unsafe reporting.
7059
7060 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
7061
7062         * decl.cs: Fix bug #58478.
7063
7064 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7065
7066         * statement.cs: When checking for unreachable code on an EmptyStatement,
7067         set the location. Fixes bug #58488.
7068
7069 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
7070
7071         * driver.cs: Add -pkg handling.
7072
7073         From Gonzalo: UseShelLExecute=false
7074
7075 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
7076
7077         * attribute.cs:
7078         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
7079         for attribute.
7080         (Attribute.IsClsCompliaceRequired): Moved to base for better
7081         accesibility.
7082         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
7083         when attribute is AttributeUsageAttribute.
7084         (Attribute.GetValidTargets): Simplified.
7085         (Attribute.GetAttributeUsage): New method returns AttributeUsage
7086         attribute for this type.
7087         (Attribute.ApplyAttributes): Method renamed to Emit and make
7088         non-static.
7089         (GlobalAttributeSection): New class for special handling of global
7090         attributes (assembly, module).
7091         (AttributeSection.Emit): New method.
7092
7093         * class.cs: Implemented Attributable abstract methods.
7094         (MethodCore.LabelParameters): Moved to Parameter class.
7095         (Accessor): Is back simple class.
7096         (PropertyMethod): Implemented Attributable abstract class.
7097         (DelegateMethod): Implemented Attributable abstract class.
7098         (Event): New constructor for disctintion between normal Event
7099         and Event with accessors.
7100
7101         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
7102
7103         * codegen.cs, const.cs, decl.cs, delegate.cs:
7104         (CommonAssemblyModulClass): Implemented Attributable abstract class
7105         and simplified.
7106
7107         * enum.cs: Implement IAttributeSupport interface.
7108         (EnumMember): New class for emum members. Implemented Attributable
7109         abstract class
7110
7111         * parameter.cs:
7112         (ParameterBase): Is abstract.
7113         (ReturnParameter): New class for easier [return:] attribute handling.
7114
7115         * typemanager.cs: Removed builder_to_attr.
7116
7117 2004-05-11  Raja R Harinath  <rharinath@novell.com>
7118
7119         Fix bug #57151.
7120         * attribute.cs (Attribute.GetPositionalValue): New function.
7121         * class.cs (TypeContainer.VerifyMembers): New function.
7122         (TypeContainer.Emit): Use it.
7123         (ClassOrStruct): New base class for Class and Struct.
7124         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
7125         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
7126         class.
7127         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
7128         then each non-static field should have a FieldOffset attribute.
7129         Otherwise, none of the fields should have a FieldOffset attribute.
7130         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
7131         and FieldOffset attributes.
7132         * typemanager.cs (TypeManager.struct_layout_attribute_type)
7133         (TypeManager.field_offset_attribute_type): New core types.
7134         (TypeManager.InitCoreTypes): Initialize them.
7135
7136 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
7137
7138         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
7139         Return correct type.
7140         From bug #58270.
7141
7142 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
7143
7144         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
7145         be implicitly converted to ulong.
7146         
7147         * expression.cs: The logic for allowing operator &, | and ^ worked
7148         was wrong, it worked before because we did not report an error in
7149         an else branch.  Fixes 57895.
7150
7151         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
7152         allow volatile fields to be reference types.
7153
7154 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
7155
7156         * driver.cs: Add support for /debug-
7157
7158 2004-05-07  Raja R Harinath  <rharinath@novell.com>
7159
7160         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
7161         Add a 'complain' parameter to silence errors.
7162         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
7163         silently overlooked type-resolutions.
7164         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
7165         to reflect changes.
7166         (Attributes.Search): New function.
7167         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
7168         (Attributes.GetAttributeFullName): Remove hack.
7169         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
7170         Update to reflect changes.
7171         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7172         Use Attributes.Search instead of nested loops.
7173
7174 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
7175
7176         * decl.cs:
7177         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
7178         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
7179         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
7180
7181         * report.cs: (Report.Warning): Renamed to Warning_T because of
7182         parameter collision.
7183
7184 2004-05-05  Raja R Harinath  <rharinath@novell.com>
7185
7186         * expression.cs (MemberAccess.ResolveMemberAccess):
7187         Exit with non-zero status after Report.Error.
7188         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
7189         Likewise.
7190         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
7191
7192 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7193
7194         * support.cs: Don't hang when the file is empty.
7195
7196 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
7197
7198         * support.cs: In SeekableStreamReader, compute the preamble size of the
7199           underlying stream. Position changes should take into account that initial
7200           count of bytes.
7201
7202 2004-05-03  Todd Berman  <tberman@sevenl.net>
7203
7204         * driver.cs: remove unused GetSysVersion function.
7205
7206 2004-05-03  Todd Berman  <tberman@sevenl.net>
7207
7208         * driver.cs: Remove the hack from saturday, as well as the hack
7209         from jackson (LoadAssemblyFromGac), also adds the CWD to the
7210         link_paths to get that bit proper.
7211
7212 2004-05-01  Todd Berman  <tberman@sevenl.net>
7213
7214         * driver.cs: Try a LoadFrom before a Load, this checks the current
7215         path. This is currently a bug in mono that is be fixed, however, this
7216         provides a workaround for now. This will be removed when the bug
7217         is fixed.
7218
7219 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
7220
7221         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7222         incomplete key pairs (#57941).
7223
7224 2004-05-01  Todd Berman  <tberman@sevenl.net>
7225
7226         * driver.cs: Remove '.' from path_chars, now System.* loads properly
7227         from the GAC
7228
7229 2004-04-30  Jackson Harper  <jackson@ximian.com>
7230
7231         * codegen.cs: Open keys readonly.
7232         
7233 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7234
7235         * typemanager.cs: don't report cyclic struct layout when a struct
7236         contains 2 or more fields of the same type. Failed for Pango.AttrShape
7237         which has 2 Pango.Rectangle fields.
7238
7239 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7240
7241         * expression.cs: Handle IntPtr comparisons with IL code
7242         rather than a method call.
7243
7244 2004-04-29  Martin Baulig  <martin@ximian.com>
7245
7246         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
7247         the list of PropertyInfo's in class hierarchy and find the
7248         accessor.  Fixes #56013.
7249
7250 2004-04-29  Martin Baulig  <martin@ximian.com>
7251
7252         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
7253
7254 2004-04-29  Martin Baulig  <martin@ximian.com>
7255
7256         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7257
7258         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
7259
7260 2004-04-29  Martin Baulig  <martin@ximian.com>
7261
7262         * class.cs (ConstructorInitializer.Resolve): Check whether the
7263         parent .ctor is accessible.  Fixes #52146.
7264
7265 2004-04-29  Martin Baulig  <martin@ximian.com>
7266
7267         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
7268
7269         * statement.cs (Using.EmitLocalVariableDecls): Use
7270         TypeManager.idisposable_type, not typeof (IDisposable).
7271         (Foreach.EmitCollectionForeach): Added support for valuetypes.
7272
7273 2004-04-29  Martin Baulig  <martin@ximian.com>
7274
7275         * class.cs (Event.Define): Don't emit the field and don't set
7276         RTSpecialName and SpecialName for events on interfaces.  Fixes
7277         #57703. 
7278
7279 2004-04-29  Raja R Harinath  <rharinath@novell.com>
7280
7281         Refactor Attribute.ApplyAttributes.
7282         * attribute.cs (Attributable): New base class for objects that can
7283         have Attributes applied on them.
7284         (Attribute): Make AttributeUsage fields public.
7285         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
7286         (Attribute.IsInternalCall): New property.
7287         (Attribute.UsageAttr): Convert to a public read-only property.
7288         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
7289         (Attribute.ResolveType, Attribute.Resolve)
7290         (Attribute.ScanForIndexerName): Update to reflect changes.
7291         (Attribute.CheckAttributeTarget): Re-format.
7292         (Attribute.ApplyAttributes): Refactor, to various
7293         Attributable.ApplyAttributeBuilder methods.
7294         * decl.cs (MemberCore): Make Attributable.
7295         * class.cs (Accessor): Make Attributable.
7296         (MethodData.ApplyAttributes): Use proper attribute types, not
7297         attribute names.
7298         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
7299         (TypeContainer.ApplyAttributeBuilder)
7300         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
7301         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
7302         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
7303         (Operator.ApplyAttributeBuilder): New factored-out methods.
7304         * const.cs (Const.ApplyAttributeBuilder): Likewise.
7305         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
7306         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
7307         * parameter.cs (ParameterBase): New Attributable base class
7308         that can also represent Return types.
7309         (Parameter): Update to the changes.
7310
7311 2004-04-29  Jackson Harper  <jackson@ximian.com>
7312
7313         * driver.cs: Prefer the corlib system version when looking for
7314         assemblies in the GAC. This is still a hack, but its a better hack
7315         now.
7316         
7317 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
7318
7319         * decl.cs, enum.cs: Improved error 3005 reporting.
7320   
7321         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
7322         (related_symbols): New private member for list of symbols
7323         related to reported error/warning.
7324         
7325         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
7326
7327 2004-04-29  Martin Baulig  <martin@ximian.com>
7328
7329         * ecore.cs (Expression.Constantify): If we're an enum and
7330         TypeManager.TypeToCoreType() doesn't give us another type, use
7331         t.UnderlyingSystemType.  Fixes #56178.  
7332
7333 2004-04-29  Martin Baulig  <martin@ximian.com>
7334
7335         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
7336         interfaces and for each interface, only add members directly
7337         declared in that interface.  Fixes #53255.
7338
7339 2004-04-28  Martin Baulig  <martin@ximian.com>
7340
7341         * expression.cs (ConditionalLogicalOperator): Use a temporary
7342         variable for `left' to avoid that we evaluate it more than once;
7343         bug #52588.
7344
7345 2004-04-28  Martin Baulig  <martin@ximian.com>
7346
7347         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
7348         `void[]' (CS1547).
7349
7350 2004-04-28  Martin Baulig  <martin@ximian.com>
7351
7352         * statement.cs (LocalInfo.Resolve): Check whether the type is not
7353         void (CS1547).
7354
7355         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
7356         whether the type is not void (CS1547).
7357
7358 2004-04-28  Martin Baulig  <martin@ximian.com>
7359
7360         * expression.cs (Unary.DoResolveLValue): Override this and report
7361         CS0131 for anything but Operator.Indirection.
7362
7363 2004-04-28  Martin Baulig  <martin@ximian.com>
7364
7365         Committing a patch from Ben Maurer; see bug #50820.
7366
7367         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7368         check for classes.
7369
7370         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7371         classes.        
7372
7373 2004-04-28  Martin Baulig  <martin@ximian.com>
7374
7375         Committing a patch from Ben Maurer; see bug #50820.
7376
7377         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
7378         check for classes.
7379
7380         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
7381         classes.        
7382
7383 2004-04-28  Martin Baulig  <martin@ximian.com>
7384
7385         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
7386         (Block.AddLabel): Call DoLookupLabel() to only search in the
7387         current block.
7388
7389 2004-04-28  Martin Baulig  <martin@ximian.com>
7390
7391         * cfold.cs (ConstantFold.BinaryFold): Added special support for
7392         comparing StringConstants and NullLiterals in Equality and Inequality.
7393
7394 2004-04-28  Jackson Harper  <jackson@ximian.com>
7395
7396         * driver.cs: Attempt to load referenced assemblies from the
7397         GAC. This is the quick and dirty version of this method that
7398         doesnt take into account versions and just takes the first
7399         canidate found. Will be good enough for now as we will not have more
7400         then one version installed into the GAC until I update this method.
7401
7402 2004-04-28  Martin Baulig  <martin@ximian.com>
7403
7404         * typemanager.cs (TypeManager.CheckStructCycles): New public
7405         static method to check for cycles in the struct layout.
7406
7407         * rootcontext.cs (RootContext.PopulateTypes): Call
7408         TypeManager.CheckStructCycles() for each TypeContainer.
7409         [Note: We only need to visit each type once.]
7410
7411 2004-04-28  Martin Baulig  <martin@ximian.com>
7412
7413         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
7414
7415         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
7416         success and added `out object value'.  Use a `bool resolved' field
7417         to check whether we've already been called rather than
7418         `ConstantValue != null' since this breaks for NullLiterals.
7419
7420 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7421
7422         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
7423         setting of this flag, since the 'set' method may be non-public.
7424
7425 2004-04-28  Raja R Harinath  <rharinath@novell.com>
7426
7427         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
7428         check on current_vector.Block.
7429
7430 2004-04-27  Martin Baulig  <martin@ximian.com>
7431
7432         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7433         a field initializer.  Fixes #56459.
7434
7435 2004-04-27  Martin Baulig  <martin@ximian.com>
7436
7437         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7438         we're not attempting to use an indexer.  Fixes #52154.
7439
7440 2004-04-27  Martin Baulig  <martin@ximian.com>
7441
7442         * statement.cs (Return): Don't create a return label if we don't
7443         need it; reverts my change from January 20th.  Thanks to Ben
7444         Maurer for this.
7445
7446 2004-04-27  Martin Baulig  <martin@ximian.com>
7447
7448         According to the spec, `goto' can only leave a nested scope, but
7449         never enter it.
7450
7451         * statement.cs (Block.LookupLabel): Only lookup in the current
7452         block, don't recurse into parent or child blocks.
7453         (Block.AddLabel): Check in parent and child blocks, report
7454         CS0140/CS0158 if we find a duplicate.
7455         (Block): Removed this indexer for label lookups.
7456         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7457         this already does the error reporting for us.
7458
7459         * flowanalysis.cs
7460         (FlowBranching.UsageVector.Block): New public variable; may be null.
7461         (FlowBranching.CreateSibling): Added `Block' argument.
7462         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7463         label for the target of a `goto' and check whether we're not
7464         leaving a `finally'.
7465
7466 2004-04-27  Martin Baulig  <martin@ximian.com>
7467
7468         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7469         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7470         just for returns).
7471
7472 2004-04-27  Martin Baulig  <martin@ximian.com>
7473
7474         * statement.cs (Block.AddLabel): Also check for implicit blocks
7475         and added a CS0158 check.
7476
7477 2004-04-27  Martin Baulig  <martin@ximian.com>
7478
7479         * flowanalysis.cs (FlowBranchingLoop): New class.
7480         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7481         UsageVector's instead of an ArrayList.
7482         (FlowBranching.Label): Likewise.
7483         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7484         (FlowBranching.AddBreakVector): New method.
7485
7486 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7487
7488         * attribute.cs: Small regression fix: only convert the type if we
7489         the type is different, fixes System.Drawing build.
7490
7491 2004-04-27  Martin Baulig  <martin@ximian.com>
7492
7493         * attribute.cs (Attribute.Resolve): If we have a constant value
7494         for a named field or property, implicity convert it to the correct
7495         type.
7496
7497 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7498
7499         * statement.cs (Block.Block): Implicit blocks share
7500         'child_variable_names' fields with parent blocks.
7501         (Block.AddChildVariableNames): Remove.
7502         (Block.AddVariable): Mark variable as "used by a child block" in
7503         every surrounding block.
7504         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7505         been used in a child block, complain about violation of "Invariant
7506         meaning in blocks" rule.
7507         * cs-parser.jay (declare_local_variables): Don't use
7508         AddChildVariableNames.
7509         (foreach_statement): Don't create an implicit block: 'foreach'
7510         introduces a scope.
7511
7512 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7513
7514         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7515         converting from 0L to ulong.  Fixes 57522.
7516
7517 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7518
7519         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7520         derived class hides via 'new' keyword field from base class (test-242.cs).
7521         TODO: Handle this in the more general way.
7522         
7523         * class.cs (CheckBase): Ditto.
7524
7525 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7526
7527         * decl.cs (caching_flags): New member for storing cached values
7528         as bit flags.
7529         (MemberCore.Flags): New enum where bit flags for caching_flags
7530         are defined.
7531         (MemberCore.cls_compliance): Moved to caching_flags.
7532         (DeclSpace.Created): Moved to caching_flags.
7533
7534         * class.cs: Use caching_flags instead of DeclSpace.Created
7535         
7536 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7537
7538         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7539         if we are only a derived class, not a nested class.
7540
7541         * typemanager.cs: Same as above, but do this at the MemberLookup
7542         level (used by field and methods, properties are handled in
7543         PropertyExpr).   Allow for the qualified access if we are a nested
7544         method. 
7545
7546 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7547
7548         * class.cs: Refactoring.
7549         (IMethodData): New inteface; Holds links to parent members
7550         to avoid member duplication (reduced memory allocation).
7551         (Method): Implemented IMethodData interface.
7552         (PropertyBase): New inner classes for get/set methods.
7553         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7554         (Event): New inner classes for add/remove methods.
7555         (Event.DelegateMethod): Implemented IMethodData interface.
7556
7557         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7558         EmitContext (related to class.cs refactoring).
7559
7560 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7561
7562         * delegate.cs (Delegate.VerifyApplicability): If the number of
7563         arguments are the same as the number of parameters, first try to
7564         verify applicability ignoring  any 'params' modifier on the last
7565         parameter.
7566         Fixes #56442.
7567
7568 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7569
7570         * class.cs (TypeContainer.AddIndexer): Use
7571         'ExplicitInterfaceName' to determine if interface name was
7572         explicitly specified.  'InterfaceType' is not initialized at this time.
7573         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7574         Indexers array is already in the required order.  Initialize
7575         'IndexerName' only if there are normal indexers.
7576         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7577         (TypeContainer.Emit): Emit DefaultMember attribute only if
7578         IndexerName is initialized.
7579         Fixes #56300.
7580
7581 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7582
7583         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7584         Fixes #57007
7585
7586 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7587
7588         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7589         attributes.
7590         Fix for #56456.
7591
7592         * attribute.cs (Attribute.Resolve): Check for duplicate named
7593         attributes.
7594         Fix for #56463.
7595
7596 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7597
7598         * iterators.cs (MarkYield): track whether we are in an exception,
7599         and generate code accordingly.  Use a temporary value to store the
7600         result for our state.
7601
7602         I had ignored a bit the interaction of try/catch with iterators
7603         since their behavior was not entirely obvious, but now it is
7604         possible to verify that our behavior is the same as MS .NET 2.0
7605
7606         Fixes 54814
7607
7608 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7609
7610         * iterators.cs: Avoid creating temporaries if there is no work to
7611         do. 
7612
7613         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7614         Enumerations, use TypeManager.EnumToUnderlying and call
7615         recursively. 
7616
7617         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7618         bug #57013
7619
7620         (This.Emit): Use EmitContext.EmitThis to emit our
7621         instance variable.
7622
7623         (This.EmitAssign): Ditto.
7624
7625         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7626         codepaths, we will move all the functionality into
7627         Mono.CSharp.This 
7628
7629         (FieldExpr.EmitAssign): Ditto.
7630
7631         This fixes several hidden bugs that I uncovered while doing a code
7632         review of this today.
7633
7634         * codegen.cs (EmitThis): reworked so the semantics are more clear
7635         and also support value types "this" instances.
7636
7637         * iterators.cs: Changed so that for iterators in value types, we
7638         do not pass the value type as a parameter.  
7639
7640         Initialization of the enumerator helpers is now done in the caller
7641         instead of passing the parameters to the constructors and having
7642         the constructor set the fields.
7643
7644         The fields have now `assembly' visibility instead of private.
7645
7646 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7647
7648         * expression.cs (Argument.Resolve): Check if fields passed as ref
7649         or out are contained in a MarshalByRefObject.
7650
7651         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7652         another compiler type.
7653
7654 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7655
7656         * class.cs (Indexer.Define): use the new name checking method.
7657         Also, return false on an error.
7658         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7659         (is_identifier_[start/part]_character): make static.
7660
7661 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7662
7663         * expression.cs (Binary.ResolveOperator): Do no append strings
7664         twice: since we can be invoked more than once (array evaluation)
7665         on the same concatenation, take care of this here.  Based on a fix
7666         from Ben (bug #56454)
7667
7668 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7669
7670         * codegen.cs: Fix another case where CS1548 must be reported (when 
7671         delay-sign isn't specified and no private is available #56564). Fix
7672         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7673         error when MCS is used on the MS runtime and we need to delay-sign 
7674         (which seems unsupported by AssemblyBuilder - see #56621).
7675
7676 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7677
7678         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7679         (TypeManager.ComputeNamespaces): Faster implementation for
7680         Microsoft runtime.
7681
7682         * compiler.csproj: Updated AssemblyName to mcs.
7683
7684 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7685
7686         * rootcontext.cs: Add new types to the boot resolution.
7687
7688         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7689         MulticastDelegate is not allowed.
7690
7691         * typemanager.cs: Add new types to lookup: System.TypedReference
7692         and ArgIterator.
7693
7694         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7695         check for TypedReference or ArgIterator, they are not allowed. 
7696
7697         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7698         makes us properly catch 1510 in some conditions (see bug 56016 for
7699         details). 
7700
7701 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7702
7703         * CryptoConvert.cs: update from corlib version
7704         with endian fixes.
7705
7706 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7707
7708         * class.cs (Indexer.Define): Check indexername declaration
7709
7710 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7711
7712         * attribute.cs (IsClsCompliant): Fixed problem with handling
7713         all three states (compliant, not-compliant, undetected).
7714
7715 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7716
7717         * attribute.cs (Attribute): Location is now public.
7718         (Resolve): Store resolved arguments (pos_values) in attribute class.
7719         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7720         (GetClsCompliantAttributeValue): New method that gets
7721         CLSCompliantAttribute value.
7722         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7723         if exists else null.
7724         (AttributeTester): New class for CLS-Compliant verification routines.
7725
7726         * class.cs (Emit): Add CLS-Compliant verification.
7727         (Method.GetSignatureForError): Implemented.
7728         (Constructor.GetSignatureForError): Implemented
7729         (Constructor.HasCompliantArgs): Returns if constructor has
7730         CLS-Compliant arguments.
7731         (Constructor.Emit): Override.
7732         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7733         is needed to test only parameters.
7734         (FieldBase.GetSignatureForError): Implemented.
7735         (TypeContainer): New member for storing base interfaces.
7736         (TypeContainer.FindMembers): Search in base interfaces too.
7737
7738         * codegen.cs (GetClsComplianceAttribute): New method that gets
7739         assembly or module CLSCompliantAttribute value.
7740         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7741         for assembly.
7742         (ModuleClass.Emit): Add error 3012 test.
7743
7744         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7745
7746         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7747         state for all decl types.
7748         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7749         if CLS-Compliant tests are required.
7750         (IsClsCompliaceRequired): New method. Analyze whether code
7751         must be CLS-Compliant.
7752         (IsExposedFromAssembly): New method. Returns true when MemberCore
7753         is exposed from assembly.
7754         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7755         value or gets cached value.
7756         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7757         is explicitly marked with CLSCompliantAttribute.
7758         (IsIdentifierClsCompliant): New abstract method. This method is
7759         used to testing error 3005.
7760         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7761         for identifier and parameters CLS-Compliant testing.
7762         (VerifyClsCompliance): New method. The main virtual method for
7763         CLS-Compliant verifications.
7764         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7765         null. I don't know why is null (too many public members !).
7766         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7767         and get value of first CLSCompliantAttribute that found.
7768
7769         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7770         (VerifyClsCompliance): Override and add extra tests.
7771
7772         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7773         clscheck- disable CLS-Compliant verification event if assembly is has
7774         CLSCompliantAttribute(true).
7775
7776         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7777         ApllyAttribute is now called in emit section as in the other cases.
7778         Possible future Emit integration.
7779         (IsIdentifierClsCompliant): New override.
7780         (VerifyClsCompliance): New override.
7781         (GetEnumeratorName): Returns full enum name.
7782
7783         * parameter.cs (GetSignatureForError): Implemented.
7784
7785         * report.cs (WarningData): New struct for Warning message information.
7786         (LocationOfPreviousError): New method.
7787         (Warning): New method. Reports warning based on the warning table.
7788         (Error_T): New method. Reports error based on the error table.
7789
7790         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7791         verifications are done here.
7792
7793         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7794
7795         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7796         CLSCompliantAttribute.
7797         (all_imported_types): New member holds all imported types from other
7798         assemblies.
7799         (LoadAllImportedTypes): New method fills static table with exported types
7800         from all referenced assemblies.
7801         (Modules): New property returns all assembly modules.
7802
7803 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7804
7805         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7806         throwing a parser error.
7807
7808         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7809         which removes the hardcoded get_/set_ prefixes for properties, as
7810         IL allows for the properties to be named something else.  
7811
7812         Bug #56013
7813
7814         * expression.cs: Do not override operand before we know if it is
7815         non-null.  Fix 56207
7816
7817 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7818
7819         * typemanager.cs: support for pinned variables.
7820
7821 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7822
7823         * decl.cs, typemanager.cs: Avoid using an arraylist
7824         as a buffer if there is only one result set.
7825
7826 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7827
7828         * expression.cs: Make sure you cant call a static method
7829         with an instance expression, bug #56174.
7830
7831 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7832
7833         * class.cs (IsDuplicateImplementation): Improve error reporting to
7834         flag 663 (method only differs in parameter modifier).
7835
7836         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7837         in preprocessor directives.
7838
7839         * location.cs (LookupFile): Allow for the empty path.
7840
7841         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7842         better approach for some of that patch, but its failing with the
7843         CharSet enumeration.  For now try/catch will do.
7844
7845         * typemanager.cs: Do not crash if a struct does not have fields.
7846         Fixes 56150.
7847
7848 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7849
7850         * expression.cs: cs0213, cant fix a fixed expression.
7851         fixes 50231.
7852
7853 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7854
7855         * cs-parser.jay: detect invalid embeded statements gracefully.
7856         bug #51113.
7857
7858 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7859
7860         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7861         As a regex:
7862         s/
7863         the invocation type may not be a subclass of the tye of the item/
7864         The type of the item must be a subclass of the invocation item.
7865         /g
7866
7867         Fixes bug #50820.
7868
7869 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7870
7871         * attribute.cs: Added methods to get a string and a bool from an
7872         attribute. Required to information from AssemblyKeyFileAttribute,
7873         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7874         * codegen.cs: Modified AssemblyName creation to include support for
7875         strongnames. Catch additional exceptions to report them as CS1548.
7876         * compiler.csproj: Updated include CryptoConvert.cs.
7877         * compiler.csproj.user: Removed file - user specific configuration.
7878         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7879         Mono.Security assembly. The original class is maintained and tested in
7880         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7881         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7882         like CSC 8.0 (C# v2) supports.
7883         * Makefile: Added CryptoConvert.cs to mcs sources.
7884         * rootcontext.cs: Added new options for strongnames.
7885
7886 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7887
7888         * driver.cs: For --expect-error, report error code `2'
7889         if the program compiled with no errors, error code `1' if
7890         it compiled with an error other than the one expected.
7891
7892 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7893
7894         * compiler.csproj: Updated for Visual Studio .NET 2003.
7895         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7896         * compiler.sln: Updated for Visual Studio .NET 2003.
7897
7898 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7899
7900         * expression.cs: Fix bug #47234. We basically need to apply the
7901         rule that we prefer the conversion of null to a reference type
7902         when faced with a conversion to 'object' (csc behaviour).
7903
7904 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7905
7906         * statement.cs: Shorter form for foreach, eliminates
7907         a local variable. r=Martin.
7908
7909 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7910
7911         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7912         checks if we can use brtrue/brfalse to test for 0.
7913         * expression.cs: use the above in the test for using brtrue/brfalse.
7914         cleanup code a bit.
7915
7916 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7917
7918         * expression.cs: Rewrite string concat stuff. Benefits:
7919
7920         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7921         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7922         rather than a concat chain.
7923
7924         * typemanager.cs: Add lookups for more concat overloads.
7925
7926 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7927
7928         * expression.cs: Emit shorter il code for array init.
7929
7930         newarr
7931         dup
7932         // set 1
7933
7934         // set 2
7935
7936         newarr
7937         stloc.x
7938
7939         ldloc.x
7940         // set 1
7941
7942         ldloc.x
7943         // set 2
7944
7945 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7946
7947         * statement.cs: Before, two switch blocks would be merged if the
7948         total size of the blocks (end_item - begin_item + 1) was less than
7949         two times the combined sizes of the blocks.
7950
7951         Now, it will only merge if after the merge at least half of the
7952         slots are filled.
7953
7954         fixes 55885.
7955
7956 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7957
7958         * class.cs : csc build fix for GetMethods(). See bug #52503.
7959
7960 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7961
7962         * expression.cs: Make sure fp comparisons work with NaN.
7963         This fixes bug #54303. Mig approved this patch a long
7964         time ago, but we were not able to test b/c the runtime
7965         had a related bug.
7966
7967 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7968
7969         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7970
7971 2004-03-19  Martin Baulig  <martin@ximian.com>
7972
7973         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7974         error here and not in our caller.
7975
7976 2004-03-19  Martin Baulig  <martin@ximian.com>
7977
7978         * interface.cs: Completely killed this file.
7979         (Interface): We're now a TypeContainer and live in class.cs.
7980
7981         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7982         argument; we're now also called for interfaces.
7983         (TypeContainer.DefineMembers): Allow this method being called
7984         multiple times.
7985         (TypeContainer.GetMethods): New public method; formerly known as
7986         Interface.GetMethod().  This is used by PendingImplementation.
7987         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7988         it's now private and non-static.
7989         (Interface): Moved this here; it's now implemented similar to
7990         Class and Struct.
7991         (Method, Property, Event, Indexer): Added `bool is_interface'
7992         argument to their .ctor's.
7993         (MemberBase.IsInterface): New public field.
7994
7995         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7996         instances instead of InterfaceMethod, InterfaceProperty, etc.
7997         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7998         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7999
8000 2004-03-19  Martin Baulig  <martin@ximian.com>
8001
8002         * class.cs (MethodCore.IsDuplicateImplementation): New private
8003         method which does the CS0111 checking.
8004         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8005         Use IsDuplicateImplementation().
8006
8007 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8008
8009         * decl.cs (FindMemberToOverride): New method to find the correct
8010         method or property to override in the base class.
8011         * class.cs
8012             - Make Method/Property use the above method to find the
8013               version in the base class.
8014             - Remove the InheritableMemberSignatureCompare as it is now
8015               dead code.
8016
8017         This patch makes large code bases much faster to compile, as it is
8018         O(n) rather than O(n^2) to do this validation.
8019
8020         Also, it fixes bug 52458 which is that nested classes are not
8021         taken into account when finding the base class member.
8022
8023         Reviewed/Approved by Martin.
8024
8025 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8026
8027         * interface.cs: In all interface classes removed redundant
8028         member initialization.
8029
8030 2004-03-16  Martin Baulig  <martin@ximian.com>
8031
8032         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8033
8034 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8035
8036         * decl.cs (DefineTypeAndParents): New helper method to define a
8037         type's containers before the type itself is defined;  This is a
8038         bug exposed by the recent changes to Windows.Forms when an
8039         implemented interface was defined inside a class that had not been
8040         built yet.   
8041
8042         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8043
8044         (Check): Loop correctly to report errors modifiers
8045         (UNSAFE was not in the loop, since it was the same as TOP).
8046
8047         * interface.cs: Every interface member now takes a ModFlags,
8048         instead of a "is_new" bool, which we set on the base MemberCore. 
8049
8050         Every place where we called "UnsafeOk" in the interface, now we
8051         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8052         the unsafe settings from the member declaration instead of the
8053         container interface. 
8054
8055         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8056
8057         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8058         `set_indexer_name' to the pending bits (one per type).
8059
8060         We fixed a bug today that was picking the wrong method to
8061         override, since for properties the existing InterfaceMethod code
8062         basically ignored the method name.  Now we make sure that the
8063         method name is one of the valid indexer names.
8064
8065 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8066  
8067         * support.cs (SeekableStreamReader): Keep track of stream byte
8068         positions and don't mix them with character offsets to the buffer.
8069
8070         Patch from Gustavo Giráldez
8071
8072 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8073
8074         * interface.cs (InterfaceSetGetBase): Removed double member
8075         initialization, base class does it as well.
8076
8077 2004-03-13  Martin Baulig  <martin@ximian.com>
8078
8079         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8080         when compiling corlib.
8081
8082 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8083
8084         * convert.cs (ExplicitConversion): We were reporting an error on
8085         certain conversions (object_type source to a value type, when the
8086         expression was `null') before we had a chance to pass it through
8087         the user defined conversions.
8088
8089         * driver.cs: Replace / and \ in resource specifications to dots.
8090         Fixes 50752
8091
8092         * class.cs: Add check for duplicate operators.  Fixes 52477
8093
8094 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8095
8096         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8097         that are in the middle of the statements, not only at the end.
8098         Fixes #54987
8099
8100         * class.cs (TypeContainer.AddField): No longer set the
8101         `HaveStaticConstructor' flag, now we call it
8102         `UserDefineStaticConstructor' to diferentiate the slightly
8103         semantic difference.
8104
8105         The situation is that we were not adding BeforeFieldInit (from
8106         Modifiers.TypeAttr) to classes that could have it.
8107         BeforeFieldInit should be set to classes that have no static
8108         constructor. 
8109
8110         See:
8111
8112         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8113
8114         And most importantly Zoltan's comment:
8115
8116         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8117
8118         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8119          before its static fields are used', i.e. initialization does not need
8120          to be triggered by the first access to the type. Setting this flag
8121          helps the JIT to compile better code, since it can run the static
8122          constructor at JIT time, and does not need to generate code to call it
8123          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8124          this flag for lots of classes like String. 
8125          
8126          csc sets this flag if the type does not have an explicit static 
8127          constructor. The reasoning seems to be that if there are only static
8128          initalizers for a type, and no static constructor, then the programmer
8129          does not care when this initialization happens, so beforefieldinit
8130          can be used.
8131          
8132          This bug prevents the AOT compiler from being usable, since it 
8133          generates so many calls to mono_runtime_class_init that the AOT code
8134          is much slower than the JITted code. The JITted code is faster, 
8135          because it does not generate these calls if the vtable is type is
8136          already initialized, which is true in the majority of cases. But the
8137          AOT compiler can't do this."
8138
8139 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8140
8141         * class.cs (MethodData.Emit): Refactor the code so symbolic
8142         information is generated for destructors;  For some reasons we
8143         were taking a code path that did not generate symbolic information
8144         before. 
8145
8146 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8147
8148         * class.cs: Create a Constructor.CheckBase method that
8149         takes care of all validation type code. The method
8150         contains some code that was moved from Define.
8151
8152         It also includes new code that checks for duplicate ctors.
8153         This fixes bug #55148.
8154
8155 2004-03-09  Joshua Tauberer <tauberer@for.net>
8156
8157         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8158         a { ... }-style array creation invokes EmitStaticInitializers
8159         which is not good for reference-type arrays.  String, decimal
8160         and now null constants (NullCast) are not counted toward
8161         static initializers.
8162
8163 2004-03-05  Martin Baulig  <martin@ximian.com>
8164
8165         * location.cs (SourceFile.HasLineDirective): New public field;
8166         specifies whether the file contains or is referenced by a "#line"
8167         directive.
8168         (Location.DefineSymbolDocuments): Ignore source files which
8169         either contain or are referenced by a "#line" directive.        
8170
8171 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8172
8173         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8174         direct access to our parent, so check the method inline there.
8175
8176 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8177
8178         * expression.cs (Invocation.EmitCall): Miguel's last commit
8179         caused a regression. If you had:
8180
8181             T t = null;
8182             t.Foo ();
8183
8184         In Foo the implict this would be null.
8185
8186 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8187
8188         * expression.cs (Invocation.EmitCall): If the method is not
8189         virtual, do not emit a CallVirt to it, use Call.
8190
8191         * typemanager.cs (GetFullNameSignature): Improve the method to
8192         cope with ".ctor" and replace it with the type name.
8193
8194         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8195         as an argument the ConstructorBuilder where it is being defined,
8196         to catch the recursive constructor invocations.
8197
8198 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8199
8200         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8201         routines to check if a type is an enumerable/enumerator allow
8202         classes that implement the IEnumerable or IEnumerator interfaces.
8203
8204         * class.cs (Property, Operator): Implement IIteratorContainer, and
8205         implement SetYields.
8206
8207         (Property.Define): Do the block swapping for get_methods in the
8208         context of iterators.   We need to check if Properties also
8209         include indexers or not.
8210
8211         (Operator): Assign the Block before invoking the
8212         OperatorMethod.Define, so we can trigger the Iterator code
8213         replacement. 
8214
8215         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8216         Property and Operator classes are not created when we parse the
8217         declarator but until we have the block completed, so we use a
8218         singleton SimpleIteratorContainer.Simple to flag whether the
8219         SetYields has been invoked.
8220
8221         We propagate this setting then to the Property or the Operator to
8222         allow the `yield' to function.
8223
8224 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8225
8226         * codegen.cs: Implemented attribute support for modules.
8227         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8228         Assembly/Module functionality.
8229
8230         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8231         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8232         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8233
8234 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8235
8236         * interface.cs (FindMembers): The operation is performed on all base
8237         interfaces and not only on the first. It is required for future CLS Compliance patch.
8238
8239 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8240
8241         * statement.cs, codegen.cs:
8242         This patch deals with patterns such as:
8243
8244         public class List : IEnumerable {
8245
8246                 public MyEnumerator GetEnumerator () {
8247                         return new MyEnumerator(this);
8248                 }
8249
8250                 IEnumerator IEnumerable.GetEnumerator () {
8251                         ...
8252                 }
8253                 
8254                 public struct MyEnumerator : IEnumerator {
8255                         ...
8256                 }
8257         }
8258
8259         Before, there were a few things we did wrong:
8260         1) we would emit callvirt on a struct, which is illegal
8261         2) we emited ldarg when we needed to emit ldarga
8262         3) we would mistakenly call the interface methods on an enumerator
8263         type that derived from IEnumerator and was in another assembly. For example:
8264
8265         public class MyEnumerator : IEnumerator
8266
8267         Would have the interface methods called, even if there were public impls of the
8268         method. In a struct, this lead to invalid IL code.
8269
8270 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8271
8272         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8273           renamed to Emit.
8274
8275         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8276
8277 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8278
8279         * cs-parser.jay: Fix small regression: we were not testing V2
8280         compiler features correctly.
8281
8282         * interface.cs: If the emit context is null, then create one
8283
8284 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8285
8286         * decl.cs (GetSignatureForError): New virtual method to get full name
8287           for error messages.
8288
8289         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8290           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8291
8292         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8293           Duplicated members and code in these classes has been removed.
8294           Better encapsulation in these classes.
8295
8296 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8297
8298         * assign.cs (Assign.DoResolve): When dealing with compound
8299         assignments, there is a new rule in ECMA C# 2.4 (might have been
8300         there before, but it is documented here) that states that in:
8301
8302         a op= b;
8303
8304         If b is of type int, and the `op' is a shift-operator, then the
8305         above is evaluated as:
8306
8307         a = (int) a op b 
8308
8309         * expression.cs (Binary.ResolveOperator): Instead of testing for
8310         int/uint/long/ulong, try to implicitly convert to any of those
8311         types and use that in pointer arithmetic.
8312
8313         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8314         method to print information for from the type, not from the
8315         null-method we were given.
8316
8317 2004-02-01  Duncan Mak  <duncan@ximian.com>
8318
8319         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8320         parsing for cmd, fixes bug #53694.
8321
8322 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8323
8324         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8325         in the member name duplication tests. Property and operator name duplication
8326         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8327
8328 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8329
8330         * interface.cs (PopulateMethod): Fixed crash when interface method
8331         returns not existing type (error test cs0246-3.cs).
8332
8333 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8334
8335         * cs-parser.jay (interface_accessors): Re-write actions to also
8336         store attributes attached to get and set methods. Fix spelling
8337         while at it.
8338
8339         (inteface_property_declaration): Modify accordingly.
8340
8341         (InterfaceAccessorInfo): New helper class to store information to pass
8342         around between rules that use interface_accessors.
8343
8344         * interface.cs (Emit): Apply attributes on the get and set
8345         accessors of properties and indexers too.
8346
8347         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8348         right MethodBuilder when applying attributes to the get and set accessors.
8349
8350 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8351
8352         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8353
8354 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8355
8356         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8357
8358 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8359
8360         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8361         changes that treat `yield' specially when present before `break'
8362         or `return' tokens.
8363
8364         * cs-tokenizer.cs: yield is no longer a keyword.
8365
8366 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8367
8368         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8369         setting for default constructors.
8370         For default constructors are almost every time set wrong Modifier. The
8371         generated IL code has been alright. But inside mcs this values was
8372         wrong and this was reason why several of my CLS Compliance tests
8373         failed.
8374
8375 2004-01-22  Martin Baulig  <martin@ximian.com>
8376
8377         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8378         not a QualifiedIdentifier.  This is what `type_name_expression'
8379         was previously doing.
8380         (type_name_expression): Removed; the code is now in
8381         `namespace_or_type_name'.
8382         (qualified_identifier): Removed, use `namespace_or_type_name'
8383         instead.
8384         (QualifiedIdentifier): Removed this class.      
8385
8386 2004-01-22  Martin Baulig  <martin@ximian.com>
8387
8388         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8389         not a string as alias name.
8390
8391 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8392
8393         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8394         #52730 bug, and instead compute correctly the need to use a
8395         temporary variable when requesting an address based on the
8396         static/instace modified of the field and the constructor.
8397  
8398 2004-01-21  Martin Baulig  <martin@ximian.com>
8399
8400         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8401         class and namespace before looking up aliases.  Fixes #52517.
8402
8403 2004-01-21  Martin Baulig  <martin@ximian.com>
8404
8405         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8406         assinged in a 'try'; fixes exception4.cs.
8407
8408 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8409         * class.cs : Implemented parameter-less constructor for TypeContainer
8410
8411         * decl.cs: Attributes are now stored here. New property OptAttributes
8412
8413         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8414
8415         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8416
8417 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8418
8419         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8420           (CSharpSignature): New method for indexer and property signature.
8421
8422 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8423
8424         * pending.cs (IsVirtualFilter): Faster implementation.
8425
8426 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8427
8428         * typemanager.cs: Avoid inclusion of same assembly more than once.
8429
8430 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8431
8432         * cs-parser.jay: Fixed problem where the last assembly attribute
8433           has been applied also to following declaration (class, struct, etc.)
8434           
8435 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8436
8437         * class.cs: Added error CS0538, CS0539 reporting.
8438         Fixed crash on Microsoft runtime when field type is void.
8439
8440         * cs-parser.jay: Added error CS0537 reporting.
8441
8442         * pending.cs: Added error CS0535 reporting.
8443         Improved error report for errors CS0536, CS0534.
8444
8445 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8446
8447         Merge a few bits from the Anonymous Method MCS tree.
8448
8449         * statement.cs (ToplevelBlock): New class for toplevel methods,
8450         will hold anonymous methods, lifted variables.
8451
8452         * cs-parser.jay: Create toplevel blocks for delegates and for
8453         regular blocks of code. 
8454
8455 2004-01-20  Martin Baulig  <martin@ximian.com>
8456
8457         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8458         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8459         and `NeedExplicitReturn'; added `IsLastStatement'.
8460         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8461         have a `ReturnLabel' or we're not unreachable.
8462
8463         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8464         child's reachability; don't just override ours with it.  Fixes
8465         #58058 (lluis's example).
8466         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8467         InFinally(), InLoop(), InSwitch() and
8468         BreakCrossesTryCatchBoundary() methods.
8469
8470         * statement.cs (Return): Do all error checking in Resolve().
8471         Unless we are the last statement in a top-level block, always
8472         create a return label and jump to it.
8473         (Break, Continue): Do all error checking in Resolve(); also make
8474         sure we aren't leaving a `finally'.
8475         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8476         statement in a top-level block.
8477         (Block.Flags): Added `IsDestructor'.
8478         (Block.IsDestructor): New public property.
8479
8480 2004-01-20  Martin Baulig  <martin@ximian.com>
8481
8482         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8483
8484 2004-01-20  Martin Baulig  <martin@ximian.com>
8485
8486         * statement.cs (Statement.ResolveUnreachable): New public method.
8487         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8488         (Block.Resolve): Resolve unreachable statements.
8489
8490 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8491
8492         * expression.cs: We need to fix the case where we do
8493         not have a temp variable here.
8494
8495         * assign.cs: Only expression compound assignments need
8496         temporary variables.
8497
8498 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8499
8500         * flowanalysis.cs: Reduce memory allocation in a few ways:
8501           - A block with no variables should not allocate a bit
8502             vector for itself.
8503           - A method with no out parameters does not need any tracking
8504             for assignment of the parameters, so we need not allocate
8505             any data for it.
8506           - The arrays:
8507                 public readonly Type[] VariableTypes;
8508                 public readonly string[] VariableNames;
8509             Are redundant. The data is already stored in the variable
8510             map, so we need not allocate another array for it.
8511           - We need to add alot of checks for if (params | locals) == null
8512             due to the first two changes.
8513
8514 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8515
8516         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8517         implement IMemoryLocation, we store a copy on a local variable and
8518         take the address of it.  Patch from Benjamin Jemlich
8519
8520         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8521         to use a special "type_name_expression" rule which reduces the
8522         number of "QualifiedIdentifier" classes created, and instead
8523         directly creates MemberAccess expressions.
8524
8525 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8526
8527         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8528         that fixes #52853.  Null literal assignment to ValueType
8529
8530         * class.cs (MethodData.Emit): Instead of checking the name of the
8531         method to determine if its a destructor, create a new derived
8532         class from Method called Destructor, and test for that.  
8533
8534         * cs-parser.jay: Create a Destructor object instead of a Method.  
8535
8536         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8537
8538         Fixes: 52933
8539
8540 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8541
8542         * expression.cs (Binary.ResolveOperator): Perform an implicit
8543         conversion from MethodGroups to their delegate types on the
8544         Addition operation.
8545
8546         * delegate.cs: Introduce a new class DelegateCreation that is the
8547         base class for `NewDelegate' and `ImplicitDelegateCreation',
8548         factor some code in here.
8549
8550         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8551         conversion from MethodGroups to compatible delegate types. 
8552
8553         * ecore.cs (Expression.Resolve): Do not flag error 654
8554         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8555         we allow conversions from MethodGroups to delegate types now.
8556
8557         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8558         assignments in v2 either.
8559
8560 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8561
8562         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8563         static read-only fields in ctors.
8564
8565         Applied patch from Benjamin Jemlich 
8566
8567         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8568
8569 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8570
8571         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8572         here to return true, as they can be used like this:
8573
8574                 (XXX) int.MEMBER ()
8575
8576         Fixed 49836 and all the other dups
8577
8578 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8579
8580         * driver.cs: Implement /win32res and /win32icon.
8581
8582 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8583
8584         * cs-parser.jay: Add a rule to improve error handling for the
8585         common mistake of placing modifiers after the type.
8586
8587 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8588
8589         * cs-parser.jay (interface_event_declaration): Catch
8590         initialization of events on interfaces, and report cs0068
8591
8592         * cs-parser.jay (interface_event_declaration): Catch
8593         initialization of events. 
8594
8595         * ecore.cs: Better report missing constructors.
8596
8597         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8598         the error reporting done in the wrong place.  Fix.
8599
8600         * expression.cs (Binary.ResolveOperator): Catch the 
8601         operator + (E x, E y) error earlier, and later allow for implicit
8602         conversions in operator +/- (E e, U x) from U to the underlying
8603         type of E.
8604
8605         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8606         52596, if the container class is abstract, the default constructor
8607         is protected otherwise its public (before, we were always public).
8608
8609         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8610         fixed statement.
8611
8612         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8613         Jemlich that fixes bug #52597, MCS was generating invalid code for
8614         idisposable structs.   Thanks to Ben for following up with this
8615         bug as well.
8616
8617 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8618
8619         * driver.cs: Allow assemblies without code to be generated, fixes
8620         52230.
8621
8622 2004-01-07  Nick Drochak <ndrochak@gol.com>
8623
8624         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8625
8626 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8627
8628         * cs-parser.jay: Add rules to improve error reporting if fields or
8629         methods are declared at the namespace level (error 116)
8630
8631         * Add rules to catch event add/remove
8632
8633 2004-01-04  David Sheldon <dave-mono@earth.li>
8634
8635   * expression.cs: Added matching ")" to error message for 
8636   CS0077
8637
8638 2004-01-03 Todd Berman <tberman@gentoo.org>
8639
8640         * ecore.cs, attribute.cs:
8641         Applying fix from #52429.
8642
8643 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8644
8645         * ecore.cs, expression.cs, statement.cs:
8646         Total rewrite of how we handle branching. We
8647         now handle complex boolean expressions with fewer
8648         jumps. As well if (x == 0) no longer emits a ceq.
8649
8650         if (x is Foo) is much faster now, because we generate
8651         better code.
8652
8653         Overall, we get a pretty big improvement on our benchmark
8654         tests. The code we generate is smaller and more readable.
8655
8656         I did a full two-stage bootstrap. The patch was reviewed
8657         by Martin and Miguel.
8658
8659 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8660
8661         * cs-parser.jay: Make primary_expression not take a QI.
8662         we dont need this because the member_access rule covers
8663         us here. So we replace the rule with just IDENTIFIER.
8664
8665         This has two good effects. First, we remove a s/r conflict.
8666         Second, we allocate many fewer QualifiedIdentifier objects.
8667
8668 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8669
8670         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8671         set the correct information via SRE. This prevents
8672         hanging on the MS runtime. Fixes #29374.
8673
8674 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8675
8676         * convert.cs: correctly handle conversions to value types
8677         from Enum and ValueType as unboxing conversions.
8678
8679         Fixes bug #52569. Patch by Benjamin Jemlich.
8680
8681 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8682
8683         * expression.cs (BetterConversion): Prefer int -> uint
8684         over int -> ulong (csc's behaviour). This fixed bug #52046.
8685
8686 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8687
8688         * decl.cs (MemberCache.FindMembers): now returns a
8689         MemberInfo [].
8690
8691         * typemanager.cs: In general, go with with ^^.
8692         (CopyNewMethods): take an IList.
8693         (RealMemberLookup): Only allocate an arraylist
8694         if we copy from two sets of methods.
8695
8696         This change basically does two things:
8697         1) Fewer array lists allocated due to CopyNewMethods.
8698         2) the explicit cast in MemberList costed ALOT.
8699
8700 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8701
8702         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8703         a hashtable to avoid needless string allocations when an identifier is
8704         used more than once (the common case).
8705
8706 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8707
8708         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8709         is broken, it will not return anything. So, we
8710         have to use the information we have in mcs to
8711         do the task.
8712
8713         * typemanager.cs: Add a cache for GetInterfaces,
8714         since this will now be used more often (due to ^^)
8715
8716         (GetExplicitInterfaces) New method that gets the
8717         declared, not effective, interfaces on a type
8718         builder (eg, if you have interface IFoo, interface
8719         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8720         { IBar }.
8721
8722         This patch makes MCS able to bootstrap itself on
8723         Windows again.
8724
8725 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8726
8727         * expression.cs: Remove the Nop's that Miguel put
8728         in by mistake.
8729
8730 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8731
8732         * report.cs, codegen.cs: Give the real stack trace to
8733         the error when an exception is thrown.
8734
8735 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8736
8737         * decl.cs: only allocate hashtables for ifaces if 
8738         it is an iface!
8739
8740 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8741
8742         * expression.cs: fix the error from cs0121-2.cs
8743         (a parent interface has two child interfaces that
8744         have a function with the same name and 0 params
8745         and the function is called through the parent).
8746
8747 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8748
8749         * class.cs, rootcontext.cs, typmanager.cs: do not
8750         leak pointers.
8751
8752 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8753
8754         * codegen.cs: remove stack for the ec flow branching.
8755         It is already a linked list, so no need.
8756
8757 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8758
8759         * Makefile: Allow custom profiler here.
8760
8761 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8762
8763         * typemanager.cs (LookupType):
8764           - Use a static char [], because split takes
8765             a param array for args, so it was allocating
8766             every time.
8767           - Do not store true in a hashtable, it boxes.
8768
8769 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8770
8771         * flowanalysis.cs: bytify common enums.
8772
8773 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8774
8775         * modifiers.cs: Add a new set of flags for the
8776         flags allowed on explicit interface impls.
8777         * cs-parser.jay: catch the use of modifiers in
8778         interfaces correctly.
8779         * class.cs: catch private void IFoo.Blah ().
8780
8781         All related to bug #50572.
8782
8783 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8784
8785         * decl.cs: Rewrite the consistant accessability checking.
8786         Accessability is not linear, it must be implemented in
8787         a tableish way. Fixes #49704.
8788
8789 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8790
8791         * expression.cs: Handle negation in a checked context.
8792         We must use subtraction from zero. Fixes #38674.
8793
8794 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8795
8796         * class.cs: Ignore static void main in DLLs.
8797         * rootcontext.cs: Handle the target type here,
8798         since we are have to access it from class.cs
8799         * driver.cs: account for the above.
8800
8801 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8802
8803         * report.cs: Give line numbers and files if available.
8804
8805 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8806
8807         * driver.cs: Implement /addmodule.
8808
8809         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8810         ModuleBuilders.
8811
8812 2003-12-20  Martin Baulig  <martin@ximian.com>
8813
8814         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8815         (FieldBase.IsAssigned): Removed this field.
8816         (FieldBase.SetAssigned): New public method.
8817         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8818
8819 2003-12-20  Martin Baulig  <martin@ximian.com>
8820
8821         * expression.cs (LocalVariableReference.DoResolve): Don't set
8822         `vi.Used' if we're called from DoResolveLValue().
8823
8824         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8825         returns the usage vector it just merged into the current one -
8826         pass this one to UsageWarning().
8827         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8828         of the `EmitContext', don't call this recursively on our children.
8829
8830 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8831
8832         * driver.cs: Implement /target:module.
8833
8834 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8835
8836         * support.cs (CharArrayHashtable): New helper class.
8837
8838         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8839         char arrays, not strings, so we can avoid creating a string in
8840         consume_identifier if the identifier is a keyword.
8841
8842 2003-12-16  Martin Baulig  <martin@ximian.com>
8843
8844         * statement.cs (LocalInfo.Assigned): Removed this property.
8845         (LocalInfo.Flags): Removed `Assigned'.
8846         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8847         and uses flow analysis.
8848         (Block.UsageWarning): Made this method private.
8849         (Block.Resolve): Call UsageWarning() if appropriate.
8850
8851         * expression.cs (LocalVariableReference.DoResolve): Always set
8852         LocalInfo.Used here.
8853
8854 2003-12-13  Martin Baulig  <martin@ximian.com>
8855
8856         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8857         any value here; we're now using flow analysis to figure out
8858         whether a statement/block returns a value.
8859
8860 2003-12-13  Martin Baulig  <martin@ximian.com>
8861
8862         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8863         working again.
8864         (FlowBranching.MergeFinally): Don't call
8865         `branching.CheckOutParameters()' here, this is called in
8866         MergeTopBlock().
8867         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8868         when adding the `finally' vector.       
8869
8870 2003-12-13  Martin Baulig  <martin@ximian.com>
8871
8872         * flowanalysis.cs
8873         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8874         actually work and also fix #48962.
8875
8876 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8877
8878         * decl.cs: Do not check System.Object for nested types,
8879         since we know it does not have any. Big bang for buck:
8880
8881         BEFORE:
8882            Run 1:   8.35 seconds
8883            Run 2:   8.32 seconds
8884            corlib:  17.99 seconds
8885         AFTER:
8886            Run 1:   8.17 seconds
8887            Run 2:   8.17 seconds
8888            corlib:  17.39 seconds
8889
8890 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8891
8892         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8893         time we are returning 0 members, so we save alot here.
8894
8895 2003-12-11  Martin Baulig  <martin@ximian.com>
8896
8897         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8898         `MergeChild()', also just take the `FlowBranching' as argument;
8899         call Merge() on it and return the result.
8900         (FlowBranching.Merge): We don't need to do anything if we just
8901         have one sibling.
8902
8903 2003-12-11  Martin Baulig  <martin@ximian.com>
8904
8905         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8906         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8907         Maurer for this idea.
8908
8909 2003-12-11  Martin Baulig  <martin@ximian.com>
8910
8911         * flowanalysis.cs (MergeResult): This class is now gone; we now
8912         use the `UsageVector' for this.  The reason for this is that if a
8913         branching just has one sibling, we don't need to "merge" them at
8914         all - that's the next step to do.
8915         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8916         `MergeResult'.
8917
8918 2003-12-11  Martin Baulig  <martin@ximian.com>
8919
8920         Reworked flow analyis and made it more precise and bug-free.  The
8921         most important change is that we're now using a special `Reachability'
8922         class instead of having "magic" meanings of `FlowReturns'.  I'll
8923         do some more cleanups and optimizations and also add some more
8924         documentation this week.
8925
8926         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8927         largely reworked this class.
8928         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8929         the new `Reachability' class instead of having "magic" values here.
8930         (FlowBranching): We're now using an instance of `Reachability'
8931         instead of having separate `Returns', `Breaks' etc. fields.
8932
8933         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8934         based on flow analysis; ignore the return value of block.Emit ().
8935
8936 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8937
8938         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8939         if they are private.
8940
8941 2003-12-09  Martin Baulig  <martin@ximian.com>
8942
8943         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8944         call them directly on the UsageVector.
8945
8946 2003-12-09  Martin Baulig  <martin@ximian.com>
8947
8948         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8949         Changed return type from `FlowReturns' to `Reachability'.
8950
8951 2003-12-09  Martin Baulig  <martin@ximian.com>
8952
8953         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8954         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8955         `Reachable' fields with a single `Reachability' one.
8956
8957 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8958
8959         * class.cs (FindMembers): Remove foreach's.
8960
8961         Bootstrap times:
8962
8963         BEFORE
8964                 Run 1:   8.74 seconds
8965                 Run 2:   8.71 seconds
8966
8967         AFTER
8968                 Run 1:   8.64 seconds
8969                 Run 2:   8.58 seconds
8970
8971
8972 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8973
8974         * cs-parser.jay:
8975         * gen-treedump.cs:
8976         * statement.cs:
8977         This patch does a few things:
8978                 1. EmptyStatement is now a singleton, so it is never reallocated.
8979                 2. All blah is EmptyStatement constructs have been changed to
8980                    blah == EmptyStatement.Value, which is much faster and valid
8981                    now that EmptyStatement is a singleton.
8982                 3. When resolving a block, rather than allocating a new array for
8983                    the non-empty statements, empty statements are replaced with
8984                    EmptyStatement.Value
8985                 4. Some recursive functions have been made non-recursive.
8986         Mainly the performance impact is from (3), however (1) and (2) are needed for
8987         this to work. (4) does not make a big difference in normal situations, however
8988         it makes the profile look saner.
8989
8990         Bootstrap times:
8991
8992         BEFORE
8993         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8994         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8995         Total memory allocated: 56397 KB
8996
8997         AFTER
8998         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8999         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9000         Total memory allocated: 55666 KB
9001
9002 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9003
9004         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9005         than the hashtable in a hashtable version
9006
9007         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9008         we always end up concating a string. This results in a huge perf
9009         loss, because many strings have to be tracked by the GC. In this
9010         patch, we first use a hashtable that works with two keys, so that
9011         the strings do not need to be concat'ed.
9012
9013         Bootstrap times:
9014         BEFORE
9015                 Run 1:   8.74 seconds
9016                 Run 2:   8.71 seconds
9017
9018         AFTER
9019                 Run 1:   8.65 seconds
9020                 Run 2:   8.56 seconds
9021
9022 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9023
9024         * Makefile: Add a new target `do-time' that does a quick and simple
9025         profile, leaving easy to parse output.
9026
9027 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9028
9029         * codegen.cs (Init): Create the dynamic assembly with 
9030         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9031
9032 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9033
9034         * support.cs: Make the PtrHashtable use only one
9035         instance of its comparer.
9036
9037 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9038
9039         * typemanager.cs: Fix lookup of GetNamespaces.
9040
9041 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9042
9043         * expression.cs: Removed redundant line.
9044
9045         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9046         ArrayLists, use for loops with bounds.  
9047
9048         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9049         arraylist.
9050
9051         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9052         arraylists, use for loop with bounds.
9053
9054         The above three changes give us a 0.071 second performance
9055         improvement out of 3.294 seconds down to 3.223.  On my machine
9056         the above changes reduced the memory usage by 1,387 KB during
9057         compiler bootstrap.
9058
9059         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9060         QualifiedIdentifiers.  Before we created a new string through
9061         concatenation, and mostly later on, the result would be
9062         manipulated by DecomposeQI through string manipulation.
9063
9064         This reduced the compiler memory usage for bootstrapping from
9065         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9066         compile times in 0.05 seconds.
9067
9068 2003-11-28  Dick Porter  <dick@ximian.com>
9069
9070         * support.cs: Do string compares with the Invariant culture.
9071
9072         * rootcontext.cs: 
9073         * gen-treedump.cs: 
9074         * expression.cs: 
9075         * driver.cs: 
9076         * decl.cs: 
9077         * codegen.cs: 
9078         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9079         the comparison is done with the Invariant culture.
9080
9081 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9082
9083         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9084         GetEnumerator method.
9085
9086         (ProbeCollectionType): Iterate starting at the most specific type
9087         upwards looking for a GetEnumerator
9088
9089         * expression.cs: Shift count can be up to 31 for int/uint and 63
9090         for long/ulong.
9091
9092 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9093
9094         * statement.cs (Block.LookupLabel): Also look for the label on the
9095         children blocks.  Use a hash table to keep track of visited
9096         nodes. 
9097
9098         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9099         we actually did transform the other operand, otherwise fall back
9100         to the common codepath that casts to long.
9101
9102         * cs-tokenizer.cs: Use the same code pattern as the int case.
9103         Maybe I should do the parsing myself, and avoid depending on the
9104         Parse routines to get this done.
9105
9106 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9107
9108         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9109         which fixes bug 51347.  This time test it.
9110
9111         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9112         attributes for example can not tell the difference between these.
9113         The difference was only a syntax feature of the language. 
9114
9115         * attribute.cs: Apply attributes to delegates.
9116
9117         * delegate.cs: Call the apply attributes method.
9118
9119 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9120
9121         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9122         comparing 0 vs Byte.MinValue, not the value
9123
9124         (ImplicitConversionRequired): When reporting a conversion error,
9125         use error 31 to print out the constant error instead of the
9126         simpler 29.
9127
9128         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9129         which fixes bug 51347.
9130
9131 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9132
9133         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9134         which fixes the -warnaserror command line option.
9135
9136 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9137
9138         * cfold.cs (DoNumericPromotions): During constant folding of
9139         additions on UIntConstant, special case intconstants with
9140         IntConstants like we do on the expression binary operator. 
9141
9142 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9143
9144         * convert.cs (ImplicitReferenceConversion): We were missing a case
9145         (System.Enum are not value types or class types, so we need to
9146         classify them separatedly).
9147
9148         * driver.cs: We do not support error 2007.
9149
9150 2003-11-12 Jackson Harper <jackson@ximian.com>
9151
9152         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9153         system directory. Also use the full file name so users can
9154         libraries names mscorlib-o-tron.dll in a non system dir.
9155
9156 2003-11-10  Martin Baulig  <martin@ximian.com>
9157
9158         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9159         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9160         calling `ResolveType()' on them, directly assign their `Type'.
9161
9162 2003-11-08  Martin Baulig  <martin@ximian.com>
9163
9164         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9165         return value and the `out parent' parameter.
9166         (TypeContainer.DefineType): Moved the CS0644 check into
9167         GetClassBases().  Don't pass the interface types to the
9168         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9169         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9170
9171         * ecore.cs (TypeExpr.IsAttribute): New property.
9172         (TypeExpr.GetInterfaces): New method.
9173
9174         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9175         TypeExpr instead of a Type.
9176         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9177         (Interface.DefineType): Don't pass the interface types to the
9178         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9179         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9180
9181         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9182         instead of a `Type[]'.
9183         (TypeManager.RegisterBuilder): Likewise.
9184         (TypeManager.AddUserInterface): Likewise.
9185         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9186         `Type[]' and also return a `TypeExpr[]'.
9187         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9188
9189 2003-11-08  Martin Baulig  <martin@ximian.com>
9190
9191         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9192         Expression.     
9193
9194 2003-11-08  Martin Baulig  <martin@ximian.com>
9195
9196         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9197         TypeManager.ResolveExpressionTypes().
9198
9199         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9200         instead of an Expression.
9201         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9202         (TypeExpression): New public class; formerly known as `TypeExpr'.
9203
9204         * expression.cs (ComposedCast): Derive from TypeExpr.
9205
9206         * typemanager.cs (TypeManager.system_*_expr): These are now
9207         TypExpr's instead of Expression's.
9208         (TypeManager.ResolveExpressionTypes): New public static function;
9209         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9210         of them.        
9211
9212 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9213
9214         * expression.cs (New.DoResolve): Do not dereference value that
9215         might be a null return.
9216
9217         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9218         sure that the constant value has the right type.  Fixes an
9219         unreported bug, similar to 50425.
9220
9221         * const.cs (Const.LookupConstantValue): Call
9222         ImplicitStandardConversionExists before doing a conversion to
9223         avoid havng the TypeManager.ChangeType do conversions.
9224
9225         Reduced the number of casts used
9226
9227         (Const.ChangeType): New routine to enable reuse of the constant
9228         type changing code from statement.
9229
9230         * typemanager.cs (ChangeType): Move common initialization to
9231         static global variables.
9232
9233         Fixes #50425.
9234
9235         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9236         every value type to go through, even if it was void.  Fix that. 
9237
9238         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9239         character of the define, and the is_identifier_part_character for
9240         the rest of the string.
9241
9242 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9243
9244         * expression.cs (UnaryMutator.EmitCode): When I updated
9245         LocalVariableReference.DoResolve, I overdid it, and dropped an
9246         optimization done on local variable references.
9247
9248 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9249
9250         * ecore.cs: Convert the return from Ldlen into an int.
9251
9252 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9253
9254         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9255         the accessibility, this is a special case for toplevel non-public
9256         classes (internal for instance).
9257
9258 2003-10-20  Nick Drochak <ndrochak@gol.com>
9259
9260         * ecore.cs: Fix typo and build.  Needed another right paren.
9261
9262 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9263
9264         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9265         `internal' case regular and protected, but not allowing protected
9266         to be evaluated later.  Bug 49840
9267
9268 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9269
9270         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9271         to kb.Nlast, and not the kb.nFirst to isolate the switch
9272         statement.
9273
9274         Extract the underlying type, so enumerations of long/ulong are
9275         treated like long/ulong.
9276
9277 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9278
9279         * expression.cs (New): Overload the meaning of RequestedType to
9280         track the possible creation of the NewDelegate type, since
9281         DoResolve is invoked more than once for new constructors on field
9282         initialization.
9283
9284         See bugs: #48800 and #37014
9285
9286         * cs-parser.jay (declare_local_constants): Take an arraylist
9287         instead of a single constant.
9288
9289         (local_constant_declaration): It should take a
9290         constant_declarators, not a constant_declarator.  Fixes 49487
9291
9292         * convert.cs: Fix error report.
9293
9294 2003-10-13 Jackson Harper <jackson@ximian.com>
9295
9296         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9297         bug #49611
9298
9299 2003-10-09  Martin Baulig  <martin@ximian.com>
9300
9301         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9302         to the .ctor.
9303         (MethodCore.DoDefineParameters): Removed the TypeContainer
9304         argument; use the DeclSpace which was passed to the .ctor instead.
9305         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9306         TypeContainer; we only need a DeclSpace here.
9307
9308 2003-10-09  Martin Baulig  <martin@ximian.com>
9309
9310         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9311         to the .ctor.
9312         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9313         EmitContext's .ctor.    
9314
9315 2003-10-09  Martin Baulig  <martin@ximian.com>
9316
9317         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9318         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9319         AsAccessible(), moved them as well.
9320
9321         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9322
9323 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9324
9325         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9326
9327 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9328
9329         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9330         generation for >=, as spotted by Paolo, bug 48679.  
9331         Patch from David Waite.
9332
9333         * cs-tokenizer.cs: Add handling for #pragma.
9334
9335         * cs-parser.jay: Allow for both yield and yield return in the
9336         syntax.  The anti-cobolization of C# fight will go on!
9337
9338         * class.cs (TypeBuilder.DefineType): Catch error condition here
9339         (Parent.DefineType erroring out and returning null).
9340
9341         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9342         coping with enumerations variables, we were mistakenly processing
9343         them as a regular value type instead of built-in types.  Fixes the
9344         bug #48063
9345
9346         * typemanager.cs (IsBuiltinOrEnum): New method.
9347
9348 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9349
9350         * cs-parser.jay: Upgrade: yield now needs the return clause.
9351
9352 2003-09-19  Martin Baulig  <martin@ximian.com>
9353
9354         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9355         `MemberCache parent' argument.  Normally, an interface doesn't
9356         have a parent type except System.Object, but we use this in gmcs
9357         for generic type parameters.
9358
9359 2003-09-18  Martin Baulig  <martin@ximian.com>
9360
9361         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9362         on `type.IsInterface'; don't check whether the type has a parent
9363         to determine whether it's an interface.
9364
9365 2003-09-15  Martin Baulig  <martin@ximian.com>
9366
9367         * class.cs (TypeContainer.DefineType): Added an error flag to
9368         avoid reporting duplicate CS0146's ("class definition is
9369         circular.").
9370
9371         * driver.cs (Driver.MainDriver): Abort if
9372         RootContext.ResolveTree() reported any errors.
9373
9374 2003-09-07  Martin Baulig  <martin@ximian.com>
9375
9376         * report.cs (Error, Warning): Added overloaded versions which take
9377         a `params object[] args' and call String.Format().
9378
9379 2003-09-07  Martin Baulig  <martin@ximian.com>
9380
9381         * decl.cs (DeclSpace..ctor): Don't call
9382         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9383         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9384         (DeclSpace.RecordDecl): New method.
9385
9386         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9387
9388 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9389
9390         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9391         value attributes to be applied to ParameterBuilders.
9392
9393         * class.cs (MethodCore.LabelParameters): Make static and more
9394         generic so that it can be used from other places - like interface
9395         methods, for instance.
9396
9397         * interface.cs (Interface.Emit): Call LabelParameters before
9398         emitting attributes on the InterfaceMethod.
9399
9400 2003-08-26  Martin Baulig  <martin@ximian.com>
9401
9402         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9403         resolving aliases; fixes #47927.
9404
9405 2003-08-26  Martin Baulig  <martin@ximian.com>
9406
9407         * statement.cs (Using.DoResolve): This is internally emitting a
9408         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9409         do not always return.  Fixes #47681.
9410
9411 2003-08-26  Martin Baulig  <martin@ximian.com>
9412
9413         * decl.cs (MemberCore): Moved WarningNotHiding(),
9414         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9415         into MemberBase.
9416         (AdditionResult): Make this nested in DeclSpace.
9417         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9418         argument; call NamespaceEntry.Define() unless we're nested in a
9419         class or struct.
9420
9421         * namespace.cs (Namespace.DefineName): New public function.  This
9422         is called from DeclSpace's .ctor to add 
9423         (Namespace.Lookup): Include DeclSpaces in the lookup.
9424
9425         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9426
9427         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9428
9429 2003-08-25  Martin Baulig  <martin@ximian.com>
9430
9431         * convert.cs (Convert.ExplicitReferenceConversion): When
9432         converting from an interface type to a class, unbox if the target
9433         type is a struct type.  Fixes #47822.
9434
9435 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9436
9437         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9438         #47854.
9439
9440 2003-08-22  Martin Baulig  <martin@ximian.com>
9441
9442         * class.cs (TypeManager.DefineType): When defining a nested type,
9443         call DefineType() on our parent; fixes #47801.
9444
9445 2003-08-22  Martin Baulig  <martin@ximian.com>
9446
9447         * class.cs (MethodData.Define): While checking if a method is an
9448         interface implementation, improve the test a bit more to fix #47654.
9449
9450 2003-08-22  Martin Baulig  <martin@ximian.com>
9451
9452         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9453         correctly; fixes #47722.
9454
9455 2003-08-22  Martin Baulig  <martin@ximian.com>
9456
9457         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9458         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9459
9460         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9461
9462 2003-08-22  Martin Baulig  <martin@ximian.com>
9463
9464         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9465         can only be assigned in static constructors.  Fixes #47161.
9466
9467 2003-08-22  Martin Baulig  <martin@ximian.com>
9468
9469         Rewrote and improved the flow analysis code.
9470
9471         * flowbranching.cs (FlowBranching): Make this class abstract.
9472         (FlowBranching.CreateBranching): New static function to create a
9473         new flow branching.
9474         (FlowBranchingBlock, FlowBranchingException): New classes.
9475         (FlowBranching.UsageVector.Type): New public readonly field.
9476         (FlowBranching.UsageVector.Breaks): Removed the setter.
9477         (FlowBranching.UsageVector.Returns): Removed the setter.
9478         (FlowBranching.UsageVector): Added Break(), Return(),
9479         NeverReachable() and Throw() methods to modify the reachability.
9480         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9481         done by FlowBranching.Merge().
9482         (FlowBranching.UsageVector.MergeChild): New method; merges the
9483         merge result into the current vector.
9484         (FlowBranching.Merge): New abstract method to merge a branching.
9485
9486 2003-08-12  Martin Baulig  <martin@ximian.com>
9487
9488         * expression.cs (Indirection.CacheTemporaries): Create the
9489         LocalTemporary with the pointer type, not its element type.
9490
9491 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9494         token was a keyword or not.
9495
9496         Add `error' options where an IDENTIFIER was expected;  Provide
9497         CheckToken and CheckIdentifierToken convenience error reporting
9498         functions. 
9499
9500         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9501
9502         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9503         NameSpaceEntry NameSpaceEntry.
9504
9505         (LookupInterfaceOrClass): Avoid creating a full qualified name
9506         from namespace and name: avoid doing lookups when we know the
9507         namespace is non-existant.   Use new Tree.LookupByNamespace which
9508         looks up DeclSpaces based on their namespace, name pair.
9509
9510         * driver.cs: Provide a new `parser verbose' to display the
9511         exception thrown during parsing.  This is turned off by default
9512         now, so the output of a failure from mcs is more graceful.
9513
9514         * namespace.cs: Track all the namespaces defined in a hashtable
9515         for quick lookup.
9516
9517         (IsNamespace): New method
9518
9519 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9520
9521         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9522         we know that we need to concatenate (full typename can never be
9523         null). 
9524
9525         * class.cs: ditto.
9526
9527         * statement.cs: Use a bitfield;  Do not initialize to null things
9528         which are done by the constructor by default.
9529
9530         * cs-parser.jay: bug fix, parameter was 4, not 3.
9531
9532         * expression.cs: Just use the property;
9533
9534         * statement.cs: No need for GetVariableInfo method.
9535
9536 2003-08-08  Martin Baulig  <martin@ximian.com>
9537
9538         * flowanalysis.cs (FlowReturns): This is now nested in the
9539         `FlowBranching' class.
9540         (MyBitVector): Moved this here from statement.cs.
9541         (FlowBranching.SiblingType): New enum type.
9542         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9543
9544 2003-08-07  Martin Baulig  <martin@ximian.com>
9545
9546         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9547         `FlowBranching' class and called `BranchingType'.
9548
9549 2003-08-07  Martin Baulig  <martin@ximian.com>
9550
9551         * flowanalysis.cs: Moved all the control flow analysis code into
9552         its own file.
9553
9554 2003-08-07  Martin Baulig  <martin@ximian.com>
9555
9556         * assign.cs (Assign.DoResolve): `target' must either be an
9557         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9558         #37319.
9559
9560 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9561
9562         * expression.cs (BinaryMethod): This kind of expression is created by the
9563         Binary class if it determines that the operator has to be handled
9564         by a method.
9565
9566         (BinaryDelegate): This kind of expression is created if we are
9567         dealing with a + or - operator on delegates.
9568
9569         (Binary): remove method, argumetns, and DelegateOperator: when
9570         dealing with methods, 
9571
9572         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9573
9574         * statement.cs (Block): use bitfields for the three extra booleans
9575         we had in use.   Remove unused topblock parameter.
9576
9577         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9578
9579         * assign.cs: Drop extra unneeded tests.
9580
9581 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9582
9583         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9584
9585         * statement.cs (Foreach): Use VariableStorage instead of
9586         LocalBuilders.   
9587
9588         * codegen.cs (VariableStorage): New class used by clients that
9589         require a variable stored: locals or fields for variables that
9590         need to live across yield.
9591
9592         Maybe provide a convenience api for EmitThis+EmitLoad?
9593
9594         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9595         these bad boys.
9596
9597 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9600         RemapParameterLValue): New methods that are used to turn a
9601         precomputed FieldInfo into an expression like this:
9602
9603                 instance.FieldInfo
9604
9605         The idea is to use this instead of making LocalVariableReference
9606         have more than one meaning.
9607
9608         * cs-parser.jay: Add error production to BASE.
9609
9610         * ecore.cs: Deal with TypeManager.GetField returning null, which
9611         is now a valid return value.
9612
9613         (FieldExprNoAddress): New expression for Fields whose address can
9614         not be taken.
9615
9616         * expression.cs (LocalVariableReference): During the resolve
9617         phases, create new expressions if we are in a remapping context.
9618         Remove code that dealt with remapping here.
9619
9620         (ParameterReference): same.
9621
9622         (ProxyInstance): New expression, like the `This' expression, but
9623         it is born fully resolved.  We know what we are doing, so remove
9624         the errors that are targeted to user-provided uses of `this'.
9625
9626         * statement.cs (Foreach): our variable is now stored as an
9627         Expression;  During resolution, follow the protocol, dont just
9628         assume it will return this.
9629
9630 2003-08-06  Martin Baulig  <martin@ximian.com>
9631
9632         * support.cs (SeekableStreamReader.cs): New public class.
9633
9634         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9635         SeekableStreamReader instead of the normal StreamReader.
9636
9637 2003-08-04  Martin Baulig  <martin@ximian.com>
9638
9639         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9640         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9641         deambiguate casts and delegate invocations.
9642         (parenthesized_expression): Use the new tokens to ensure this is
9643         not a cast of method invocation.
9644
9645         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9646         when reading a `)' and Deambiguate_CloseParens () was previously
9647         called.
9648
9649         * expression.cs (ParenthesizedExpression): New class.  This is
9650         just used for the CS0075 test.
9651         (Binary.DoResolve): Check for CS0075.   
9652
9653 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9654
9655         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9656         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9657         reference comparison.
9658
9659         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9660         examine the ReturnType for equality - this is necessary in the
9661         cases of implicit and explicit operators whose signature also
9662         includes the return type.
9663
9664 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9665
9666         * namespace.cs: Cache the result of the namespace computation,
9667         instead of computing it every time.
9668
9669 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9670
9671         * decl.cs: Use a global arraylist that we reuse over invocations
9672         to avoid excesive memory consumption.  Reduces memory usage on an
9673         mcs compile by one meg (45 average).
9674
9675         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9676         private, work around that.
9677
9678 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * literal.cs (IntLiteral): Define Zero and One static literals. 
9681
9682         * cs-parser.jay (integer_literal): use static literals to reduce
9683         memory usage for the most used literals (0, 1 and -1).  211kb
9684         reduced in memory usage.
9685
9686         Replace all calls to `new ArrayList' with `new
9687         ArrayList(4)' which is a good average number for most allocations,
9688         and also requires only 16 bytes of memory for its buffer by
9689         default. 
9690
9691         This reduced MCS memory usage in seven megabytes for the RSS after
9692         bootstrapping.
9693
9694 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9695
9696         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9697         handle params methods the correct way by forming only one
9698         applicable set with params and normal methods in them. Earlier we
9699         were looking at params methods only if we found no normal methods
9700         which was not the correct thing to do.
9701
9702         (Invocation.BetterFunction): Take separate arguments indicating
9703         when candidate and the best method are params methods in their
9704         expanded form.
9705
9706         This fixes bugs #43367 and #46199.
9707
9708         * attribute.cs: Documentation updates.
9709
9710         (CheckAttribute): Rename to CheckAttributeTarget.
9711         (GetValidPlaces): Rename to GetValidTargets.
9712
9713         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9714         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9715
9716         Fixes bug #44468.
9717
9718 2003-07-28  Martin Baulig  <martin@ximian.com>
9719
9720         * class.cs (TypeContainer.DefineMembers): Use the base type's full
9721         name when looking up the base class of a nested class.  Fixes #46977.
9722
9723 2003-07-26  Martin Baulig  <martin@ximian.com>
9724
9725         * expression.cs (Indexers.Indexer): New nested struct; contains
9726         getter, setter and the indexer's type.
9727         (Indexers.Properties): This is now an ArrayList of
9728         Indexers.Indexer's.
9729         (IndexerAccess.DoResolveLValue): Correctly set the type if the
9730         indexer doesn't have any getters.
9731
9732         * assign.cs (Assign.DoResolve): Also do the implicit conversions
9733         for embedded property and indexer assignments.
9734
9735 2003-07-26  Martin Baulig  <martin@ximian.com>
9736
9737         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
9738         preprocessor directive is not the first non-whitespace character
9739         on a line.
9740
9741 2003-07-26  Martin Baulig  <martin@ximian.com>
9742
9743         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
9744         namespace parsing, follow the spec more closely.
9745
9746         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
9747         NamespaceEntry.Lookup().
9748
9749 2003-07-25  Martin Baulig  <martin@ximian.com>
9750
9751         * MethodCore.cs (OverridesSomething): New public field; it's set
9752         from TypeContainer.DefineMembers if this method overrides
9753         something (which doesn't need to be a method).  Fix #39462.
9754
9755 2003-07-25  Ravi Pratap  <ravi@ximian.com>
9756
9757         * typemanager.cs (GetMembers): Ensure that the list of members is
9758         reversed. This keeps things in sync.
9759
9760         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
9761         find an AttributeUsage attribute.
9762
9763         * expression.cs (Invocation.OverloadResolve): Perform the check
9764         which disallows Invoke to be directly called on a Delegate.
9765
9766         (Error_InvokeOnDelegate): Report error cs1533.
9767
9768 2003-07-25  Martin Baulig  <martin@ximian.com>
9769
9770         * expression.cs (Indexers.GetIndexersForType): Only look in the
9771         interface hierarchy if the requested type is already an
9772         interface.  Fixes #46788 while keeping #46502 fixed.
9773
9774 2003-07-25  Martin Baulig  <martin@ximian.com>
9775
9776         * class.cs (TypeContainer.DefineMembers): Check whether all
9777         readonly fields have been assigned and report warning CS0649 if
9778         not.
9779
9780         * statement.cs (LocalInfo.IsFixed): Always return true if this is
9781         a valuetype.
9782
9783 2003-07-24  Ravi Pratap  <ravi@ximian.com>
9784
9785         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
9786         returned from GetMethods to make things consistent with the
9787         assumptions MCS makes about ordering of methods.
9788
9789         This should comprehensively fix bug #45127 and it does :-)
9790
9791         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
9792         ordering is actually reverse.
9793
9794         * Clean up some debug messages I left lying around.
9795
9796         * interface.cs (Populate*): Get rid of code which emits attributes
9797         since the stage in which we emit attributes is the 'Emit' stage,
9798         not the define stage.
9799
9800         (Emit): Move attribute emission for interface members here.
9801
9802 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9803
9804         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9805         closely: we eliminate methods in base types when we have an
9806         applicable method in a top-level type.
9807
9808         Please see section 14.5.5.1 for an exact description of what goes
9809         on. 
9810
9811         This fixes bug #45127 and a host of other related to corlib compilation.
9812
9813         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9814         array is the method corresponding to the top-level type (this is
9815         because of the changes made to icall.c) so we change this
9816         accordingly.
9817
9818         (MethodGroupExpr.Name): This too.
9819
9820         * typemanager.cs (GetElementType): New method which does the right
9821         thing when compiling corlib. 
9822
9823         * everywhere: Make use of the above in the relevant places.
9824
9825 2003-07-22  Martin Baulig  <martin@ximian.com>
9826
9827         * cs-parser.jay (invocation_expression): Moved
9828         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9829         `cast_expression', but create a InvocationOrCast which later
9830         resolves to either an Invocation or a Cast.
9831
9832         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9833         method; call this before EmitStatement() to make sure that this
9834         expression can be used as a statement.
9835
9836         * expression.cs (InvocationOrCast): New class; resolves to either
9837         an Invocation or a Cast.
9838
9839         * statement.cs (StatementExpression): Call ResolveStatement() on
9840         the ExpressionStatement before emitting it.
9841
9842 2003-07-21  Martin Baulig  <martin@ximian.com>
9843
9844         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9845         `ref' and `out' attributes match; fixes #46220.
9846         (MemberAccess.ResolveMemberAccess): You can't reference a type
9847         through an expression; fixes #33180.
9848         (Indexers.GetIndexersForType): Don't return the indexers from
9849         interfaces the class implements; fixes #46502.
9850
9851 2003-07-21  Martin Baulig  <martin@ximian.com>
9852
9853         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9854         CS0661 checks; fixes bug #30442.
9855
9856 2003-07-21  Martin Baulig  <martin@ximian.com>
9857
9858         * decl.cs (AdditionResult): Added `Error'.
9859
9860         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9861
9862         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
9863         makes cs0031.cs actually work.
9864
9865 2003-07-20  Martin Baulig  <martin@ximian.com>
9866
9867         * namespace.cs: Fixed that bug which caused a crash when compiling
9868         the debugger's GUI.
9869
9870 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9871
9872         * typemanager.cs (LookupTypeReflection): Never expose types which
9873         are NotPublic, NestedPrivate, NestedAssembly, or
9874         NestedFamANDAssem.  We used to return these, and later do a check
9875         that would report a meaningful error, but the problem is that we
9876         would not get the real match, if there was a name override.
9877
9878 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9879
9880         * namespace.cs (Namespace, Name): Do not compute the namespace
9881         name dynamically, compute it in the constructor.  This reduced
9882         memory usage by 1697 KB.
9883
9884         * driver.cs: Use --pause to pause at the end.
9885
9886 2003-07-17  Peter Williams  <peter@newton.cx>
9887
9888         * Makefile: Change the name of the test target so that it doesn't
9889         conflict with the recursive test target.
9890
9891 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9892
9893         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9894         AddressOf): Do not use EmitThis, that was wrong, use the actual
9895         this pointer.
9896
9897 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9898
9899         * class.cs (MethodData.Define): While checking if a method is an
9900         interface implementation, improve the test: If we are not public
9901         (use new test here: use the computed MethodAttributes directly,
9902         instead of the parsed modifier flags) check if the `implementing'
9903         method comes from an interface or not.
9904
9905         * pending.cs (VerifyPendingMethods): Slightly better error
9906         message.
9907
9908         * makefile: add test target that does the mcs bootstrap.
9909
9910 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9911
9912         * interface.cs (Define): Do nothing here since there are no
9913         members to populate etc. Move the attribute emission out of here
9914         since this was just totally the wrong place to put it. Attribute
9915         application happens during the 'Emit' phase, not in the 'Define'
9916         phase.
9917
9918         (Emit): Add this method and move the attribute emission here
9919
9920         * rootcontext.cs (EmitCode): Call the Emit method on interface
9921         types too.
9922
9923 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9924
9925         * expression.cs (OverloadResolve): Report error only if Location
9926         is not 'Null' which means that there was a probe going on.
9927
9928 2003-07-14  Martin Baulig  <martin@ximian.com>
9929
9930         * expression.cs (ConditionalLogicalOperator): New public class to
9931         implement user defined conditional logical operators.
9932         This is section 14.11.2 in the spec and bug #40505.
9933
9934 2003-07-14  Martin Baulig  <martin@ximian.com>
9935
9936         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9937
9938 2003-07-14  Martin Baulig  <martin@ximian.com>
9939
9940         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9941
9942         * ecore.cs (IVariable.VerifyFixed): New interface method.
9943
9944         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9945         operator, check whether the variable is actually fixed.  Fixes bug
9946         #36055.  Set a variable definitely assigned when taking its
9947         address as required by the spec.
9948
9949         * statement.cs (LocalInfo.IsFixed): New field.
9950         (LocalInfo.MakePinned): Set `IsFixed' to true.
9951
9952 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9953
9954         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9955         for .ctors, ensure that we only ask for members declared in the
9956         attribute type (BindingFlags.DeclaredOnly).
9957
9958         Fixes bug #43632.
9959
9960         * expression.cs (Error_WrongNumArguments): Report error 1501
9961         correctly the way CSC does.
9962
9963 2003-07-13  Martin Baulig  <martin@ximian.com>
9964
9965         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9966         lookup on the fully qualified name, to make things like "X.X" work
9967         where "X.X" is a fully qualified type name, but we also have a
9968         namespace "X" in the using list.  Fixes #41975.
9969
9970 2003-07-13  Martin Baulig  <martin@ximian.com>
9971
9972         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9973         function. If we're a CompoundAssign, we need to create an embedded
9974         CompoundAssign, not an embedded Assign.
9975         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9976         Fixes #45854.
9977
9978 2003-07-13  Martin Baulig  <martin@ximian.com>
9979
9980         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9981         work to fix bug #46088.
9982
9983 2003-07-13  Ravi Pratap <ravi@ximian.com>
9984
9985         * class.cs (Operator.Emit): Do not emit attributes here - it is
9986         taken care of by the Method class that we delegate too. This takes
9987         care of bug #45876.
9988
9989 2003-07-10  Martin Baulig  <martin@ximian.com>
9990
9991         * expression.cs (TypeOfVoid): New class.
9992         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9993
9994 2003-07-10  Martin Baulig  <martin@ximian.com>
9995
9996         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9997         bug #35957.
9998
9999 2003-07-10  Martin Baulig  <martin@ximian.com>
10000
10001         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10002         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10003
10004         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10005
10006         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10007
10008 2003-07-10  Martin Baulig  <martin@ximian.com>
10009
10010         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10011         of decimal.  Fixes #42850.
10012
10013         NOTE: I also fixed the created byte blob, but this doesn't work on
10014         the MS runtime and csc never produces any byte blobs for decimal
10015         arrays.
10016
10017 2003-07-10  Martin Baulig  <martin@ximian.com>
10018
10019         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10020         structs; fixes #32068.
10021         (Block.AddChildVariableNames): Fixed #44302.
10022
10023 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10024
10025         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10026
10027 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * attribute.cs: And this test is onger needed.
10030
10031 2003-07-08  Martin Baulig  <martin@ximian.com>
10032
10033         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10034         inaccessible types.  Fixes #36313.
10035
10036         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10037
10038         * namespace.cs (NamespaceEntry): Create implicit entries for all
10039         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10040         implicit entries for N1.N2 and N1.
10041
10042 2003-07-08  Martin Baulig  <martin@ximian.com>
10043
10044         Rewrote the handling of namespaces to fix a lot of the issues
10045         wrt. `using' aliases etc.
10046
10047         * namespace.cs (Namespace): Splitted this class into a
10048         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10049
10050         * typemanager.cs (TypeManager.IsNamespace): Removed.
10051         (TypeManager.ComputeNamespaces): Only compute namespaces from
10052         loaded assemblies here, not the namespaces from the assembly we're
10053         currently compiling.
10054
10055 2003-07-08  Martin Baulig  <martin@ximian.com>
10056
10057         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10058
10059 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10062         already fixed it.  
10063
10064         I thought about the memory savings here, but LookupTypeReflection
10065         is used under already very constrained scenarios.  Compiling
10066         corlib or mcs only exposes one hit, so it would not really reduce
10067         any memory consumption.
10068
10069 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10070
10071         * typemanager.cs: fixes bug #45889 by only adding public types from
10072         other assemblies to the list of known types.
10073
10074 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10075
10076         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10077         on the type we resolved.
10078
10079 2003-07-05  Martin Baulig  <martin@ximian.com>
10080
10081         * pending.cs (PendingImplementation.ParentImplements): Don't
10082         create the proxy if the parent is abstract.
10083
10084         * class.cs (TypeContainer.DefineIndexers): Process explicit
10085         interface implementations first.  Fixes #37714.
10086
10087 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10088
10089         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10090         defined recursively;  but since we modify the input parameters
10091         (left is set to `this' temporarily), we reset this value if the
10092         left_is_explicit is false, which gives the original semantics to
10093         the code.  
10094
10095         * literal.cs (NullPointer): new class used to represent a null
10096         literal in a pointer context.
10097
10098         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10099         type is a pointer, use a NullPointer object instead of a
10100         NullLiteral.   Closes 43687
10101
10102         (ExplicitConversion): Convert pointer values using
10103         the conv opcode to the proper type.
10104
10105         * ecore.cs (New): change ValueTypeVariable property into a method,
10106         that returns whether the valuetype is suitable for being used.
10107
10108         * expression.cs (Binary.DoNumericPromotions): Only return if we
10109         the int constant was a valid uint, and we can return both left and
10110         right as uints.  If not, we continue processing, to trigger the
10111         type conversion.  This fixes 39018.
10112
10113         * statement.cs (Block.EmitMeta): During constant resolution, set
10114         the CurrentBlock property on the emitcontext, so that we resolve
10115         constants propertly.
10116
10117 2003-07-02  Martin Baulig  <martin@ximian.com>
10118
10119         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10120         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10121
10122         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10123         than emitting it here.
10124
10125         * statement.cs: Fixed some more flow analysis bugs.
10126
10127 2003-07-02  Martin Baulig  <martin@ximian.com>
10128
10129         * class.cs (MethodData.Define): When implementing interface
10130         methods, set Final unless we're Virtual.
10131
10132         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10133         check work for interface methods.
10134
10135 2003-07-01  Martin Baulig  <martin@ximian.com>
10136
10137         * ecore.cs (EmitContext.This): Replaced this property with a
10138         GetThis() method which takes a Location argument.  This ensures
10139         that we get the correct error location for a CS0188.
10140
10141 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10144         ImplicitStandardConversion.
10145
10146         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10147
10148 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10149
10150         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10151         optimization.
10152
10153 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10154
10155         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10156         constructors.
10157
10158         (MethodData.Define): Turn off initlocals for unsafe methods.
10159
10160 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10163         complete;  Fixes #37521.
10164
10165         * delegate.cs: Use Modifiers.TypeAttr to compute the
10166         TypeAttributes, instead of rolling our own.  This makes the flags
10167         correct for the delegates.
10168
10169 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10170
10171         * class.cs (Constructor.Define): Set the private flag for static
10172         constructors as well.
10173
10174         * cs-parser.jay (statement_expression): Set the return value to
10175         null, to avoid a crash when we catch an error.
10176
10177 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10178
10179         * cs-parser.jay: Applied patch from Jackson that adds support for
10180         extern and unsafe modifiers to destructor declarations.
10181
10182         * expression.cs: Report error 21 if the user is trying to index a
10183         System.Array.
10184
10185         * driver.cs: Add an error message, suggested by the bug report.
10186
10187         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10188         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10189
10190 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10191
10192         * namespace.cs: Add some information to reduce FAQs.
10193
10194 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10195
10196         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10197         underlying enumeration types.  Fixes #43915.
10198
10199         * expression.cs: Treat ushort/short as legal values to be used in
10200         bitwise operations.
10201
10202 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10203
10204         * delegate.cs: transfer custom attributes for paramenters from
10205         the delegate declaration to Invoke and BeginInvoke.
10206
10207 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10208
10209         * attribute.cs: handle custom marshalers and emit marshal info
10210         for fields, too.
10211
10212 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10213
10214         * makefile.gnu: Added anonymous.cs to the compiler sources.
10215
10216 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10217
10218         * iterators.cs: Change the name of the proxy class to include two
10219         underscores.
10220
10221         * cs-parser.jay: Update grammar to include anonymous methods.
10222
10223         * anonymous.cs: new file.
10224
10225 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10226
10227         * class.cs (Field.Define): Add missing test for pointers and
10228         safety. 
10229
10230 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10231
10232         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10233         we use the stobj opcode.
10234
10235         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10236         since it wasn't the correct fix. 
10237
10238         It still is puzzling that we are required to use stobj for IntPtr
10239         which seems to be a ValueType.
10240
10241 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10242
10243         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10244         during regular simple name resolution.   Now, the trick is that
10245         instead of returning for processing the simplename, we do a
10246         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10247         contextual lookup type).   If a match is found, return that, if
10248         not, return for further composition.
10249
10250         This fixes long-standing 30485.
10251
10252         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10253         using the address to initialize an object, do an Stobj instead of
10254         using the regular Stelem.
10255
10256         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10257         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10258         Because if we are a BaseIndexerAccess that value will be true.
10259         Fixes 43643.
10260
10261         * statement.cs (GotoCase.Resolve): Return after reporting an
10262         error, do not attempt to continue. 
10263
10264         * expression.cs (PointerArithmetic.Emit): If our operand is a
10265         long, convert our constants to match the operand before
10266         multiplying.  Convert to I type before adding.   Fixes 43670.
10267
10268 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10269
10270         * enum.cs (ImplicitConversionExists) : Rename to
10271         ImplicitEnumConversionExists to remove ambiguity. 
10272
10273         * ecore.cs (NullCast): New type of cast expression class which
10274         basically is very similar to EmptyCast with the difference being
10275         it still is a constant since it is used only to cast a null to
10276         something else
10277         (eg. (string) null)
10278
10279         * convert.cs (ImplicitReferenceConversion): When casting a null
10280         literal, we return a NullCast.
10281
10282         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10283         should be around anymore.
10284
10285         The renaming (reported was slightly wrong). Corrections:
10286
10287         ConvertImplicitStandard -> ImplicitConversionStandard
10288         ConvertExplicitStandard -> ExplicitConversionStandard
10289
10290         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10291         before passing them in !
10292
10293         * convert.cs (ImplicitConversionStandard): When comparing for
10294         equal expr and target types, ensure that expr is not a
10295         NullLiteral.
10296
10297         In general, we must not be checking (expr_type ==
10298         target_type) in the top level conversion methods
10299         (ImplicitConversion, ExplicitConversion etc). This checking is
10300         done in the methods that they delegate to.
10301
10302 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10303
10304         * convert.cs: Move Error_CannotConvertType,
10305         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10306         ImplicitNumericConversion, ImplicitConversionExists,
10307         ImplicitUserConversionExists, StandardConversionExists,
10308         FindMostEncompassedType, FindMostSpecificSource,
10309         FindMostSpecificTarget, ImplicitUserConversion,
10310         ExplicitUserConversion, GetConversionOperators,
10311         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10312         TryImplicitIntConversion, Error_CannotConvertImplicit,
10313         ConvertImplicitRequired, ConvertNumericExplicit,
10314         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10315         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10316         its own file.
10317
10318         Perform the following renames:
10319
10320         StandardConversionExists -> ImplicitStandardConversionExists
10321         ConvertImplicit -> ImplicitConversion
10322         ConvertImplicitStandard -> ImplicitStandardConversion
10323         TryImplicitIntConversion -> ImplicitIntConversion
10324         ConvertImplicitRequired -> ImplicitConversionRequired
10325         ConvertNumericExplicit -> ExplicitNumericConversion
10326         ConvertReferenceExplicit -> ExplicitReferenceConversion
10327         ConvertExplicit -> ExplicitConversion
10328         ConvertExplicitStandard -> ExplicitStandardConversion
10329
10330 2003-05-19  Martin Baulig  <martin@ximian.com>
10331
10332         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10333         (TypeInfo): Added support for structs having structs as fields.
10334
10335         * ecore.cs (FieldExpr): Implement IVariable.
10336         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10337         VariableInfo for the field.
10338
10339 2003-05-18  Martin Baulig  <martin@ximian.com>
10340
10341         * expression.cs (This.DoResolve): Report a CS0027 if we're
10342         emitting a field initializer.
10343
10344 2003-05-18  Martin Baulig  <martin@ximian.com>
10345
10346         * expression.cs (This.ResolveBase): New public function.
10347         (This.DoResolve): Check for CS0188.
10348
10349         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10350         This.Resolve().
10351
10352         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10353         `instance_expression' to null if we don't have any non-static
10354         methods.
10355
10356 2003-05-18  Martin Baulig  <martin@ximian.com>
10357
10358         Reworked the way how local variables and parameters are handled by
10359         the flow analysis code.
10360
10361         * statement.cs (TypeInfo, VariableMap): New public classes.
10362         (VariableInfo): New public class.  This is now responsible for
10363         checking whether a variable has been assigned.  It is used for
10364         parameters and local variables.
10365         (Block.EmitMeta): Take the InternalParameters as argument; compute
10366         the layout of the flow vectors here.
10367         (Block.LocalMap, Block.ParameterMap): New public properties.
10368         (FlowBranching): The .ctor doesn't get the InternalParameters
10369         anymore since Block.EmitMeta() now computes the layout of the flow
10370         vector.
10371         (MyStructInfo): This class is now known as `StructInfo' and nested
10372         in `TypeInfo'; we don't access this directly anymore.
10373
10374         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10375         property and removed IsAssigned(), IsFieldAssigned(),
10376         SetAssigned() and SetFieldAssigned(); we now call them on the
10377         VariableInfo so we don't need to duplicate this code everywhere.
10378
10379         * expression.cs (ParameterReference): Added `Block block' argument
10380         to the .ctor.
10381         (LocalVariableReference, ParameterReference, This): The new
10382         VariableInfo class is now responsible for all the definite
10383         assignment stuff.
10384
10385         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10386         IsParameterAssigned, SetParameterAssigned): Removed.
10387
10388 2003-05-18  Martin Baulig  <martin@ximian.com>
10389
10390         * typemanager.cs (InitCoreTypes): Try calling
10391         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10392         the 3-args-version.  Corlib now also needs our `void_type'.
10393         (GetMethod): Added overloaded version which takes an optional
10394         `bool report_errors' to allow lookups of optional methods.
10395
10396 2003-05-12  Martin Baulig  <martin@ximian.com>
10397
10398         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10399         only used for locals and not for parameters.
10400
10401 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10402
10403         * support.cs (InternalParameters.ParameterType): Return the
10404         ExternalType of the parameter.
10405
10406         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10407         they were unused.
10408
10409 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10410
10411         * class.cs (MethodData.Define): Do not set the `newslot' on
10412         interface members, if they are also flagged as "override".
10413
10414         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10415         better code for ++i and i++.  This only works for static fields
10416         and local variables.
10417
10418         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10419         want to pull the DeclSpace out of the builder_to_declspace instead
10420         of the TypeBuilder (like in TypeContainer.FindMembers).
10421
10422         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10423         instead of LookupTypeContainer.  Fixes the crash on .NET for
10424         looking up interface members.
10425
10426         * const.cs: Create our own emit context during the Definition
10427         stage, so that constants are evaluated in the proper context, when
10428         a recursive definition happens.
10429
10430 2003-05-11  Martin Baulig  <martin@ximian.com>
10431
10432         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10433         new block for a switch section.
10434         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10435         the adding/lookup in the switch block.  Fixes #39828.
10436
10437 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10438
10439         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10440         functionality: I needed to convert the data after I had performed
10441         the add/sub operation into the operands type size.
10442
10443         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10444         pass the type for the box operation, otherwise the resulting
10445         object would have been of type object.
10446
10447         (BoxedCast): Add constructor to specify the type to box as.
10448
10449 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10450
10451         * iterators.cs: I was reusing the `count' variable inadvertently,
10452         take steps to not allow this to happen.
10453
10454 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10455
10456         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10457         by creating an array at the point where the params starts and
10458         putting all those arguments there, then adjusting the size of the
10459         array.
10460
10461 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10462
10463         * expression.cs (New.AddressOf): Implement interface
10464         IMemoryLocation.  This is used when the `new' operator is used in
10465         the context of an invocation to a method on a value type.
10466
10467         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10468         example. 
10469
10470         * namespace.cs: Also check the using aliases here.
10471
10472         * driver.cs: Move the test for using validity after the types have
10473         been entered, so we do a single pass that also includes the using
10474         aliases. 
10475
10476         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10477         in the regular case.   CreateSiblingForFinally is doing extra
10478         error checking.
10479
10480         * attribute.cs (GetAttributeArgumentExpression): Store the result
10481         on an out value, and use the return value to indicate failure
10482         instead of using null (which is a valid return for Constant.GetValue).
10483
10484         * statement.cs: Perform the analysis flow for the increment
10485         portion after the statement, because this will be the real flow of
10486         execution.  Fixes #42385
10487
10488         * codegen.cs (EmitContext.EmitArgument,
10489         EmitContext.EmitStoreArgument): New helper functions when the
10490         RemapToProxy flag is set.
10491
10492         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10493         function.
10494
10495         Add support for remapping parameters. 
10496
10497         * iterators.cs: Propagate parameter values;  Store parameter
10498         values in the proxy classes.
10499
10500 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10501
10502         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10503         need a proxy reference;  I do not know what I was thinking
10504
10505         * cs-parser.jay (constructor_initializer): catch another error,
10506         and display nice message.
10507
10508         (field_declaration): catch void field declaration
10509         to flag a better error. 
10510
10511         * class.cs (MemberBase.CheckBase): Report an error instead of a
10512         warning if a new protected member is declared in a struct. 
10513         (Field.Define): catch the error of readonly/volatile.
10514
10515         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10516
10517         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10518         volatile variable is taken
10519
10520 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10521
10522         * statement.cs (Fixed.Resolve): Report an error if we are not in
10523         an unsafe context.
10524
10525 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10526
10527         * typemanager.cs: reuse the code that handles type clashes for
10528         delegates and enumerations.
10529
10530         * class.cs (Report28): Always report.
10531
10532         * expression.cs (EncodeAsAttribute): Allow nulls here.
10533
10534 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10537         the functionality for testing whether an expression is valid for
10538         an attribute here.  Also handle the case of arrays of elements
10539         being stored. 
10540
10541         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10542         encoding a linear array into an array of objects that are suitable
10543         to be passed to an CustomAttributeBuilder.
10544
10545         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10546
10547         * ecore.cs: (FieldExpr): Handle field remapping here.
10548
10549         * iteratators.cs: Pass the instance variable (if the method is an
10550         instance method) to the constructors, so we can access the field
10551         variables on the class.
10552
10553         TODO: Test this with structs.  I think the THIS variable on
10554         structs might have to be a pointer, and not a refenrece
10555
10556 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10557
10558         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10559         local variables to fields in a proxy class.
10560
10561         * iterators.cs (PopulateProxy): Rename our internal fields to
10562         <XXX>.  
10563         Create a <THIS> field if we are an instance method, so we can
10564         reference our parent container variables.
10565         (MapVariable): Called back from the EmitContext code to enter a
10566         new variable to field mapping into the proxy class (we just create
10567         a FieldBuilder).
10568
10569         * expression.cs
10570         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10571         for using the remapped locals to fields.
10572
10573         I placed the code here, because that gives the same semantics to
10574         local variables, and only changes the Emit code.
10575
10576         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10577         statements inside iterators.
10578         (VariableInfo): Add a FieldBuilder for the cases when we are
10579         remapping local variables to fields in a proxy class
10580
10581         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10582         current_block != null.
10583
10584         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10585         not cope with strings, as it has been moved to the
10586         TableSwitchEmit.  Fixed bug in switch generation.
10587
10588         * expression.cs (New.DoResolve): Provide more context for the user
10589         when reporting an error.
10590
10591         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10592         pointers. 
10593
10594         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10595         check the permissions for it.  Note than in a type-resolution
10596         context the check was already present in DeclSpace.ResolveType,
10597         but was missing from the MemberAccess.
10598
10599         (ArrayCreation.CheckIndices): warn if the user has
10600         more nested levels of expressions, but there are no more
10601         dimensions specified.  Avoids crash on bug 41906.
10602
10603 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10604
10605         * statement.cs (Block): replace Implicit bool, for a generic
10606         flags.   
10607         New flag: `Unchecked'.  This is used during the EmitMeta phase
10608         (which is out-of-line with the regular Resolve/Emit process for a
10609         statement, as this is done ahead of time, but still gets a chance
10610         to call constant resolve).
10611
10612         (Block.Flags): new enum for adding a new flag.
10613
10614         (Block.EmitMeta): track the state of unchecked.
10615
10616         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10617         to enable constant resolution to work there as well.
10618
10619 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * typemanager.cs (ienumerable_type): Also look up
10622         System.Collections.IEnumerable. 
10623
10624 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10625
10626         TODO: Test more than one conditional per method.
10627
10628         * class.cs (Indexer.Define): Report the location where the user is
10629         referencing the unsupported feature.
10630
10631         (MethodData): Overload the use of `conditionals' to
10632         minimize the creation of needless ArrayLists.   This saves roughly
10633         212kb on my machine.
10634
10635         (Method): Implement the new IIteratorContainer interface.
10636         (Method.SetYields): Implement the method by setting the ModFlags
10637         to contain METHOD_YIELDS.
10638
10639         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10640         which just got set to null.
10641
10642         * iterators.cs: New file.
10643
10644         (Yield, YieldBreak): New statements.
10645
10646         * statement.cs (Return.Resolve): Flag an error if we are used in
10647         an iterator method.
10648
10649         * codegen.cs (InIterator): New flag set if the code is being
10650         compiled in an iterator method.
10651
10652         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10653         internal modifier, and we just use it to avoid adding extra
10654         fields, as this is seldom used.  
10655
10656         * cs-parser.jay: Add yield_statement (yield and yield break).
10657
10658         * driver.cs: New flag -v2 to turn on version 2 features. 
10659
10660         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10661         hashtable when v2 is enabled.
10662
10663 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10666         there is already a namespace defined with this name.
10667
10668         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10669         people upgraded their corlibs.
10670
10671         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10672         always use fully qualified types, no need to use the compiler
10673         front end.
10674
10675         (TypeManager.IsNamespace): Use binarysearch.
10676
10677         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10678         AddDelegate): I did not quite use the new IsValid API properly: I
10679         have to pass the short-name and the fullname.  I was passing only
10680         the basename instead of the fullname sometimes. 
10681
10682         (TypeContainer.DefineType): call NamespaceClash.
10683
10684         * interface.cs (Interface.DefineType): use NamespaceClash before
10685         defining the type.
10686
10687         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10688         defining the type.
10689
10690         * enum.cs: (Enum.DefineType): use NamespaceClash before
10691         defining the type.
10692
10693         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10694         speed increase.  First, use the negative_hits cache when we get a
10695         negative.  Second, add the type with its full original name
10696         instead of the new . and + encoded name (reflection uses + to
10697         separate type from a nested type).  Use LookupTypeReflection
10698         directly which bypasses the type->name hashtable (that we already
10699         know does not contain the type.
10700
10701         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10702         location/container type. 
10703
10704         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10705
10706 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10707
10708         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10709
10710         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10711         method is being referenced in the method group from a static
10712         context, and report error 120 if so.
10713
10714         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10715         Error118. 
10716
10717         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10718         is created, we create the A namespace).
10719
10720         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10721         Fixes #41591
10722
10723 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10724
10725         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10726         invocation to ModuleBuilder.GetType with the same values will
10727         return a new type instance, so we need to cache its return
10728         values. 
10729
10730         * expression.cs (Binary.ResolveOperator): Only allow the compare
10731         operators on enums if they are of the same type.
10732
10733         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10734         types of ValueType on their own case.  Before we were giving them
10735         the same treatment as objects.
10736
10737         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10738         fullname.  Short name is used to compare against container name.
10739         Fullname is used to check against defined namespace names.
10740
10741         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10742         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10743
10744         (Method.CheckBase): Call parent.
10745         (MemberBase.CheckBase): Check for protected members on sealed
10746         classes.
10747         (PropertyBase.CheckBase): Call parent.
10748         (Field.Define): Call parent.
10749
10750         * report.cs: Negative error codes are now mapped to 8000 - code,
10751         so that the display is render more nicely.
10752
10753         * typemanager.cs: Do not use try/catch, instead report a regular
10754         error. 
10755
10756         (GetPointerType, GetReferenceType): These methods provide
10757         mechanisms to obtain the T* and T& from a T.  We had the code
10758         previously scattered around the code base, and it also used
10759         TypeManager.LookupType that would go through plenty of caches.
10760         This one goes directly to the type source.
10761
10762         In some places we did the Type.GetType followed by
10763         ModuleBuilder.GetType, but not in others, so this unifies the
10764         processing as well.
10765
10766         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10767         statements now that we have namespace information.
10768
10769         * typemanager.cs (IsNamespace): New method, returns whether the
10770         string presented is a namespace or not.
10771
10772         (ComputeNamespaces): New public entry point, computes the list of
10773         available namespaces, using the GetNamespaces API call in Mono, or
10774         the slower version in MS.NET.   
10775
10776         Now before we start the semantic analysis phase, we have a
10777         complete list of namespaces including everything that the user has
10778         provided.
10779
10780         Deleted old code to cache namespaces in .nsc files.
10781
10782 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10783
10784         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10785         class/struct location definition Location for the implicit
10786         constructor location.
10787
10788         (Operator.Define): Use the location of the operator for the
10789         implicit Method definition.
10790
10791         (Constructor.Emit): use the constructor location for the implicit
10792         base initializer constructor.
10793
10794         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10795         and the Expression class now contains two new methods:
10796
10797         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10798         isolate type lookup from the rest of the resolution process.
10799
10800         Since we use Expressions to hold type definitions due to the way
10801         we parse the input we have historically overloaded Resolve to
10802         perform the Type lookups if a special flag is passed.  Now this is
10803         eliminated and two methods take their place. 
10804
10805         The differences in the two methods between xStep and xTerminal is
10806         that xStep is involved in our current lookup system that uses
10807         SimpleNames to compose a name, while xTerminal is used just to
10808         catch the case where the simplename lookup failed.
10809
10810 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10811
10812         * expression.cs (ResolveMemberAccess): Remove redundant code.
10813         TypeExpr expressions are always born fully resolved.
10814
10815         * interface.cs (PopulateMethod): Do not lookup the types twice.
10816         We were doing it once during SemanticAnalysis and once during
10817         PopulateMethod.
10818
10819         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10820         in local variable type definitions, were being returned as a
10821         SimpleName (we decomposed everything into a string), that is
10822         because primary_expression was being used instead of a type in the
10823         grammar (reduce/reduce conflicts).
10824
10825         The part that was wrong is that we converted the expression into a
10826         string (an oversimplification in one hand, compounded with primary
10827         expressions doing string concatenation).
10828
10829         So things like:
10830
10831         A.B.C [] x;
10832
10833         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10834         using clauses from working on this particular context.  And a type
10835         was being matched directly against "A.B.C[]".
10836
10837         We now use the correct approach, and allow for ComposedCast to be
10838         part of the unary expression.  So the "A.B.C []" become a composed
10839         cast of "A.B.C" (as a nested group of MemberAccess with a
10840         SimpleName at the end) plus the rank composition "[]". 
10841
10842         Also fixes 35567
10843
10844 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10845
10846         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10847         for the access level checking.
10848
10849         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10850         `TypeContainer container', because I kept getting confused when I
10851         was debugging this code.
10852
10853         * expression.cs (Indexers): Instead of tracking getters/setters,
10854         we now track them in parallel.  We create one arraylist less, but
10855         most importantly it is possible now for the LValue code to find a
10856         matching get for a set.
10857
10858         (IndexerAccess.DoResolveLValue): Update the code.
10859         GetIndexersForType has been modified already to extract all the
10860         indexers from a type.  The code assumed it did not.
10861
10862         Also make the code set the correct return type for the indexer.
10863         This was fixed a long time ago for properties, but was missing for
10864         indexers.  It used to be void_type.
10865
10866         (Binary.Emit): Test first for doubles instead of
10867         floats, as they are more common.
10868
10869         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10870         when dealing with floats and the <=, >= operators.  This fixes bug
10871         #39314 
10872
10873         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10874         to load the array value by emitting a load on the foreach variable
10875         type.  This was incorrect.  
10876
10877         We now emit the code to load an element using the the array
10878         variable type, and then we emit the conversion operator.
10879
10880         Fixed #40176
10881
10882 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10883
10884         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10885
10886 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10887
10888         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10889         test for protection before we test for signatures. 
10890
10891         (MethodSignature.ToString): implement.
10892
10893         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10894         to the case where we reduced into a LongConstant.
10895
10896         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10897         depend on whether the information is acurrate, because the
10898         Microsoft runtime will always claim that the array type is public,
10899         regardless of the real state.
10900
10901         If the type is a pointer, another problem happens: the type is
10902         reported as non-public in Microsoft.  
10903
10904         In both cases we have to call CheckAccessLevel recursively with
10905         the underlying type as the argument to be tested.
10906
10907 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * assign.cs (Assign.Emit): If we are dealing with a compound
10910         assignment expression, we should use the code path that stores the
10911         intermediate result in a temporary value.  This fixes #40903.
10912
10913         *expression.cs (Indirection.ToString): Provide ToString method for
10914         debugging. 
10915
10916 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10917
10918         * class.cs: Null out fields holding references to Block objects so
10919         they can be garbage collected.
10920
10921         * expression.cs (OverloadResolve): Remove unused local.
10922
10923 2003-04-07  Martin Baulig  <martin@ximian.com>
10924
10925         * codegen.cs (EmitContext.CurrentFile): New public field.
10926         (EmitContext.Mark): Use the CurrentFile to check whether the
10927         location is in the correct file.
10928         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10929
10930 2003-04-07  Martin Baulig  <martin@ximian.com>
10931
10932         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10933
10934         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10935         location.  [FIXME: The location argument which gets passed to this
10936         method is sometimes wrong!]
10937
10938 2003-04-07  Nick Drochak <ndrochak@gol.com>
10939
10940         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10941
10942 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10943
10944         * expression.cs (Indirection.EmitAssign): We were using the
10945         temporary, but returning immediately instead of continuing the
10946         EmitAssing flow.
10947
10948 2003-04-06  Martin Baulig  <martin@ximian.com>
10949
10950         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10951         if it's a nested child, but also deriving from the outer class.
10952         See test 190.cs.
10953
10954         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10955         nested child, but also deriving from the outer class.  See
10956         test-190.cs.
10957         (FilterWithClosure): We may access private members of the outer
10958         class if we're a nested child and deriving from the outer class.
10959         (RealMemberLookup): Only set `closure_private_ok' if the
10960         `original_bf' contained BindingFlags.NonPublic.
10961
10962 2003-04-05  Martin Baulig  <martin@ximian.com>
10963
10964         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
10965
10966 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10967
10968         * class.cs (Event.Define): Do not allow abstract events to have
10969         initializers. 
10970
10971 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10972
10973         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10974         block in event declarations.
10975
10976         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10977         value type, get its address.
10978
10979         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10980         leaving a class on the stack instead of a boolean value (int
10981         0/1).  Change the code so we compare against null, and then the
10982         result against zero.
10983
10984         * class.cs (TypeContainer.GetClassBases): We were checking for the
10985         parent class being sealed too late.
10986
10987         * expression.cs (Binary.Emit): For <= and >= when dealing with
10988         floating point values, use cgt.un and clt.un instead of cgt and
10989         clt alone.
10990
10991 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10992
10993         * statement.cs: Apply the same optimization as MS: skip the 
10994         GetEnumerator returning an IEnumerator, and use the one returning a 
10995         CharEnumerator instead. This allows us to avoid the try-finally block 
10996         and the boxing.
10997
10998 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10999
11000         * cs-parser.jay: Attributes cannot be applied to
11001                          namespaces. Fixes #40473
11002
11003 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11004
11005         * class.cs:
11006         (Add*): check if the name is valid using the full name for constants,
11007         fields, properties and events.
11008
11009 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11010
11011         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11012         char constants to be part of the enumeration.
11013
11014         * expression.cs (Conditional.DoResolve): Add support for operator
11015         true. Implements the missing functionality from 14.12
11016
11017         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11018         operator true/false as required by the spec.
11019
11020         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11021         implicit conversion to boolean.
11022
11023         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11024         also one where the type implements `operator true'. 
11025
11026         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11027         get an expression that will invoke operator true based on an
11028         expression.  
11029
11030         (GetConversionOperators): Removed the hack that called op_True
11031         here.  
11032
11033         (Expression.ResolveBoolean): Move this from Statement.
11034
11035 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11036
11037         * ecore.cs (FieldExpr): do not allow initialization of initonly
11038         fields on derived classes
11039
11040 2003-03-13  Martin Baulig  <martin@ximian.com>
11041
11042         * statement.cs (Block.Emit): Call ig.BeginScope() and
11043         ig.EndScope() when compiling with debugging info; call
11044         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11045
11046 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * expression.cs (Indexers): Do not construct immediately, allow
11049         for new members to be appended as we go.  Fixes 38143
11050
11051 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11052
11053         * expression.cs: save/restore context when resolving an unchecked
11054         expression.
11055
11056 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11057
11058         * cfold.cs: Catch division by zero in modulus operator during
11059         constant folding.
11060
11061 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11062
11063         * interface.cs (Interface.DefineMembers): Avoid defining members
11064         twice. 
11065
11066 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * driver.cs: handle the +/- options for -noconfig
11069
11070         * statement.cs (Unckeched.Resolve): Also track the state of
11071         unchecked in the Resolve phase.
11072
11073 2003-02-27  Martin Baulig  <martin@ximian.com>
11074
11075         * ecore.cs (Expression.MemberLookup): Don't create a
11076         MethodGroupExpr for something which is not a method.  Fixes #38291.
11077
11078 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11079
11080         * class.cs (MemberBase.CheckParameters): Also check that the type
11081         is unmanaged if it is a pointer.
11082
11083         * expression.cs (SizeOf.Resolve): Add location information.
11084
11085         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11086         a managed type is declared.
11087
11088         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11089         parameter modifiers as well.  Fixes bug 38606
11090
11091         * class.cs: Very sad.  Am backing out the speed up changes
11092         introduced by the ArrayList -> Array in the TypeContainer, as they
11093         were not actually that much faster, and introduced a bug (no error
11094         reports on duplicated methods).
11095
11096         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11097         source first, this will guarantee that we have a valid expression
11098         before calling in lower levels functions that will require a
11099         resolved object.  Then use this original_source in the
11100         target.ResolveLValue instead of the original source that was
11101         passed to us.
11102
11103         Another change.  Use target.Resolve instead of LValueResolve.
11104         Although we are resolving for LValues, we will let the Assign code
11105         take care of that (it will be called again from Resolve).  This
11106         basically allows code like this:
11107
11108         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11109         class Y { void A (X x) { x [0] += o; }
11110
11111         The problem was that the indexer was trying to resolve for
11112         set_Item (idx, object o) and never finding one.  The real set_Item
11113         was set_Item (idx, X).  By delaying the process we get the right
11114         semantics. 
11115
11116         Fixes bug 36505
11117
11118 2003-02-23  Martin Baulig  <martin@ximian.com>
11119
11120         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11121         while calling DoEmit ().
11122
11123         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11124         source files; if you use the #line directive inside a method, the
11125         compiler stops emitting line numbers for the debugger until it
11126         reaches the end of the method or another #line directive which
11127         restores the original file.
11128
11129 2003-02-23  Martin Baulig  <martin@ximian.com>
11130
11131         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11132
11133 2003-02-23  Martin Baulig  <martin@ximian.com>
11134
11135         * statement.cs (Block.AddChildVariableNames): We need to call this
11136         recursively, not just for our immediate children.
11137
11138 2003-02-23  Martin Baulig  <martin@ximian.com>
11139
11140         * class.cs (Event.Define): Always make the field private, like csc does.
11141
11142         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11143         actually work, fixes bug #37521.
11144
11145 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11146
11147         * delegate.cs: When creating the various temporary "Parameters"
11148         classes, make sure that we call the ComputeAndDefineParameterTypes
11149         on those new parameters (just like we do with the formal ones), to
11150         allow them to be resolved in the context of the DeclSpace.
11151
11152         This fixes the bug that Dick observed in Bugzilla #38530.
11153
11154 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11155
11156         * expression.cs (ResolveMemberAccess): When resolving a constant,
11157         do not attempt to pull a constant if the value was not able to
11158         generate a valid constant.
11159
11160         * const.cs (LookupConstantValue): Do not report more errors than required.
11161
11162 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11163
11164         * expression.cs: fixes bug #38328.
11165
11166 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11167
11168         * class.cs: Changed all the various members that can be part of a
11169         class from being an ArrayList to be an Array of the right type.
11170         During the DefineType type_list, interface_list, delegate_list and
11171         enum_list are turned into types, interfaces, delegates and enums
11172         arrays.  
11173
11174         And during the member population, indexer_list, event_list,
11175         constant_list, field_list, instance_constructor_list, method_list,
11176         operator_list and property_list are turned into their real arrays.
11177
11178         Although we could probably perform this operation earlier, for
11179         good error reporting we need to keep the lists and remove the
11180         lists for longer than required.
11181
11182         This optimization was triggered by Paolo profiling the compiler
11183         speed on the output of `gen-sample-program.pl' perl script. 
11184
11185         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11186         not crash in methods like MemberLookupFailed that use this field.  
11187
11188         This problem arises when the compiler fails to resolve a type
11189         during interface type definition for example.
11190
11191 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11192
11193         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11194         inherit from System.Object, so we have to stop at null, not only
11195         when reaching System.Object.
11196
11197 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11198
11199         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11200         DeclaredOnly because the parent indexer might have had a different
11201         name, but did not loop until the top of the hierarchy was reached.
11202
11203         The problem this one fixes is 35492: when a class implemented an
11204         indexer from an interface, we were getting the interface method
11205         (which was abstract) and we were flagging an error (can not invoke
11206         abstract method).
11207
11208         This also keeps bug 33089 functioning, and test-148 functioning.
11209
11210         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11211         out if a method is special is to see if it is declared in a
11212         property or event, or whether it is one of the predefined operator
11213         names.   This should fix correctly #36804.
11214
11215 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11216
11217         The goal here is to remove the dependency on EmptyCast.Peel ().
11218         Killing it completely.
11219
11220         The problem is that currently in a number of places where
11221         constants are expected, we have to "probe" for an EmptyCast, and
11222         Peel, which is not the correct thing to do, as this will be
11223         repetitive and will likely lead to errors. 
11224
11225         The idea is to remove any EmptyCasts that are used in casts that
11226         can be reduced to constants, so we only have to cope with
11227         constants. 
11228
11229         This bug hunt was triggered by Bug 37363 and the desire to remove
11230         the duplicate pattern where we were "peeling" emptycasts to check
11231         whether they were constants.  Now constants will always be
11232         constants.
11233
11234         * ecore.cs: Use an enumconstant here instead of wrapping with
11235         EmptyCast.  
11236
11237         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11238         throwing me off.  By handling this we can get rid of a few hacks.
11239
11240         * statement.cs (Switch): Removed Peel() code.
11241
11242 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11243
11244         * class.cs: Location information for error 508
11245
11246         * expression.cs (New.DoResolve): Add a guard against double
11247         resolution of an expression.  
11248
11249         The New DoResolve might be called twice when initializing field
11250         expressions (see EmitFieldInitializers, the call to
11251         GetInitializerExpression will perform a resolve on the expression,
11252         and later the assign will trigger another resolution
11253
11254         This leads to bugs (#37014)
11255
11256         * delegate.cs: The signature for EndInvoke should contain any ref
11257         or out parameters as well.  We were not doing this in the past. 
11258
11259         * class.cs (Field.Define): Do not overwrite the type definition
11260         inside the `volatile' group.  Turns out that volatile enumerations
11261         were changing the type here to perform a validity test, which
11262         broke conversions. 
11263
11264 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11267         and structs, we do not want to load the instance variable
11268
11269         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11270         enum_type has to be handled like an object reference (implicit
11271         conversions exists from this to object), but the regular IsClass
11272         and IsValueType tests will never return true for this one.
11273
11274         Also we use TypeManager.IsValueType instead of type.IsValueType,
11275         just for consistency with the rest of the code (this is only
11276         needed if we ever use the construct exposed by test-180.cs inside
11277         corlib, which we dont today).
11278
11279 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11280
11281         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11282         just InternalCall.
11283
11284 2003-02-09  Martin Baulig  <martin@ximian.com>
11285
11286         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11287         (Namespace.DefineNamespaces): New static public method; this is
11288         called when we're compiling with debugging to add all namespaces
11289         to the symbol file.
11290
11291         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11292         pass it to the Namespace's .ctor.
11293
11294         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11295         and MethodBase arguments; pass the namespace ID to the symwriter;
11296         pass the MethodBase instead of the token to the symwriter.
11297         (SymbolWriter.DefineNamespace): New method to add a namespace to
11298         the symbol file.
11299
11300 2003-02-09  Martin Baulig  <martin@ximian.com>
11301
11302         * symbolwriter.cs: New file.  This is a wrapper around
11303         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11304         methods here in near future.
11305
11306 2003-02-09  Martin Baulig  <martin@ximian.com>
11307
11308         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11309         ILGenerator.MarkSequencePoint() which are actually used by the
11310         symbol writer.
11311
11312 2003-02-09  Martin Baulig  <martin@ximian.com>
11313
11314         * location.cs (SourceFile): New public sealed class.  This
11315         contains the name and an index which is used in the location's token.
11316         (Location): Reserve an appropriate number of bits in the token for
11317         the source file instead of walking over that list, this gives us a
11318         really huge performance improvement when compiling with debugging.
11319
11320         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11321         `SourceFile' argument instead of a string.
11322         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11323         but don't parse/tokenize here, we need to generate the list of all
11324         source files before we do that.
11325         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11326         the files.
11327
11328         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11329         instead of a string.
11330
11331         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11332         of a string.
11333
11334 2003-02-09  Martin Baulig  <martin@ximian.com>
11335
11336         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11337         filename on `#line default'.
11338
11339 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11340
11341         * statement.cs: don't clear the pinned var when the fixed statement
11342         returns from the method (fixes bug#37752).
11343
11344 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11345
11346         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11347         to IsValueType.
11348
11349 2003-02-07  Martin Baulig  <martin@ximian.com>
11350
11351         * driver.cs: Removed the `--debug-args' command line argument.
11352
11353         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11354         automatically by the AsssemblyBuilder.
11355         (CodeGen.InitializeSymbolWriter): We don't need to call any
11356         initialization function on the symbol writer anymore.  This method
11357         doesn't take any arguments.
11358
11359 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11362         from referenced assemblies as well.
11363
11364 2003-02-02  Martin Baulig  <martin@ximian.com>
11365
11366         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11367
11368 2003-02-02  Martin Baulig  <martin@ximian.com>
11369
11370         * class.cs (Constructor.Emit): Open the symbol writer before
11371         emitting the constructor initializer.
11372         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11373         single-stepping through constructor initializers.
11374
11375 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11376
11377         * class.cs: Handle error 549: do not allow virtual methods in
11378         sealed classes. 
11379
11380 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11381
11382         * decl.cs: Check access levels when resolving types
11383
11384 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11385
11386         * statement.cs: Add parameters and locals set in catch blocks that might 
11387         return to set vector
11388
11389 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11390
11391         * class.cs (Operator): Set the SpecialName flags for operators.
11392
11393         * expression.cs (Invocation.DoResolve): Only block calls to
11394         accessors and operators on SpecialName methods.
11395
11396         (Cast.TryReduce): Handle conversions from char constants.
11397
11398
11399 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11400
11401         * statement.cs: small memory and time optimization in FlowBranching.
11402
11403 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11404
11405         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11406         problem that the last fix but in the other sid (Set).
11407
11408         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11409         access when there is no indexer in the hierarchy.
11410
11411 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11412
11413         * class.cs: Combine some if statements.
11414
11415 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11416
11417         * driver.cs: fixed bug #37187.
11418
11419 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11420
11421         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11422         any indexer, it's needed to build a list with all the indexers in the
11423         hierarchy (AllGetters), else we have problems. Fixes #35653.
11424
11425 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11426
11427         * class.cs (MethodData.Define): It is wrong for an interface
11428         implementation to be static in both cases: explicit and implicit.
11429         We were only handling this in one case.
11430
11431         Improve the if situation there to not have negations.
11432
11433         * class.cs (Field.Define): Turns out that we do not need to check
11434         the unsafe bit on field definition, only on usage.  Remove the test.
11435
11436 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11437
11438         * driver.cs: use assembly.Location instead of Codebase (the latest
11439         patch made mcs fail when using MS assemblies).
11440
11441 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11442
11443         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11444         get the path to *corlib.dll.
11445
11446 2003-01-21  Nick Drochak <ndrochak@gol.com>
11447
11448         * cs-tokenizer.cs:
11449         * pending.cs:
11450         * typemanager.cs: Remove compiler warnings
11451
11452 2003-01-20  Duncan Mak  <duncan@ximian.com>
11453
11454         * AssemblyInfo.cs: Bump the version number to 0.19.
11455
11456 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11457
11458         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11459
11460 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11461
11462         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11463
11464 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11465
11466         * cs-parser.jay: Small fix: we were not comparing the constructor
11467         name correctly.   Thanks to Zoltan for the initial pointer.
11468
11469 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11470
11471         * cs-tokenizer.cs: Set file name when specified with #line
11472
11473 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11474
11475         * cs-parser.jay: Only perform the constructor checks here if we
11476         are named like the class;  This will help provider a better
11477         error.  The constructor path is taken when a type definition is
11478         not found, but most likely the user forgot to add the type, so
11479         report that rather than the constructor error.
11480
11481 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11482
11483         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11484         allocations.
11485
11486 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11487
11488         * cs-parser.jay: Add cleanup call.
11489
11490 2003-01-13  Duncan Mak  <duncan@ximian.com>
11491
11492         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11493         consistent with other methods.
11494
11495 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11496
11497         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11498
11499 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11500
11501         * attribute.cs: only set GuidAttr to true when we have a
11502         GuidAttribute.
11503
11504 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11505
11506         * ecore.cs:
11507         * expression.cs:
11508         * typemanager.cs: fixes to allow mcs compile corlib with the new
11509         Type.IsSubclassOf fix.
11510
11511 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11512
11513         * expression.cs (LocalVariableReference.DoResolve): Classify a
11514         constant as a value, not as a variable.   Also, set the type for
11515         the variable.
11516
11517         * cs-parser.jay (fixed_statement): take a type instead of a
11518         pointer_type, so we can produce a better error message later.
11519
11520         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11521         as an error.  
11522
11523         (For.DoEmit): Make inifinite loops have a
11524         non-conditional branch back.
11525
11526         (Fixed.DoEmit): First populate the pinned variables, then emit the
11527         statement, then clear the variables.  Before I was emitting the
11528         code once for each fixed piece.
11529
11530
11531 2003-01-08  Martin Baulig  <martin@ximian.com>
11532
11533         * statement.cs (FlowBranching.MergeChild): A break in a
11534         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11535
11536 2003-01-08  Martin Baulig  <martin@ximian.com>
11537
11538         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11539         lives in the same number space than `param_map'.  Fixes #36154.
11540
11541 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11542
11543         * cs-parser.jay (constructor_declaration): Set the
11544         Constructor.ModFlags before probing for it.  This makes the
11545         compiler report 514, 515 and 132 (the code was there, but got
11546         broken). 
11547
11548         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11549         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11550         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11551
11552 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11553
11554         * enum.cs: create the enum static fields using the enum type.
11555
11556 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11557
11558         * class.cs: don't try to create the ParamBuilder for the return
11559         type if it's not needed (and handle it breaking for the ms runtime
11560         anyway).
11561
11562 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11563
11564         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11565
11566 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11567
11568         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11569         the command.   This showed up while compiling the JANET source
11570         code, which used \r as its only newline separator.
11571
11572 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11573
11574         * class.cs (Method.Define): If we are an operator (because it
11575         reuses our code), then set the SpecialName and HideBySig.  #36128
11576
11577 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11578
11579         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11580         exception, report error 120 `object reference required'.
11581
11582         * driver.cs: Add --pause option, used during to measure the size
11583         of the process as it goes with --timestamp.
11584
11585         * expression.cs (Invocation.DoResolve): Do not allow methods with
11586         SpecialName to be invoked.
11587
11588 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11589
11590         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11591         number before adding it.
11592
11593 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11594
11595         * ecore.cs (StandardImplicitConversion): When in an unsafe
11596         context, we allow conversion between void * to any other pointer
11597         type. This fixes bug #35973.
11598
11599 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11600
11601         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11602         is not thrown when extensionless outputs are used 
11603
11604 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11605
11606         * rootcontext.cs: fixed compilation of corlib.
11607
11608 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11609
11610         * attribute.cs (Attributes.Contains): Add new method.
11611
11612         * class.cs (MethodCore.LabelParameters): if the parameter is an
11613         `out' parameter, check that no attribute `[In]' has been passed.
11614
11615         * enum.cs: Handle the `value__' name in an enumeration.
11616
11617 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11618
11619         * decl.cs: Added special case to allow overrides on "protected
11620         internal" methods
11621
11622 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11623
11624         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11625         since it makes much more sense.
11626
11627         (Attributes.ctor): Don't require a Location parameter.
11628
11629         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11630
11631         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11632         since we already have that information per attribute.
11633
11634         * everywhere : make appropriate changes.
11635
11636         * class.cs (LabelParameters): Write the code which actually
11637         applies attributes to the return type. We can't do this on the MS
11638         .NET runtime so we flag a warning in the case an exception is
11639         thrown.
11640
11641 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11642
11643         * const.cs: Handle implicit null conversions here too.
11644
11645 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11646
11647         * class.cs (MethodCore.LabelParameters): Remove the extra
11648         Type [] parameter since it is completely unnecessary. Instead
11649         pass in the method's attributes so that we can extract
11650         the "return" attribute.
11651
11652 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11655         of ignoring it and letting the compile continue.
11656
11657         * typemanager.cs (ChangeType): use an extra argument to return an
11658         error condition instead of throwing an exception.
11659
11660 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * expression.cs (Unary.TryReduce): mimic the code for the regular
11663         code path.  Perform an implicit cast in the cases where we can
11664         implicitly convert to one of the integral types, and then reduce
11665         based on that constant.   This fixes bug #35483.
11666
11667 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11668
11669         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11670
11671 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11672
11673         * namespace.cs: fixed bug #35489.
11674
11675 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11676
11677         * class.cs: Remove some dead code.
11678
11679         * cs-parser.jay: Estimate the number of methods needed
11680         (RootContext.MethodCount);
11681
11682         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11683         numbers instead of StringBuilders.
11684
11685         * support.cs (PtrHashtable): Add constructor with initial size;
11686         We can now reduce reallocations of the method table.
11687
11688 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11689
11690         * attribute.cs (ApplyAttributes): Keep track of the emitted
11691         attributes on a per-target basis. This fixes bug #35413.
11692
11693 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11694
11695         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11696         default to the Windows 1252 encoding.
11697
11698         (UnixParseOption): Support version, thanks to Alp for the missing
11699         pointer. 
11700
11701         * AssemblyInfo.cs: Add nice assembly information.
11702
11703         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11704         (bug 35169).
11705
11706         * cs-parser.jay: Allow a trailing comma before the close bracked
11707         in the attribute_section production.
11708
11709         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11710         address of the instance was being taken, I will take this out,
11711         because we take the address of the object immediately here.
11712
11713 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11714
11715         * typemanager.cs (AreMultipleAllowed): Take care of the most
11716         obvious case where attribute type is not in the current assembly -
11717         stupid me ;-)
11718
11719 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11722         definitions, instead of doing that afterwards.  
11723
11724         Also we use a nice little hack, depending on the constructor, we
11725         know if we are a "composed" name or a simple name.  Hence, we
11726         avoid the IndexOf test, and we avoid 
11727
11728         * codegen.cs: Add code to assist in a bug reporter to track down
11729         the source of a compiler crash. 
11730
11731 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11732
11733         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11734         types have been emitted for a given element and flag an error
11735         if something which does not have AllowMultiple set is used more
11736         than once.
11737
11738         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11739         attribute types and their corresponding AllowMultiple properties
11740
11741         (AreMultipleAllowed): Check the property for a given type.
11742
11743         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11744         property in the case we have a TypeContainer.
11745
11746         (Attributes.AddAttribute): Detect duplicates and just skip on
11747         adding them. This trivial fix catches a pretty gross error in our
11748         attribute emission - global attributes were being emitted twice!
11749
11750         Bugzilla bug #33187 is now fixed.
11751
11752 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11755         instead of pp_and).
11756
11757         * expression.cs (Binary.ResolveOperator): I can only use the
11758         Concat (string, string, string) and Concat (string, string,
11759         string, string) if the child is actually a concatenation of
11760         strings. 
11761
11762 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11763
11764         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11765         context where we need a 2-character lookahead.
11766
11767         * pending.cs (PendingImplementation): Rework so we can keep track
11768         of interface types all the time, and flag those which were
11769         implemented by parents as optional.
11770
11771 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * expression.cs (Binary.ResolveOperator): Use
11774         String.Concat(string,string,string) or
11775         String.Concat(string,string,string,string) when possible. 
11776
11777         * typemanager: More helper methods.
11778
11779
11780 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11781
11782         * pending.cs: remove the bogus return from GetMissingInterfaces()
11783         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11784
11785 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11786
11787         * namespace.cs: avoid duplicated 'using xxx' being added to
11788         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11789         when we get more than one 'using' statement for the same namespace.
11790         Report a CS0105 warning for it.
11791
11792 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11793
11794         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11795         of calling getChar/putback, uses internal knowledge of it.    
11796
11797         (xtoken): Reorder tokenizer so most common patterns are checked
11798         first.  This reduces the compilation time in another 5% (from 8.11s
11799         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11800
11801         The parsing time is 22% of the compilation in mcs, and from that
11802         64% is spent on the tokenization process.  
11803
11804         I tried using a binary search for keywords, but this is slower
11805         than the hashtable.  Another option would be to do a couple of
11806         things:
11807
11808                 * Not use a StringBuilder, instead use an array of chars,
11809                   with a set value.  Notice that this way we could catch
11810                   the 645 error without having to do it *afterwards*.
11811
11812                 * We could write a hand-parser to avoid the hashtable
11813                   compares altogether.
11814
11815         The identifier consumption process takes 37% of the tokenization
11816         time.  Another 15% is spent on is_number.  56% of the time spent
11817         on is_number is spent on Int64.Parse:
11818
11819                 * We could probably choose based on the string length to
11820                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11821                   computations. 
11822
11823         Another 3% is spend on wrapping `xtoken' in the `token' function.
11824
11825         Handle 0xa0 as whitespace (#34752)
11826
11827 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11828
11829         * typemanager.cs (IsCLRType): New routine to tell whether a type
11830         is one of the builtin types.  
11831
11832         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11833         typecode in more places instead of doing pointer comparissions.
11834         We could leverage some knowledge about the way the typecodes are
11835         laid out.
11836
11837         New code to cache namespaces in assemblies, it is currently not
11838         invoked, to be used soon.
11839
11840         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11841
11842         * expression.cs (Binary.ResolveOperator): specially handle
11843         strings, and do not perform user-defined operator overloading for
11844         built-in types.
11845
11846 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11847
11848         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11849         internalcall as it is a pretty simple operation;  Avoid whenever
11850         possible to call Char.IsLetter.
11851
11852         (consume_identifier): Cut by half the number of
11853         hashtable calls by merging the is_keyword and GetKeyword behavior.
11854
11855         Do not short-circuit, because if we do, we
11856         report errors (ie, #if false && true would produce an invalid
11857         directive error);
11858
11859
11860 2002-11-24  Martin Baulig  <martin@ximian.com>
11861
11862         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11863         check constant ranges and report a CS0221.  Fixes #33186.
11864
11865 2002-11-24  Martin Baulig  <martin@ximian.com>
11866
11867         * cs-parser.jay: Make this work for uninitialized variable
11868         declarations in the `for' initializer.  Fixes #32416.
11869
11870 2002-11-24  Martin Baulig  <martin@ximian.com>
11871
11872         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11873         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11874
11875 2002-11-24  Martin Baulig  <martin@ximian.com>
11876
11877         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11878         argument; if true, we also check for user-defined conversions.
11879         This is only needed if both arguments are of a user-defined type.
11880         Fixes #30443, added test-175.cs.
11881         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11882
11883         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11884
11885 2002-11-24  Martin Baulig  <martin@ximian.com>
11886
11887         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11888         function to get the store opcode.
11889         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11890         only emit the Ldelema if the store opcode is Stobj.  You must run
11891         both test-34 and test-167 to test this.  Fixes #34529.
11892
11893 2002-11-23  Martin Baulig  <martin@ximian.com>
11894
11895         * ecore.cs (Expression.MemberLookup): Added additional
11896         `qualifier_type' argument which is used when we're being called
11897         from MemberAccess.DoResolve() and null if we're called from a
11898         SimpleName lookup.
11899         (Expression.MemberLookupFailed): New method to report errors; this
11900         does the CS1540 check and reports the correct error message.
11901
11902         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11903         argument for the CS1540 check and redone the way how we're dealing
11904         with private members.  See the comment in the source code for details.
11905         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11906         `closure_start_type' to `closure_qualifier_type' and check whether
11907         it's not null.  It was not this filter being broken, it was just
11908         being called with the wrong arguments.
11909
11910         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11911         and pass it the correct `qualifier_type'; this also does the error
11912         handling for us.
11913
11914 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11915
11916         * expression.cs (Invocation.EmitParams): If the we are dealing
11917         with a non-built-in value type, load its address as well.
11918
11919         (ArrayCreation): Use a a pretty constant instead
11920         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11921         static initializers.  
11922
11923         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11924         because they are not really value types, just glorified integers. 
11925
11926         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11927
11928         * ecore.cs: Remove redundant code for enumerations, make them use
11929         the same code path as everything else, fixes the casting issue
11930         with enumerations in Windows.Forms.
11931
11932         * attribute.cs: Do only cast to string if it is a string, the
11933         validation happens later.
11934
11935         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11936         people upgrade their corlibs.
11937
11938         * ecore.cs: Oops, enumerations were not following the entire code path
11939
11940 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11941
11942         * typemanager.cs (FilterWithClosure): Commented out the test for
11943         1540 in typemanager.cs, as it has problems when accessing
11944         protected methods from a parent class (see test-174.cs). 
11945
11946         * attribute.cs (Attribute.ValidateGuid): new method.
11947         (Attribute.Resolve): Use above.
11948
11949 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11952
11953         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11954         handling for enumerations, as we only needed the TypeContainer
11955         functionality to begin with (this is required for the fix below to
11956         work for enums that reference constants in a container class for
11957         example). 
11958
11959         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11960
11961         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11962         a valid TypeBuilder to perform lookups on.o
11963
11964         * class.cs (InheritableMemberSignatureCompare): Use true in the
11965         call to GetGetMethod and GetSetMethod, because we are comparing
11966         the signature, and we need to get the methods *even* if they are
11967         private. 
11968
11969         (PropertyBase.CheckBase): ditto.
11970
11971         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11972         GotoCase.Resolve): Use Peel on EmpytCasts.
11973
11974         * ecore.cs (EmptyCast): drop child, add Peel method.
11975
11976 2002-11-17  Martin Baulig  <martin@ximian.com>
11977
11978         * ecore.cs (EmptyCast.Child): New public property.
11979
11980         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11981         label resolved to an EmptyCast.  Fixes #34162.
11982         (GotoCase.Resolve): Likewise.
11983         (Block.EmitMeta): Likewise.
11984
11985 2002-11-17  Martin Baulig  <martin@ximian.com>
11986
11987         * expression.cs (Invocation.BetterConversion): Prefer int over
11988         uint; short over ushort; long over ulong for integer literals.
11989         Use ImplicitConversionExists instead of StandardConversionExists
11990         since we also need to check for user-defined implicit conversions.
11991         Fixes #34165.  Added test-173.cs.
11992
11993 2002-11-16  Martin Baulig  <martin@ximian.com>
11994
11995         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11996         with the `true' and `false' literals.  Fixes #33151.
11997
11998 2002-11-16  Martin Baulig  <martin@ximian.com>
11999
12000         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12001         October 22nd; don't do the cs1540 check for static members.
12002
12003         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12004         now using our own filter here and doing the cs1540 check again.
12005
12006 2002-11-16  Martin Baulig  <martin@ximian.com>
12007
12008         * support.cs (InternalParameters): Don't crash if we don't have
12009         any fixed parameters.  Fixes #33532.
12010
12011 2002-11-16  Martin Baulig  <martin@ximian.com>
12012
12013         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12014         when looking up static methods to make this work on Windows.
12015         Fixes #33773.
12016
12017 2002-11-16  Martin Baulig  <martin@ximian.com>
12018
12019         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12020         a setter rather than using PropertyInfo.CanWrite.
12021
12022 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12023
12024         * class.cs: Allow acces to block member by subclasses. Fixes build
12025         breaker.
12026
12027 2002-11-14  Martin Baulig  <martin@ximian.com>
12028
12029         * class.cs (Constructor.Emit): Added the extern/block check.
12030         Fixes bug #33678.
12031
12032 2002-11-14  Martin Baulig  <martin@ximian.com>
12033
12034         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12035         iteration while looking for indexers, this is needed because the
12036         indexer may have a different name in our base classes.  Fixed the
12037         error reporting (no indexers at all, not get accessor, no
12038         overloaded match).  Fixes bug #33089.
12039         (IndexerAccess.DoResolveLValue): Likewise.
12040
12041 2002-11-14  Martin Baulig  <martin@ximian.com>
12042
12043         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12044         indexers.  Fixes the first part of bug #33089.
12045         (MethodSignature.InheritableMemberSignatureCompare): Added support
12046         for properties.
12047
12048 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12049
12050         * attribute.cs (Attribute.Resolve): Catch the
12051         NullReferenceException and report it since it isn't supposed to
12052         happen. 
12053
12054 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12055
12056         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12057         LogicalOr and LogicalAnd that can benefit from recursively
12058         handling EmitBranchable.  The code now should be nice for Paolo.
12059
12060 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12061
12062         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12063         the Type lookups, as we perform quite a number of lookups on
12064         non-Types.  This can be removed once we can deterministically tell
12065         whether we have a type or a namespace in advance.
12066
12067         But this might require special hacks from our corlib.
12068
12069         * TODO: updated.
12070
12071         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12072         and double which avoids a conversion from an integer to a double.
12073
12074         * expression.cs: tiny optimization, avoid calling IsConstant,
12075         because it effectively performs the lookup twice.
12076
12077 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12078
12079         But a bogus return here to keep the semantics of the old code
12080         until the Mono runtime is fixed.
12081
12082         * pending.cs (GetMissingInterfaces): New method used to remove all
12083         the interfaces that are already implemented by our parent
12084         classes from the list of pending methods. 
12085
12086         * interface.cs: Add checks for calls after ResolveTypeExpr.
12087
12088 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12089
12090         * class.cs (Class.Emit): Report warning 67: event not used if the
12091         warning level is beyond 3.
12092
12093         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12094         being a NullLiteral.
12095
12096         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12097         specifiers. 
12098
12099         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12100         path that might fail if a type can not be resolved.
12101
12102         * expression.cs (Binary.Emit): Emit unsigned versions of the
12103         operators. 
12104
12105         * driver.cs: use error 5.
12106
12107 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12108
12109         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12110
12111 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12112
12113         * cs-parser.jay (switch_section): A beautiful patch from Martin
12114         Baulig that fixed 33094.
12115
12116 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12117
12118         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12119         Check whether the base is abstract and report an error if so.
12120
12121         * expression.cs (IndexerAccess.DoResolveLValue,
12122         IndexerAccess.DoResolve): ditto. 
12123
12124         (Invocation.DoResolve): ditto.
12125
12126         (Invocation.FullMethodDesc): Improve the report string.
12127
12128         * statement.cs (Block): Eliminate IsVariableDefined as it is
12129         basically just a wrapper for GetVariableInfo.
12130
12131         * ecore.cs (SimpleName): Use new 
12132
12133         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12134         type, as we return the actual parameter ref/unref state on a
12135         different call.
12136
12137 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12138
12139         * support.cs: Return proper flags REF/OUT fixing the previous
12140         commit.  
12141
12142         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12143         not used to mean `ref' but `ref or out' in ParameterReference
12144
12145         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12146         full type signature instead of calling TypeManger.CSharpName
12147         ourselves. 
12148
12149         * support.cs (InternalParameters.ParameterDesc): Do not compare
12150         directly to the modflags, because REF/OUT will actually be bitsets
12151         if set. 
12152
12153         * delegate.cs (VerifyMethod): Check also the modifiers.
12154
12155         * cs-tokenizer.cs: Fix bug where floating point values with an
12156         exponent where a sign was missing was ignored.
12157
12158         * driver.cs: Allow multiple assemblies to be specified in a single
12159         /r: argument
12160
12161 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12164         because identifiers after a parenthesis would end up in this kind
12165         of production, and we needed to desamiguate it for having casts
12166         like:
12167
12168                 (UserDefinedType *) xxx
12169
12170 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12171
12172         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12173         we should set on the Bindingflags.NonPublic, but not turn on
12174         private_ok.  private_ok controls whether a Private member is
12175         returned (this is chekced on the filter routine), while the
12176         BindingFlags.NonPublic just controls whether private/protected
12177         will be allowed.   This fixes the problem part of the problem of
12178         private properties being allowed to be used in derived classes.
12179
12180         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12181         so we can call the children DoResolveLValue method (this will
12182         properly signal errors on lvalue assignments to base properties)
12183
12184         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12185         getter are null, and we have a property info, we know that this
12186         happened because the lookup failed, so we report an error 122 for
12187         protection level violation.
12188
12189         We also silently return if setter and getter are null in the
12190         resolve functions, this condition only happens if we have flagged
12191         the error before.  This is the other half of the problem. 
12192
12193         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12194         not have accessibility information, that is why we were returning
12195         true in the filter function in typemanager.cs.
12196
12197         To properly report 122 (property is inaccessible because of its
12198         protection level) correctly, we report this error in ResolveAccess
12199         by failing if both the setter and the getter are lacking (ie, the
12200         lookup failed). 
12201
12202         DoResolve and DoLResolve have been modified to check for both
12203         setter/getter being null and returning silently, the reason being
12204         that I did not want to put the knowledge about this error in upper
12205         layers, like:
12206
12207         int old = Report.Errors;
12208         x = new PropertyExpr (...);
12209         if (old != Report.Errors)
12210                 return null;
12211         else
12212                 return x;
12213
12214         So the property expr is returned, but it is invalid, so the error
12215         will be flagged during the resolve process. 
12216
12217         * class.cs: Remove InheritablePropertySignatureCompare from the
12218         class, as we no longer depend on the property signature to compute
12219         whether it is possible to implement a method or not.
12220
12221         The reason is that calling PropertyInfo.GetGetMethod will return
12222         null (in .NET, in Mono it works, and we should change this), in
12223         cases where the Get Method does not exist in that particular
12224         class.
12225
12226         So this code:
12227
12228         class X { public virtual int A { get { return 1; } } }
12229         class Y : X { }
12230         class Z : Y { public override int A { get { return 2; } } }
12231
12232         Would fail in Z because the parent (Y) would not have the property
12233         defined.  So we avoid this completely now (because the alternative
12234         fix was ugly and slow), and we now depend exclusively on the
12235         method names.
12236
12237         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12238         reference method, instead of using the property.
12239
12240         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12241         routines are gone now.
12242
12243         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12244         names, they were incorrectly named.
12245
12246         * cs-tokenizer.cs: Return are more gentle token on failure. 
12247
12248         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12249         had an out-of-sync index variable, which caused it to remove from
12250         the list of pending methods the wrong method sometimes.
12251
12252 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12255         CanWrite, because those refer to this particular instance of the
12256         property, and do not take into account the fact that we can
12257         override single members of a property.
12258
12259         Constructor requires an EmitContext.  The resolution process does
12260         not happen here, but we need to compute the accessors before,
12261         because the resolution does not always happen for properties.
12262
12263         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12264         subclass, before we did not update this flag, but we did update
12265         bindingflags. 
12266
12267         (GetAccessors): Drop this routine, as it did not work in the
12268         presence of partially overwritten set/get methods. 
12269
12270         Notice that this broke the cs1540 detection, but that will require
12271         more thinking. 
12272
12273 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12274
12275         * class.cs:
12276         * codegen.cs:
12277         * driver.cs: issue a warning instead of an error if we don't support
12278         debugging for the platform. Also ignore a couple of errors that may
12279         arise when trying to write the symbols. Undo my previous patch.
12280
12281 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12282
12283         * driver.cs: ignore /debug switch except for Unix platforms.
12284
12285 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12286
12287         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12288
12289 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12290
12291         * driver.cs: Do not make mcs-debug conditional, so we do not break
12292         builds that use it.
12293
12294         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12295         review this patch.  But basically after all the children variables
12296         have been merged, the value of "Breaks" was not being set to
12297         new_breaks for Switch blocks.  I think that it should be set after
12298         it has executed.  Currently I set this to the value of new_breaks,
12299         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12300         conservative, but I do not understand this code very well.
12301
12302         I did not break anything in the build, so that is good ;-)
12303
12304         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12305
12306 2002-10-20  Mark Crichton  <crichton@gimp.org>
12307
12308         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12309
12310 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12311
12312         * cfold.cs: Fixed compile blocker.
12313
12314 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * driver.cs: I was chekcing the key, not the file.
12317
12318 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12319
12320         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12321         message that we were generating - we just need to silently return
12322         a null.
12323
12324 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * class.cs (Event.Define): Change my previous commit, as this
12327         breaks the debugger.  This is a temporary hack, as it seems like
12328         the compiler is generating events incorrectly to begin with.
12329
12330         * expression.cs (Binary.ResolveOperator): Added support for 
12331         "U operator - (E x, E y)"
12332
12333         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12334         y)".
12335
12336         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12337         init-only variables, but this path did not take into account that
12338         there might be also instance readonly variables.  Correct this
12339         problem. 
12340
12341         This fixes bug 32253
12342
12343         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12344         delegates as well.
12345
12346         * driver.cs: Change the extension for modules to `netmodule'
12347
12348         * cs-parser.jay: Improved slightly the location tracking for
12349         the debugger symbols.
12350
12351         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12352         modifiers that were specified instead of the hardcoded value
12353         (FamAndAssem).  This was basically ignoring the static modifier,
12354         and others.  Fixes 32429.
12355
12356         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12357         fixed a bug in the process (32476)
12358
12359         * expression.cs (ArrayAccess.EmitAssign): Patch from
12360         hwang_rob@yahoo.ca that fixes bug 31834.3
12361
12362 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12363
12364         * driver.cs: Make the module extension .netmodule.
12365
12366 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * driver.cs: Report an error if the resource file is not found
12369         instead of crashing.
12370
12371         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12372         false, like Emit does.
12373
12374 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12375
12376         * typemanager.cs: Remove unused private member.  Also reported mcs
12377         bug to report this as a warning like csc.
12378
12379 2002-10-15  Martin Baulig  <martin@gnome.org>
12380
12381         * statement.cs (Statement.Emit): Made this a virtual method; emits
12382         the line number info and calls DoEmit().
12383         (Statement.DoEmit): New protected abstract method, formerly knows
12384         as Statement.Emit().
12385
12386         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12387
12388 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12391         have fixed a remaining problem: not every AddXXXX was adding a
12392         fully qualified name.  
12393
12394         Now everyone registers a fully qualified name in the DeclSpace as
12395         being defined instead of the partial name.  
12396
12397         Downsides: we are slower than we need to be due to the excess
12398         copies and the names being registered this way.  
12399
12400         The reason for this is that we currently depend (on the corlib
12401         bootstrap for instance) that types are fully qualified, because
12402         we dump all the types in the namespace, and we should really have
12403         types inserted into the proper namespace, so we can only store the
12404         basenames in the defined_names array.
12405
12406 2002-10-10  Martin Baulig  <martin@gnome.org>
12407
12408         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12409         from bug #31834, see the bug report for a testcase which is
12410         miscompiled.
12411
12412 2002-10-10  Martin Baulig  <martin@gnome.org>
12413
12414         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12415         flow analysis code for this.
12416
12417         * statement.cs (Do, While, For): Tell the flow analysis code about
12418         infinite loops.
12419         (FlowBranching.UsageVector): Added support for infinite loops.
12420         (Block.Resolve): Moved the dead code elimination here and use flow
12421         analysis to do it.
12422
12423 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12424
12425         * class.cs (Field.Define): Catch cycles on struct type
12426         definitions. 
12427
12428         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12429         fields if the fields are static.  We only need to check instance
12430         fields. 
12431
12432         * expression.cs (As.DoResolve): Test for reference type.
12433
12434         * statement.cs (Using.ResolveExpression): Use
12435         ConvertImplicitRequired, not ConvertImplicit which reports an
12436         error on failture
12437         (Using.ResolveLocalVariableDecls): ditto.
12438
12439         * expression.cs (Binary.ResolveOperator): Report errors in a few
12440         places where we had to.
12441
12442         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12443
12444 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12445
12446         * expression.cs: Use StoreFromPtr instead of extracting the type
12447         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12448
12449         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12450         an enumeration value to a System.Enum, but System.Enum is not a
12451         value type, but an class type, so we need to box.
12452
12453         (Expression.ConvertExplicit): One codepath could return
12454         errors but not flag them.  Fix this.  Fixes #31853
12455
12456         * parameter.cs (Resolve): Do not allow void as a parameter type.
12457
12458 2002-10-06  Martin Baulig  <martin@gnome.org>
12459
12460         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12461         if it's a class type and not a struct.  Fixes #31815.
12462
12463 2002-10-06  Martin Baulig  <martin@gnome.org>
12464
12465         * statement.cs: Reworked the flow analysis code a bit to make it
12466         usable for dead code elimination.
12467
12468 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12469
12470         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12471
12472 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12473
12474         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12475         to fix the test 165, will investigate deeper.
12476
12477 2002-10-04  Martin Baulig  <martin@gnome.org>
12478
12479         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12480         finally blocks actually work.
12481         (Try.Resolve): We don't need to create a sibling for `finally' if
12482         there is no finally block.
12483
12484 2002-10-04  Martin Baulig  <martin@gnome.org>
12485
12486         * class.cs (Constructor.Define): The default accessibility for a
12487         non-default constructor is private, not public.
12488
12489 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * class.cs (Constructor): Make AllowedModifiers public, add
12492         EXTERN.
12493
12494         * cs-parser.jay: Perform the modifiers test here, as the
12495         constructor for the Constructor class usually receives a zero
12496         because of the way we create it (first we create, later we
12497         customize, and we were never checking the modifiers).
12498
12499         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12500         is a version of LookupTypeReflection that includes the type-name
12501         cache.  This can be used as a fast path for functions that know
12502         the fully qualified name and are only calling into *.GetType() to
12503         obtain a composed type.
12504
12505         This is also used by TypeManager.LookupType during its type
12506         composition.
12507
12508         (LookupType): We now also track the real type name, as sometimes
12509         we can get a quey for the real type name from things like
12510         ComposedCast.  This fixes bug 31422.
12511
12512         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12513         complete type fullname, it does not have to go through the type
12514         resolution system to obtain the composed version of the type (for
12515         obtaining arrays or pointers).
12516
12517         (Conditional.Emit): Use the EmitBoolExpression to
12518         generate nicer code, as requested by Paolo.
12519
12520         (ArrayCreation.CheckIndices): Use the patch from
12521         hwang_rob@yahoo.ca to validate the array initializers. 
12522
12523 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12524
12525         * class.cs (ConstructorInitializer.Emit): simplify code by using
12526         Invocation.EmitCall, and at the same time, fix the bugs in calling
12527         parent constructors that took variable arguments. 
12528
12529         * ecore.cs (Expression.ConvertNumericExplicit,
12530         Expression.ImplicitNumericConversion): Remove the code that
12531         manually wrapped decimal (InternalTypeConstructor call is now gone
12532         as well).
12533
12534         * expression.cs (Cast.TryReduce): Also handle decimal types when
12535         trying to perform a constant fold on the type.
12536
12537         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12538
12539         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12540         that only turned off an error report, and did nothing else. 
12541
12542 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12543
12544         * driver.cs: Handle and ignore /fullpaths
12545
12546 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12547
12548         * expression.cs (Binary.ResolveOperator): Catch the case where
12549         DoNumericPromotions returns true, 
12550
12551         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12552
12553 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12554
12555         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12556         report error 70.
12557
12558 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12559
12560         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12561         conversion exists, but it is also required that the conversion be
12562         performed.  This manifested in "(Type64Enum) 2".  
12563
12564         * class.cs (TypeManager.AddMethod): The fix is not to change
12565         AddEnum, because that one was using a fully qualified name (every
12566         DeclSpace derivative does), but to change the AddMethod routine
12567         that was using an un-namespaced name.  This now correctly reports
12568         the duplicated name.
12569
12570         Revert patch until I can properly fix it.  The issue
12571         is that we have a shared Type space across all namespaces
12572         currently, which is wrong.
12573
12574         Options include making the Namespace a DeclSpace, and merge
12575         current_namespace/current_container in the parser.
12576
12577 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12578
12579         * cs-parser.jay: Improve error reporting when we get a different
12580         kind of expression in local_variable_type and
12581         local_variable_pointer_type. 
12582
12583         Propagate this to avoid missleading errors being reported.
12584
12585         * ecore.cs (ImplicitReferenceConversion): treat
12586         TypeManager.value_type as a target just like object_type.   As
12587         code like this:
12588
12589         ValueType v = 1;
12590
12591         Is valid, and needs to result in the int 1 being boxed before it
12592         is assigned to the value type v.
12593
12594         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12595         to validate the enumeration name.
12596
12597         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12598         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12599         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12600
12601         * ecore.cs (TryImplicitIntConversion): When doing an
12602         implicit-enumeration-conversion, check if the type is 64-bits and
12603         perform a conversion before passing to EnumConstant.
12604
12605 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12606
12607         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12608         report ambiguous type references.  Unlike the MS version, we
12609         report what the ambiguity is.   Innovation at work ;-)
12610
12611         (DeclSpace.FindType): Require a location argument to
12612         display when we display an ambiguous error.
12613
12614         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12615
12616         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12617
12618         * expression.cs (EmitDynamicInitializers): Apply patch from
12619         hwang_rob@yahoo.ca that fixes the order in which we emit our
12620         initializers. 
12621
12622 2002-09-21  Martin Baulig  <martin@gnome.org>
12623
12624         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12625         delegate takes no arguments.
12626
12627 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12628
12629         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12630         from integers.
12631
12632         * expression.cs: Extract the underlying type.
12633
12634         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12635
12636         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12637
12638 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12639
12640         * class.cs (TypeContainer.DefineType): We can not use the nice
12641         PackingSize with the size set to 1 DefineType method, because it
12642         will not allow us to define the interfaces that the struct
12643         implements.
12644
12645         This completes the fixing of bug 27287
12646
12647         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12648         means also structs.  This fixes part of the problem. 
12649         (Expresion.ImplicitReferenceConversionExists): ditto.
12650
12651         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12652         error if there were no errors reported during the type lookup
12653         process, to avoid duplicates or redundant errors.  Without this
12654         you would get an ambiguous errors plus a type not found.  We have
12655         beaten the user enough with the first error.  
12656
12657         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12658         reference. 
12659
12660         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12661         during the resolution process, stop the lookup, this avoids
12662         repeated error reports (same error twice).
12663
12664         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12665
12666         * typemanager.cs (LookupType): Redo the type lookup code to match
12667         the needs of System.Reflection.  
12668
12669         The issue is that System.Reflection requires references to nested
12670         types to begin with a "+" sign instead of a dot.  So toplevel
12671         types look like: "NameSpace.TopLevelClass", and nested ones look
12672         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12673         levels. 
12674
12675 2002-09-19  Martin Baulig  <martin@gnome.org>
12676
12677         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12678         says that a method always returns or always throws an exception,
12679         don't report the CS0161.
12680
12681         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12682         set `Returns = new_returns'.
12683
12684 2002-09-19  Martin Baulig  <martin@gnome.org>
12685
12686         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12687         to an enum constant, check for a CS0176.
12688
12689 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12690
12691         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12692         for operators that must be in pairs and report errors.
12693
12694         * ecore.cs (SimpleName.DoResolveType): During the initial type
12695         resolution process, when we define types recursively, we must
12696         check first for types in our current scope before we perform
12697         lookups in the enclosing scopes.
12698
12699         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12700
12701         (Invocation.VerifyArgumentsCompat): Call
12702         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12703         I thought we were supposed to always call this, but there are a
12704         few places in the code where we dont do it.
12705
12706 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12707
12708         * driver.cs: Add support in -linkres and -resource to specify the
12709         name of the identifier.
12710
12711 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12712
12713         * ecore.cs (StandardConversionExists): Sync with the conversion
12714         code: allow anything-* to void* conversions.
12715
12716         (FindMostSpecificSource): Use an Expression argument
12717         instead of a Type, because we might be handed over a Literal which
12718         gets a few more implicit conversions that plain types do not.  So
12719         this information was being lost.
12720
12721         Also, we drop the temporary type-holder expression when not
12722         required.
12723
12724 2002-09-17  Martin Baulig  <martin@gnome.org>
12725
12726         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12727         this is an explicit interface implementation.
12728
12729 2002-09-17  Martin Baulig  <martin@gnome.org>
12730
12731         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12732         different `IndexerName' attributes.
12733
12734         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12735         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12736         virtual CommonResolve().
12737
12738 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12739
12740         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12741         and convert that to the UnderlyingType.
12742
12743         * statement.cs (Foreach.Resolve): Indexers are just like variables
12744         or PropertyAccesses.
12745
12746         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12747         inside quoted strings, we were not doing this before.
12748
12749 2002-09-16  Martin Baulig  <martin@gnome.org>
12750
12751         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12752         resolve it.  This is needed for the definite assignment check of the
12753         instance expression, fixes bug #29846.
12754         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12755
12756 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12757
12758         * parameter.cs: Fix compile error.  Cannot reference static member
12759         from an instance object.  Is this an mcs bug?
12760
12761 2002-09-14  Martin Baulig  <martin@gnome.org>
12762
12763         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12764         multiple times.  Fixes bug #30295, added test-166.cs.
12765
12766 2002-09-14  Martin Baulig  <martin@gnome.org>
12767
12768         * statement.cs (Block.Emit): Don't emit unreachable code.
12769         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12770         `break' statements.
12771         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12772
12773 2002-09-14  Martin Baulig  <martin@gnome.org>
12774
12775         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12776         is set.
12777
12778 2002-09-14  Martin Baulig  <martin@gnome.org>
12779
12780         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12781         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12782         be false on the ms runtime.
12783
12784 2002-09-13  Martin Baulig  <martin@gnome.org>
12785
12786         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12787         the CS0038 error message.
12788
12789 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12790
12791         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12792         constant inside, return it.
12793
12794 2002-09-12  Martin Baulig  <martin@gnome.org>
12795
12796         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12797         implicit conversion can be done between enum types.
12798
12799         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12800         check whether an implicit conversion to the current enum's UnderlyingType
12801         exists and report an error if not.
12802
12803         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12804         without debugging support.
12805
12806         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12807         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12808
12809 2002-09-12  Martin Baulig  <martin@gnome.org>
12810
12811         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12812
12813         * ecore.cs (IMemberExpr.DeclaringType): New property.
12814         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12815         nonstatic member of an outer type (CS0038).
12816
12817 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12818
12819         * driver.cs: Activate the using-error detector at warning level
12820         4 (at least for MS-compatible APIs).
12821
12822         * namespace.cs (VerifyUsing): Small buglett fix.
12823
12824         * pending.cs (PendingImplementation): pass the container pointer. 
12825
12826         * interface.cs (GetMethods): Allow for recursive definition.  Long
12827         term, I would like to move every type to support recursive
12828         definitions, not the current ordering mechanism that we have right
12829         now.
12830
12831         The situation is this: Attributes are handled before interfaces,
12832         so we can apply attributes to interfaces.  But some attributes
12833         implement interfaces, we will now handle the simple cases
12834         (recursive definitions will just get an error).  
12835
12836         * parameter.cs: Only invalidate types at the end if we fail to
12837         lookup all types.  
12838
12839 2002-09-09  Martin Baulig  <martin@gnome.org>
12840
12841         * ecore.cs (PropertyExpr.Emit): Also check for
12842         TypeManager.system_int_array_get_length so this'll also work when
12843         compiling corlib.  Fixes #30003.
12844
12845 2002-09-09  Martin Baulig  <martin@gnome.org>
12846
12847         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12848         and throw an exception if we can't get the type's size.  Fixed #30040,
12849         added test-165.cs.
12850
12851 2002-09-09  Martin Baulig  <martin@gnome.org>
12852
12853         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12854
12855         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12856         context.  Fixes bug #30027.
12857
12858         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12859         virtual functions.  Fixes bug #30043, added test-164.cs.
12860
12861 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12862
12863         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12864
12865 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12866
12867         * driver.cs: Use an object to get the windows codepage since it's not a
12868         static property.
12869
12870 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * statement.cs (For.Emit): for infinite loops (test == null)
12873         return whether there is a break inside, not always "true".
12874
12875         * namespace.cs (UsingEntry): New struct to hold the name of the
12876         using definition, the location where it is defined, and whether it
12877         has been used in a successful type lookup.
12878
12879         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12880         strings.
12881
12882         * decl.cs: ditto.
12883
12884 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12885
12886         * attribute.cs : Fix incorrect code which relied on catching
12887         a NullReferenceException to detect a null being passed in
12888         where an object was expected.
12889
12890 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12891
12892         * statement.cs (Try): flag the catch variable as assigned
12893
12894         * expression.cs (Cast): Simplified by using ResolveType instead of
12895         manually resolving.
12896
12897         * statement.cs (Catch): Fix bug by using ResolveType.
12898
12899 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12900
12901         * expression.cs (BetterConversion): Special case for when we have
12902         a NullLiteral as the argument and we have to choose between string
12903         and object types - we choose string the way csc does.
12904
12905         * attribute.cs (Attribute.Resolve): Catch the
12906         NullReferenceException and report error #182 since the Mono
12907         runtime no more has the bug and having this exception raised means
12908         we tried to select a constructor which takes an object and is
12909         passed a null.
12910
12911 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12912
12913         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12914         message (1502, 1503) when we can't locate a method after overload
12915         resolution. This is much more informative and closes the bug
12916         Miguel reported.
12917
12918         * interface.cs (PopulateMethod): Return if there are no argument
12919         types. Fixes a NullReferenceException bug.
12920
12921         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12922         expressions too. Previously we were checking only in one place for
12923         positional arguments leaving out named arguments.
12924
12925         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12926         type to the enum type is not allowed. Remove code corresponding to
12927         that.
12928
12929         (ConvertNumericExplicit): Allow explicit conversions from
12930         the underlying type to enum type. This precisely follows the spec
12931         and closes a bug filed by Gonzalo.
12932
12933 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12934
12935         * compiler.csproj:
12936         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12937
12938 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12941         it was important that we stored the right value after the
12942         reduction in `converted'.
12943
12944 2002-09-04  Martin Baulig  <martin@gnome.org>
12945
12946         * location.cs (Location.SymbolDocument): Use full pathnames for the
12947         source files.
12948
12949 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12950
12951         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12952         of the expression resolve mechanism, because that will catch the
12953         SimpleName error failures.
12954
12955         (Conditional): If we can not resolve the
12956         expression, return, do not crash.
12957
12958 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12959
12960         * cs-tokenizer.cs:
12961         (location): display token name instead of its number.
12962
12963 2002-08-28  Martin Baulig  <martin@gnome.org>
12964
12965         * expression.cs (Binary.ResolveOperator): Don't silently return
12966         but return an error if an operator cannot be applied between two
12967         enum types.
12968
12969 2002-08-28  Martin Baulig  <martin@gnome.org>
12970
12971         * class.cs (Constructor.Define): Set the permission attributes
12972         correctly instead of making all constructors public.
12973
12974 2002-08-28  Martin Baulig  <martin@gnome.org>
12975
12976         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12977         for private members before reporting a CS0103; if we find anything,
12978         it's a CS0122.
12979
12980 2002-08-28  Martin Baulig  <martin@gnome.org>
12981
12982         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12983         to check whether `closure_start_type == closure_invocation_type',
12984         we also need to check whether `m.DeclaringType == closure_invocation_type'
12985         before bypassing the permission checks.  We might be accessing
12986         protected/private members from the base class.
12987         (TypeManager.RealMemberLookup): Only set private_ok if private
12988         members were requested via BindingFlags.NonPublic.
12989
12990         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12991
12992         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12993         MethodGroupExpr.IsExplicitImpl if appropriate.
12994         (Invocation.DoResolve): Don't report the CS0120 for explicit
12995         interface implementations.
12996
12997 2002-08-27  Martin Baulig  <martin@gnome.org>
12998
12999         * expression.cs (Invocation.DoResolve): If this is a static
13000         method and we don't have an InstanceExpression, we must report
13001         a CS0120.
13002
13003 2002-08-25  Martin Baulig  <martin@gnome.org>
13004
13005         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13006         `==' between a valuetype and an object.
13007
13008 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13009
13010         * ecore.cs (TypeExpr): Provide a ToString method.
13011
13012 2002-08-24  Martin Baulig  <martin@gnome.org>
13013
13014         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13015         now called proggie.dbg and it's a binary file.
13016
13017 2002-08-23  Martin Baulig  <martin@gnome.org>
13018
13019         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13020
13021 2002-08-23  Martin Baulig  <martin@gnome.org>
13022
13023         * struct.cs (MyStructInfo.ctor): Make this work with empty
13024         structs; it's not allowed to use foreach() on null.
13025
13026 2002-08-23  Martin Baulig  <martin@gnome.org>
13027
13028         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13029         writer the full pathname of the generated assembly.
13030
13031 2002-08-23  Martin Baulig  <martin@gnome.org>
13032
13033         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13034         A `finally' block never returns or breaks; improved handling of
13035         unreachable code.
13036
13037 2002-08-23  Martin Baulig  <martin@gnome.org>
13038
13039         * statement.cs (Throw.Resolve): Allow `throw null'.
13040
13041 2002-08-23  Martin Baulig  <martin@gnome.org>
13042
13043         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13044         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13045         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13046         MemberLookup would return a wrong event if this is an explicit
13047         interface implementation and the class has an event with the same
13048         name.
13049
13050 2002-08-23  Martin Baulig  <martin@gnome.org>
13051
13052         * statement.cs (Block.AddChildVariableNames): New public method.
13053         (Block.AddChildVariableName): Likewise.
13054         (Block.IsVariableNameUsedInChildBlock): Likewise.
13055         (Block.AddVariable): Check whether a variable name has already
13056         been used in a child block.
13057
13058         * cs-parser.jay (declare_local_variables): Mark all variable names
13059         from the current block as being used in a child block in the
13060         implicit block.
13061
13062 2002-08-23  Martin Baulig  <martin@gnome.org>
13063
13064         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13065         find the symbol writer.
13066
13067         * driver.cs: csc also allows the arguments to /define being
13068         separated by commas, not only by semicolons.
13069
13070 2002-08-23  Martin Baulig  <martin@gnome.org>
13071
13072         * interface.cs (Interface.GetMembers): Added static check for events.
13073
13074 2002-08-15  Martin Baulig  <martin@gnome.org>
13075
13076         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13077         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13078
13079         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13080         why the MethodData.EmitDestructor() change was necessary.
13081
13082 2002-08-20  Martin Baulig  <martin@gnome.org>
13083
13084         * class.cs (TypeContainer.FindMembers): Added static check for events.
13085
13086         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13087
13088         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13089         use Type.GetEvents(), not Type.FindMembers().
13090
13091 2002-08-20  Martin Baulig  <martin@gnome.org>
13092
13093         * decl.cs (MemberCache): Added a special method cache which will
13094         be used for method-only searched.  This ensures that a method
13095         search will return a MethodInfo with the correct ReflectedType for
13096         inherited methods.      
13097
13098 2002-08-20  Martin Baulig  <martin@gnome.org>
13099
13100         * decl.cs (DeclSpace.FindMembers): Made this public.
13101
13102 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13103
13104         * delegate.cs: fixed build on windows.
13105         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13106
13107 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13108
13109         * ecore.cs (StandardConversionExists): Return a false
13110         if we are trying to convert the void type to anything else
13111         since that is not allowed.
13112
13113         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13114         we flag error 70 in the event an event is trying to be accessed
13115         directly from outside the declaring type.
13116
13117 2002-08-20  Martin Baulig  <martin@gnome.org>
13118
13119         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13120         MemberCache from typemanager.cs to decl.cs.
13121
13122 2002-08-19  Martin Baulig  <martin@gnome.org>
13123
13124         * class.cs (TypeContainer): Implement IMemberContainer.
13125         (TypeContainer.DefineMembers): Create the MemberCache.
13126         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13127         return public members if BindingFlags.Public was given, check
13128         whether members are static.
13129
13130 2002-08-16  Martin Baulig  <martin@gnome.org>
13131
13132         * decl.cs (DeclSpace.Define): Splitted this in Define and
13133         DefineMembers.  DefineMembers is called first and initializes the
13134         MemberCache.
13135
13136         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13137         DefineMembers() on all our DeclSpaces.
13138
13139         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13140         but call DefineMembers() on all nested interfaces.  We call their
13141         Define() in our new Define() function.
13142
13143         * interface.cs (Interface): Implement IMemberContainer.
13144         (Interface.Define): Moved all code except the attribute stuf to
13145         DefineMembers().
13146         (Interface.DefineMembers): Initialize the member cache.
13147
13148         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13149         need this anymore since we can use MemberCache.FindMembers directly.
13150
13151 2002-08-19  Martin Baulig  <martin@gnome.org>
13152
13153         * typemanager.cs (MemberCache): When creating the cache for an
13154         interface type, add all inherited members.
13155         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13156         to `out bool used_cache' and documented it.
13157         (TypeManager.MemberLookup): If we already used the cache in the first
13158         iteration, we don't need to do the interfaces check.
13159
13160 2002-08-19  Martin Baulig  <martin@gnome.org>
13161
13162         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13163         here from IMemberFinder and don't implement this interface anymore.
13164         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13165
13166         * typemanager.cs (IMemberFinder): This interface is now only used by
13167         classes which actually support the member cache.
13168         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13169         since we only put DeclSpaces into this Hashtable.
13170         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13171         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13172
13173 2002-08-16  Martin Baulig  <martin@gnome.org>
13174
13175         * typemanager.cs (ICachingMemberFinder): Removed.
13176         (IMemberFinder.MemberCache): New property.
13177         (TypeManager.FindMembers): Merged this with RealFindMembers().
13178         This function will never be called from TypeManager.MemberLookup()
13179         so we can't use the cache here, just the IMemberFinder.
13180         (TypeManager.MemberLookup_FindMembers): Check whether the
13181         IMemberFinder has a MemberCache and call the cache's FindMembers
13182         function.
13183         (MemberCache): Rewrote larger parts of this yet another time and
13184         cleaned it up a bit.
13185
13186 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13187
13188         * driver.cs (LoadArgs): Support quoting.
13189
13190         (Usage): Show the CSC-like command line arguments.
13191
13192         Improved a few error messages.
13193
13194 2002-08-15  Martin Baulig  <martin@gnome.org>
13195
13196         * typemanager.cs (IMemberContainer.Type): New property.
13197         (IMemberContainer.IsInterface): New property.
13198
13199         The following changes are conditional to BROKEN_RUNTIME, which is
13200         defined at the top of the file.
13201
13202         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13203         class'es members, but add all members from TypeHandle.ObjectType
13204         if we're an interface.
13205         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13206         is the current type.
13207         (MemberCache.CacheEntry.Container): Removed this field.
13208         (TypeHandle.GetMembers): Include inherited members.
13209
13210 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13211
13212         * typemanager.cs: fixed compilation and added a comment on a field that
13213         is never used.
13214
13215 2002-08-15  Martin Baulig  <martin@gnome.org>
13216
13217         * class.cs (ConstructorInitializer.Resolve): In the
13218         Expression.MemberLookup call, use the queried_type as
13219         invocation_type.
13220
13221         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13222         declared' attribute, it's always true.
13223         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13224         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13225         temporary wrapper for FindMembers which tells MemberLookup whether
13226         members from the base classes are included in the return value.
13227         This will go away soon.
13228         (TypeManager.MemberLookup): Use this temporary hack here; once the
13229         new MemberCache is completed, we don't need to do the DeclaredOnly
13230         looping here anymore since the MemberCache will take care of this.
13231         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13232         (MemberCache): When creating the MemberCache for a class, get
13233         members from the current class and all its base classes.
13234         (MemberCache.CacheEntry.Container): New field.  This is a
13235         temporary hack until the Mono runtime is fixed to distinguish
13236         between ReflectedType and DeclaringType.  It allows us to use MCS
13237         with both the MS runtime and the unfixed Mono runtime without
13238         problems and without accecting performance.
13239         (MemberCache.SearchMembers): The DeclaredOnly looping from
13240         TypeManager.MemberLookup is now done here.      
13241
13242 2002-08-14  Martin Baulig  <martin@gnome.org>
13243
13244         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13245         Type.GetFields on dynamic types but get the fields from the
13246         corresponding TypeContainer.
13247         (MyStructInfo.GetStructInfo): Added check for enum types.
13248
13249         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13250         (MemberList.SyncRoot): Implemented.
13251         (TypeManager.FilterWithClosure): No need to check permissions if
13252         closure_start_type == closure_invocation_type, don't crash if
13253         closure_invocation_type is null.
13254
13255 2002-08-13  Martin Baulig  <martin@gnome.org>
13256
13257         Rewrote TypeContainer.FindMembers to use a member cache.  This
13258         gives us a speed increase of about 35% for the self-hosting MCS
13259         build and of about 15-20% for the class libs (both on GNU/Linux).
13260
13261         * report.cs (Timer): New class to get enhanced profiling.  This
13262         whole class is "TIMER" conditional since it remarkably slows down
13263         compilation speed.
13264
13265         * class.cs (MemberList): New class.  This is an IList wrapper
13266         which we're now using instead of passing MemberInfo[]'s around to
13267         avoid copying this array unnecessarily.
13268         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13269         (ICachingMemberFinder, IMemberContainer): New interface.
13270         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13271         has already been checked, otherwise use it for the name comparision.
13272         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13273         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13274         if possible.  Returns a MemberList, not a MemberInfo [].
13275         (TypeHandle): New class, implements IMemberContainer.  We create
13276         one instance of this class per type, it contains a MemberCache
13277         which is used to do the member lookups.
13278         (MemberCache): New class.  Each instance of this class contains
13279         all members of a type and a name-based hash table.
13280         (MemberCache.FindMembers): This is our new member lookup
13281         function.  First, it looks up all members of the requested name in
13282         the hash table.  Then, it walks this list and sorts out all
13283         applicable members and returns them.
13284
13285 2002-08-13  Martin Baulig  <martin@gnome.org>
13286
13287         In addition to a nice code cleanup, this gives us a performance
13288         increase of about 1.4% on GNU/Linux - not much, but it's already
13289         half a second for the self-hosting MCS compilation.
13290
13291         * typemanager.cs (IMemberFinder): New interface.  It is used by
13292         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13293         Enum, Delegate or Interface.
13294         (TypeManager.finder_to_member_finder): New PtrHashtable.
13295         (TypeManager.finder_to_container): Removed.
13296         (TypeManager.finder_to_delegate): Removed.
13297         (TypeManager.finder_to_interface): Removed.
13298         (TypeManager.finder_to_enum): Removed.
13299
13300         * interface.cs (Interface): Implement IMemberFinder.
13301
13302         * delegate.cs (Delegate): Implement IMemberFinder.
13303
13304         * enum.cs (Enum): Implement IMemberFinder.
13305
13306         * class.cs (TypeContainer): Implement IMemberFinder.
13307
13308 2002-08-12  Martin Baulig  <martin@gnome.org>
13309
13310         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13311
13312 2002-08-12  Martin Baulig  <martin@gnome.org>
13313
13314         * ecore.cs (ITypeExpression): New interface for expressions which
13315         resolve to a type.
13316         (TypeExpression): Renamed to TypeLookupExpression.
13317         (Expression.DoResolve): If we're doing a types-only lookup, the
13318         expression must implement the ITypeExpression interface and we
13319         call DoResolveType() on it.
13320         (SimpleName): Implement the new ITypeExpression interface.
13321         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13322         hack, the situation that we're only looking up types can't happen
13323         anymore when this method is called.  Moved the type lookup code to
13324         DoResolveType() and call it.
13325         (SimpleName.DoResolveType): This ITypeExpression interface method
13326         is now doing the types-only lookup.
13327         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13328         (ResolveFlags): Added MaskExprClass.
13329
13330         * expression.cs (MemberAccess): Implement the ITypeExpression
13331         interface.
13332         (MemberAccess.DoResolve): Added support for a types-only lookup
13333         when we're called via ITypeExpression.DoResolveType().
13334         (ComposedCast): Implement the ITypeExpression interface.
13335
13336         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13337         Expression.Resolve() with ResolveFlags.Type instead.
13338
13339 2002-08-12  Martin Baulig  <martin@gnome.org>
13340
13341         * interface.cs (Interface.Define): Apply attributes.
13342
13343         * attribute.cs (Attribute.ApplyAttributes): Added support for
13344         interface attributes.
13345
13346 2002-08-11  Martin Baulig  <martin@gnome.org>
13347
13348         * statement.cs (Block.Emit): Only check the "this" variable if we
13349         do not always throw an exception.
13350
13351         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13352         whether the property has a set accessor.
13353
13354 2002-08-11  Martin Baulig  <martin@gnome.org>
13355
13356         Added control flow analysis support for structs.
13357
13358         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13359         with control flow analysis turned off.
13360         (IVariable): New interface.
13361         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13362         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13363         (FieldExpr.DoResolve): Resolve the instance expression with flow
13364         analysis turned off and do the definite assignment check after the
13365         resolving when we know what the expression will resolve to.
13366
13367         * expression.cs (LocalVariableReference, ParameterReference):
13368         Implement the new IVariable interface, only call the flow analysis
13369         code if ec.DoFlowAnalysis is true.
13370         (This): Added constructor which takes a Block argument.  Implement
13371         the new IVariable interface.
13372         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13373         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13374         This does the definite assignment checks for struct members.
13375
13376         * class.cs (Constructor.Emit): If this is a non-static `struct'
13377         constructor which doesn't have any initializer, call
13378         Block.AddThisVariable() to tell the flow analysis code that all
13379         struct elements must be initialized before control returns from
13380         the constructor.
13381
13382         * statement.cs (MyStructInfo): New public class.
13383         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13384         argument to this indexer.  If non-zero, check an individual struct
13385         member, not the whole struct.
13386         (FlowBranching.CheckOutParameters): Check struct members.
13387         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13388         overloaded versions of these methods which take an additional
13389         `int field_idx' argument to check struct members.
13390         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13391         overloaded versions of these methods which take an additional
13392         `string field_name' argument to check struct member.s
13393         (VariableInfo): Implement the IVariable interface.
13394         (VariableInfo.StructInfo): New public property.  Returns the
13395         MyStructInfo instance of the variable if it's a struct or null.
13396         (Block.AddThisVariable): New public method.  This is called from
13397         Constructor.Emit() for non-static `struct' constructor which do
13398         not have any initializer.  It creates a special variable for the
13399         "this" instance variable which will be checked by the flow
13400         analysis code to ensure that all of the struct's fields are
13401         initialized before control returns from the constructor.
13402         (UsageVector): Added support for struct members.  If a
13403         variable/parameter is a struct with N members, we reserve a slot
13404         in the usage vector for each member.  A struct is considered fully
13405         initialized if either the struct itself (slot 0) or all its
13406         members are initialized.
13407
13408 2002-08-08  Martin Baulig  <martin@gnome.org>
13409
13410         * driver.cs (Driver.MainDriver): Only report an error CS5001
13411         if there were no compilation errors.
13412
13413         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13414         `UnsafeContext' property to determine whether the parent is in
13415         unsafe context rather than checking the parent's ModFlags:
13416         classes nested in an unsafe class are unsafe as well.
13417
13418 2002-08-08  Martin Baulig  <martin@gnome.org>
13419
13420         * statement.cs (UsageVector.MergeChildren): Distinguish between
13421         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13422         we return.  Added test17() and test18() to test-154.cs.
13423
13424 2002-08-08  Martin Baulig  <martin@gnome.org>
13425
13426         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13427         Family access, make sure the invoking type isn't a subclass of the
13428         queried type (that'd be a CS1540).
13429
13430         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13431         this method which takes an additional `Type invocation_type'.
13432
13433         * expression.cs (BaseAccess.DoResolve): Use the base type as
13434         invocation and query type.
13435         (MemberAccess.DoResolve): If the lookup failed and we're about to
13436         report a CS0122, try a lookup with the ec.ContainerType - if this
13437         succeeds, we must report a CS1540.
13438
13439 2002-08-08  Martin Baulig  <martin@gnome.org>
13440
13441         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13442         (MethodGroupExpr): Implement the IMemberExpr interface.
13443
13444         * expression (MemberAccess.ResolveMemberAccess): No need to have
13445         any special code for MethodGroupExprs anymore, they're now
13446         IMemberExprs.   
13447
13448 2002-08-08  Martin Baulig  <martin@gnome.org>
13449
13450         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13451         Family, FamANDAssem and FamORAssem permissions.
13452         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13453
13454 2002-08-08  Martin Baulig  <martin@gnome.org>
13455
13456         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13457         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13458         or loop block.
13459
13460 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13461
13462         * driver.cs: implemented /resource option to embed managed resources.
13463
13464 2002-08-07  Martin Baulig  <martin@gnome.org>
13465
13466         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13467         (FieldBase.HasFieldInitializer): New public property.
13468         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13469         returns the field initializer and makes sure it is only resolved once.
13470         (TypeContainer.EmitFieldInitializers): Call
13471         FieldBase.GetInitializerExpression to get the initializer, this ensures
13472         that it isn't resolved multiple times.
13473
13474         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13475         the resolving process (SimpleName/MemberLookup) that we're currently
13476         emitting a field initializer (which must not access any instance members,
13477         this is an error CS0236).
13478
13479         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13480         argument, if the `IsFieldInitializer' flag is set, we must report and
13481         error CS0236 and not an error CS0120.   
13482
13483 2002-08-07  Martin Baulig  <martin@gnome.org>
13484
13485         * ecore.cs (IMemberExpr): New public interface.
13486         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13487         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13488         if the expression is an IMemberExpr.
13489
13490         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13491         to be null, implicitly default to `this' if we're non-static in
13492         this case.  Simplified the code a lot by using the new IMemberExpr
13493         interface.  Also fixed bug #28176 here.
13494
13495 2002-08-06  Martin Baulig  <martin@gnome.org>
13496
13497         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13498         ParameterReferences during semantic analysis so that we can do a
13499         type-only search when resolving Cast, TypeOf and SizeOf.
13500         (block): Pass the `current_local_parameters' to the Block's
13501         constructor.
13502
13503         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13504         argument to the constructor.
13505         (ConstructorInitializer.Resolve): Create a temporary implicit
13506         block with the parameters.
13507
13508         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13509         references here if we aren't doing a type-only search.
13510
13511         * statement.cs (Block): Added constructor which takes a
13512         `Parameters parameters' argument.
13513         (Block.Parameters): New public property.
13514
13515         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13516         to `Parameters' and made it public readonly.
13517
13518 2002-08-06  Martin Baulig  <martin@gnome.org>
13519
13520         * ecore.cs (Expression.Warning): Made this public as well.
13521
13522         * report.cs (Report.Debug): Print the contents of collections.
13523
13524 2002-08-06  Martin Baulig  <martin@gnome.org>
13525
13526         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13527         used to tell Resolve() which kinds of expressions it may return.
13528         (Expression.Resolve): Added overloaded version of this method which
13529         takes a `ResolveFlags flags' argument.  This can be used to tell
13530         Resolve() which kinds of expressions it may return.  Reports a
13531         CS0118 on error.
13532         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13533         ResolveFlags.SimpleName.
13534         (Expression.Error118): Added overloaded version of this method which
13535         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13536         which kinds of expressions are allowed.
13537
13538         * expression.cs (Argument.ResolveMethodGroup): New public method.
13539         Resolves an argument, but allows a MethodGroup to be returned.
13540         This is used when invoking a delegate.
13541
13542         * TODO: Updated a bit.
13543
13544 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13545
13546         Fixed compilation with csc.
13547
13548         * ecore.cs: Expression.Error made public. Is this correct? Should
13549         Warning be made public too?
13550
13551         * expression.cs: use ea.Location instead of ea.loc.
13552         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13553
13554 2002-08-06  Martin Baulig  <martin@gnome.org>
13555
13556         * ecore.cs (Expression.loc): Moved the location here instead of
13557         duplicating it in all derived classes.
13558         (Expression.Location): New public property.
13559         (Expression.Error, Expression.Warning): Made them non-static and
13560         removed the location argument.
13561         (Expression.Warning): Added overloaded version which takes an
13562         `int level' argument.
13563         (Expression.Error118): Make this non-static and removed the
13564         expression and location arguments.
13565         (TypeExpr): Added location argument to the constructor.
13566
13567         * expression.cs (StaticCallExpr): Added location argument to
13568         the constructor.
13569         (Indirection, PointerArithmetic): Likewise.
13570         (CheckedExpr, UnCheckedExpr): Likewise.
13571         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13572         (StringPtr): Likewise.
13573
13574
13575 2002-08-05  Martin Baulig  <martin@gnome.org>
13576
13577         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13578
13579         * assign.cs (Assign.DoResolve): Check whether the source
13580         expression is a value or variable.
13581
13582         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13583         while resolving the corresponding blocks.
13584
13585         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13586         an error, don't silently return null.
13587
13588         * statement.cs (Block.AddVariable): Do the error reporting here
13589         and distinguish between CS0128 and CS0136.
13590         (Block.DoResolve): Report all unused labels (warning CS0164).
13591         (LabeledStatement): Pass the location to the constructor.
13592         (LabeledStatement.HasBeenReferenced): New property.
13593         (LabeledStatement.Resolve): Set it to true here.
13594
13595         * statement.cs (Return.Emit): Return success even after reporting
13596         a type mismatch error (CS0126 or CS0127), this is what csc does and
13597         it avoids confusing the users with any consecutive errors.
13598
13599 2002-08-05  Martin Baulig  <martin@gnome.org>
13600
13601         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13602
13603         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13604
13605         * expression.cs (MemberAccess.DoResolve): Silently return if an
13606         error has already been reported.
13607
13608         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13609         error has already been reported.
13610
13611 2002-08-05  Martin Baulig  <martin@gnome.org>
13612
13613         * statement.cs (UsageVector): Only initialize the `parameters'
13614         vector if we actually have any "out" parameters.
13615
13616 2002-08-05  Martin Baulig  <martin@gnome.org>
13617
13618         * expression.cs (Binary.ResolveOperator): When combining delegates,
13619         they must have the same type.
13620
13621 2002-08-05  Martin Baulig  <martin@gnome.org>
13622
13623         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13624         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13625         work with the ms runtime and we also don't need it: if we're a
13626         PropertyBuilder and not in the `indexer_arguments' hash, then we
13627         are a property and not an indexer.
13628
13629         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13630         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13631         since the latter one doesn't work with the ms runtime.
13632
13633 2002-08-03  Martin Baulig  <martin@gnome.org>
13634
13635         Fixed bugs #27998 and #22735.
13636
13637         * class.cs (Method.IsOperator): New public field.
13638         (Method.CheckBase): Report CS0111 if there's already a method
13639         with the same parameters in the current class.  Report CS0508 when
13640         attempting to change the return type of an inherited method.
13641         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13642         and it's not marked abstract or extern.
13643         (PropertyBase): New abstract base class for Property and Indexer.
13644         (PropertyBase.CheckBase): Moved here from Property and made it work
13645         for indexers.
13646         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13647         the same so we can reuse it there.
13648         (Property, Indexer): Derive from PropertyBase.
13649         (MethodSignature.inheritable_property_signature_filter): New delegate
13650         to find properties and indexers.
13651
13652         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13653         argument and improved error reporting.
13654
13655         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13656         EmptyReadOnlyParameters and made it a property.
13657
13658         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13659         version of this method which takes a `PropertyInfo indexer'.
13660         (TypeManager.RegisterIndexer): New method.
13661
13662         * class.cs: Added myself as author of this file :-)
13663
13664 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13665
13666         * class.cs: fixed compilation on windoze.
13667
13668 2002-08-03  Martin Baulig  <martin@gnome.org>
13669
13670         * interface.cs (Interface.GetInterfaceBases): Check whether all
13671         base interfaces are at least as accessible than the current one.
13672
13673         * class.cs (TypeContainer.GetClassBases): Check whether base types
13674         are at least as accessible than the current type.
13675         (TypeContainer.AsAccessible): Implemented and made non-static.
13676         (MemberBase.CheckParameters): Report errors if the accessibility
13677         checks fail.
13678
13679         * delegate.cs (Delegate.Delegate): The default visibility is
13680         internal for top-level types and private for nested types.
13681         (Delegate.Define): Report errors if the accessibility checks fail.
13682
13683         * enum.cs (Enum.Enum): The default visibility is internal for
13684         top-level types and private for nested types.
13685         (Enum.DefineType): Compute the correct visibility.
13686
13687         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13688         function which takes a `bool is_toplevel' instead of a TypeContainer.
13689
13690         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13691         builtin type.
13692
13693 2002-08-02  Martin Baulig  <martin@gnome.org>
13694
13695         * expression.cs (LocalVariableReferenc): Added constructor which
13696         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13697         (LocalVariableReference.IsReadOnly): New property.
13698         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13699         variable is readonly, use our own readonly flag to do this; you can
13700         use the new constructor to get a writable reference to a read-only
13701         variable.
13702
13703         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13704         reference to the local variable.
13705
13706 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13707
13708         * rootcontext.cs (ResolveCore): Also include System.Exception
13709
13710         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13711         we reach an EmptyStatement.
13712
13713         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13714         is also fine.
13715
13716         * expression.cs (Binary.ResolveOperator): Check error result in
13717         two places.
13718
13719         use brtrue/brfalse directly and avoid compares to null.
13720
13721 2002-08-02  Martin Baulig  <martin@gnome.org>
13722
13723         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13724         Fixes bug #28407, added test-155.cs.
13725
13726 2002-08-01  Martin Baulig  <martin@gnome.org>
13727
13728         * class.cs (Event.EmitDefaultMethod): Make this work with static
13729         events.  Fixes #28311, added verify-3.cs.
13730
13731 2002-08-01  Martin Baulig  <martin@gnome.org>
13732
13733         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13734         `is_disposable' fields.
13735         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13736         `hm.is_disposable' if we're using the collection pattern.
13737         (Foreach.EmitCollectionForeach): Use the correct type for the
13738         enumerator's local variable, only emit the try/finally block if
13739         necessary (fixes #27713).
13740
13741 2002-08-01  Martin Baulig  <martin@gnome.org>
13742
13743         * ecore.cs (Expression.report118): Renamed to Error118 and made
13744         it public static.
13745
13746         * statement.cs (Throw.Resolve): Check whether the expression is of
13747         the correct type (CS0118) and whether the type derives from
13748         System.Exception (CS0155).
13749         (Catch.Resolve): New method.  Do the type lookup here and check
13750         whether it derives from System.Exception (CS0155).
13751         (Catch.CatchType, Catch.IsGeneral): New public properties.
13752
13753         * typemanager.cs (TypeManager.exception_type): Added.
13754
13755 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * driver.cs: Updated About function.
13758
13759 2002-07-31  Martin Baulig  <martin@gnome.org>
13760
13761         Implemented Control Flow Analysis.
13762
13763         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13764         (EmitContext.CurrentBranching): Added.
13765         (EmitContext.StartFlowBranching): Added.
13766         (EmitContext.EndFlowBranching): Added.
13767         (EmitContext.KillFlowBranching): Added.
13768         (EmitContext.IsVariableAssigned): Added.
13769         (EmitContext.SetVariableAssigned): Added.
13770         (EmitContext.IsParameterAssigned): Added.
13771         (EmitContext.SetParameterAssigned): Added.
13772         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13773         Added control flow analysis stuff here.
13774
13775         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13776         resolve the expression as lvalue.
13777         (LocalVariableReference.DoResolve): Check whether the variable has
13778         already been assigned.
13779         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13780         the parameter as assigned here.
13781         (ParameterReference.DoResolve): Check whether the parameter has already
13782         been assigned.
13783         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13784         expression as lvalue.
13785
13786         * statement.cs (FlowBranching): New class for the flow analysis code.
13787         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13788         (LabeledStatement.IsDefined): New public property.
13789         (LabeledStatement.AddUsageVector): New public method to tell flow
13790         analyis that the label may be reached via a forward jump.
13791         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13792         flow analysis.
13793         (VariableInfo.Number): New public field.  This is used by flow analysis
13794         to number all locals of a block.
13795         (Block.CountVariables): New public property.  This is the number of
13796         local variables in this block (including the locals from all parent
13797         blocks).
13798         (Block.EmitMeta): Number all the variables.
13799
13800         * statement.cs: Added flow analysis support to all classes.
13801
13802 2002-07-31  Martin Baulig  <martin@gnome.org>
13803
13804         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13805         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13806         then use this argument.
13807
13808         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13809
13810         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13811         use this to specify /define options.
13812
13813 2002-07-29  Martin Baulig  <martin@gnome.org>
13814
13815         * statement.cs (Fixed): Moved all code that does variable lookups
13816         and resolvings from Emit to Resolve.
13817
13818         * statement.cs (For): Moved all code that does variable lookups
13819         and resolvings from Emit to Resolve.
13820
13821         * statement.cs (Using): Moved all code that does variable lookups
13822         and resolvings from Emit to Resolve.
13823
13824 2002-07-29  Martin Baulig  <martin@gnome.org>
13825
13826         * attribute.cs (Attribute.Resolve): Explicitly catch a
13827         System.NullReferenceException when creating the
13828         CustromAttributeBuilder and report a different warning message.
13829
13830 2002-07-29  Martin Baulig  <martin@gnome.org>
13831
13832         * support.cs (ParameterData.ParameterName): Added method to
13833         get the name of a parameter.
13834
13835         * typemanager.cs (TypeManager.IsValueType): New public method.
13836
13837 2002-07-29  Martin Baulig  <martin@gnome.org>
13838
13839         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13840         is a flag which specifies that it's either ref or out.
13841         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13842         the out parameter to `out Parameter.Modifier mod', also set the
13843         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13844
13845         * support.cs (InternalParameters.ParameterModifier): Distinguish
13846         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13847         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13848
13849         * expression.cs (Argument.GetParameterModifier): Distinguish
13850         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13851         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13852
13853 2002-07-29  Martin Baulig  <martin@gnome.org>
13854
13855         * expression.cs (ParameterReference.ParameterReference): Added
13856         `Location loc' argument to the constructor.
13857
13858         * cs-parser.jay: Pass location to ParameterReference.
13859
13860 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * statement.cs (Try): Initialize the location.
13863
13864         * cs-parser.jay: pass location to Try.
13865
13866         * expression.cs (Unary.Reduce): Change the prototype to return
13867         whether a constant fold could be performed or not.  The result is
13868         returned in an out parameters.  In the case of Indirection and
13869         AddressOf, we want to perform the full tests.
13870
13871 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13872
13873         * statement.cs (Statement.Emit): Flag dead code.
13874
13875 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13876
13877         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13878
13879 2002-07-27  Martin Baulig  <martin@gnome.org>
13880
13881         * class.cs (MethodData.Define): Put back call to
13882         TypeManager.AddMethod(), accidentally commented this out.
13883
13884         * report.cs (Debug): New public method to print debugging information,
13885         this is `[Conditional ("DEBUG")]'.
13886
13887 2002-07-26  Martin Baulig  <martin@gnome.org>
13888
13889         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13890         (switch_statement): Push the current_block to the switch_stack and
13891         pop it again when we're done with the switch.
13892         (switch_section): The new block is a child of the current_block.
13893         Fixes bug #24007, added test-152.cs.
13894
13895 2002-07-27  Martin Baulig  <martin@gnome.org>
13896
13897         * expression.cs (Invocation.EmitArguments): When calling a varargs
13898         function with only its fixed arguments, we need to pass an empty
13899         array.
13900
13901 2002-07-27  Martin Baulig  <martin@gnome.org>
13902
13903         Mono 0.13 has been released.
13904
13905 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13906
13907         * driver.cs: Rename --resource to --linkres, because that is what
13908         we do currently, we dont support --resource yet.
13909
13910         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13911
13912 2002-07-25  Martin Baulig  <martin@gnome.org>
13913
13914         * class.cs (MethodData): New public class.  This is a `method builder'
13915         class for a method or one accessor of a Property/Indexer/Event.
13916         (MethodData.GetMethodFlags): Moved here from MemberBase.
13917         (MethodData.ApplyAttributes): Likewise.
13918         (MethodData.ApplyObsoleteAttribute): Likewise.
13919         (MethodData.ApplyConditionalAttribute): Likewise.
13920         (MethodData.ApplyDllImportAttribute): Likewise.
13921         (MethodData.CheckAbstractAndExternal): Likewise.
13922         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13923         (MethodData.Emit): Formerly known as Method.Emit().
13924         (MemberBase): Moved everything which was specific to a single
13925         accessor/method to MethodData.
13926         (Method): Create a new MethodData and call Define() and Emit() on it.
13927         (Property, Indexer, Event): Create a new MethodData objects for each
13928         accessor and call Define() and Emit() on them.
13929
13930 2002-07-25  Martin Baulig  <martin@gnome.org>
13931
13932         Made MethodCore derive from MemberBase to reuse the code from there.
13933         MemberBase now also checks for attributes.
13934
13935         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13936         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13937         as virtual.
13938         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13939         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13940         (MemberBase.ApplyAttributes): New virtual method; applies the
13941         attributes to a method or accessor.
13942         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13943         (MemberBase.ApplyConditionalAttribute): Likewise.
13944         (MemberBase.ApplyDllImportAttribute): Likewise.
13945         (MemberBase.CheckAbstractAndExternal): Likewise.
13946         (MethodCore.ParameterTypes): This is now a property instead of a
13947         method, it's initialized from DoDefineParameters().
13948         (MethodCore.ParameterInfo): Removed the set accessor.
13949         (MethodCore.DoDefineParameters): New protected virtual method to
13950         initialize ParameterTypes and ParameterInfo.
13951         (Method.GetReturnType): We can now simply return the MemberType.
13952         (Method.GetMethodFlags): Override the MemberBase version and add
13953         the conditional flags.
13954         (Method.CheckBase): Moved some code from Define() here, call
13955         DoDefineParameters() here.
13956         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13957         here to avoid some larger code duplication.
13958         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13959         ensure that abstract and external accessors don't declare a body.
13960
13961         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13962         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13963         lookup in the attribute's parent classes, so we need to abort as soon
13964         as we found the first match.
13965         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13966         the attribute has no arguments.
13967
13968         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13969         of a Method.
13970
13971 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13972
13973         * cs-parser.jay: reverted previous patch.
13974
13975 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13976
13977         * cs-parser.jay: fixed bug #22119.
13978
13979 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13980
13981         * attribute.cs: fixed compilation. The error was:
13982         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13983         be assigned to before control leaves the current method."
13984         [FIXME:  Filed as bug #28186: MCS must report this error.]
13985
13986 2002-07-25  Martin Baulig  <martin@gnome.org>
13987
13988         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13989         method to pull the condition name ouf of a Conditional attribute.
13990         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13991         the obsolete message and error flag out of an Obsolete attribute.
13992
13993         * class.cs (Method.GetMethodFlags): New public method to get the
13994         TypeManager.MethodFlags for this method.
13995         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13996         private methods.
13997         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13998         if we're overriding a virtual function, set the new private variable
13999         `parent_method'; call the new TypeManager.AddMethod().
14000
14001         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14002         the MethodBuilder and the Method in a PtrHashtable.
14003         (TypeManager.builder_to_method): Added for this purpose.
14004         (TypeManager.MethodFlags): Added IsObsoleteError.
14005         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14006         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14007         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14008         the message from the attribute.
14009
14010 2002-07-24  Martin Baulig  <martin@gnome.org>
14011
14012         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14013         preprocessor directives, ensure that the argument to #define/#undef is
14014         exactly one identifier and that it's actually an identifier.
14015
14016         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14017         did not work ....
14018
14019 2002-07-24  Martin Baulig  <martin@gnome.org>
14020
14021         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14022         initialize it to TypeManager.object_type in the constructor.
14023         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14024         of the `hm.get_current' method if we're using the collection pattern.
14025         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14026         for the explicit conversion to make it work when we're using the collection
14027         pattern and the `Current' property has a different return type than `object'.
14028         Fixes #27713.
14029
14030 2002-07-24  Martin Baulig  <martin@gnome.org>
14031
14032         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14033         does not match, but don't report any errors.  This method is called in
14034         order for all methods in a MethodGroupExpr until a matching method is
14035         found, so we don't want to bail out if the first method doesn't match.
14036         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14037         matches, report the 123.  Fixes #28070.
14038
14039 2002-07-24  Martin Baulig  <martin@gnome.org>
14040
14041         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14042         TypeManager.TypeToCoreType() to the top of the method so the
14043         following equality checks will work.  Fixes #28107.
14044
14045 2002-07-24  Martin Baulig  <martin@gnome.org>
14046
14047         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14048         operand is of type uint, and the other operand is of type sbyte,
14049         short or int, the operands are converted to type long." -
14050         Actually do what this comment already told us.  Fixes bug #28106,
14051         added test-150.cs.
14052
14053 2002-07-24  Martin Baulig  <martin@gnome.org>
14054
14055         * class.cs (MethodBase): New abstract class.  This is now a base
14056         class for Property, Indexer and Event to avoid some code duplication
14057         in their Define() and DefineMethods() methods.
14058         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14059         generic methods for Define() and DefineMethods().
14060         (FieldBase): Derive from MemberBase, not MemberCore.
14061         (Property): Derive from MemberBase, not MemberCore.
14062         (Property.DefineMethod): Moved all the code from this method to the
14063         new MethodBase.DefineAccessor(), just call it with appropriate
14064         argumetnts.
14065         (Property.Define): Call the new Property.DoDefine(), this does some
14066         sanity checks and we don't need to duplicate the code everywhere.
14067         (Event): Derive from MemberBase, not MemberCore.
14068         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14069         accessors, this will also make them work with interface events.
14070         (Indexer): Derive from MemberBase, not MemberCore.
14071         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14072         (Indexer.Define): Use the new MethodBase functions.
14073
14074         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14075         argument to the constructor.
14076         (Interface.FindMembers): Added support for interface events.
14077         (Interface.PopluateEvent): Implemented.
14078
14079         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14080
14081 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14084         but this is required to check for a method name being the same as
14085         the containing class.  
14086
14087         Handle this now.
14088
14089 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14090
14091         * interface.cs: initialize variable.
14092
14093 2002-07-23  Martin Baulig  <martin@gnome.org>
14094
14095         Implemented the IndexerName attribute in interfaces.
14096
14097         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14098         name if this is an explicit interface implementation.
14099         (Indexer.InterfaceIndexerName): New public variable.  If we're
14100         implementing an interface indexer, this is the IndexerName in that
14101         interface.  Otherwise, it's the IndexerName.
14102         (Indexer.DefineMethod): If we're implementing interface indexer,
14103         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14104         and Pending.ImplementIndexer methods.
14105         (Indexer.Define): Also define the PropertyBuilder if we're
14106         implementing an interface indexer and this is neither an explicit
14107         interface implementation nor do the IndexerName match the one in
14108         the interface.
14109
14110         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14111         If a method is defined here, then we always need to create a proxy
14112         for it.  This is used when implementing interface indexers.
14113         (Pending.IsInterfaceIndexer): New public method.
14114         (Pending.ImplementIndexer): New public method.
14115         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14116         This is used when implementing interface indexers to define a proxy
14117         if necessary.
14118         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14119         define a proxy if necessary.
14120
14121         * interface.cs (Interface.IndexerName): New public variable.
14122         (Interface.PopulateIndexer): Set the IndexerName.
14123         (Interface.DefineIndexers): New private method.  Populate all the
14124         indexers and make sure their IndexerNames match.
14125
14126         * typemanager.cs (IndexerPropertyName): Added support for interface
14127         indexers.
14128
14129 2002-07-22  Martin Baulig  <martin@gnome.org>
14130
14131         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14132         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14133         ret if HasReturnLabel.
14134         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14135         variables.
14136
14137         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14138         and set the ec.LoopBeginTryCatchLevel.
14139         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14140         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14141         the current ec.TryCatchLevel, the branch goes out of an exception
14142         block.  In this case, we need to use Leave and not Br.
14143
14144 2002-07-22  Martin Baulig  <martin@gnome.org>
14145
14146         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14147         block unless the block does not always return or it is contained in
14148         another try { ... } catch { ... } block.  Fixes bug #26506.
14149         Added verify-1.cs to the test suite.
14150
14151 2002-07-22  Martin Baulig  <martin@gnome.org>
14152
14153         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14154         then we do not always return.  Fixes bug #24985.
14155
14156 2002-07-22  Martin Baulig  <martin@gnome.org>
14157
14158         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14159         lookup on a per-class level; ie. walk up the class hierarchy until we
14160         found at least one applicable method, then choose the best among them.
14161         Fixes bug #24463 and test-29.cs.
14162
14163 2002-07-22  Martin Baulig  <martin@gnome.org>
14164
14165         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14166         return types of the methods.  The return type is not part of the
14167         signature and we must not check it to make the `new' modifier work.
14168         Fixes bug #27999, also added test-147.cs.
14169         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14170
14171         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14172         on the method's return type.
14173
14174 2002-07-21  Martin Baulig  <martin@gnome.org>
14175
14176         * assign.cs: Make this work if the rightmost source is a constant and
14177         we need to do an implicit type conversion.  Also adding a few more tests
14178         to test-38.cs which should have caught this.
14179
14180         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14181         target in the makefile for this.  The makefile.gnu is primarily intended
14182         for end-users who don't want to debug the compiler.
14183
14184 2002-07-21  Martin Baulig  <martin@gnome.org>
14185
14186         * assign.cs: Improved the Assign class so it can now handle embedded
14187         assignments (X = Y = Z = something).  As a side-effect this'll now also
14188         consume less local variables.  test-38.cs now passes with MCS, added
14189         a few new test cases to that test.
14190
14191 2002-07-20  Martin Baulig  <martin@gnome.org>
14192
14193         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14194         instructions.  Fixes bug #27977, also added test-146.cs.
14195
14196 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14197
14198         * cs-tokenizer.cs: fixed getHex ().
14199
14200 2002-07-19  Martin Baulig  <martin@gnome.org>
14201
14202         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14203         not Type.GetType() to lookup the array type.  This is needed when
14204         we're constructing an array of a user-defined type.
14205         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14206         single-dimensional arrays, but also for single-dimensial arrays of
14207         type decimal.
14208
14209 2002-07-19  Martin Baulig  <martin@gnome.org>
14210
14211         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14212         this function is called, it's not allowed to share LocalBuilders
14213         among ILGenerators.
14214
14215 2002-07-19  Martin Baulig  <martin@gnome.org>
14216
14217         * expression.cs (Argument.Resolve): Report an error 118 when trying
14218         to pass a type as argument.
14219
14220 2002-07-18  Martin Baulig  <martin@gnome.org>
14221
14222         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14223         Conv_R_Un for the signed `long' type.
14224
14225 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14226
14227         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14228         `expr' for the temporary result, as that will fail if we do
14229         multiple resolves on the same expression.
14230
14231 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14232
14233         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14234         ec.TypeContainer for looking up aliases. 
14235
14236         * class.cs (TypeContainer): Remove LookupAlias from here.
14237
14238         * decl.cs (DeclSpace); Move here.
14239
14240 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14241
14242         * class.cs (FindMembers): Only call filter if the constructor
14243         bulider is not null.
14244
14245         Also handle delegates in `NestedTypes' now.  Now we will perform
14246         type lookups using the standard resolution process.  This also
14247         fixes a bug.
14248
14249         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14250         This uses Expressions (the limited kind that can be parsed by the
14251         tree) instead of strings.
14252
14253         * expression.cs (ComposedCast.ToString): Implement, used to flag
14254         errors since now we have to render expressions.
14255
14256         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14257         FormArrayType. 
14258
14259         * ecore.cs (SimpleName.ToString): ditto.
14260
14261         * cs-parser.jay: Instead of using strings to assemble types, use
14262         Expressions to assemble the type (using SimpleName, ComposedCast,
14263         MemberAccess).  This should fix the type lookups in declarations,
14264         because we were using a different code path for this.
14265
14266         * statement.cs (Block.Resolve): Continue processing statements
14267         even when there is an error.
14268
14269 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14270
14271         * class.cs (Event.Define): Also remove the `remove' method from
14272         the list of pending items.
14273
14274         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14275         generate more compact code. 
14276
14277 2002-07-17  Martin Baulig  <martin@gnome.org>
14278
14279         * const.cs (Const.LookupConstantValue): Add support for constant
14280         `unchecked' and `checked' expressions.
14281         Also adding test case test-140.cs for this.
14282
14283 2002-07-17  Martin Baulig  <martin@gnome.org>
14284
14285         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14286         check whether mi.ReturnType implements the IEnumerator interface; the
14287         `==' and the IsAssignableFrom() will fail in this situation.
14288
14289 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14290
14291         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14292         here too.
14293
14294 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14295
14296         * expression.cs: fixed bug #27811.
14297
14298 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14299
14300         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14301         Molaro: when we are a ref, the value already contains a pointer
14302         value, do not take the address of it.
14303
14304 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14305         * removed mb-parser.jay and mb-tokenizer.cs
14306
14307 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14308
14309         * expression.cs: check against the building corlib void type.
14310
14311 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14312
14313         * ecore.cs: fix for valuetype static readonly fields: when 
14314         initializing them, we need their address, not the address of a copy.
14315
14316 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14317
14318         * typemanager.cs: register also enum_type in corlib.
14319
14320 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14321
14322         * class.cs: allow calling this (but not base) initializers in structs.
14323
14324 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14325
14326         * ecore.cs: make sure we compare against the building base types
14327         in GetTypeSize ().
14328
14329 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14330
14331         * typemanager.cs: fix TypeToCoreType() to handle void and object
14332         (corlib gets no more typerefs after this change).
14333
14334 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14335
14336         * expression.cs (ArrayCreation.EmitArrayArguments): use
14337         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14338
14339         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14340         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14341         array indexes, the runtime actually forbids them.
14342
14343         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14344         for array arguments here.
14345
14346         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14347         instead of the default for ValueTypes.
14348
14349         (New.DoEmit): Use IsValueType instead of
14350         IsSubclassOf (value_type)
14351         (New.DoResolve): ditto.
14352         (Invocation.EmitCall): ditto.
14353
14354         * assign.cs (Assign): ditto.
14355
14356         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14357         Statements *are* currently doing part of their resolution during
14358         Emit.  
14359
14360         Expressions do always resolve during resolve, but statements are
14361         only required to propagate resolution to their children.
14362
14363 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14364
14365         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14366
14367         (LoadAssembly): Do not add the dll if it is already specified
14368
14369         (MainDriver): Add the System directory to the link path at the end,
14370         after all the other -L arguments. 
14371
14372         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14373         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14374         ldelem.u1) and using the opposite for sbytes.
14375
14376         This fixes Digger, and we can finally run it.
14377
14378         * driver.cs (UnixParseOption): Move the option parsing here.  
14379         (CSCParseOption): Implement CSC-like parsing of options.
14380
14381         We now support both modes of operation, the old Unix way, and the
14382         new CSC-like way.  This should help those who wanted to make cross
14383         platform makefiles.
14384
14385         The only thing broken is that /r:, /reference: and /lib: are not
14386         implemented, because I want to make those have the same semantics
14387         as the CSC compiler has, and kill once and for all the confussion
14388         around this.   Will be doing this tomorrow.
14389
14390         * statement.cs (Unsafe.Resolve): The state is checked during
14391         resolve, not emit, so we have to set the flags for IsUnsfe here.
14392
14393 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14396         not catch the Error_ObjectRefRequired in SimpleName (as it is
14397         possible to have a class/instance variable name that later gets
14398         deambiguated), we have to check this here.      
14399
14400 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14401
14402         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14403         make static and put into Expression.
14404
14405         (Event.Define): Register the private field of the event with the 
14406         TypeManager so that GetFieldFromEvent can get at it.
14407
14408         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14409         keep track of the private field associated with an event which
14410         has no accessors.
14411
14412         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14413         private field.
14414
14415         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14416
14417 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14418
14419         * expression.cs (Binary.EmitBranchable): this routine emits the
14420         Binary expression in a branchable context.  This basically means:
14421         we need to branch somewhere, not just get the value on the stack.
14422
14423         This works together with Statement.EmitBoolExpression.
14424
14425         * statement.cs (Statement.EmitBoolExpression): Use
14426         EmitBranchable. 
14427
14428 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * statement.cs (For): Reduce the number of jumps in loops.
14431
14432         (For): Implement loop inversion for the For statement.
14433
14434         (Break): We can be breaking out of a Try/Catch controlled section
14435         (foreach might have an implicit try/catch clause), so we need to
14436         use Leave instead of Br.
14437
14438         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14439         now).  If the instace expression supports IMemoryLocation, we use
14440         the AddressOf method from the IMemoryLocation to extract the
14441         address instead of emitting the instance.
14442
14443         This showed up with `This', as we were emitting the instance
14444         always (Emit) instead of the Address of This.  Particularly
14445         interesting when This is a value type, as we dont want the Emit
14446         effect (which was to load the object).
14447
14448 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14451
14452         * statement.cs (Checked): Set the CheckedState during the resolve
14453         process too, as the ConvCast operations track the checked state on
14454         the resolve process, and not emit.
14455
14456         * cs-parser.jay (namespace_member_declaration): Flag that we have
14457         found a declaration when we do.  This is used to flag error 1529
14458
14459         * driver.cs: Report ok when we display the help only.
14460
14461 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14462
14463         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14464
14465 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * cs-tokenizer.cs (define): We also have to track locally the
14468         defines.  AllDefines is just used for the Conditional Attribute,
14469         but we also need the local defines for the current source code. 
14470
14471 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14472
14473         * statement.cs (While, For, Do): These loops can exit through a
14474         Break statement, use this information to tell whether the
14475         statement is the last piece of code.
14476
14477         (Break): Flag that we break.
14478
14479         * codegen.cs (EmitContexts): New `Breaks' state variable.
14480
14481 2002-07-03  Martin Baulig  <martin@gnome.org>
14482
14483         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14484         modifiers in method declarations in structs.  Otherwise, you won't
14485         be able to override things like Object.Equals().
14486
14487 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * class.cs (Method, Property, Indexer): Do not allow the public
14490         modifier to be used in explicit interface implementations.
14491
14492         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14493         override modifiers in method declarations in structs
14494
14495 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14496
14497         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14498         integer or real overflow, report an error
14499
14500 2002-07-02  Martin Baulig  <martin@gnome.org>
14501
14502         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14503         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14504         to tell the runtime about our newly created System.Object and
14505         System.ValueType types.
14506
14507 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14510         struct instead of Ldarg/Starg.
14511
14512 2002-07-02  Martin Baulig  <martin@gnome.org>
14513
14514         * expression.cs (Indirection.Indirection): Call
14515         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14516
14517 2002-07-02  Martin Baulig  <martin@gnome.org>
14518
14519         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14520         ValueType, call TypeManager.TypeToCoreType() on it.
14521         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14522         the OpCodes.Newarr argument.
14523
14524 2002-07-02  Martin Baulig  <martin@gnome.org>
14525
14526         * expression.cs (Invocation.EmitCall): When compiling corlib,
14527         replace all calls to the system's System.Array type to calls to
14528         the newly created one.
14529
14530         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14531         System.Array methods.
14532         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14533         from the system's System.Array type which must be replaced.
14534
14535 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14536
14537         * typemanager.cs: load unverifiable_code_ctor so we can build
14538         corlib using the correct type. Avoid using GetTypeCode() with
14539         TypeBuilders.
14540         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14541         TypeManager.object_type to allow building corlib.
14542
14543 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14544
14545         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14546
14547 2002-07-01  Martin Baulig  <martin@gnome.org>
14548
14549         * class.cs: Make the last change actually work, we need to check
14550         whether `ifaces != null' to avoid a crash.
14551
14552 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14553
14554         * class.cs: when we build structs without fields that implement
14555         interfaces, we need to add the interfaces separately, since there is
14556         no API to both set the size and add the interfaces at type creation
14557         time.
14558
14559 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14560
14561         * expression.cs: the dimension arguments to the array constructors
14562         need to be converted if they are a long.
14563
14564 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14565
14566         * class.cs: don't emit ldarg.0 if there is no parent constructor
14567         (fixes showstopper for corlib).
14568
14569 2002-06-29  Martin Baulig  <martin@gnome.org>
14570
14571         MCS now compiles corlib on GNU/Linux :-)
14572
14573         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14574         ie. check for MethodImplOptions.InternalCall.
14575
14576         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14577         and TypeManager.attribute_type are null, so we must explicitly check
14578         whether parent is not null to find out whether it's an attribute type.
14579         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14580         and SetBuilder, not only if the property is neither abstract nor external.
14581         This is necessary to set the MethodImplOptions on the accessor methods.
14582         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14583         SetBuilder, see Property.Emit().
14584
14585         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14586         populate "System.Object", "System.ValueType" and "System.Attribute" since
14587         they've already been populated from BootCorlib_PopulateCoreTypes().
14588
14589 2002-06-29  Martin Baulig  <martin@gnome.org>
14590
14591         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14592         is the NullLiteral, we also need to make sure that target_type is not
14593         an enum type.   
14594
14595 2002-06-29  Martin Baulig  <martin@gnome.org>
14596
14597         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14598         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14599         before calling BootstrapCorlib_ResolveDelegate ().
14600
14601 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14602
14603         * statement.cs: fixed build-breaker. All tests passed ok.
14604
14605 2002-06-27  Martin Baulig  <martin@gnome.org>
14606
14607         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14608         for System.Decimal when compiling corlib.
14609
14610 2002-06-27  Martin Baulig  <martin@gnome.org>
14611
14612         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14613         switch blocks which contain nothing but a default clause.
14614
14615 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14616
14617        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14618
14619 2002-06-27  Martin Baulig  <martin@gnome.org>
14620
14621         * ecore.cs (PropertyExpr.PropertyExpr): Call
14622         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14623
14624         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14625         is already a TypeBuilder.
14626
14627 2002-06-27  Martin Baulig  <martin@gnome.org>
14628
14629         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14630         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14631         the "from an array-type to System.Array" case.  This makes it work
14632         when compiling corlib.
14633
14634 2002-06-27  Martin Baulig  <martin@gnome.org>
14635
14636         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14637         non-static PropertyExpr, set its InstanceExpression.  This makes
14638         the `ICollection.Count' property work in System/Array.cs.
14639
14640 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14641
14642         * driver.cs: Made error handling more consistent.  Errors now
14643         tracked by Report class, so many methods which used to return int
14644         now return void.  Main() now prints success/failure and 
14645         errors/warnings message.
14646
14647         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14648         the magic number return values (123 and 124).  Now, if the
14649         expected error occurs, the compiler exits with success (exit value
14650         0).  If the compilation completes without seeing that particular
14651         error, the compiler exits with failure (exit value 1).  The
14652         makefile in mcs/errors has been changed to handle the new behaviour.
14653
14654         * report.cs: Made 'expected error' number a property and renamed
14655         it from 'Probe' to 'ExpectedError'.
14656
14657         * genericparser.cs: Removed error handling support, since it is
14658         now all done by Report class.
14659
14660         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14661         class, so parse() no longer returns an int.
14662
14663         * namespace.cs: Use Report.Error instead of GenericParser.error
14664
14665 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14666
14667         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14668         TypeContainer.AddOperator): At the front of the list put the
14669         explicit implementations, so they get resolved/defined first. 
14670
14671 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14672
14673         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14674         interface type is implemented by this TypeContainer.  Used during
14675         explicit interface implementation.
14676
14677         (Property.Define, Indexer.Define, Method.Define): Validate that
14678         the given interface in the explicit implementation is one of the
14679         base classes for the containing type.
14680
14681         Also if we are explicitly implementing an interface, but there is
14682         no match in the pending implementation table, report an error.
14683
14684         (Property.Define): Only define the property if we are
14685         not explicitly implementing a property from an interface.  Use the
14686         correct name also for those properties (the same CSC uses,
14687         although that is really not needed).
14688
14689         (Property.Emit): Do not emit attributes for explicitly implemented
14690         properties, as there is no TypeBuilder.
14691
14692         (Indexer.Emit): ditto.
14693
14694         Hiding then means that we do not really *implement* a pending
14695         implementation, which makes code fail.
14696
14697 2002-06-22  Martin Baulig  <martin@gnome.org>
14698
14699         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14700         the return value of Object.GetType().  [FIXME: we need to do this whenever
14701         we get a type back from the reflection library].
14702
14703 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14704
14705         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14706
14707 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14708
14709         * attribute.cs: Return null if we can not look up the type.
14710
14711         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14712         the interface types found.
14713
14714         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14715         interface types found.
14716
14717         * typemanager.cs (GetInterfaces): Make this routine returns alll
14718         the interfaces and work around the lame differences between
14719         System.Type and System.Reflection.Emit.TypeBuilder in the results
14720         result for GetInterfaces.
14721
14722         (ExpandInterfaces): Given an array of interface types, expand and
14723         eliminate repeated ocurrences of an interface.  This expands in
14724         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14725         be IA, IB, IC.
14726
14727 2002-06-21  Martin Baulig  <martin@gnome.org>
14728
14729         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14730         on System.Enum.
14731
14732 2002-06-21  Martin Baulig  <martin@gnome.org>
14733
14734         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14735         and called with one of the core types, return the corresponding typebuilder for
14736         that type.
14737
14738         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14739         element type.
14740
14741 2002-06-21  Martin Baulig  <martin@gnome.org>
14742
14743         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14744         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14745         (Expression.ConvertReferenceExplicit): Likewise.
14746
14747         * expression.cs (ElementAccess.DoResolve): Likewise.
14748         (ElementAccess.DoResolveLValue): Likewise.
14749
14750 2002-06-10  Martin Baulig  <martin@gnome.org>
14751
14752         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14753         add the "value" parameter to the parameter list.
14754
14755         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14756         to our caller.
14757
14758 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14759
14760         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14761         the argument to an int, uint, long or ulong, per the spec.  Also
14762         catch negative constants in array creation.
14763
14764 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14765
14766         * class.cs: do not allow the same interface to appear twice in
14767         the definition list.
14768
14769 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14770
14771         * ecore.cs: don't use ldlen with System.Array.
14772
14773 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14774
14775         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14776
14777 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14778
14779         * modifiers.cs: produce correct field attributes for protected
14780         internal. Easy fix so miguel can work on ther harder stuff:-)
14781
14782 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14783
14784         * pending.cs: New file.  Move the code from class.cs here.
14785         Support clearning the pending flag for all methods (when not doing
14786         explicit interface implementation).
14787
14788 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14789
14790         * rootcontext.cs: added a couple more types needed to bootstrap.
14791
14792 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14793
14794         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14795         constructor in the type, instead of any constructor in the type
14796         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14797         a bug in the Mono runtime when applying the params attribute). 
14798
14799 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14800         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14801
14802 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14803
14804         * expression.cs (Unary.ResolveOperator): Use TypeManager
14805         to resolve the type.
14806
14807 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14808
14809         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14810         attached.
14811
14812         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14813         with each member too.
14814
14815         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14816         field builders too - this takes care of the enum member case.
14817
14818 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14819
14820         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14821         address-of operator on both value types and pointers.
14822
14823 2002-06-10  Martin Baulig  <martin@gnome.org>
14824
14825         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14826         PropertyBuilder to the `property_builders' list.
14827
14828         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14829         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14830         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14831         find any indexers which are inherited from an interface.
14832
14833 2002-06-09  Martin Baulig  <martin@gnome.org>
14834
14835         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14836         the same type as the constant if necessary.  There's also a test-130.cs
14837         for this.
14838
14839         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14840
14841         * typemanager.cs (TypeManager.ChangeType): Previously known as
14842         Enum.ChangeEnumType().
14843
14844 2002-06-09  Martin Baulig  <martin@gnome.org>
14845
14846         * expression.cs (Cast.TryReduce): Added support for consts.
14847
14848 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14849
14850         * class.cs (Accessor): Hold attributes information so we can pass
14851         it along.
14852
14853         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14854         Modify to pass in attributes attached to the methods.
14855
14856         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14857
14858         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14859         to handle the Accessor kind :-)
14860
14861         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14862
14863 2002-06-08  Martin Baulig  <martin@gnome.org>
14864
14865         * expression.cs (Unary.TryReduceNegative): Added support for
14866         ULongConstants.
14867
14868 2002-06-08  Martin Baulig  <martin@gnome.org>
14869
14870         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14871         name can't be found in the `defined_names' - the caller will do a
14872         MemberLookup in this case and thus find methods in System.Enum
14873         such as Enum.IsDefined().
14874
14875 2002-06-08  Martin Baulig  <martin@gnome.org>
14876
14877         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14878         Convert.ChangeType() which works with TypeBuilder created types.
14879         (Enum.LookupEnumValue, Enum.Define): Use it here.
14880
14881         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14882         `TypeBuilder.BaseType != null' check.
14883         (TypeContainer.FindMembers): Only lookup parent members if we
14884         actually have a parent.
14885         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14886         (ConstructorInitializer.Resolve): Likewise.
14887
14888         * interface.cs (Interface.FindMembers): Added
14889         `TypeBuilder.BaseType != null' check.
14890
14891         * rootcontext.cs (RootContext.ResolveCore): Added
14892         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14893         classes_second_stage.
14894
14895         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14896         debug_type and trace_type when compiling with --nostdlib.       
14897
14898 2002-06-07  Martin Baulig  <martin@gnome.org>
14899
14900         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14901         (AddField): Set it to true when adding a non-static field.
14902         (DefineType): Use `have_nonstatic_fields' to find out whether we
14903         have non-static fields, not `Fields != null'.
14904
14905 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14908         dereferencing a null on the static-field code path)
14909
14910 2002-05-30  Martin Baulig  <martin@gnome.org>
14911
14912         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14913         to take command line arguments.  Use reflection to call the new
14914         custom `Initialize' function on the symbol writer and pass it the
14915         command line arguments.
14916
14917         * driver.cs (--debug-args): New command line argument to pass command
14918         line arguments to the symbol writer.
14919
14920 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14923         the target type for indexers and properties.  Thanks to Joe for
14924         catching this.
14925
14926 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14927
14928         * typemanager.cs (MethodFlags): returns the method flags
14929         (Obsolete/ShouldIgnore) that control warning emission and whether
14930         the invocation should be made, or ignored. 
14931
14932         * expression.cs (Invocation.Emit): Remove previous hack, we should
14933         not do this on matching a base type, we should do this based on an attribute
14934
14935         Only emit calls to System.Diagnostics.Debug and
14936         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14937         on the command line.
14938
14939         * rootcontext.cs: Global settings for tracing and debugging.
14940
14941         * cs-tokenizer.cs (define): New utility function to track
14942         defines.   Set the global settings for TRACE and DEBUG if found.
14943
14944 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14945
14946         * interface.cs (Populate*): Pass in the TypeContainer as well as
14947         the DeclSpace as parameters so that we can create EmitContexts and
14948         then use that to apply attributes etc.
14949
14950         (PopulateMethod, PopulateEvent, PopulateProperty)
14951         (PopulateIndexer): Apply attributes everywhere.
14952
14953         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14954         etc.
14955
14956         (ApplyAttributes): Update accordingly.
14957
14958         We now apply interface attributes for all members too.
14959
14960 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14961
14962         * class.cs (Indexer.Define); Correctly check if we are explicit
14963         implementation (instead of checking the Name for a ".", we
14964         directly look up if the InterfaceType was specified).
14965
14966         Delay the creation of the PropertyBuilder.
14967
14968         Only create the PropertyBuilder if we are not an explicit
14969         interface implementation.   This means that explicit interface
14970         implementation members do not participate in regular function
14971         lookups, and hence fixes another major ambiguity problem in
14972         overload resolution (that was the visible effect).
14973
14974         (DefineMethod): Return whether we are doing an interface
14975         implementation. 
14976
14977         * typemanager.cs: Temporary hack until we get attributes in
14978         interfaces (Ravi is working on that) and we get IndexerName
14979         support in interfaces.
14980
14981         * interface.cs: Register the indexers as properties.
14982
14983         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14984         warning, I have verified that this is a bug in the .NET runtime
14985         (JavaScript suffers of the same problem).
14986
14987         * typemanager.cs (MemberLookup): When looking up members for
14988         interfaces, the parent of an interface is the implicit
14989         System.Object (so we succeed in searches of Object methods in an
14990         interface method invocation.  Example:  IEnumerable x;  x.ToString
14991         ()) 
14992
14993 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * class.cs (Event): Events should also register if they do
14996         implement the methods that an interface requires.
14997
14998         * typemanager.cs (MemberLookup); use the new GetInterfaces
14999         method. 
15000
15001         (GetInterfaces): The code used to lookup interfaces for a type is
15002         used in more than one place, factor it here. 
15003
15004         * driver.cs: Track the errors at the bottom of the file, we kept
15005         on going.
15006
15007         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15008         instance if the method we are calling is static!
15009
15010 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * attribute.cs (ApplyAttributes): Make this function filter out
15013         the IndexerName attribute (as that attribute in reality is never
15014         applied) and return the string constant for the IndexerName
15015         attribute. 
15016
15017         * class.cs (TypeContainer.Emit): Validate that all the indexers
15018         have the same IndexerName attribute, and if so, set the
15019         DefaultName attribute on the class. 
15020
15021         * typemanager.cs: The return value might contain other stuff (not
15022         only methods).  For instance, consider a method with an "Item"
15023         property and an Item method.
15024
15025         * class.cs: If there is a problem with the parameter types,
15026         return. 
15027
15028 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15029
15030         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15031         looks at user defined conversion after making a call to 
15032         StandardConversionExists - we need this for overload resolution.
15033
15034         * expression.cs : Update accordingly the various method calls.
15035
15036         This fixes 2 bugs filed against implicit user defined conversions 
15037
15038 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * statement.cs: Track the result of the assignment.
15041
15042 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * expression.cs (MemberAccess): Improved error reporting for
15045         inaccessible members.
15046
15047 2002-05-22  Martin Baulig  <martin@gnome.org>
15048
15049         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15050         itself with debugging support.
15051
15052 2002-05-22  Martin Baulig  <martin@gnome.org>
15053
15054         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15055         Removed, this isn't needed anymore.
15056
15057 2002-05-20  Martin Baulig  <martin@gnome.org>
15058
15059         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15060         be underlying type for an enum.
15061
15062 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15063
15064         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15065         that splits out the loading of just the core types.
15066
15067         * rootcontext.cs (ResolveCore): Split the struct resolution in
15068         two, so we can load the enumeration underlying types before any
15069         enums are used.
15070
15071         * expression.cs (Is): Bandaid until we fix properly Switch (see
15072         bug #24985 for details).
15073
15074         * typemanager.cs (ImplementsInterface): The hashtable will contain
15075         a null if there are no interfaces implemented.
15076
15077 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15078
15079         * cs-parser.jay (indexer_declarator): It is fine to have array
15080         parameters
15081
15082 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15083
15084         * typemanager.cs: (RegisterBuilder): New function used to register
15085         TypeBuilders that implement interfaces.  Since
15086         TypeBuilder.GetInterfaces (as usual) does not work with lame
15087         Reflection.Emit. 
15088         (AddUserType): register interfaces.
15089
15090         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15091         dealing with TypeBuilder.  Also, arrays are showing up as
15092         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15093         methods can not be invoked on them!
15094
15095         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15096         (ImplicitReferenceConversionExists): Split out from
15097         StandardConversionExists. 
15098
15099         * expression.cs (As): We were only implementing one of the three
15100         cases for the as operator.  We now implement them all.
15101         (Is): Implement the various other cases for Is as well.
15102
15103         * typemanager.cs (CACHE): New define used to control if we want or
15104         not the FindMembers cache.  Seems to have a negative impact on
15105         performance currently
15106
15107         (MemberLookup): Nested types have full acess to
15108         enclosing type members
15109
15110         Remove code that coped with instance/static returns for events, we
15111         now catch this in RealFindMembers.
15112
15113         (RealFindMembers): only perform static lookup if the instance
15114         lookup did not return a type or an event.  
15115
15116 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * assign.cs (CompoundAssign): We pass more semantic information
15119         now to Compound Assignments than we did before: now we have all
15120         the information at hand, and now we resolve the target *before* we
15121         do the expression expansion, which allows the "CacheValue" method
15122         to have the effect we intended (before, a [x] += 1 would generate
15123         two differen ArrayAccess expressions from the ElementAccess,
15124         during the resolution process).
15125
15126         (CompoundAssign.DoResolve): Resolve target and original_source here.
15127
15128 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15129
15130         * expression.cs (ArrayAccess): dropped debugging information. 
15131
15132         * typemanager.cs: Small bug fix: I was always returning i_members,
15133         instead of one of i_members or s_members (depending on which had
15134         the content).
15135
15136         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15137         method is invoked before any code generation takes place, and it
15138         is a mechanism to inform that the expression will be invoked more
15139         than once, and that the method should use temporary values to
15140         avoid having side effects
15141
15142         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15143
15144         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15145         implementation.
15146
15147         * expression.cs (Indirection, ArrayAccess): Add support for
15148         CacheTemporaries in these two bad boys. 
15149
15150         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15151         ldobj or ldind_ref.  
15152         (StoreFromPtr): Handle stobj as well.
15153
15154         * expression.cs (UnaryMutator): Share more code.
15155
15156         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15157         down: I was not tracking the Filter function as well, which
15158         was affecting the results of the cache.
15159
15160 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * attribute.cs: Remove the hack to handle the CharSet property on
15163         StructLayouts. 
15164
15165 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15166
15167         * attribute.cs (DoResolve): More uglyness, we now only try to
15168         resolve the attribute partially, to extract the CharSet
15169         information (only if we are a StructLayout attribute).  Otherwise 
15170
15171         (GetExtraTypeInfo): Add some code to conditionally kill in the
15172         future this.   I am more and more convinced that the .NET
15173         framework has special code to handle the attribute setting on
15174         certain elements.
15175
15176         * expression.cs (IsParamsMethodApplicable): Revert my previous
15177         foreach change here, it was wrong.
15178
15179 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15180
15181         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15182         (pp_expr): do not abort on unknown input, just return.
15183         (eval): abort if there are pending chars.
15184
15185         * attribute.cs (Attribute.Resolve): Positional parameters are
15186         optional.  Deal with that case.
15187
15188         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15189         the Ansi/Unicode/Auto information for the type.
15190
15191         (TypeContainer.DefineType): instantiate the EmitContext here, as
15192         we will be using it during the type definition (to resolve
15193         attributes) and during the emit phase.
15194
15195         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15196         to pull type information out of the attributes
15197
15198         (Attribute.Resolve): track the constructor builder, and allow for
15199         multiple invocations (structs and classes will use this).
15200
15201         * ecore.cs (MemberLookupFinal): new version with all the
15202         parameters customizable.
15203
15204         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15205         constructors.  Return if the result value is null (as the error
15206         would have been flagged already by MemberLookupFinal)
15207
15208         Do not allow instances of abstract classes or interfaces to be
15209         created.
15210
15211         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15212         We have to compare the assembly property here when dealing with
15213         FamANDAssem and Assembly access modifiers, because we might be
15214         creating an assembly from *modules* (that means that we are not
15215         getting TypeBuilders for types defined in other modules that are
15216         part of this assembly).
15217
15218         (Method.Emit): If the method is marked abstract and has a body,
15219         emit an error. 
15220
15221         (TypeContainer.DefineMembers): If both the defined member and the
15222         parent name match are methods, then do not emit any warnings: let
15223         the Method.Define routine take care of flagging warnings.  But if
15224         there is a mismatch (method overrides something else, or method is
15225         overriwritten by something, then emit warning).
15226
15227         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15228         set to null, this means `do not check for the return type on the
15229         signature'. 
15230
15231         (Method.Define): set the return type for the method signature to
15232         null, so that we get methods with the same name and parameters and
15233         different return types.  This is used to flag warning 114 (you are
15234         hiding a method, and you probably want to use the new/override
15235         keywords instead).
15236
15237         * typemanager.cs (MemberLookup): Implemented proper access
15238         control, closing a long standing set of bug reports.  The problem
15239         was that the Framework only has two bits: Public and NonPublic,
15240         and NonPublic includes private and protected methods, but we need
15241         to enforce the FamANDAssem, FamOrAssem and Family. 
15242
15243 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15244
15245         * statement.cs (GotoCase): Return true: Ammounts to giving up
15246         knowledge on whether we return or not, and letting the other case
15247         be responsible for it.
15248
15249 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15250
15251         * driver.cs: Do not load directories for each file processed, only
15252         do it if there is a pattern.
15253
15254         * ecore.cs: Report readonly assigns here as well, as we might have
15255         been resolved only by MemberAccess.
15256
15257         (SimpleName.SimpleNameResolve): Also be useful for LValue
15258         resolution.   We need this to propagate assign to local readonly variables
15259
15260         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15261         do not want to reuse potential criteria memory.
15262
15263         * class.cs (MyEventBuilder): Set reflected_type;
15264
15265         * ecore.cs (Constantify): Added support for constifying bools.
15266
15267         (RootContext.LookupType): Added a cache for values looked up in
15268         the declaration space.
15269
15270         * typemanager.cs (FindMembers): Now is a front-end to
15271         RealFindMembers, and provides a two-level hashtable-based cache to
15272         the request.  
15273
15274         15% performance improvement: from 22.5 to 19.2 seconds.
15275
15276         * expression.cs (IsParamsMethodApplicable): use foreach.
15277         (Invocation.DoResolve): ditto.
15278         (New.DoResolve): ditto.
15279         (ArrayCreation.DoResolve): ditto.
15280
15281         * ecore.cs (FindMostEncompassingType): use foreach.
15282
15283         * delegate.cs (NewDelegate.DoResolve): Use foreach
15284
15285         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15286         (RemoveMethods): use foreach.
15287
15288         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15289         nested foreach statements instead of for, and also break out of
15290         the inner loop once a match is found.
15291
15292         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15293
15294 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15297         we actually unwrap the expression to allow for extra information
15298         to be extracted. 
15299
15300         * expression.cs: Use Shr_Un on unsigned operations. 
15301
15302 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15303
15304         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15305         applicable operators was not being considered correctly. This closes
15306         the bug Miguel reported.
15307
15308 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15309
15310         * attribute.cs: check that the type derives from System.Attribute
15311         and report the correct error in that case (moved the duplicate code to
15312         its own method, too).
15313
15314 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15315
15316         * attribute.cs: lookup attribute type name as the spec says: first the
15317         bare attribute name and then name + "Attribute" (nant compiles with
15318         mcs after this fix).
15319
15320 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15321
15322         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15323         Because of the way we parse things, we should try to see if a
15324         UIntConstant can fit in an integer.
15325
15326 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15327
15328         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15329         when we are in an explicit context.
15330
15331         (ConvertReferenceExplicit): When converting from Iface type S to Class
15332         T make sure the rules are implemented as an OR.
15333
15334         * parameter.cs (ParameterType): Make it a property for now although the
15335         purpose really isn't anything immediate.
15336
15337         * expression.cs (Is*Applicable): Do better checking on the parameter type
15338         of a ref/out parameter. The ones from the system assemblies are already 
15339         marked with the correct type so we don't need to do any correction.
15340
15341         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15342         the object type is standard too so include that.
15343
15344 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * ecore.cs (StandardConversionExists): Augment with missing code:
15347         deal with IntConstant, LongConstants and Enumerations.
15348
15349         * assign.cs: Report the error, instead of failing silently
15350
15351         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15352         typecontainer that they are declared, because the
15353         typecontainer/namespace will have the list of using clauses that
15354         need to be applied.
15355
15356         Assembly Attributes were escaping the normal registration
15357         mechanism. 
15358
15359         (EmitCode): Apply attributes within an EmitContext that represents
15360         the container they were declared on.
15361
15362         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15363
15364 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15365
15366         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15367         Revamp completely - make much cleaner as we now operate only
15368         on a set of Types.
15369
15370         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15371         to implement the logic detailed in the spec more correctly.
15372
15373         (UserDefinedConversion): Update accordingly.
15374
15375 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15376
15377         * statement.cs: Return flow analysis information up.
15378
15379         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15380         and the default.
15381
15382         (token): Do not consume an extra character before calling
15383         decimal_digits.
15384
15385 2002-05-06  Piers Haken <piersh@friskit.com>
15386
15387         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15388
15389 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15390
15391         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15392         EmitContext during the instance constructor initializer
15393         resolution, to stop access to instance variables.
15394
15395         This is mandated by the spec, last paragraph of the `constructor
15396         initializers' section. 
15397
15398 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * cs-parser.jay, class.cs (Accessor): new class used to represent
15401         an accessor (get or set).  In the past we used `null' to represent
15402         a missing accessor.  But this is ambiguous because there was no
15403         way to tell in abstract indexers/properties if one of them was
15404         specified.
15405
15406         Now there is a way of addressing that.
15407
15408         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15409         instead of FindMembers.
15410
15411         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15412         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15413
15414         * attribute.cs: Treat indexers and properties as the same in terms
15415         of applying attributes
15416
15417         * ecore.cs (FindMostEncompassedType): Use statically initialized
15418         EmptyExpressions()s like we do elsewhere to avoid creating useless
15419         objects (and we take this out of the tight loop).
15420
15421         (GetConversionOperators): Move the code to extract the actual
15422         operators to a separate routine to clean things up.
15423
15424 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15425
15426         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15427         events are always registered FieldBuilders.
15428
15429         * class.cs (FieldBase): New class shared by Fields 
15430
15431         * delegate.cs: If we are a toplevel delegate, use our full name.
15432         If we are a nested delegate, then only use our tail name.
15433
15434 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15435
15436         * expression.cs (IsApplicable): Ensure that we add the "&" to
15437         ref/out types before comparing it with the type of the argument.
15438
15439         (IsParamsMethodApplicable): Ditto.
15440
15441         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15442         silly me ;-)
15443
15444         * delegate.cs : Handle the case when we have more than one applicable
15445         method. Flag an error only when we finish checking all.
15446
15447 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * expression.cs: Add support for boolean static initializers.
15450
15451 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15452
15453         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15454
15455         * parameter.cs (ComputeParameterTypes,
15456         ComputeAndDefineParameterTypes): Better error handling: now we
15457         clear the `types' cache if we fail during any of the type lookups.
15458         We also return the status code correctly to our caller
15459
15460         * delegate.cs: If we fail to define a delegate, abort the extra
15461         steps. 
15462
15463         * expression.cs (Binary.ResolveOperator): for
15464         operator==(object,object) and operator !=(object, object) we also
15465         have to verify that there is an implicit conversion from one to
15466         the other.
15467
15468         (ArrayAccess.DoResolve): Array Access can operate on
15469         non-variables. 
15470
15471 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * assign.cs (CompoundAssign): A new class used as a "flag" that
15474         the assignment actually is happening as part of a compound
15475         assignment operator.
15476
15477         During compound assignment, a few new rules exist to enable things
15478         like:
15479
15480         byte b |= 1 + 2
15481
15482         From the spec:
15483
15484         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15485         to the type of x) if y is implicitly convertible to the type of x,
15486         and the operator is a builtin operator and the return type of the
15487         operator is explicitly convertible to the type of x. 
15488
15489         * rootcontext.cs: Reset warning level to 2.  4 catches various
15490         "interesting" features in mcs, we must clean this up at some
15491         point, but currently am trying to kill other bugs ;-)
15492
15493         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15494         in container classes as well.  
15495
15496         * expression.cs (Binary.ResolveOperator): Handle string case
15497         before anything else (as operator overloading does emit an error
15498         before doing anything else).
15499
15500         This code could go away when we move to a table driven model, but
15501         i could not come up with a good plan last night.
15502
15503 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15504
15505         * typemanager.cs (CSharpName): reimplementation using regex.
15506         * class.cs: added null check for fields in Emit
15507         * rootcontext.cs: set warninglevel to 4
15508
15509 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15510
15511         * typemanager.cs (CSharpName): reimplemented with Lupus
15512         suggestion.
15513
15514 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * statement.cs (If): correclty implement Resolve, because we were
15517         not catching sem errors in there.  The same process is needed
15518         everywhere else. 
15519         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15520
15521
15522         (Statement.Warning_DeadCodeFound): Factorize code.
15523         (While): Report dead code here too.
15524
15525         (Statement): Added Resolve virtual method to allow
15526         for resolution split from the emit code.
15527
15528 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * statement.cs (EmitBoolExpression): No longer try to resolve the
15531         expression here.    
15532         (MakeBoolean): New utility function that resolve, implicitly
15533         converts to boolean and tags the expression. 
15534
15535
15536         (If, Do): Implement dead code elimination.
15537         (While): Implement loop inversion
15538
15539         (Do, While, For, If): Resolve the expression prior to calling our
15540         code generation.
15541
15542 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15543
15544         * class.cs:
15545           - added method Report28 (warning: program has more than one entry point)
15546           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15547           - modified method Method.Define, the part at the end of the method
15548
15549         * rootcontext.cs: added static public Location EntryPointLocation;
15550           
15551         * ../errors/cs0028.cs : Add test case for the above warning.              
15552
15553         * typemanager.cs:
15554           - modified method CSharpName to allow arrays of primitive type to
15555             be printed nicely (e.g. instead of System.Int32[][] it now prints
15556             int[][])
15557           - added method CSharpSignature: returns the signature of a method
15558             in string format to be used in reporting errors, warnings, etc.
15559
15560         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15561         with String.Empty.
15562
15563 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15564
15565         * delegate.cs (Define): Fix extremely silly bug where I was
15566         setting the type of the 'object' parameter of the BeginInvoke
15567         method to System.IAsyncResult instead of System.Object ;-)
15568
15569 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15572         here. 
15573
15574         (Constructor.Emit): return if we fail to initialize the
15575         constructor.  Another door closed!  
15576
15577         * expression.cs (New.DoResolve): Improve error message (from -6 to
15578         1501).  Use DeclaredOnly lookup to find the exact constructor.
15579
15580         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15581         loop.  This is useful.
15582
15583         * cs-parser.jay: Adjust the default parameters so that destructors
15584         have the proper signature.
15585
15586 2002-04-26  Martin Baulig  <martin@gnome.org>
15587
15588         * driver.cs (LoadAssembly): If `assembly' contains any characters
15589         which are only valid in path names and not in assembly names
15590         (currently slash, backslash and point), use Assembly.LoadFrom ()
15591         instead of Assembly.Load () on the `assembly' (before iteration
15592         over the link_paths).
15593
15594 2002-04-26  Martin Baulig  <martin@gnome.org>
15595
15596         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15597
15598 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15599
15600         * class.cs (Property): use the new typemanager.MemberLookup
15601
15602         (TypeContainer.MemberLookup): Implement using the
15603         TypeManager.MemberLookup now. 
15604
15605         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15606         and return MemberInfos, so that these can be used without an
15607         EmitContext (what we had before).
15608
15609 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * expression.cs: Fix the case where the argument to params if the
15612         type of the params.  I omitted handling this before.   Fixed
15613
15614 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * driver.cs: Call BootCorlib_PopulateCoreType
15617
15618         * class.cs (Property.CheckBase): Check for properties only, not
15619         for all members. 
15620
15621         * interface.cs: Temporary hack: try/catch around the
15622         CustomAttributeBuilder, because I am getting an exception that I
15623         do not understand.
15624
15625         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15626         types whose definitions are required to be there (attributes are
15627         defined before standard types).
15628
15629         Compute definitions as we boot the various types, as they are used
15630         immediately (value_type class will need object_type, but if we do
15631         not initialize object_type, we will pass a null, which will let
15632         the runtime pick the System.Object from the existing corlib, which
15633         is not what we want).
15634
15635 2002-04-22  Patrik Torstensson <totte@labs2.com>
15636
15637         * cs-tokenizer.cs: fixed a number of trim() issues.
15638
15639 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15640
15641         * expression.cs (Argument.Type): Ensure that we return the correct
15642         type when we have out or ref parameters [in which case we 
15643         append a "&"].
15644
15645 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15646
15647         * class.cs (Property, Indexer): Allow extern modifier in there. 
15648
15649         * typemanager.cs (InitBaseTypes): Initializes object_type and
15650         value_type, since those will be used early on during the bootstrap
15651         process to compile corlib.
15652
15653         (InitCoreTypes): Move code from here to InitBaseTypes.
15654
15655 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15656
15657         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15658         single-dimension arrays as using the ldlen opcode.  
15659
15660         Daniel Lewis discovered this optimization.  
15661
15662         * typemanager.cs: Add signature for System.Array::get_Length
15663
15664 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15665
15666         * statement.cs: report the error when the foreach does not apply to an
15667         array nor a collection.
15668
15669 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15670
15671         * expression.cs: Add implicit conversions to the operator ~.
15672
15673         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15674
15675         * typemanager.cs: Locate the decimal constructor.
15676
15677 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15678
15679         * attribute.cs: use the new property of TypeOf.
15680         * expression.cs: added 'get' property around typearg.
15681
15682         These changes fix a build breaker reported by NickD. Is this the
15683         correct way to fix?  If not, please, revert my changes and make it
15684         work :-).
15685
15686 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15687
15688         * attribute.cs: Add support for typeof in attribute invocations.
15689         I am not sure that this is right though.
15690
15691 2002-04-14  Duncan Mak  <duncan@ximian.com>
15692
15693         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15694         Binary.Operator.Division case.
15695
15696 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15697
15698         * class.cs (DefineType): Ensure that we do a proper check on
15699         attribute types and also register it with the TypeManager.
15700
15701         (TypeContainer.Targets): The default for attribute types is
15702         AttributeTargets.All.
15703
15704         * attribute.cs (ApplyAttributes): Registering the attribute type
15705         is done elsewhere, not when we discover we have a Usage attribute.
15706
15707 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15708
15709         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15710         and get rid of is_delegate parameter.
15711
15712         * everywhere : update.
15713
15714 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15715
15716         * cs-parser.jay (compilation_unit): Revamp completely to use
15717         some new ideas that I got from Rhys' grammar to solve the problems
15718         with assembly level attributes.
15719
15720         (outer_declaration): New grammar production.
15721
15722         (attribute_sections): Add.
15723
15724         (opt_attributes): Base on attribute_sections
15725
15726         (namespace_declaration): Allow opt_attributes to tackle the case
15727         when we have assembly level attributes - we are clever in this
15728         regard now ;-)
15729
15730         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15731         attributes in the non-global context.
15732
15733         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15734         instead of SetGlobalAttributes.
15735
15736         * class.cs, rootcontext.cs : Ensure we define and generate 
15737         attribute types before anything else.
15738
15739         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15740         and flag the new error -20 for the case when the attribute type
15741         does not have valid targets specified. csc does not catch this.
15742
15743         * ../errors/errors.txt : update for error # -20
15744
15745 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15746
15747         * support.cs (InternalParameters.ParameterModifier): Do some null
15748         checking and return sane values.
15749
15750         * class.cs (Method.Define): If we are a PInvoke method, ensure
15751         that we are static and extern. Report error # 601
15752
15753         * ../errors/cs0601.cs : Add test case for the above error.
15754
15755 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15756
15757         * rootcontext.cs (attribute_types): We need to keep type of
15758         all attribute types separately and emit code for them first.
15759
15760         (RegisterAttribute) : Implement.
15761
15762         * class.cs (DefineType): Check if the current Type is a custom
15763         attribute type and register it accordingly.
15764
15765         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15766         adding the first attribute twice and rename to
15767
15768         (SetGlobalAttributes): this.
15769
15770         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15771         lookups.
15772
15773         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15774         if we are processing global arguments. Hmm, I am unsure of this.
15775
15776 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15777
15778         * expression.cs: added static array of strings to avoid calling
15779         Enum.ToString () for Operator in Binary. Significant recover of
15780         performance.
15781
15782 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15783
15784         * class.cs (FindMembers): Allow the Builders of the various
15785         members to be null.  If they are skip them.  This only happens
15786         during the PInvoke declaration.
15787
15788 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15791         failure, so we do not keep going afterwards.
15792
15793         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15794         wanted to pass `false' as the `is_delegate' argument.  If this is
15795         the case, why not use delegate_type == null to mean `is_delegate =
15796         false' and anything else as is_delegate = true.
15797
15798 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15799
15800         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15801         code for the section, not the beginning of the tests.
15802
15803 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15804
15805         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15806
15807         * expression.cs (Binary): same.  Warn about errors where we have
15808         Enum/Enum in operator + as well.
15809
15810 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15811
15812         * statement.cs:
15813                 - added support for switch(bool)
15814                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15815                 - add TableSwitchEmit() to handle table-based switch statements
15816
15817 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15818
15819         * expression.cs (Invocation.OverloadResolve): Factor out code which
15820         does parameter compatibility checking with arguments so that we can 
15821         re-use the code even from Delegate.VerifyApplicability
15822
15823         (VerifyArgumentsCompat): Move above code here.
15824
15825         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15826         and instead make a call to the above method.
15827
15828 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15829
15830         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15831         We use it to keep track of classes which are attribute types.
15832
15833 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15834
15835         * delegate.cs (Delegate.Define): Correctly define the types in the
15836         presence of fixed and array parameters.
15837
15838         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15839         doing FindMembers.
15840
15841         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15842         include NonPublic after the first iteration.
15843
15844         * class.cs (Indexer.CheckBase): Only check if both parents are
15845         non-null. 
15846
15847         * cs-parser.jay (accessor_body): If empty, set to null.
15848
15849         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15850         same code path here to resolve constants names that we did have in
15851         MemberAccess.DoResolve.  There is too much code duplicated here.
15852
15853 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15854
15855         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15856
15857         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15858         to MakeUnionSet.
15859
15860         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15861         tokens, numbers and strings.
15862
15863         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15864         parenthesis.
15865
15866         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15867         asyncronous parameters and the regular parameters.  
15868
15869         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15870         specify the target directory.
15871
15872         * expression.cs: (This.DoResolve): Simplify
15873         (As.Emit): Optimize, do not generate IsInst if the expression is
15874         always of the given type.
15875
15876         (Is.DoResolve): Bug fix, we were reporting both always/never for
15877         the is expression.
15878
15879         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15880         creating too many unnecessary arrays.
15881
15882 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15883
15884         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15885         fields instead of rolling our own initializer.   Takes care of all
15886         implicit conversions, and drops unnecessary static checks/argument.
15887
15888 2002-03-31  Dick Porter  <dick@ximian.com>
15889
15890         * driver.cs: use the GetDirectories() return values properly, and
15891         use "/" as path separator.
15892
15893 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * expression.cs (Unary): Optimize - - expr into expr.
15896         (Binary): Optimize a + (-b) into a -b.
15897
15898         * codegen.cs (CodeGen): Made all methods static.
15899
15900 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * rootcontext.cs: 
15903
15904         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15905         TypeBuilder property.
15906
15907         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15908         instead. 
15909
15910         * tree.cs: Removed the various RecordXXXX, and replaced with a
15911         single RecordDecl.  Removed all the accessor methods, and just
15912         left a single access point Type 
15913
15914         * enum.cs: Rename DefineEnum to DefineType.
15915
15916         * decl.cs: New abstract method `DefineType' used to unify the
15917         Defines for Enumerations, Interfaces, TypeContainers and
15918         Delegates.
15919
15920         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15921         LookupBaseClasses method that used to live in class.cs and
15922         interface.cs here, and renamed to FindType.
15923
15924         * delegate.cs: Implement DefineType.  Take advantage of the
15925         refactored pattern for locating the parent builder without taking
15926         the parent_builder argument (which we know does not work if we are
15927         nested, and triggering a toplevel definition).
15928
15929 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15930
15931         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15932         accessibility of a member has changed during override and report
15933         an error if so.
15934
15935         * class.cs (Method.Define, Property.Define): Only complain on
15936         overrides if the method is private, any other accessibility is
15937         fine (and since we just checked the permission is the same, we are
15938         good to go).
15939
15940         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15941         and elif are processed always.  The other pre-processing
15942         directives are only processed if we are "taking" the path
15943
15944 2002-03-29  Martin Baulig  <martin@gnome.org>
15945
15946         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15947         current location is not Null.
15948
15949         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15950         a separate method so we can profile it.
15951
15952         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15953         `span.Seconds' are just seconds, but no minutes or hours.
15954         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15955
15956 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15959         Remove the gratuitous set of Final:
15960
15961                                 // If an interface implementation, then we can set Final.
15962                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15963                                     implementing.DeclaringType.IsInterface)
15964                                         flags |= MethodAttributes.Final;
15965
15966         I do not know what I was smoking when I used that.
15967
15968
15969         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15970         step into fixing the name resolution issues for delegates and
15971         unifying the toplevel name resolution.
15972
15973 2002-03-28  Martin Baulig  <martin@gnome.org>
15974
15975         * class.cs (Method.Emit): If we have a symbol writer, call its
15976         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15977         tell it about the current method.
15978
15979         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15980         writer that we're going to emit the first byte of IL code for a new
15981         statement (a new source line).
15982         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15983         EmitContext.Mark() before emitting any code.
15984
15985         * location.cs (SymbolDocument): Return null when we're Null.
15986
15987         * statement.cs (Statement): Moved the `Location loc' variable here.
15988         (Statement.EmitBoolExpression): If we have a symbol writer, call
15989         ec.Mark() before emitting any code to tell it that we're at the
15990         beginning of a new statement.
15991         (StatementExpression): Added `Location' argument to the constructor.
15992         (Block): Added public readonly variable `StartLocation' and public
15993         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15994         (Block): Added constructor which takes a start and end location.
15995         (Block.SetEndLocation): New method. This sets the end location.
15996         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15997         local variables we create.
15998         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15999         each statement and do also mark the begin and end of the block.
16000
16001         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16002         tell it the current lexer.Location, use Location.Null for the end of the
16003         block.
16004         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16005         current block, set its end location using SetEndLocation().
16006         (statement_expression): StatementExpression constructor now takes the
16007         lexer.Location as additional argument.
16008         (for_statement, declare_local_variables): Likewise.
16009         (declare_local_variables): When creating a new implicit block, use the
16010         new Block constructor and pass it the lexer.Location.
16011
16012 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16015         members also on the parent interfaces recursively.
16016
16017 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16018
16019         * report.cs: Use new formats, since Gonzalo finished the missing
16020         bits. 
16021
16022         * expression.cs (Binary.ResolveOperator): added missing operator|
16023         operator& and operator^ for bool/bool.
16024
16025         * cs-parser.jay: CheckDef now takes a Location argument that is
16026         used to report errors more precisly (instead of reporting the end
16027         of a definition, we try to track something which is a lot closer
16028         to the source of the problem).
16029
16030         * cs-tokenizer.cs: Track global token use, so we can properly flag
16031         the use of #define/#undef after the first token has been seen.
16032
16033         Also, rename the reportXXXX to Error_DescriptiveName
16034
16035         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16036         TypeContainer, so that Enum and Interface can use this too.
16037
16038         * class.cs (TypeContainer.LookupInterfaceOrClass,
16039         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16040         `builder' argument.  Typically this was used to pass the parent
16041         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16042         the definition).  
16043
16044         The problem is that a nested class could trigger the definition of
16045         a toplevel class, and the builder would be obviously wrong in that
16046         case. 
16047
16048         So we drop this argument, and we compute dynamically the
16049         TypeBuilder/ModuleBuilder (the correct information was available
16050         to us anyways from DeclSpace.Parent)
16051
16052         * interface.cs (Interface.DefineInterface): Drop builder
16053         parameter cleanup like class.cs
16054
16055         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16056         like class.cs
16057
16058         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16059         values. 
16060
16061         (Try.Emit): Propagate the returns value from the statement.
16062
16063         (Return.Emit): Even if we are leavning 
16064
16065         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16066
16067         * modifiers.cs: Fix the computation of MethodAttributes flags.
16068
16069 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16070
16071         * driver.cs: allow compilation of files that start with '/'.
16072         Add a default case when checking the argument of --target.
16073
16074 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * interface.cs: Implement the same search algorithm for types in
16077         the interface code.
16078
16079         * delegate.cs: Do not allow multiple definition.
16080
16081         * Recovered ChangeLog that got accidentally amputated
16082
16083         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16084
16085         * rootcontext.cs: Load manually enum to allow core classes to
16086         contain enumerations.
16087
16088         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16089         Update to new static methods in TypeManager.
16090
16091         * typemanager.cs (GetMethod, GetConstructor): Use our
16092         implementation of FindMembers to find the members, since during
16093         corlib compilation, the types are TypeBuilders and GetMethod and
16094         GetConstructor do not work.
16095
16096         Make all methods in TypeManager static.
16097
16098         (InitCodeHelpers): Split the functionality from
16099         the InitCodeTypes function.
16100
16101         * driver.cs: Call InitCodeHelpers after we have populated the
16102         types. 
16103
16104         * cs-parser.jay (delegate_declaration): we did not used to compute
16105         the delegate name correctly for void delegates.
16106
16107 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * rootcontext.cs (RootContext): Init the interface_resolve_order
16110         and type_container_resolve_order always.
16111
16112         (ResolveCore, BootstrapCorlib_ResolveClass,
16113         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16114         compiler when compiling with --nostdlib
16115
16116         * class.cs (TypeContainer.DefineType): Check that our parent is
16117         not null.  This test is most important when we are bootstraping
16118         the core types.
16119
16120         * codegen.cs: Split out the symbol writing code.
16121
16122 2002-03-25  Martin Baulig  <martin@gnome.org>
16123
16124         * driver.cs (-g): Made -g an alias for --debug.
16125
16126 2002-03-24  Martin Baulig  <martin@gnome.org>
16127
16128         * codegen.cs (SymbolWriter): New public variable. Returns the
16129         current symbol writer.
16130         (CodeGen): Added `bool want_debugging_support' argument to the
16131          constructor. If true, tell the ModuleBuild that we want debugging
16132         support and ask it for the ISymbolWriter.
16133         (Save): If we have a symbol writer, call it's Close() method after
16134         saving the assembly.
16135
16136         * driver.c (--debug): New command line argument to create a
16137         debugger information file.
16138
16139         * location.cs (SymbolDocument): New public property. Returns an
16140         ISymbolDocumentWriter object for the current source file or null
16141         if we don't have a symbol writer.
16142
16143 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16144
16145         * driver.cs (LoadAssembly): Correctly return when all the paths
16146         have been tried and not before.
16147
16148         * statement.cs (Switch.Emit): return the actual coverage for this
16149         statement (returns/not-returns)
16150
16151         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16152         switch of the statement if we are the last switch section.  That
16153         kills two problems: try/catch problems (we used to emit an empty
16154         nop at the end) and switch statements where all branches would
16155         return. 
16156
16157 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16158
16159         * driver.cs: Add default assemblies (the equivalent to the
16160         Microsoft CSC.RSP file)
16161
16162         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16163         also update tokens_seen and set it to false.
16164
16165         * driver.cs: Implement --recurse for Mike.
16166
16167         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16168         correctly splitting out the paths.
16169
16170 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16171
16172         * interface.cs (Interface.PopulateProperty): Instead of using
16173         `parent' as the declaration space for the set parameters, use
16174         `this' 
16175
16176         * support.cs (InternalParameters): InternalParameters constructor
16177         takes a DeclSpace instead of a TypeContainer.
16178
16179         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16180         types are being initialized, load the address of it before calling
16181         the function.  
16182
16183         (New): Provide a mechanism to disable the generation of local
16184         value type temporaries when the caller will be providing us with
16185         an address to store it.
16186
16187         (ArrayCreation.EmitDynamicInitializers): Use it.
16188
16189 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16190
16191         * expression.cs (Invocation.EmitArguments): Only probe for array
16192         property if there is more than one argument.  Sorry about that.
16193
16194         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16195         empty param arrays.
16196
16197         * class.cs (Method.LabelParameters): Fix incorrect code path that
16198         prevented the `ParamArrayAttribute' from being applied to the
16199         params attribute.
16200
16201 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * support.cs (ReflectionParameters): Correctly compute whether the
16204         last argument is a params array.  Fixes the problem with
16205         string.Split ('a')
16206
16207         * typemanager.cs: Make the assemblies array always be non-null
16208         (empty, but non-null)
16209
16210         * tree.cs (RecordDecl): New function that abstracts the recording
16211         of names.  This reports error 101, and provides a pointer to the
16212         previous declaration.  Fixes a crash in the compiler.
16213
16214         * cs-parser.jay (constructor_declaration): Update to new grammar,
16215         and provide a constructor_body that can be empty.
16216
16217 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16218
16219         * driver.cs: Add support for --resources.
16220
16221         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16222         Make all types for the various array helper methods be integer.
16223
16224         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16225         CheckState to ConvCast.
16226
16227         (ConvCast): Now it takes a `checked' state argument, to avoid
16228         depending on the emit context for the conversion, and just using
16229         the resolve time setting.
16230
16231         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16232         instead of Invocation.EmitArguments.  We do not emit the original
16233         arguments, instead we emit those which have been converted to
16234         unsigned int expressions.
16235
16236         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16237
16238         * codegen.cs: ditto.
16239
16240         * expression.cs (LocalVariableReference): Drop the use of the
16241         Store function that depended on the variable index.
16242
16243         * statement.cs (VariableInfo): Drop the `Idx' property from this
16244         class, as this is not taking into account the indexes for
16245         temporaries tat we generate during the execution, getting the
16246         indexes wrong.
16247
16248         * class.cs: First emit class initializers, then call the parent
16249         constructor. 
16250
16251         * expression.cs (Binary): Fix opcode emision.
16252         (UnaryMutator.EmitCode): Support checked code generation
16253
16254         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16255         matches for events for both the Static and Instance scans,
16256         pointing to the same element.   Fix that.
16257
16258 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * rootcontext.cs (ResolveTree): Always set the
16261         interface_resolve_order, because nested interfaces will be calling
16262         into us.
16263
16264         * class.cs (GetInterfaceOrClass): Track the same resolution
16265         process used by TypeManager.LookupType.  This fixes the nested
16266         type lookups in class declarations (separate path from
16267         LookupType). 
16268
16269         (TypeContainer.DefineType): Also define nested interfaces.
16270         (TypeContainer.RegisterOrder): New public function used to
16271         register the order in which child interfaces need to be closed.
16272
16273         Nested interfaces need to be closed after their parents have been
16274         created. 
16275
16276         * interface.cs (InterfaceAttr): Put all the logic for computing
16277         the interface attribute here. 
16278
16279         (DefineInterface): Register our interface order with the
16280         RootContext or with the TypeContainer depending on the case.
16281
16282 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * cs-parser.jay: rework foreach statement to work with the new
16285         changes to the policy on SimpleNames.
16286
16287         * report.cs: support Stacktrace on warnings as well.
16288
16289         * makefile: drop --unsafe and /unsafe from the compile.
16290
16291 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16292
16293         * ecore.cs (StandardConversionExists): Modify to take an Expression
16294         as the first parameter. Ensure we do null -> reference type conversion
16295         checking.
16296
16297         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16298         temporary Expression objects.
16299
16300 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16301
16302         * interface.cs: workaround bug in method overloading resolution
16303         (there is already a bugzilla bug for it).
16304
16305 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16306
16307         We could also solve this problem by having a separate path for
16308         performing type lookups, instead of DoResolve, we could have a
16309         ResolveType entry point, and only participating pieces of the
16310         production (simplename, deref, array) would implement this. 
16311
16312         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16313         signal SimpleName to only resolve type names and not attempt to
16314         resolve anything else.
16315
16316         * expression.cs (Cast): Set the flag.
16317
16318         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16319
16320         * class.cs: Only report 108 if there is no `new' modifier.
16321
16322         * cs-parser.jay: rework foreach statement to work with the new
16323         changes to the policy on SimpleNames.
16324
16325         * report.cs: support Stacktrace on warnings as well.
16326
16327         * makefile: drop --unsafe and /unsafe from the compile.
16328
16329 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16330
16331         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16332         lookups here, instead of doing that at parse time.  This means
16333         that our grammar will not introduce `LocalVariableReferences' as
16334         expressions at this point.  That solves the problem of code like
16335         this:
16336
16337         class X {
16338            static void Main ()
16339            { int X = 1;
16340             { X x = null }}}
16341
16342         This is only half the fix.  The full fix requires parameters to
16343         also be handled in this way.
16344
16345         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16346         makes the use more obvious of the DeclSpace.  The
16347         ec.TypeContainer.TypeBuilder is now only used to pull the
16348         TypeBuilder for it.
16349
16350         My theory is that I can get rid of the TypeBuilder completely from
16351         the EmitContext, and have typecasts where it is used (from
16352         DeclSpace to where it matters).  
16353
16354         The only pending problem is that the code that implements Aliases
16355         is on TypeContainer, and probably should go in DeclSpace.
16356
16357         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16358         lookups here, instead of doing that at parse time.  This means
16359         that our grammar will not introduce `LocalVariableReferences' as
16360         expressions at this point.  That solves the problem of code like
16361         this:
16362
16363         class X {
16364            static void Main ()
16365            { int X = 1;
16366             { X x = null }}}
16367
16368         This is only half the fix.  The full fix requires parameters to
16369         also be handled in this way.
16370
16371         * class.cs (Property.DefineMethod): When implementing an interface
16372         method, set newslot, when implementing an abstract method, do not
16373         set the flag (before we tried never setting it, or always setting
16374         it, which is the difference).
16375         (Indexer.DefineMethod): same.
16376         (Method.DefineMethod): same.
16377
16378         * ecore.cs: Only set the status used flag if we get back a Field.
16379
16380         * attribute.cs: Temporary hack, so Paolo can keep working.
16381
16382 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16383
16384         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16385         the unmanaged type in the case we have a MarshalAs attribute.
16386
16387         (Resolve): Handle the case when we are parsing the special MarshalAs
16388         attribute [we need to store the unmanaged type to use later]
16389
16390         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16391         MarshalAs Attribute.
16392
16393         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16394         on parameters and accordingly set the marshalling info.
16395
16396 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16397
16398         * class.cs: Optimizing slightly by removing redundant code after
16399         we switched to the `NoTypes' return value.
16400         (Property.DefineMethod): use NoTypes here too.
16401
16402         This fixes the bug I introduced in my last batch of changes.
16403
16404 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16405
16406         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16407
16408         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16409         Enums since those are types too. 
16410
16411         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16412
16413         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16414         thanks to a call during the lookup process.
16415
16416 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * statement.cs (Foreach): Lots of work to accomodate a particular
16419         kind of foreach statement that I had not kept in mind.  It is
16420         possible to have foreachs on classes that provide a GetEnumerator
16421         method that return objects that implement the "pattern" for using
16422         a foreach, there is no need to support GetEnumerator
16423         specifically. 
16424
16425         This is needed to compile nant.
16426
16427         * decl.cs: Only report 114 if the member is not `Finalize' and if
16428         the warning level is at least 2.
16429
16430         * class.cs: Moved the compare function from Method to
16431         MethodSignature. 
16432
16433         (MethodSignature.InheritableMemberSignatureCompare): Add new
16434         filter function that is used to extract inheritable methods from a
16435         class. 
16436
16437         (Method.Define): Use the new `inheritable_method_signature_filter'
16438         delegate
16439
16440         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16441         command. 
16442
16443 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16446
16447         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16448
16449         * expression.cs: Pass location information to
16450         ConvertImplicitStandard. 
16451
16452         * class.cs: Added debugging code to track return values from
16453         interfaces. 
16454
16455 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16456
16457         * expression.cs (Is.DoResolve): If either side of the `is' is an
16458         interface, do not flag the warning.
16459
16460         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16461         for interfaces
16462
16463         * report.cs: Allow for --fatal to be used with --probe.
16464
16465         * typemanager.cs (NoTypes): Move the definition for the empty Type
16466         array here. 
16467
16468         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16469         properties. 
16470         (TypeContainer.DefineProxy): New function used to proxy to parent
16471         implementations when implementing interfaces.
16472         (TypeContainer.ParentImplements): used to lookup if our parent
16473         implements a public function that is required by an interface.
16474         (TypeContainer.VerifyPendingMethods): Hook this up.
16475
16476         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16477         `modules' and `assemblies' arraylists into arrays.  We only grow
16478         these are the very early start up of the program, so this improves
16479         the speedof LookupType (nicely measured).
16480
16481         * expression.cs (MakeByteBlob): Replaced unsafe code with
16482         BitConverter, as suggested by Paolo.
16483
16484         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16485         folding of string concatenation, but if either side is a string,
16486         and the other is not, then return null, and let the runtime use
16487         the concatenation on the string plus the object (using
16488         `Object.ToString'). 
16489
16490 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16491
16492         Constant Folding has been implemented now.
16493
16494         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16495         the error instead on types that are not supported in one's
16496         complement. 
16497
16498         * constant.cs (Constant and all children): New set of functions to
16499         perform implict and explicit conversions.
16500
16501         * ecore.cs (EnumConstant): Implement the new functions to perform
16502         conversion by proxying to the child expression.
16503
16504         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16505         own separate setting that can not be turned off from the command
16506         line using --unchecked or --checked and is only controlled using
16507         the checked/unchecked statements and expressions.  This setting is
16508         used by the constant folder to flag errors.
16509
16510         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16511         ConstantCheckState as well.   
16512
16513         During Resolve, they also have to flag the state, because the
16514         constant folder runs completely in the Resolve phase.
16515
16516         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16517         well.
16518
16519 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16520
16521         * cfold.cs: New file, this file contains the constant folder.
16522
16523         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16524         argument to track whether we are using the resulting address to
16525         load or store a value and provide better error messages. 
16526
16527         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16528         new AddressOf arguments.
16529
16530         * statement.cs (Foreach.EmitCollectionForeach): Update
16531
16532         * expression.cs (Argument.Emit): Call AddressOf with proper
16533         arguments to track usage.
16534
16535         (New.DoEmit): Call AddressOf with new arguments.
16536
16537         (Unary.Emit): Adjust AddressOf call.
16538
16539 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16540
16541         * cs-parser.jay (member_access): Change the case for pre-defined types
16542         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16543         this suggestion.
16544
16545         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16546         a method body.
16547
16548         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16549         essentially like methods and apply attributes like MethodImplOptions to them too.
16550
16551         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16552         not being null.
16553
16554         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16555         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16556         is the DeclSpace.
16557
16558         * Update code everywhere accordingly.
16559
16560         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16561
16562         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16563
16564 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16565
16566         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16567         try performing lookups against those instead of jumping straight into using
16568         the 'using' clauses.
16569
16570         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16571
16572         (LookupType): Perform lookups in implicit parents too.
16573
16574         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16575         sequence as RootContext.LookupType. 
16576
16577         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16578         the various cases of namespace lookups into this method.
16579
16580 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16581
16582         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16583         in positional arguments)
16584
16585         * class.cs (Operator): Update the AllowedModifiers to contain
16586         extern. 
16587
16588         * cs-parser.jay: Update operator declaration to allow for the
16589         operator body to be empty.
16590
16591         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16592         values. 
16593
16594 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * class.cs (Method.Emit): Label parameters.
16597
16598         * driver.cs: Return 1 or 0 as the program exit code.
16599
16600 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16601
16602         * expression.cs: Special case the `null' object when trying to
16603         auto-compute the type, as anything can be explicitly converted to
16604         that. 
16605
16606         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16607         spotting this Paolo.
16608
16609         (Expression.ImplicitNumericConversion): Perform comparissions of
16610         the type using the underlying type in the case of an enumeration
16611         rather than using the enumeration type for the compare.
16612
16613         Cope with the underlying == type case, which is not possible to
16614         catch before. 
16615
16616         (Expression.ConvertNumericExplicit): Perform comparissions of
16617         the type using the underlying type in the case of an enumeration
16618         rather than using the enumeration type for the compare.
16619
16620         * driver.cs: If the user does not supply an extension, assume .exe
16621
16622         * cs-parser.jay (if_statement): Rewrote so that we can track the
16623         location for the if statement.
16624
16625         * expression.cs (Binary.ConstantFold): Only concat strings when
16626         the operation is "+", not everything ;-)
16627
16628         * statement.cs (Statement.EmitBoolExpression): Take a location
16629         argument. 
16630         (If, While, Do): Track location.
16631
16632         * expression.cs (Binary.ResolveOperator): In the object + string
16633         case, I was missing a call to ConvertImplicit
16634
16635 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16636
16637         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16638         Location arguments. Ensure we use RootContext.LookupType to do our work
16639         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16640
16641         * interface.cs (PopulateMethod): Handle the type of the parameter being
16642         null gracefully.
16643
16644         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16645         have a params method with no fixed arguments and a call is made with no
16646         arguments.
16647
16648 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16651         the verbatim-string-literal
16652
16653         * support.cs (InternalParameters.ParameterModifier): handle null
16654         fixed parameters.
16655         (InternalParameters.ParameterType): ditto.
16656
16657         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16658         duplicating the name of the variable parameter.
16659         (GetParameterByName): Fix bug where we were not looking up array
16660         paramters if they were the only present (thanks Paolo!).
16661         (GetParameterInfo): We only have an empty set of types if both
16662         fixed and array are set to null.
16663         (GetParameterInfo-idx): Handle FixedParameter == null
16664
16665         * cs-parser.jay: Handle the case where there is no catch
16666         statements (missing null test).
16667
16668 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16669
16670         * driver.cs (MainDriver): Be conservative on our command line
16671         handling.
16672
16673         Catch DirectoryNotFoundException when calling GetFiles.
16674
16675         (SplitPathAndPattern): Used to split the input specification into
16676         a path and a pattern that we can feed to Directory.GetFiles.
16677
16678 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * statement.cs (Fixed): Implement the last case of the Fixed
16681         statement (string handling).
16682
16683         * expression.cs (StringPtr): New class used to return a char * to
16684         a string;  Used by the Fixed statement.
16685
16686         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16687
16688         * expression.cs (Binary.ResolveOperator): Remove redundant
16689         MemberLookup pn parent type.
16690         Optimize union call, we do not need a union if the types are the same.
16691         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16692         type.
16693
16694         Specialize the use of MemberLookup everywhere, instead of using
16695         the default settings. 
16696
16697         (StackAlloc): Implement stackalloc keyword.
16698
16699         * cs-parser.jay: Add rule to parse stackalloc.
16700
16701         * driver.cs: Handle /h, /help, /?
16702
16703         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16704         before we supported unsafe code.
16705
16706         * makefile: add --unsafe to the self compilation of mcs.
16707
16708 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16709
16710         * expression.cs (PointerArithmetic): New class that is used to
16711         perform pointer arithmetic.
16712         (Binary.Resolve): Handle pointer arithmetic
16713         Handle pointer comparission.
16714         (ArrayPtr): Utility expression class that is used to take the
16715         address of an array.
16716
16717         (ElementAccess): Implement array access for pointers
16718
16719         * statement.cs (Fixed): Implement fixed statement for arrays, we
16720         are missing one more case before we are done.
16721
16722         * expression.cs (Indirection): Implement EmitAssign and set the
16723         ExprClass to Variable.  This allows pointer dereferences to be
16724         treated as variables, and to have values assigned to them.
16725
16726         * ecore.cs (Expression.StoreFromPtr): New utility function to
16727         store values dereferencing.
16728
16729 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16730
16731         * expression.cs (Binary.ResolveOperator): Ensure that we are
16732         not trying to operate on a void type - this fixes the reported
16733         bug.
16734
16735         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16736         the parent implementation is sealed.
16737
16738         * ../errors/cs0239.cs : Add.
16739
16740         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16741
16742         * typemanager.cs (unverifiable_code_type): Corresponds to 
16743         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16744         which have unsafe code in them.
16745
16746         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16747         unsafe context.
16748
16749 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * cs-tokenizer.cs: Add support for @"litreal strings"
16752
16753         Make tokenizer accept pre-processor directives
16754         on any column (remove the old C-like limitation). 
16755
16756         * rootcontext.cs (EmitCode): Emit any global attributes.
16757         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16758
16759         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16760
16761         * cs-parser.jay: Add support for global attributes.  
16762
16763 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16764
16765         * expression.cs (Indirection): New helper class.  Unary will
16766         create Indirection classes to be able to implement the
16767         IMemoryLocation interface on it.
16768
16769 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16770
16771         * cs-parser.jay (fixed_statement): reference the right statement.
16772
16773         * statement.cs (Fixed.Emit): Finish implementing the fixed
16774         statement for the &x case.
16775
16776 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16777
16778         * class.cs (Property.Define, Method.Define): Remove newslot when
16779         `implementing'.  
16780
16781         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16782         wrong.  NewSlot should only be used if the `new' keyword is present.
16783
16784         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16785         locating our system dir.  Sorry about this.
16786
16787 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16788
16789         * driver.cs (GetSystemDir): Compute correctly the location of our
16790         system assemblies.  I was using the compiler directory instead of
16791         the library directory.
16792
16793 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16794
16795         * expression.cs (BetterFunction): Put back in what Miguel commented out
16796         since it is the correct fix. The problem is elsewhere ;-)
16797
16798         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16799         parameters of the parms method are themselves compatible or not !
16800
16801         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16802         to check that a class implements an interface before saying that an implicit
16803         conversion was allowed. Use ImplementsInterface to do the checking.
16804
16805 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16806
16807         * class.cs (Method.Define): Track whether we are an explicit
16808         implementation or not.  And only call DefineMethodOverride if we
16809         are an explicit implementation.
16810
16811         (Property.DefineMethod): Ditto.
16812
16813 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16814
16815         * expression.cs (BetterFunction): Catch hideous bug which was
16816          preventing us from detecting ambiguous calls due to implicit casts i.e
16817         cs0121.
16818
16819 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16820
16821         * support.cs (Pair): Remove un-needed method.  I figured why I was
16822         getting the error in cs-parser.jay, the variable in a foreach loop
16823         is readonly, and the compiler does not really treat this as a variable.
16824
16825         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16826         instead of EQUALS in grammar.  
16827
16828         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16829
16830         * expression.cs (Unary.DoResolve): Check whether the argument is
16831         managed or not.
16832
16833 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16834
16835         * support.cs: Api for Pair to set a value.  Despite the fact that
16836         the variables are public the MS C# compiler refuses to compile
16837         code that accesses the field if the variable is part of a foreach
16838         statement. 
16839
16840         * statement.cs (Fixed): Begin implementation of the fixed
16841         statement.
16842
16843         (Block.AddVariable): Return the VariableInfo on success and null
16844         on failure instead of true/false. 
16845
16846         * cs-parser.jay (foreach): Catch errors on variables already
16847         defined (we were ignoring this value before) and properly unwind
16848         the block hierarchy
16849
16850         (fixed_statement): grammar for the fixed statement.
16851
16852 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16853
16854         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16855         pointer types to be incretemented.
16856
16857         (SizeOf): Implement.
16858
16859         * cs-parser.jay (pointer_member_access): Implement
16860         expr->IDENTIFIER production.
16861
16862         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16863         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16864         on safe contexts.
16865
16866         (Unary): Implement indirection.
16867
16868         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16869         use in non-unsafe context).
16870
16871         (SimpleName.DoResolve): Check for pointers in field access on safe
16872         contexts. 
16873
16874         (Expression.LoadFromPtr): Factor the load-indirect code in this
16875         function.  This was duplicated in UnboxCast and ParameterReference
16876
16877 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16878
16879         * expression.cs (ComposedCast): report an error if a pointer cast
16880         is used in a safe region.
16881
16882         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16883         pointer type casts in unsafe context.
16884
16885         * codegen.cs (EmitContext): Set up IsUnsafe.
16886
16887         * cs-parser.jay (non_expression_type): Add productions for pointer
16888         casts. 
16889
16890         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16891         code.  We should not use force into static mode if the method is
16892         not virtual.  Fixes bug in MIS
16893
16894         * statement.cs (Do.Emit, While.Emit, For.Emit,
16895         Statement.EmitBoolExpression): Add support to Do and While to
16896         propagate infinite loop as `I do return' semantics.
16897
16898         Improve the For case to also test for boolean constants.
16899
16900         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16901         to the list of attributes we can add.
16902
16903         Remove `EmitContext' argument.
16904
16905         * class.cs (Method.Define): Apply parameter attributes.
16906         (Constructor.Define): Apply parameter attributes.
16907         (MethodCore.LabelParameters): Move here the core of labeling
16908         parameters. 
16909
16910         * support.cs (ReflectionParameters.ParameterModifier,
16911         InternalParameters.ParameterModifier): Use IsByRef on the type and
16912         only return the OUT bit for these parameters instead of in/out/ref
16913         flags.
16914
16915         This is because I miss-understood things.  The ParameterInfo.IsIn
16916         and IsOut represent whether the parameter has the [In] and [Out]
16917         attributes set.  
16918
16919 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16920
16921         * ecore.cs (FieldExpr.Emit): Release temporaries.
16922
16923         * assign.cs (LocalTemporary.Release): new function.
16924
16925         * codegen.cs (EmitContext.GetTemporaryStorage,
16926         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16927         temporary storage.  Now we can "put back" localbuilders when we
16928         are done with them
16929
16930 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16931
16932         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16933         need to make a copy of the variable to generate verifiable code.
16934
16935 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16936
16937         * driver.cs: Compute dynamically the system directory.
16938
16939         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16940         Slower, but more generally useful.  Used by the abstract
16941         registering implementation. 
16942
16943         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16944         the rules for the special rule on Type/instances.  First check if
16945         we have the same name, and if so, try that special static path
16946         rather than the instance path.
16947
16948 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16949
16950         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16951         for, while and if.
16952
16953         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16954         Enum, ValueType, Delegate or Array for non-corlib compiles.
16955
16956         * cs-tokenizer.cs: Catch long identifiers (645)
16957
16958         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16959         piece of code.
16960
16961         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16962         fix, we were returning too early, so we were not registering
16963         pending methods from abstract classes.
16964
16965         Do not register pending methods if the class is abstract.
16966
16967         * expression.cs (Conditional.DoResolve): Report circular implicit
16968         conversions when we neecd to compute it for conditional
16969         expressions. 
16970
16971         (Is.DoResolve): If the expression is always of the provided type,
16972         flag warning 183.  If the expression can not ever be of the
16973         provided type flag warning 184.
16974
16975         * class.cs: Catch 169 as well.
16976
16977         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16978         read. 
16979
16980 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16981
16982         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16983
16984 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16985
16986         * interface.cs: (PopulateMethod): Check for pointers being defined
16987         only if the unsafe context is active.
16988         (PopulateProperty): ditto.
16989         (PopulateIndexer): ditto.
16990
16991         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16992         specified.  If pointers are present, make sure that they are
16993         present in an unsafe context.
16994         (Constructor, Constructor.Define): ditto.
16995         (Field, Field.Define): ditto.
16996         (Property, Property.Define): ditto.
16997         (Event, Event.Define): ditto.
16998
16999         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17000         hashtable if there are classes or structs defined.
17001
17002         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17003         code, as the constant resolution moved.
17004
17005         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17006         the metadata, so we can flag error 133. 
17007
17008         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17009         pointer is being declared in an unsafe context.
17010
17011 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17012
17013         * modifiers.cs (Modifiers.Check): Require a Location argument.
17014         Report error 227 for Unsafe use.
17015
17016         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17017
17018         * statement.cs (For.Emit): If the test is null, then report that
17019         we do `return', as we wont reach anything afterwards.
17020
17021         (Switch.SwitchGoverningType): Track the expression that matched
17022         the conversion.
17023
17024         * driver.cs: Allow negative numbers as an error code to flag.
17025
17026         * cs-parser.jay: Handle 1551.
17027
17028         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17029
17030 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17031
17032         * cs-parser.jay: Report 1518 (type declaration can only contain
17033         class, struct, interface, enum or delegate)
17034
17035         (switch_label): Report 1523 (keywords `case' or `default' must
17036         preced code)
17037
17038         (opt_switch_sections): Report 1522 (empty switch)
17039
17040         * driver.cs: Report 1515 (response file specified multiple times)
17041         Report 1516 (Source file specified multiple times).
17042
17043         * expression.cs (Argument.Resolve): Signal 1510
17044
17045         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17046         access not allowed in static code)
17047
17048 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17049
17050         * typemanager.cs (IsPointerType): Utility method which we are going
17051         to need a lot.
17052
17053         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17054         the object type, so we take care of that.
17055
17056         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17057
17058         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17059         added to non-params parameters :-)
17060
17061         * typemanager.cs (CSharpName): Include 'void' type too. 
17062
17063         (void_ptr_type): Include in the set of core types.
17064
17065         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17066         duplicating code.
17067
17068         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17069         an unsafe context.
17070
17071         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17072         completely forgotten about it.
17073
17074 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17075
17076         * cs-parser.jay (pointer_type): Add. This begins our implementation
17077         of parsing rules for unsafe code.
17078
17079         (unsafe_statement): Implement.
17080
17081         (embedded_statement): Modify to include the above.
17082
17083         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17084
17085         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17086         if the current context is an unsafe one.
17087
17088         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17089         are handled differently, we need separate rules for them.
17090
17091         (local_variable_declaration): Update to use local_variable_pointer_type
17092         to allow variable declarations of unmanaged pointer types.
17093
17094         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17095         in unsafe contexts.
17096
17097         * ../errors/cs0214.cs : Add.
17098
17099 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17100
17101         * makefile: remove 'response' file when cleaning.
17102
17103 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * cs-parser.jay: Report 1524.
17106
17107 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17108
17109         * typemanager.cs (RegisterMethod): drop checking if we have
17110         registered this from here
17111
17112 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * class.cs (Method.EmitDestructor): Implement calling our base
17115         destructor. 
17116
17117         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17118         value of InFinally.
17119
17120         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17121         this routine and will wrap the call in a try/catch block.  Deal
17122         with the case.
17123
17124 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17125
17126         * ecore.cs (Expression.MemberLookup): instead of taking a
17127         parameter `same_type' that was used to tell whether we could
17128         access private members we compute our containing type from the
17129         EmitContext.
17130
17131         (FieldExpr): Added partial support for volatile fields.  This does
17132         not work for volatile fields exposed from assemblies, as I can not
17133         figure out how to extract the modreq from it.
17134
17135         Updated all the source files to use this.
17136
17137         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17138         because it is referenced by MemberLookup very often. 
17139
17140 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17141
17142         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17143         TypeBuilder.GetCustomAttributes to retrieve what we need.
17144
17145         Get rid of redundant default_member_attr_type as this is the same as
17146         default_member_type which already exists.
17147
17148         * interface.cs, attribute.cs : Update accordingly.
17149
17150 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17151
17152         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17153         work for TYpeBuilders though.  Ravi, can you please fix this?
17154
17155         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17156
17157         * expression.cs (Argument.Emit): Handle the case of ref objects
17158         being passed to ref functions;  
17159
17160         (ParameterReference.EmitLoad): Loads the content of the pointer
17161         without dereferencing.
17162
17163 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17164
17165         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17166
17167 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17168
17169         * class.cs (Indexer.DefineMethod): Incorporate the interface
17170         type in the name of the method if we are doing explicit interface
17171         implementation.
17172
17173         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17174
17175         (BetterConversion): Fix extremely trivial bug where we were referring to
17176         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17177         again !
17178
17179         * ../errors/bug16.cs : Add although we have fixed it.
17180
17181 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * expression.cs (BaseIndexer): Begin implementation.
17184
17185         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17186
17187         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17188         production directly to remove a shift/reduce, and implement
17189         explicit interface implementation.
17190
17191         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17192         after a floating point suffix.
17193
17194         * expression.cs (DoNumericPromotions): Improved the conversion for
17195         uint/uint.  If we have a constant, we avoid doing a typecast to a
17196         larger type.
17197
17198         * class.cs (Indexer): Implement explicit interface implementation
17199         for indexers.
17200
17201 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17202
17203         * class.cs: make the default instance constructor public and hidebysig.
17204
17205 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17206
17207         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17208         so we can call it from elsewhere.
17209
17210         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17211         we emit it internally if the class has a defined indexer; otherwise the user
17212         emits it by decorating the class definition with the DefaultMemberAttribute.
17213
17214         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17215         attribute is not used on a type which defines an indexer.
17216
17217         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17218         character when we skip whitespace.
17219
17220         * ../errors/cs0646.cs : Add.
17221
17222 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17223
17224         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17225         again. 
17226
17227         * makefile: Add practical target `mcs3.exe' which builds the third
17228         generation compiler. 
17229
17230         * expression.cs (New): Fix structures constructor calling.
17231
17232         * class.cs (Property, Method, Indexer): Emit Final flag on the
17233         method if we are an interface implementation and we are not
17234         abstract. 
17235
17236         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17237         whether this property is referencing a `base' method.
17238
17239         * expression.cs (Invocation.EmitCall): take an extra argument:
17240         is_base, this is used to determine whether the `call' or
17241         `callvirt' opcode should be used.
17242
17243
17244         * delegate.cs: update EmitCall.
17245
17246         * class.cs (Method.Define): Set NewSlot for the cases where we are
17247         not implementing an interface method.
17248
17249         (Property.Define): ditto.
17250
17251 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17252
17253         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17254         'r'.  Allows mcs to parse itself fully.
17255
17256 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17257
17258         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17259         of the number of initializers that require the InitializeArray method.
17260
17261         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17262         update the above field where necessary.
17263
17264         (MakeByteBlob): Update accordingly.
17265
17266         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17267         greater than 2.
17268
17269         (EmitDynamicInitializers): Update in accordance with the new optimization.
17270
17271         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17272         same OpCode applies.
17273
17274         * cs-parser.jay : Fix some glaring errors I introduced.
17275
17276 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17277
17278         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17279         so that we can check for name clashes there too.
17280
17281         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17282         for interface indexers.
17283
17284         * interfaces.cs (Define): Emit the default member attribute.
17285
17286         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17287         variable was being referred to while setting the value ;-)
17288
17289 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17290
17291         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17292         byte-by-byte information when we know the data is zero.
17293
17294         Make the block always a multiple of 4, because
17295         DefineInitializedData has a bug.
17296
17297         * assign.cs: Fix, we should assign from the temporary, not from
17298         the source. 
17299
17300         * expression.cs (MakeByteBlob): Fix my incorrect code.
17301
17302 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17303
17304         * typemanager.cs (EnumToUnderlying): This function is used to get
17305         the underlying type from an enumeration, because it does not
17306         always work. 
17307
17308         * constant.cs: Use the I4_S form for values between -128 and 127.
17309
17310         * statement.cs (Block.LookupLabel): Looks up a label.
17311         (Block): Drop support for labeled blocks.
17312
17313         (LabeledStatement): New kind of statement that represents a label
17314         only.
17315
17316         (Goto): Finally implement this bad boy.
17317
17318         * cs-parser.jay: Update to reflect new mechanism to implement
17319         labels.
17320
17321 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17322
17323         * codegen.cs (EmitContext.This): a codegen property that keeps the
17324         a single instance of this instead of creating many different this
17325         instances. 
17326
17327         * delegate.cs (Delegate.DoResolve): Update to use the property;
17328
17329         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17330
17331         * expression.cs (BaseAccess.DoResolve): Ditto.
17332
17333 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17334
17335         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17336         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17337
17338         (InitCoreTypes): Update accordingly.
17339
17340         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17341         so we can quickly store the state.
17342
17343         (ApplyAttributes): Set the correct implementation flags
17344         for InternalCall methods.
17345
17346 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17347
17348         * expression.cs (EmitCall): if a method is not virtual, then do
17349         not use callvirt on it.
17350
17351         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17352         user defined stuff) requires the use of stobj, which takes an
17353         address on the stack instead of an array and an index.  So emit
17354         the Ldelema operation for it.
17355
17356         (EmitStoreOpcode): Use stobj for valuetypes.
17357
17358         (UnaryMutator.EmitCode): Use the right 1 value depending on
17359         whether we are dealing with int64/uint64, float or doubles.
17360
17361         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17362         constructors that I implemented last night.
17363
17364         (Constructor.IsDefault): Fix to work properly for static
17365         constructors.
17366
17367         * cs-parser.jay (CheckDef): report method signature errors.
17368         Update error number 103 to be 132.
17369
17370         * decl.cs: New AdditionResult enumeration value: MethodExists.
17371         Although we do this check for methods later on in the semantic
17372         analysis, catching repeated default constructors is so easy that
17373         we catch these here. 
17374
17375         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17376         promotions code.
17377
17378         (ParameterReference.EmitAssign, Emit): handle
17379         bools as bytes.
17380
17381         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17382         (ArrayAccess.EmitStoreOpcode): ditto.
17383
17384         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17385
17386         * expression.cs (MakeByteBlob): Complete all the missing types
17387         (uint, short, ushort, byte, sbyte)
17388
17389         * class.cs: Only init instance field initializers on instance
17390         constructors. 
17391
17392         Rename `constructors' to instance_constructors. 
17393
17394         (TypeContainer.AddConstructor): Only add constructors to the list
17395         if it is not static.
17396
17397         Make sure that we handle default_static_constructor independently
17398         everywhere where we handle instance_constructors
17399
17400 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17401
17402         * class.cs: Do not lookup or create a base initializer for a
17403         static constructor.
17404
17405         (ConstructorInitializer.Resolve): use the proper type to lookup
17406         for constructors.
17407
17408         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17409
17410         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17411         in DeclSpace. 
17412
17413         * decl.cs: CloseType is now an virtual method, the default
17414         implementation just closes this type.
17415
17416 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17417
17418         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17419         to PreserveSig by default. Also emit HideBySig on such methods.
17420
17421         Basically, set the defaults to standard values.
17422
17423         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17424         argument, if candidate is better, it can't be worse than the best !
17425
17426         (Invocation): Re-write bits to differentiate between methods being
17427         applicable in their expanded form and their normal form - for params
17428         methods of course.
17429
17430         Get rid of use_standard everywhere as only standard conversions are allowed
17431         in overload resolution. 
17432
17433         More spec conformance.
17434
17435 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17436
17437         * driver.cs: Add --timestamp, to see where the compiler spends
17438         most of its time.
17439
17440         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17441         `this' in static code.
17442
17443         (SimpleName.DoResolve): Implement in terms of a helper function
17444         that allows static-references to be passed upstream to
17445         MemberAccess.
17446
17447         (Expression.ResolveWithSimpleName): Resolve specially simple
17448         names when called by MemberAccess to implement the special
17449         semantics. 
17450
17451         (Expression.ImplicitReferenceConversion): Handle conversions from
17452         Null to reference types before others, as Null's type is
17453         System.Object. 
17454
17455         * expression.cs (Invocation.EmitCall): Handle the special case of
17456         calling methods declared on a reference type from a ValueType
17457         (Base classes System.Object and System.Enum)
17458
17459         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17460         the left hand side is a TypeExpr, not on every enumeration. 
17461
17462         (Binary.Resolve): If types are reference types, then do a cast to
17463         object on operators != and == of both arguments.
17464
17465         * typemanager.cs (FindMembers): Extract instance and static
17466         members if requested.
17467
17468         * interface.cs (PopulateProperty): Use void_type instead of null
17469         as the return type for the setter method.
17470
17471         (PopulateIndexer): ditto.
17472
17473 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17474
17475         * support.cs (ReflectionParameters): Fix minor bug where we
17476         were examining the wrong parameter for the ParamArray attribute.
17477
17478         Cope with requests for the type of the parameter at position
17479         greater than the params parameter's. We now return the element
17480         type of the params array as that makes more sense.
17481
17482         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17483         accordingly as we no longer have to extract the element type
17484         ourselves.
17485
17486         (Invocation.OverloadResolve): Update.
17487
17488 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17489
17490         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17491         against IEnumerator, test whether the return value is a descendant
17492         of the IEnumerator interface.
17493
17494         * class.cs (Indexer.Define): Use an auxiliary method to implement
17495         the other bits of the method definition.  Begin support for
17496         explicit interface implementation.
17497
17498         (Property.DefineMethod): Use TypeManager.void_type instead of null
17499         for an empty return value.
17500
17501 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17504         dealing with a FieldExpr which is composed of a FieldBuilder, in
17505         the code path we did extract the constant, but we should have
17506         obtained the underlying value to be able to cast it (otherwise we
17507         end up in an infinite loop, this is what Ravi was running into).
17508
17509         (ArrayCreation.UpdateIndices): Arrays might be empty.
17510
17511         (MemberAccess.ResolveMemberAccess): Add support for section
17512         14.5.4.1 that deals with the special case of E.I when E is a type
17513         and something else, that I can be a reference to a static member.
17514
17515         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17516         handle a particular array type to create byte blobs, it is just
17517         something we dont generate byteblobs for.
17518
17519         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17520         arguments. 
17521
17522         * location.cs (Push): remove the key from the hashtable that we
17523         are about to add.   This happens for empty files.
17524
17525         * driver.cs: Dispose files after we have parsed them.
17526
17527         (tokenize): new function that only runs the tokenizer on its
17528         input, for speed testing.
17529
17530 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17531
17532         * class.cs (Event.Define): Define the private field only if there
17533         are no accessors defined.
17534
17535         * expression.cs (ResolveMemberAccess): If there is no associated
17536         field with the event, that means we have an event defined with its
17537         own accessors and we should flag error cs0070 since transforming
17538         ourselves into a field is not valid in that case.
17539
17540         * ecore.cs (SimpleName.DoResolve): Same as above.
17541
17542         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17543         and charset to sane values.
17544
17545 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17546
17547         * assign.cs (DoResolve): Perform check on events only if they 
17548         are being accessed outside the declaring type.
17549
17550         * cs-parser.jay (event_declarations): Update rules to correctly
17551         set the type of the implicit parameter etc.
17552
17553         (add_accessor, remove_accessor): Set current local parameters.
17554
17555         * expression.cs (Binary): For delegate addition and subtraction,
17556         cast the return value from the method into the appropriate delegate
17557         type.
17558
17559 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17560
17561         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17562         of these as the workaround is unnecessary.
17563
17564         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17565         delegate data - none of that is needed at all.
17566
17567         Re-write bits to extract the instance expression and the delegate method
17568         correctly.
17569
17570         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17571         on delegates too.
17572
17573         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17574         of attaching attributes instead of duplicating code everywhere.
17575
17576         * everywhere : Update code to do attribute emission using the above method.
17577
17578 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17579
17580         * expression.cs (IsParamsMethodApplicable): if there are not
17581         parameters, return immediately.
17582
17583         * ecore.cs: The 0 literal can be implicity converted to an enum
17584         type. 
17585
17586         (SimpleName.DoResolve): First lookup the type, then lookup the
17587         members. 
17588
17589         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17590         want to get its address.  If the InstanceExpression is not
17591         addressable, store the result in a temporary variable, then get
17592         the address of it.
17593
17594         * codegen.cs: Only display 219 errors on warning level or above. 
17595
17596         * expression.cs (ArrayAccess): Make it implement the
17597         IMemoryLocation interface.
17598
17599         (Binary.DoResolve): handle the operator == (object a, object b)
17600         and operator != (object a, object b) without incurring into a
17601         BoxedCast (because 5 != o should never be performed).
17602
17603         Handle binary enumerator operators.
17604
17605         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17606         value type, otherwise use Ldelem_ref.
17607
17608         Use precomputed names;
17609
17610         (AddressOf): Implement address of
17611
17612         * cs-parser.jay (labeled_statement): Fix recursive block
17613         addition by reworking the production.
17614
17615         * expression.cs (New.DoEmit): New has a special case:
17616                 
17617                  If we are dealing with a ValueType, we have a few
17618                  situations to deal with:
17619                 
17620                     * The target of New is a ValueType variable, that is
17621                       easy, we just pass this as the variable reference
17622                 
17623                     * The target of New is being passed as an argument,
17624                       to a boxing operation or a function that takes a
17625                       ValueType.
17626                 
17627                       In this case, we need to create a temporary variable
17628                       that is the argument of New.
17629
17630
17631 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17632
17633         * rootcontext.cs (LookupType): Check that current_type is not null before
17634         going about looking at nested types.
17635
17636         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17637         not implement the IAssignMethod interface any more.
17638
17639         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17640         where we tranform them into FieldExprs if they are being resolved from within
17641         the declaring type.
17642
17643         * ecore.cs (SimpleName.DoResolve): Do the same here.
17644
17645         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17646
17647         * ../errors/bug10.cs : Add.
17648
17649         * ../errors/cs0070.cs : Add.
17650
17651         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17652
17653         * assign.cs : Get rid of EventIsLocal everywhere.
17654
17655 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * ecore.cs (ConvertIntLiteral): finished the implementation.
17658
17659         * statement.cs (SwitchLabel): Convert the value we are using as a
17660         key before looking up the table.
17661
17662 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * codegen.cs (EmitTopBlock): Require a Location argument now.
17665
17666         * cs-parser.jay (constructor_declarator): We need to setup
17667         current_local_parameters before we parse the
17668         opt_constructor_initializer, to allow the variables to be bound
17669         to the constructor arguments.
17670
17671         * rootcontext.cs (LookupType): First lookup nested classes in our
17672         class and our parents before we go looking outside our class.
17673
17674         * expression.cs (ConstantFold): Extract/debox the values at the
17675         beginnning. 
17676
17677         * rootcontext.cs (EmitCode): Resolve the constants first before we
17678         resolve the types.  This is not really needed, but it helps debugging.
17679
17680         * statement.cs: report location.
17681
17682         * cs-parser.jay: pass location to throw statement.
17683
17684         * driver.cs: Small bug fix.
17685
17686         * report.cs: Updated format to be 4-zero filled digits.
17687
17688 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17689
17690         * expression.cs (CheckIndices): Fix minor bug where the wrong
17691         variable was being referred to ;-)
17692
17693         (DoEmit): Do not call EmitStaticInitializers when the 
17694         underlying type is System.Object.
17695
17696 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17697
17698         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17699         and do the usual workaround for SRE.
17700
17701         * class.cs (MyEventBuilder.EventType): New member to get at the type
17702         of the event, quickly.
17703
17704         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17705
17706         * assign.cs (Assign.DoResolve): Handle the case when the target
17707         is an EventExpr and perform the necessary checks.
17708
17709         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17710         interface.
17711
17712         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17713
17714         (EventExpr): Set the type in the constructor itself since we 
17715         are meant to be born fully resolved.
17716
17717         (EventExpr.Define): Revert code I wrote earlier.
17718                 
17719         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17720         instance expression is null. The instance expression is a This in that case
17721         or a null, depending on whether it is a static method or not.
17722
17723         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17724         refers to more than one method.
17725
17726         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17727         and accordingly flag errors.
17728
17729 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17732
17733 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * location.cs (ToString): Provide useful rutine.
17736
17737 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17740         objects, return the actual integral boxed.
17741
17742         * statement.cs (SwitchLabel): define an ILLabel for each
17743         SwitchLabel. 
17744
17745         (Switch.CheckSwitch): If the value is a Literal, extract
17746         the underlying literal.
17747
17748         Also in the unused hashtable we had, add the SwitchLabel so we can
17749         quickly look this value up.
17750
17751         * constant.cs: Implement a bunch of new constants.  Rewrite
17752         Literal based on this.  Made changes everywhere to adapt to this.
17753
17754         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17755         dereferencing array only once, and also copes with enumrations.
17756
17757         bytes are two bytes wide, not one.
17758
17759         (Cast): Perform constant conversions.
17760
17761         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17762         wrappers to the literals here.
17763
17764         * expression.cs (DoNumericPromotions): long literals can converted
17765         to ulong implicity (this is taken care of elsewhere, but I was
17766         missing this spot).
17767
17768         * ecore.cs (Expression.Literalize): Make the return type Literal,
17769         to improve type checking.
17770
17771         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17772
17773 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17774
17775         * literal.cs: Revert code from ravi that checked the bounds.  The
17776         bounds are sane by the definition of the type itself. 
17777
17778         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17779         need to actually look up in our parent hierarchy for interfaces
17780         implemented. 
17781
17782         * const.cs: Use the underlying type for enumerations
17783
17784         * delegate.cs: Compute the basename for the delegate creation,
17785         that should fix the delegate test case, and restore the correct
17786         Type Lookup semantics in rootcontext
17787
17788         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17789         referencing a nested type with the Reflection API is using the "+"
17790         sign. 
17791
17792         * cs-parser.jay: Do not require EOF token at the end.
17793
17794 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17795
17796         * rootcontext.cs (LookupType): Concatenate type names with
17797         a '.' instead of a '+' The test suite passes again.
17798
17799         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17800         field of the enumeration.
17801
17802         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17803         the case when the member is an EventExpr.
17804
17805         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17806         static has an associated instance expression.
17807
17808         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17809
17810         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17811
17812         * class.cs (Event.Define): Register event and perform appropriate checks
17813         for error #111.
17814
17815         We define the Add and Remove methods even if the use provides none because
17816         in that case, we provide default implementations ourselves.
17817
17818         Define a private field of the type of the event. This is done by the CSC compiler
17819         and we should be doing it too ;-)
17820
17821         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17822         More methods we use in code we generate.
17823
17824         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17825         is important.
17826
17827         (InitCoreTypes): Update accordingly for the above.
17828
17829         * class.cs (Event.Emit): Generate code for default accessors that we provide
17830
17831         (EmitDefaultMethod): Do the job in the above.
17832
17833         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17834         appropriate place.
17835
17836 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17837
17838         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17839         builders even if we were missing one.
17840
17841         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17842         pass the Basename as our class name instead of the Name.  The
17843         basename will be correctly composed for us.
17844
17845         * parameter.cs (Paramters): Now takes a Location argument.
17846
17847         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17848         make all the code call directly LookupType in RootContext and take
17849         this chance to pass the Location information everywhere.
17850
17851         * Everywhere: pass Location information.
17852
17853 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17854
17855         * class.cs (Constructor.Define): Updated way of detecting the
17856         length of the parameters.
17857
17858         (TypeContainer.DefineType): Use basename as the type name for
17859         nested types.
17860
17861         (TypeContainer.Define): Do not recursively define types here, as
17862         definition is taken care in order by the RootContext.
17863
17864         * tree.cs: Keep track of namespaces in a per-file basis.
17865
17866         * parameter.cs (Parameter.ComputeSignature): Update to use
17867         DeclSpace. 
17868
17869         (Parameters.GetSignature): ditto.
17870
17871         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17872         instead of a TypeContainer.
17873
17874         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17875         resolve names.  Because we need to be resolve in our context, not
17876         our parents.
17877
17878         * driver.cs: Implement response files.
17879
17880         * class.cs (TypeContainer.DefineType): If we are defined, do not
17881         redefine ourselves.
17882
17883         (Event.Emit): Emit the code for add/remove handlers.
17884         (Event.Define): Save the MethodBuilders for add/remove.
17885
17886         * typemanager.cs: Use pair here too.
17887
17888         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17889         DictionaryEntry requires the first argument to be non-null.  
17890
17891         (enum_declaration): Compute full name for registering the
17892         enumeration.
17893
17894         (delegate_declaration): Instead of using
17895         formal_parameter_list, use opt_formal_parameter_list as the list
17896         can be empty.
17897
17898         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17899         (EventParsing): New property that controls whether `add' and
17900         `remove' are returned as tokens or identifiers (for events);
17901
17902 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17903
17904         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17905         use MyEventBuilder only and let it wrap the real builder for us.
17906
17907         (MyEventBuilder): Revamp constructor etc.
17908
17909         Implement all operations that we perform on EventBuilder in precisely the same
17910         way here too.
17911
17912         (FindMembers): Update to use the EventBuilder member.
17913
17914         (Event.Emit): Update accordingly.
17915
17916 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17917
17918         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17919         by calling the appropriate methods.
17920
17921         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17922         useful.
17923
17924         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17925
17926 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17927
17928         * delegate.cs (Delegate.Populate): Check that the return type
17929         and various parameters types are indeed accessible.
17930
17931         * class.cs (Constructor.Define): Same here.
17932
17933         (Field.Define): Ditto.
17934
17935         (Event.Define): Ditto.
17936
17937         (Operator.Define): Check that the underlying Method defined itself
17938         correctly - so it's MethodBuilder should not be null.
17939
17940         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17941         expression happens to be null.
17942
17943         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17944         members but as of now we don't seem to be able to do anything really useful with it.
17945
17946         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17947         not the EventBuilder.
17948
17949 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17950
17951         * cs-tokenizer.cs: Add support for defines.
17952         Add support for #if, #elif, #else, #endif
17953
17954         (eval_var): evaluates a variable.
17955         (eval): stubbed for evaluating functions.
17956
17957         * cs-parser.jay: Pass the defines information
17958
17959         * driver.cs: Add --define command line option.
17960
17961         * decl.cs: Move MemberCore here.
17962
17963         Make it the base class for DeclSpace.  This allows us to catch and
17964         report 108 and 109 for everything now.
17965
17966         * class.cs (TypeContainer.Define): Extract all the members
17967         before populating and emit the warning 108 (new keyword required
17968         to override) instead of having each member implement this.
17969
17970         (MemberCore.Define): New abstract method, we will be using this in
17971         the warning reporting engine in Populate.
17972
17973         (Operator.Define): Adjust to new MemberCore protocol. 
17974
17975         * const.cs (Const): This does not derive from Expression, it is a
17976         temporary object we use to create fields, it is a MemberCore. 
17977
17978         * class.cs (Method.Define): Allow the entry point to be in a
17979         specific class.
17980
17981         * driver.cs: Rewrite the argument handler to clean it up a bit.
17982
17983         * rootcontext.cs: Made it just an auxiliary namespace feature by
17984         making everything static.
17985
17986         * driver.cs: Adapt code to use RootContext type name instead of
17987         instance variable.
17988
17989         * delegate.cs: Remove RootContext argument.
17990
17991         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17992         argument. 
17993
17994         * class.cs (Event.Define): The lookup can fail.
17995
17996         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17997
17998         * expression.cs: Resolve the this instance before invoking the code.
17999
18000 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18001
18002         * cs-parser.jay: Add a production in element_access that allows
18003         the thing to become a "type" reference.  This way we can parse
18004         things like "(string [])" as a type.
18005
18006         Note that this still does not handle the more complex rules of
18007         casts. 
18008
18009
18010         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18011
18012         * ecore.cs: (CopyNewMethods): new utility function used to
18013         assemble the list of methods from running FindMembers.
18014
18015         (MemberLookup): Rework FindMembers so that 
18016
18017 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * class.cs (TypeContainer): Remove Delegates who fail to be
18020         defined.
18021
18022         * delegate.cs (Populate): Verify that we dont get null return
18023         values.   TODO: Check for AsAccessible.
18024
18025         * cs-parser.jay: Use basename to emit error 574 (destructor should
18026         have the same name as container class), not the full name.
18027
18028         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18029         possible representation.  
18030
18031         Also implements integer type suffixes U and L.
18032
18033 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18034
18035         * expression.cs (ArrayCreation.DoResolve): We need to do the
18036         argument resolution *always*.
18037
18038         * decl.cs: Make this hold the namespace.  Hold the root context as
18039         well.
18040         (LookupType): Move here.
18041
18042         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18043
18044         * location.cs (Row, Name): Fixed the code, it was always returning
18045         references to the first file.
18046
18047         * interface.cs: Register properties defined through interfaces.
18048
18049         * driver.cs: Add support for globbing on the command line
18050
18051         * class.cs (Field): Make it derive from MemberCore as well.
18052         (Event): ditto.
18053
18054 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18055
18056         * class.cs (Event::Define): Check that the type of the event is a delegate
18057         type else flag error #66.
18058
18059         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18060         same.
18061
18062         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18063         values of EntryPoint, CharSet etc etc.
18064
18065         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18066
18067         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18068         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18069         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18070         which needs this to do its work.
18071
18072         * ../errors/cs0066.cs : Add.
18073
18074 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18075
18076         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18077         helper functions.
18078
18079         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18080         clears out the parameters field.
18081         (MemberSignatureCompare): Cleanup
18082
18083         (MemberCore): New base class used to share code between MethodCore
18084         and Property.
18085
18086         (RegisterRequiredImplementations) BindingFlags.Public requires
18087         either BindingFlags.Instace or Static.  Use instance here.
18088
18089         (Property): Refactored code to cope better with the full spec.
18090
18091         * parameter.cs (GetParameterInfo): Return an empty array instead
18092         of null on error.
18093
18094         * class.cs (Property): Abstract or extern properties have no bodies.
18095
18096         * parameter.cs (GetParameterInfo): return a zero-sized array.
18097
18098         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18099         method modifier validation to the typecontainer so we can reuse
18100         this on properties.
18101
18102         (MethodCore.ParameterTypes): return an empty sized array of types.
18103
18104         (Property.Define): Test property modifier validity.
18105
18106         Add tests for sealed/override too.
18107
18108         (Method.Emit): abstract or extern methods have no bodies.
18109
18110 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18111
18112         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18113         thing.
18114
18115         (Method::Define, ::Emit): Modify accordingly.
18116
18117         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18118
18119         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18120
18121         * makefile: Pass in /unsafe.
18122
18123 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * class.cs (MakeKey): Kill routine.
18126
18127         * class.cs (TypeContainer.Define): Correctly define explicit
18128         method implementations (they require the full interface name plus
18129         the method name).
18130
18131         * typemanager.cs: Deply the PtrHashtable here and stop using the
18132         lame keys.  Things work so much better.
18133
18134         This of course broke everyone who depended on `RegisterMethod' to
18135         do the `test for existance' test.  This has to be done elsewhere.
18136
18137         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18138         the object stupid Equals method (because, that like fails all over
18139         the place).  We still do not use it.
18140
18141         * class.cs (TypeContainer.SetRequiredInterface,
18142         TypeContainer.RequireMethods): Killed these two routines and moved
18143         all the functionality to RegisterRequiredImplementations.
18144
18145         (TypeContainer.RegisterRequiredImplementations): This routine now
18146         registers all the implementations required in an array for the
18147         interfaces and abstract methods.  We use an array of structures
18148         which can be computed ahead of time to reduce memory usage and we
18149         also assume that lookups are cheap as most classes will not
18150         implement too many interfaces.
18151
18152         We also avoid creating too many MethodSignatures.
18153
18154         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18155         clear the "pending" bit if we find that there are problems with
18156         the declaration.
18157
18158         (TypeContainer.VerifyPendingMethods): Update to report errors of
18159         methods that look like implementations but are not.
18160
18161         (TypeContainer.Define): Add support for explicit interface method
18162         implementation. 
18163
18164 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18165
18166         * typemanager.cs: Keep track of the parameters here instead of
18167         being a feature of the TypeContainer.
18168
18169         * class.cs: Drop the registration of parameters here, as
18170         InterfaceMethods are also interface declarations.
18171
18172         * delegate.cs: Register methods with the TypeManager not only with
18173         the TypeContainer.  This code was buggy.
18174
18175         * interface.cs: Full registation here.
18176
18177 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18178
18179         * expression.cs: Remove reducer for binary expressions, it can not
18180         be done this way.
18181
18182         * const.cs: Put here the code that used to go into constant.cs
18183
18184         * constant.cs: Put here the code for constants, this is a new base
18185         class for Literals.
18186
18187         * literal.cs: Make Literal derive from Constant.
18188
18189 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18190
18191         * statement.cs (Return.Emit): Report error 157 if the user
18192         attempts to return from a finally block.
18193
18194         (Return.Emit): Instead of emitting a return, jump to the end of
18195         the function.
18196
18197         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18198         LocalBuilder to store the result of the function.  ReturnLabel is
18199         the target where we jump.
18200
18201
18202 2001-12-09  Radek Doulik  <rodo@ximian.com>
18203
18204         * cs-parser.jay: remember alias in current namespace
18205
18206         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18207         namespaces
18208
18209         * class.cs (LookupAlias): lookup alias in my_namespace
18210
18211         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18212         aliases hashtable
18213         (LookupAlias): lookup alias in this and if needed in parent
18214         namespaces
18215
18216 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * support.cs: 
18219
18220         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18221         making things static.  I need this to avoid passing the
18222         TypeContainer when calling ParameterType.
18223
18224         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18225         that did string manipulation to compute the type and then call
18226         GetType.  Use Parameter.ParameterType instead.
18227
18228         * cs-tokenizer.cs: Consume the suffix for floating values.
18229
18230         * expression.cs (ParameterReference): figure out whether this is a
18231         reference parameter or not.  Kill an extra variable by computing
18232         the arg_idx during emission.
18233
18234         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18235         function that returns whether a parameter is an out/ref value or not.
18236
18237         (Parameter.ParameterType): The type of the parameter (base,
18238         without ref/out applied).
18239
18240         (Parameter.Resolve): Perform resolution here.
18241         (Parameter.ExternalType): The full type (with ref/out applied).
18242
18243         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18244         support for expressions on the using statement.
18245
18246 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18247
18248         * statement.cs (Using.EmitLocalVariableDecls): Split the
18249         localvariable handling of the using statement.
18250
18251         (Block.EmitMeta): Keep track of variable count across blocks.  We
18252         were reusing slots on separate branches of blocks.
18253
18254         (Try.Emit): Emit the general code block, we were not emitting it. 
18255
18256         Check the type of the declaration to be an IDisposable or
18257         something that can be implicity converted to it. 
18258
18259         Emit conversions if required.
18260
18261         * ecore.cs (EmptyExpression): New utility class.
18262         (Expression.ImplicitConversionExists): New utility function.
18263
18264 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * statement.cs (Using): Implement.
18267
18268         * expression.cs (LocalVariableReference): Support read only variables.
18269
18270         * statement.cs: Remove the explicit emit for the Leave opcode.
18271         (VariableInfo): Add a readonly field.
18272
18273 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * ecore.cs (ConvCast): new class used to encapsulate the various
18276         explicit integer conversions that works in both checked and
18277         unchecked contexts.
18278
18279         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18280         properly generate the overflow opcodes.
18281
18282 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18283
18284         * statement.cs: The correct type for the EmptyExpression is the
18285         element_type, not the variable type.  Ravi pointed this out.
18286
18287 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18288
18289         * class.cs (Method::Define): Handle PInvoke methods specially
18290         by using DefinePInvokeMethod instead of the usual one.
18291
18292         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18293         above to do the task of extracting information and defining the method.
18294
18295 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18296
18297         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18298         of the condition for string type.
18299
18300         (Emit): Move that here. 
18301
18302         (ArrayCreation::CheckIndices): Keep string literals in their expression
18303         form.
18304
18305         (EmitDynamicInitializers): Handle strings appropriately.
18306
18307 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * codegen.cs (EmitContext): Replace multiple variables with a
18310         single pointer to the current Switch statement.
18311
18312         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18313         EmitContext.
18314
18315 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18316
18317         * statement.cs 
18318
18319         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18320         default'.
18321
18322         (Foreach.Emit): Foreach on arrays was not setting
18323         up the loop variables (for break/continue).
18324
18325         (GotoCase): Semi-implented.
18326
18327 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18328
18329         * attribute.cs (CheckAttribute): Handle system attributes by using
18330         Attribute.GetAttributes to examine information we need.
18331
18332         (GetValidPlaces): Same here.
18333
18334         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18335
18336         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18337
18338         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18339
18340         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18341
18342         (Method::Emit): Handle the case when we are a PInvoke method.
18343
18344 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18345
18346         * expression.cs: Use ResolveWithSimpleName on compound names.
18347
18348 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18349
18350         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18351         before trying to reduce it.
18352
18353         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18354
18355         * constant.cs (LookupConstantValue): Implement.
18356
18357         (EmitConstant): Use the above in emitting the constant.
18358
18359         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18360         that are user-defined by doing a LookupConstantValue on them.
18361
18362         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18363         too, like above.
18364
18365 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18366
18367         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18368
18369         (BaseAccess.DoResolve): Implement.
18370
18371         (MemberAccess.DoResolve): Split this routine into a
18372         ResolveMemberAccess routine that can be used independently
18373
18374 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18375
18376         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18377         As that share bits of the implementation.  Is returns a boolean,
18378         while As returns the Type that is being probed.
18379
18380 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18381
18382         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18383         instead of a Literal - much easier.
18384
18385         (EnumInTransit): Remove - utterly useless :-)
18386
18387         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18388
18389         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18390
18391         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18392         chain when we have no associated expression.
18393
18394 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18395
18396         * constant.cs (Define): Use Location while reporting the errror.
18397
18398         Also emit a warning when 'new' is used and there is no inherited
18399         member to hide.
18400
18401         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18402         populated.
18403
18404         (LookupEnumValue): Implement to lookup an enum member's value and define it
18405         if necessary.
18406
18407         (Populate): Re-write accordingly to use the above routine.
18408
18409 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18410
18411         * expression.cs (This): Fix prototype for DoResolveLValue to
18412         override the base class DoResolveLValue.
18413
18414         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18415         declarations) 
18416
18417         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18418         (we need to load the address of the field here).  This fixes
18419         test-22. 
18420
18421         (FieldExpr.DoResolveLValue): Call the DoResolve
18422         function to initialize the Instance expression.
18423
18424         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18425         correctly the GetEnumerator operation on a value type.
18426
18427         * cs-parser.jay: Add more simple parsing error catches.
18428
18429         * statement.cs (Switch): Add support for string switches.
18430         Handle null specially.
18431
18432         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18433
18434 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18435
18436         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18437
18438         (declare_local_constant): New helper function.
18439
18440         * statement.cs (AddConstant): Keep a separate record of constants
18441
18442         (IsConstant): Implement to determine if a variable is a constant.
18443
18444         (GetConstantExpression): Implement.
18445
18446         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18447
18448         * statement.cs (IsVariableDefined): Re-write.
18449
18450 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18451
18452         * class.cs (TypeContainer::FindMembers): Look for constants
18453         in the case when we are looking for MemberTypes.Field
18454
18455         * expression.cs (MemberAccess::DoResolve): Check that in the
18456         case we are a FieldExpr and a Literal, we are not being accessed
18457         by an instance reference.
18458
18459         * cs-parser.jay (local_constant_declaration): Implement.
18460
18461         (declaration_statement): Implement for constant declarations.
18462
18463 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * statement.cs (Switch): Catch double defaults.
18466
18467         (Switch): More work on the switch() statement
18468         implementation.  It works for integral values now, need to finish
18469         string support.
18470
18471
18472 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18475         integer literals into other integer literals.  To be used by
18476         switch. 
18477
18478 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18479
18480         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18481         some memory.
18482
18483         (EmitDynamicInitializers): Cope with the above since we extract data
18484         directly from ArrayData now.
18485
18486         (ExpectInitializers): Keep track of whether initializers are mandatory
18487         or not.
18488
18489         (Bounds): Make it a hashtable to prevent the same dimension being 
18490         recorded for every element in that dimension.
18491
18492         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18493         from being found.
18494
18495         Also fix bug which was causing the indices to be emitted in the reverse
18496         order.
18497
18498 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18501         unfinished.  They do not work, because the underlying code is
18502         sloppy.
18503
18504 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18505
18506         * cs-parser.jay: Remove bogus fixme.
18507
18508         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18509         on Switch statement.
18510
18511 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18512
18513         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18514         the same. 
18515
18516         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18517         parameter. Apparently, any expression is allowed. 
18518
18519         (ValidateInitializers): Update accordingly.
18520
18521         (CheckIndices): Fix some tricky bugs thanks to recursion.
18522
18523         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18524         I was being completely brain-dead.
18525
18526         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18527         and re-write acordingly.
18528
18529         (DelegateInvocation): Re-write accordingly.
18530
18531         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18532
18533         (MakeByteBlob): Handle types more correctly.
18534
18535         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18536         initialization from expressions but it is incomplete because I am a complete
18537         Dodo :-|
18538
18539 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18540
18541         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18542         on If.  Basically, we have to return `true' (ie, we do return to
18543         our caller) only if both branches of the if return.
18544
18545         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18546         short-circuit operators, handle them as short circuit operators. 
18547
18548         (Cast.DoResolve): Resolve type.
18549         (Cast.Cast): Take an expression as the target type.
18550
18551         * cs-parser.jay (cast_expression): Remove old hack that only
18552         allowed a limited set of types to be handled.  Now we take a
18553         unary_expression and we resolve to a type during semantic
18554         analysis.
18555
18556         Use the grammar productions from Rhys to handle casts (this is
18557         not complete like Rhys syntax yet, we fail to handle that corner
18558         case that C# has regarding (-x), but we will get there.
18559
18560 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18561
18562         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18563         field which is an array type.
18564
18565         * cs-parser.jay (declare_local_variables): Support array initialization too.
18566
18567         * typemanager.cs (MakeKey): Implement.
18568
18569         (everywhere): Use the above appropriately.
18570
18571         * cs-parser.jay (for_statement): Update for array initialization while
18572         declaring variables.
18573
18574         * ecore.cs : The error message was correct, it's the variable's names that
18575         were misleading ;-) Make the code more readable.
18576
18577         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18578         the correct type etc.
18579
18580         (ConvertExplicit): Handle Enum types by examining the underlying type.
18581
18582 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18583
18584         * parameter.cs (GetCallingConvention): Always return
18585         CallingConventions.Standard for now.
18586
18587 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18590         and `r' after calling DoNumericPromotions.
18591
18592         * ecore.cs: Fix error message (the types were in the wrong order).
18593
18594         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18595         BindingFlags.Instance as well 
18596
18597         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18598         implicit int literal conversion in an empty cast so that we
18599         propagate the right type upstream.
18600
18601         (UnboxCast): new class used to unbox value types.
18602         (Expression.ConvertExplicit): Add explicit type conversions done
18603         by unboxing.
18604
18605         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18606         the target type before applying the implicit LongLiterals to ULong
18607         literal cast.
18608
18609 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18610
18611         * cs-parser.jay (for_statement): Reworked the way For works: now
18612         we declare manually any variables that are introduced in
18613         for_initializer to solve the problem of having out-of-band code
18614         emition (that is what got for broken).
18615
18616         (declaration_statement): Perform the actual variable declaration
18617         that used to be done in local_variable_declaration here.
18618
18619         (local_variable_declaration): Do not declare anything, just pass
18620         the information on a DictionaryEntry
18621
18622 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18623
18624         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18625         re-write of the logic to now make it recursive.
18626
18627         (UpdateIndices): Re-write accordingly.
18628
18629         Store element data in a separate ArrayData list in the above methods.
18630
18631         (MakeByteBlob): Implement to dump the array data into a byte array.
18632
18633 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18634
18635         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18636         into CheckIndices.
18637
18638         * constant.cs (Define): Implement.
18639
18640         (EmitConstant): Re-write fully.
18641
18642         Pass in location info.
18643
18644         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18645         respectively.
18646
18647         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18648         DictionaryEntry since we need location info too.
18649
18650         (constant_declaration): Update accordingly.
18651
18652         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18653         code into another method : UpdateIndices.
18654
18655 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18656
18657         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18658         some type checking etc.
18659
18660 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18661
18662         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18663         bits to provide dimension info if the user skips doing that.
18664
18665         Update second constructor to store the rank correctly.
18666
18667 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18668
18669         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18670         and try to implement.
18671
18672         * ../errors/cs0150.cs : Add.
18673
18674         * ../errors/cs0178.cs : Add.
18675
18676 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * statement.cs: Implement foreach on multi-dimensional arrays. 
18679
18680         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18681         name of the params argument.
18682
18683         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18684         initializing the array.
18685
18686         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18687         we can use this elsewhere.
18688
18689         * statement.cs: Finish implementation of foreach for single
18690         dimension arrays.
18691
18692         * cs-parser.jay: Use an out-of-band stack to pass information
18693         around, I wonder why I need this.
18694
18695         foreach_block: Make the new foreach_block the current_block.
18696
18697         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18698         function used to return a static Parameters structure.  Used for
18699         empty parameters, as those are created very frequently.
18700
18701         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18702
18703 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18704
18705         * interface.cs : Default modifier is private, not public. The
18706         make verify test passes again.
18707
18708 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18709
18710         * support.cs (ReflectionParameters): Fix logic to determine
18711         whether the last parameter is a params one. Test 9 passes again.
18712
18713         * delegate.cs (Populate): Register the builders we define with
18714         RegisterParameterForBuilder. Test 19 passes again.
18715
18716         * cs-parser.jay (property_declaration): Reference $6 instead
18717         of $$ to get at the location.
18718
18719         (indexer_declaration): Similar stuff.
18720
18721         (attribute): Ditto.
18722
18723         * class.cs (Property): Register parameters for the Get and Set methods
18724         if they exist. Test 23 passes again.
18725
18726         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18727         call to EmitArguments as we are sure there aren't any params arguments. 
18728         Test 32 passes again.
18729
18730         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18731         IndexOutOfRangeException. 
18732
18733         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18734         Test 33 now passes again.
18735
18736 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18737
18738         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18739         broke a bunch of things.  Will have to come up with a better way
18740         of tracking locations.
18741
18742         * statement.cs: Implemented foreach for single dimension arrays.
18743
18744 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18745
18746         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18747         an error.  This removes the lookup from the critical path.
18748
18749         * cs-parser.jay: Removed use of temporary_loc, which is completely
18750         broken. 
18751
18752 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18753
18754         * support.cs (ReflectionParameters.ParameterModifier): Report
18755         whether the argument is a PARAMS argument or not.
18756
18757         * class.cs: Set the attribute `ParamArrayAttribute' on the
18758         parameter argument.
18759
18760         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18761         and cons_param_array_attribute (ConstructorInfo for
18762         ParamArrayAttribute)., 
18763
18764         * codegen.cs: Emit the return using the `Return' statement, that
18765         way we can report the error correctly for missing return values. 
18766
18767         * class.cs (Method.Emit): Clean up.
18768
18769         * expression.cs (Argument.Resolve): Take another argument: the
18770         location where this argument is used.  Notice that this is not
18771         part of the "Argument" class as to reduce the size of the
18772         structure (we know the approximate location anyways).
18773
18774         Test if the argument is a variable-reference, if not, then
18775         complain with a 206.
18776
18777         (Argument.Emit): Emit addresses of variables.
18778
18779         (Argument.FullDesc): Simplify.
18780
18781         (Invocation.DoResolve): Update for Argument.Resolve.
18782
18783         (ElementAccess.DoResolve): ditto.
18784
18785         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18786         method should be virtual, as this method is always virtual.
18787
18788         (NewDelegate.DoResolve): Update for Argument.Resolve.
18789
18790         * class.cs (ConstructorInitializer.DoResolve): ditto.
18791
18792         * attribute.cs (Attribute.Resolve): ditto.
18793
18794 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18795
18796         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18797
18798         * expression.cs (ParameterReference): Drop IStackStorage and implement
18799         IAssignMethod instead. 
18800
18801         (LocalVariableReference): ditto.
18802
18803         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18804         IAssignMethod instead. 
18805
18806 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18807
18808         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18809         enumerations that are used in heavily used structures derive from
18810         byte in a laughable and pathetic attempt to reduce memory usage.
18811         This is the kind of pre-optimzations that you should not do at
18812         home without adult supervision.
18813
18814         * expression.cs (UnaryMutator): New class, used to handle ++ and
18815         -- separatedly from the other unary operators.  Cleans up the
18816         code, and kills the ExpressionStatement dependency in Unary.
18817
18818         (Unary): Removed `method' and `Arguments' from this class, making
18819         it smaller, and moving it all to SimpleCall, so I can reuse this
18820         code in other locations and avoid creating a lot of transient data
18821         strucutres when not required.
18822
18823         * cs-parser.jay: Adjust for new changes.
18824
18825 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * enum.cs (Enum.Populate): If there is a failure during
18828         definition, return
18829
18830         * cs-parser.jay (opt_enum_base): we used to catch type errors
18831         here, but this is really incorrect.  The type error should be
18832         catched during semantic analysis.
18833
18834 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18835
18836         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18837         current_local_parameters as expected since I, in my stupidity, had forgotten
18838         to do this :-)
18839
18840         * attribute.cs (GetValidPlaces): Fix stupid bug.
18841
18842         * class.cs (Method::Emit): Perform check on applicability of attributes.
18843
18844         (Constructor::Emit): Ditto.
18845
18846         (Field::Emit): Ditto.
18847
18848         (Field.Location): Store location information.
18849
18850         (Property, Event, Indexer, Operator): Ditto.
18851
18852         * cs-parser.jay (field_declaration): Pass in location for each field.
18853
18854         * ../errors/cs0592.cs : Add.
18855
18856 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18857
18858         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18859
18860         (InitCoreTypes): Update accordingly.
18861
18862         (RegisterAttrType, LookupAttr): Implement.
18863
18864         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18865         info about the same.
18866
18867         (Resolve): Update to populate the above as necessary.
18868
18869         (Error592): Helper.
18870
18871         (GetValidPlaces): Helper to the above.
18872
18873         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18874
18875         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18876
18877 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18878
18879         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18880
18881         * ../errors/cs0617.cs : Add.
18882
18883 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18884
18885         * enum.cs (Emit): Rename to Populate to be more consistent with what
18886         we expect it to do and when exactly it is called.
18887
18888         * class.cs, rootcontext.cs : Update accordingly.
18889
18890         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18891         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18892
18893         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18894
18895         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18896         of a fieldinfo using the above, when dealing with a FieldBuilder.
18897
18898 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18899
18900         * ../errors/cs0031.cs : Add.
18901
18902         * ../errors/cs1008.cs : Add.
18903
18904         * ../errrors/cs0543.cs : Add.
18905
18906         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18907         enum type.
18908
18909         (FindMembers): Implement.
18910
18911         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18912         enums and delegates too.
18913
18914         (enum_types): Rename to builder_to_enum.
18915
18916         (delegate_types): Rename to builder_to_delegate.
18917
18918         * delegate.cs (FindMembers): Implement.
18919
18920 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18921
18922         * typemanager.cs (IsEnumType): Implement.
18923
18924         * enum.cs (Emit): Re-write parts to account for the underlying type
18925         better and perform checking etc.
18926
18927         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18928         of the underlying type.
18929
18930         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18931         value
18932
18933         * enum.cs (error31): Helper to report error #31.
18934
18935         * cs-parser.jay (enum_declaration): Store location of each member too.
18936
18937         * enum.cs (member_to_location): New hashtable. 
18938
18939         (AddEnumMember): Update location hashtable.
18940
18941         (Emit): Use the location of each member while reporting errors.
18942
18943 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * cs-parser.jay: A for_initializer if is a
18946         local_variable_declaration really ammount to have an implicit
18947         block with the variable declaration and no initializer for for.
18948
18949         * statement.cs (For.Emit): Cope with null initializers.
18950
18951         This fixes the infinite loop on for initializers.
18952
18953 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18954
18955         * enum.cs: More cleanup.
18956
18957         * ecore.cs: Remove dead code.
18958
18959         * class.cs (Property.Emit): More simplification.
18960         (Event.Emit): ditto.
18961
18962         Reworked to have less levels of indentation.
18963
18964 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18965
18966         * class.cs (Property): Emit attributes.
18967
18968         (Field): Ditto.
18969
18970         (Event): Ditto.
18971
18972         (Indexer): Ditto.
18973
18974         (Operator): Ditto.
18975
18976         * enum.cs (Emit): Ditto.
18977
18978         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18979         Enums too.
18980
18981         * class.cs (Field, Event, etc.): Move attribute generation into the
18982         Emit method everywhere.
18983
18984         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18985         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18986         as we had no way of defining nested enums !
18987
18988         * rootcontext.cs : Adjust code accordingly.
18989
18990         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18991
18992 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18993
18994         * expression.cs (EvalConstantExpression): Move into ecore.cs
18995
18996         * enum.cs (Enum): Rename some members and make them public and readonly
18997         according to our convention.
18998
18999         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19000         nothing else.
19001
19002         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19003
19004         (Enum::Emit): Write a simple version for now which doesn't try to compute
19005         expressions. I shall modify this to be more robust in just a while.
19006
19007         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19008
19009         (TypeContainer::CloseType): Create the Enum types too.
19010
19011         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19012
19013         * expression.cs (EvalConstantExpression): Get rid of completely.
19014
19015         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19016         user-defined values and other cases.
19017
19018         (IsValidEnumLiteral): Helper function.
19019
19020         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19021         out there in the case we had a literal FieldExpr.
19022
19023         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19024
19025         (Literalize): Revamp a bit to take two arguments.
19026
19027         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19028
19029 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19030
19031         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19032
19033         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19034
19035         (Resolve): Use the above to ensure we have proper initializers.
19036
19037 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19038
19039         * expression.cs (Expression::EvalConstantExpression): New method to 
19040         evaluate constant expressions.
19041
19042         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19043
19044 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19047         in an array.
19048
19049         (Binary.ResolveOperator): Handle operator != (object a, object b)
19050         and operator == (object a, object b);
19051
19052         (Binary.DoNumericPromotions): Indicate whether the numeric
19053         promotion was possible.
19054
19055         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19056         Implement.  
19057
19058         Made the ArrayAccess implement interface IAssignMethod instead of
19059         IStackStore as the order in which arguments are passed reflects
19060         this.
19061
19062         * assign.cs: Instead of using expr.ExprClass to select the way of
19063         assinging, probe for the IStackStore/IAssignMethod interfaces.
19064
19065         * typemanager.cs: Load InitializeArray definition.
19066
19067         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19068         static data that can be used to initialize arrays. 
19069
19070 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19071
19072         * expression.cs: Handle operator== and operator!= for booleans.
19073
19074         (Conditioal.Reduce): Implement reducer for the ?: operator.
19075
19076         (Conditional.Resolve): Implement dead code elimination.
19077
19078         (Binary.Resolve): Catch string literals and return a new
19079         concatenated string.
19080
19081         (Unary.Reduce): Implement reduction of unary expressions.
19082
19083         * ecore.cs: Split out the expression core handling here.
19084
19085         (Expression.Reduce): New method used to perform constant folding
19086         and CSE.  This is needed to support constant-expressions. 
19087
19088         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19089         targets, and optimize for !x.
19090
19091 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19092
19093         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19094         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19095         set custom atttributes.
19096
19097         * literal.cs (Literal::GetValue): New abstract method to return the actual
19098         value of the literal, cast as an object.
19099
19100         (*Literal): Implement GetValue method.
19101
19102         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19103         expressions to the arraylist but objects of type Argument.
19104
19105         * class.cs (TypeContainer::Emit): Emit our attributes too.
19106
19107         (Method::Emit, Constructor::Emit): Ditto.
19108
19109         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19110         to be ignoring earlier.
19111
19112 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19113
19114         * attribute.cs (AttributeSection::Define): Implement to do the business
19115         of constructing a CustomAttributeBuilder.
19116
19117         (Attribute): New trivial class. Increases readability of code.  
19118
19119         * cs-parser.jay : Update accordingly.
19120
19121         (positional_argument_list, named_argument_list, named_argument): New rules
19122
19123         (attribute_arguments): Use the above so that we are more correct.
19124
19125 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19126
19127         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19128         to perform all checks for a method with a params parameter.
19129
19130         (Invocation::OverloadResolve): Update to use the above method and therefore
19131         cope correctly with params method invocations.
19132
19133         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19134         params too.
19135
19136         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19137         constructors in our parent too because we can't afford to miss out on 
19138         protected ones ;-)
19139
19140         * attribute.cs (AttributeSection): New name for the class Attribute
19141
19142         Other trivial changes to improve readability.
19143
19144         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19145         use the new class names.
19146
19147 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19148
19149         * class.cs (Method::Define): Complete definition for params types too
19150
19151         (Indexer::Define): Ditto.
19152
19153         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19154         Cope everywhere with a request for info about the array parameter.
19155
19156 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19157
19158         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19159
19160         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19161         local_variable_type to extract the string corresponding to the type.
19162
19163         (local_variable_type): Fixup the action to use the new helper method.
19164
19165         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19166         go.
19167
19168         * expression.cs : Clean out code which uses the above.
19169
19170 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19171
19172         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19173         and bale out if necessary by returning a false.
19174
19175         (RegisterProperty): Ditto.
19176
19177         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19178         and print out appropriate error messages.
19179
19180         * interface.cs (everywhere): Ditto.
19181
19182         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19183         location to constructor.
19184
19185         * class.cs (Property, Event, Indexer): Update accordingly.
19186
19187         * ../errors/cs111.cs : Added.
19188
19189         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19190         of a method, as laid down by the spec.
19191
19192         (Invocation::OverloadResolve): Use the above method.
19193
19194 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19195
19196         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19197         now take a TypeContainer and a Parameters object.
19198
19199         (ParameterData): Modify return type of ParameterModifier method to be 
19200         Parameter.Modifier and not a string.
19201
19202         (ReflectionParameters, InternalParameters): Update accordingly.
19203
19204         * expression.cs (Argument::GetParameterModifier): Same here.
19205
19206         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19207         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19208         symbol in it at all so maybe this is only for now.
19209
19210 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19211
19212         * support.cs (InternalParameters): Constructor now takes an extra argument 
19213         which is the actual Parameters class.
19214
19215         (ParameterDesc): Update to provide info on ref/out modifiers.
19216
19217         * class.cs (everywhere): Update call to InternalParameters to pass in
19218         the second argument too.
19219
19220         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19221         to return the modifier info [ref/out etc]
19222
19223         (InternalParameters, ReflectionParameters): Implement the above.
19224
19225         * expression.cs (Argument::ParameterModifier): Similar function to return
19226         info about the argument's modifiers.
19227
19228         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19229         too.
19230
19231         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19232         a new SetFormalParameters object which we pass to InternalParameters.
19233
19234 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19235
19236         * expression.cs (NewArray): Merge into the ArrayCreation class.
19237
19238 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19239
19240         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19241         NewUserdefinedArray into one as there wasn't much of a use in having
19242         two separate ones.
19243
19244         * expression.cs (Argument): Change field's name to ArgType from Type.
19245
19246         (Type): New readonly property which returns the proper type, taking into 
19247         account ref/out modifiers.
19248
19249         (everywhere): Adjust code accordingly for the above.
19250
19251         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19252         whether we are emitting for a ref or out parameter.
19253
19254         * expression.cs (Argument::Emit): Use the above field to set the state.
19255
19256         (LocalVariableReference::Emit): Update to honour the flag and emit the
19257         right stuff.
19258
19259         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19260
19261         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19262
19263         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19264
19265         (ReflectionParameters, InternalParameters): Implement the above method.
19266
19267         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19268         reporting errors.
19269
19270         (Invocation::FullMethodDesc): Ditto. 
19271
19272 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19273
19274         * cs-parser.jay: Add extra production for the second form of array
19275         creation. 
19276
19277         * expression.cs (ArrayCreation): Update to reflect the above
19278         change. 
19279
19280         * Small changes to prepare for Array initialization.
19281
19282 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19283
19284         * typemanager.cs (ImplementsInterface): interface might be null;
19285         Deal with this problem;
19286
19287         Also, we do store negative hits on the cache (null values), so use
19288         this instead of calling t.GetInterfaces on the type everytime.
19289
19290 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19291
19292         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19293
19294         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19295         split functionality out into different classes.
19296
19297         (New::FormArrayType): Move into NewBuiltinArray.
19298
19299         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19300         quite useless.
19301
19302         (NewBuiltinArray): New class to handle creation of built-in arrays.
19303
19304         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19305         account creation of one-dimensional arrays.
19306
19307         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19308
19309         (NewUserdefinedArray::DoResolve): Implement.
19310
19311         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19312
19313         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19314         we maintain inside the TypeManager. This is necessary to perform lookups on the
19315         module builder.
19316
19317         (LookupType): Update to perform GetType on the module builders too.     
19318
19319         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19320
19321         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19322
19323 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19324
19325         * expression.cs (New::DoResolve): Implement guts of array creation.
19326
19327         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19328
19329 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19330
19331         * expression.cs: Fix bug I introduced lsat night that broke
19332         Delegates. 
19333
19334         (Expression.Resolve): Report a 246 error (can not resolve name)
19335         if we find a SimpleName in the stream.
19336
19337         (Expression.ResolveLValue): Ditto.
19338
19339         (Expression.ResolveWithSimpleName): This function is a variant of
19340         ResolveName, this one allows SimpleNames to be returned without a
19341         warning.  The only consumer of SimpleNames is MemberAccess
19342
19343 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19346         might arrive here.  I have my doubts that this is correct.
19347
19348         * statement.cs (Lock): Implement lock statement.
19349
19350         * cs-parser.jay: Small fixes to support `lock' and `using'
19351
19352         * cs-tokenizer.cs: Remove extra space
19353
19354         * driver.cs: New flag --checked, allows to turn on integer math
19355         checking. 
19356
19357         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19358         Threading.Monitor.Exit 
19359
19360 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19363         Expression Class to be IndexerAccess.
19364
19365         Notice that Indexer::DoResolve sets the eclass to Value.
19366
19367 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19368
19369         * class.cs (TypeContainer::Emit): Emit code for indexers.
19370
19371         * assign.cs (IAssignMethod): New interface implemented by Indexers
19372         and Properties for handling assignment.
19373
19374         (Assign::Emit): Simplify and reuse code. 
19375
19376         * expression.cs (IndexerAccess, PropertyExpr): Implement
19377         IAssignMethod, clean up old code. 
19378
19379 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19380
19381         * typemanager.cs (ImplementsInterface): New method to determine if a type
19382         implements a given interface. Provides a nice cache too.
19383
19384         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19385         method.
19386
19387         (ConvertReferenceExplicit): Ditto.
19388
19389         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19390         various methods, with correct names etc.
19391
19392         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19393         Operator.UnaryNegation.
19394
19395         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19396         we have a unary plus or minus operator.
19397
19398         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19399         UnaryMinus.
19400
19401         * everywhere : update accordingly.
19402
19403         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19404         respectively.
19405
19406         * class.cs (Method::Define): For the case where we are implementing a method
19407         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19408         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19409
19410 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19411
19412         * interface.cs (FindMembers): Implement to work around S.R.E
19413         lameness.
19414
19415         * typemanager.cs (IsInterfaceType): Implement.
19416
19417         (FindMembers): Update to handle interface types too.
19418
19419         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19420         use IsAssignableFrom as that is not correct - it doesn't work.
19421
19422         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19423         and accordingly override EmitStatement.
19424
19425         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19426         using the correct logic :-)
19427
19428 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19429
19430         * ../errors/cs-11.cs : Add to demonstrate error -11 
19431
19432 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19433
19434         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19435         then pass this as a hint to ResolveLValue.
19436
19437         * expression.cs (FieldExpr): Add Location information
19438
19439         (FieldExpr::LValueResolve): Report assignment to readonly
19440         variable. 
19441
19442         (Expression::ExprClassFromMemberInfo): Pass location information.
19443
19444         (Expression::ResolveLValue): Add new method that resolves an
19445         LValue. 
19446
19447         (Expression::DoResolveLValue): Default invocation calls
19448         DoResolve. 
19449
19450         (Indexers): New class used to keep track of indexers in a given
19451         Type. 
19452
19453         (IStackStore): Renamed from LValue, as it did not really describe
19454         what this did.  Also ResolveLValue is gone from this interface and
19455         now is part of Expression.
19456
19457         (ElementAccess): Depending on the element access type
19458
19459         * typemanager.cs: Add `indexer_name_type' as a Core type
19460         (System.Runtime.CompilerServices.IndexerNameAttribute)
19461
19462         * statement.cs (Goto): Take a location.
19463
19464 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19465
19466         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19467         if two delegates are compatible.
19468
19469         (NewDelegate::DoResolve): Update to take care of the case when
19470         we instantiate a delegate from another delegate.
19471
19472         * typemanager.cs (FindMembers): Don't even try to look up members
19473         of Delegate types for now.
19474
19475 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19476
19477         * delegate.cs (NewDelegate): New class to take care of delegate
19478         instantiation.
19479
19480         * expression.cs (New): Split the delegate related code out into 
19481         the NewDelegate class.
19482
19483         * delegate.cs (DelegateInvocation): New class to handle delegate 
19484         invocation.
19485
19486         * expression.cs (Invocation): Split out delegate related code into
19487         the DelegateInvocation class.
19488
19489 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19490
19491         * expression.cs (New::DoResolve): Implement delegate creation fully
19492         and according to the spec.
19493
19494         (New::DoEmit): Update to handle delegates differently.
19495
19496         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19497         because of which we were printing out arguments in reverse order !
19498
19499         * delegate.cs (VerifyMethod): Implement to check if the given method
19500         matches the delegate.
19501
19502         (FullDelegateDesc): Implement.
19503
19504         (VerifyApplicability): Implement.
19505
19506         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19507         delegate invocations too.
19508
19509         (Invocation::Emit): Ditto.
19510
19511         * ../errors/cs1593.cs : Added.
19512
19513         * ../errors/cs1594.cs : Added.
19514
19515         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19516
19517 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19518
19519         * typemanager.cs (intptr_type): Core type for System.IntPtr
19520
19521         (InitCoreTypes): Update for the same.
19522
19523         (iasyncresult_type, asynccallback_type): Ditto.
19524
19525         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19526         correct.
19527
19528         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19529         too.
19530
19531         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19532         the builders for the 4 members of a delegate type :-)
19533
19534         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19535         type.
19536
19537         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19538
19539         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19540
19541 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19542
19543         * statement.cs (Break::Emit): Implement.   
19544         (Continue::Emit): Implement.
19545
19546         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19547         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19548         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19549         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19550         end loop
19551
19552         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19553         properties that track the label for the current loop (begin of the
19554         loop and end of the loop).
19555
19556 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19557
19558         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19559         use of emitting anything at all.
19560
19561         * class.cs, rootcontext.cs : Get rid of calls to the same.
19562
19563         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19564
19565         (Populate): Define the constructor correctly and set the implementation
19566         attributes.
19567
19568         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19569         have been defined.
19570
19571         (AddDelegateType): Implement.
19572
19573         (IsDelegateType): Implement helper method.
19574
19575         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19576
19577         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19578         and accordingly handle it.
19579
19580         * delegate.cs (Populate): Take TypeContainer argument.
19581         Implement bits to define the Invoke method. However, I still haven't figured out
19582         how to take care of the native int bit :-(
19583
19584         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19585         Qualify the name of the delegate, not its return type !
19586
19587         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19588         conversion.
19589
19590         (StandardConversionExists): Checking for array types turns out to be recursive.
19591
19592         (ConvertReferenceExplicit): Implement array conversion.
19593
19594         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19595
19596 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19597
19598         * cs-parser.jay (delegate_declaration): Store the fully qualified
19599         name as it is a type declaration.
19600
19601         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19602         readonly.
19603
19604         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19605         as TypeContainer::DefineType.
19606
19607         (Populate): Method in which all the definition of the various methods (Invoke)
19608         etc is done.
19609
19610         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19611         see.
19612
19613         (CloseDelegate): Finally creates the delegate.
19614
19615         * class.cs (TypeContainer::DefineType): Update to define delegates.
19616         (Populate, Emit and CloseType): Do the same thing here too.
19617
19618         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19619         delegates in all these operations.
19620
19621 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19622
19623         * expression.cs: LocalTemporary: a new expression used to
19624         reference a temporary that has been created.
19625
19626         * assign.cs: Handle PropertyAccess back here, so that we can
19627         provide the proper semantic access to properties.
19628
19629         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19630         a few more explicit conversions. 
19631
19632         * modifiers.cs: `NEW' modifier maps to HideBySig.
19633
19634         * expression.cs (PropertyExpr): Make this into an
19635         ExpressionStatement, and support the EmitStatement code path. 
19636
19637         Perform get/set error checking, clean up the interface.
19638
19639         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19640         them into toplevel access objects.
19641
19642 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19643
19644         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19645         SRE.
19646
19647         * typemanager.cs: Keep track here of our PropertyBuilders again to
19648         work around lameness in SRE.
19649
19650 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19651
19652         * expression.cs (LValue::LValueResolve): New method in the
19653         interface, used to perform a second resolution pass for LValues. 
19654
19655         (This::DoResolve): Catch the use of this in static methods.
19656
19657         (This::LValueResolve): Implement.
19658
19659         (This::Store): Remove warning, assigning to `this' in structures
19660         is 
19661
19662         (Invocation::Emit): Deal with invocation of
19663         methods on value types.  We need to pass the address to structure
19664         methods rather than the object itself.  (The equivalent code to
19665         emit "this" for structures leaves the entire structure on the
19666         stack instead of a pointer to it). 
19667
19668         (ParameterReference::DoResolve): Compute the real index for the
19669         argument based on whether the method takes or not a `this' pointer
19670         (ie, the method is static).
19671
19672         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19673         value types returned from functions when we need to invoke a
19674         method on the sturcture.
19675
19676
19677 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19678
19679         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19680         defining the type in the Modulebuilder or Typebuilder. This is to take
19681         care of nested types which need to be defined on the TypeBuilder using
19682         DefineNestedMethod.
19683
19684         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19685         methods in RootContext, only ported to be part of TypeContainer.
19686
19687         (TypeContainer::GetInterfaceOrClass): Ditto.
19688
19689         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19690
19691         * interface.cs (Interface::DefineInterface): New method. Does exactly
19692         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19693         too.
19694
19695         (Interface::GetInterfaces): Move from RootContext here and port.
19696
19697         (Interface::GetInterfaceByName): Same here.
19698
19699         * rootcontext.cs (ResolveTree): Re-write.
19700
19701         (PopulateTypes): Re-write.
19702
19703         * class.cs (TypeContainer::Populate): Populate nested types too.
19704         (TypeContainer::Emit): Emit nested members too.
19705
19706         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19707         instead just use the name argument passed in as it is already fully
19708         qualified.
19709
19710         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19711         to TypeContainer mapping to see if a type is user-defined.
19712
19713         * class.cs (TypeContainer::CloseType): Implement. 
19714
19715         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19716         the default constructor.
19717
19718         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19719         twice.
19720
19721         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19722
19723         * interface.cs (CloseType): Create the type here.
19724
19725         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19726         the hierarchy.
19727
19728         Remove all the methods which are now in TypeContainer.
19729
19730 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19731
19732         * delegate.cs (Define): Re-write bits to define the delegate
19733         correctly.
19734
19735 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19738
19739         * expression.cs (ImplicitReferenceConversion): handle null as well
19740         as a source to convert to any reference type.
19741
19742         * statement.cs (Return): Perform any implicit conversions to
19743         expected return type.  
19744
19745         Validate use of return statement.  
19746
19747         * codegen.cs (EmitContext): Pass the expected return type here.
19748
19749         * class.cs (Method, Constructor, Property): Pass expected return
19750         type to EmitContext.
19751
19752 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * expression.cs: Make DoResolve take an EmitContext instead of a
19755         TypeContainer.
19756
19757         Replaced `l' and `location' for `loc', for consistency.
19758
19759         (Error, Warning): Remove unneeded Tc argument.
19760
19761         * assign.cs, literal.cs, constant.cs: Update to new calling
19762         convention. 
19763
19764         * codegen.cs: EmitContext now contains a flag indicating whether
19765         code is being generated in a static method or not.
19766
19767         * cs-parser.jay: DecomposeQI, new function that replaces the old
19768         QualifiedIdentifier.  Now we always decompose the assembled
19769         strings from qualified_identifier productions into a group of
19770         memberaccesses.
19771
19772 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * rootcontext.cs: Deal with field-less struct types correctly now
19775         by passing the size option to Define Type.
19776
19777         * class.cs: Removed hack that created one static field. 
19778
19779 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * statement.cs: Moved most of the code generation here. 
19782
19783 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19784
19785         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19786         seem very right.
19787
19788         (ElementAccess): Remove useless bits for now - keep checks as the spec
19789         says.
19790
19791 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19792
19793         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19794         and start performing checks according to the spec.
19795
19796 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19797
19798         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19799         rank_specifiers instead.
19800
19801         (rank_specifiers): Change the order in which the rank specifiers are stored
19802
19803         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19804
19805         * expression.cs (ElementAccess): Implement the LValue interface too.
19806
19807 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19808
19809         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19810         except that user defined conversions are not included.
19811
19812         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19813         perform the conversion of the return type, if necessary.
19814
19815         (New::DoResolve): Check whether we are creating an array or an object
19816         and accordingly do the needful.
19817
19818         (New::Emit): Same here.
19819
19820         (New::DoResolve): Implement guts of array creation.
19821
19822         (New::FormLookupType): Helper function.
19823
19824 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * codegen.cs: Removed most of the code generation here, and move the
19827         corresponding code generation bits to the statement classes. 
19828
19829         Added support for try/catch/finalize and throw.
19830
19831         * cs-parser.jay: Added support for try/catch/finalize.
19832
19833         * class.cs: Catch static methods having the flags override,
19834         virtual or abstract.
19835
19836         * expression.cs (UserCast): This user cast was not really doing
19837         what it was supposed to do.  Which is to be born in fully resolved
19838         state.  Parts of the resolution were being performed at Emit time! 
19839
19840         Fixed this code.
19841
19842 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19843
19844         * expression.cs: Implicity convert the result from UserCast.
19845
19846 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19847
19848         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19849         prevented it from working correctly. 
19850
19851         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19852         merely ConvertImplicit.
19853
19854 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19855
19856         * typemanager.cs: Make the LookupTypeContainer function static,
19857         and not per-instance.  
19858
19859         * class.cs: Make static FindMembers (the one that takes a Type
19860         argument). 
19861
19862         * codegen.cs: Add EmitForeach here.
19863
19864         * cs-parser.jay: Make foreach a toplevel object instead of the
19865         inline expansion, as we need to perform semantic analysis on it. 
19866
19867 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19868
19869         * expression.cs (Expression::ImplicitUserConversion): Rename to
19870         UserDefinedConversion.
19871
19872         (Expression::UserDefinedConversion): Take an extra argument specifying 
19873         whether we look for explicit user conversions too.
19874
19875         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19876
19877         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19878
19879         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19880         with the appropriate arguments.
19881
19882         * cs-parser.jay (cast_expression): Record location too.
19883
19884         * expression.cs (Cast): Record location info.
19885
19886         (Expression::ConvertExplicit): Take location argument.
19887
19888         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19889         to determine if we are doing explicit conversions.
19890
19891         (UserCast::Emit): Update accordingly.
19892
19893         (Expression::ConvertExplicit): Report an error if everything fails.
19894
19895         * ../errors/cs0030.cs : Add.
19896
19897 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19898
19899         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19900         virtual and newslot bits. 
19901
19902         * class.cs (TypeContainer::RegisterRequiredImplementations):
19903         Record methods we need.
19904
19905         (TypeContainer::MakeKey): Helper function to make keys for
19906         MethodBases, since the Methodbase key is useless.
19907
19908         (TypeContainer::Populate): Call RegisterRequiredImplementations
19909         before defining the methods.   
19910
19911         Create a mapping for method_builders_to_methods ahead of time
19912         instead of inside a tight loop.
19913
19914         (::RequireMethods):  Accept an object as the data to set into the
19915         hashtable so we can report interface vs abstract method mismatch.
19916
19917 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19918
19919         * report.cs: Make all of it static.
19920
19921         * rootcontext.cs: Drop object_type and value_type computations, as
19922         we have those in the TypeManager anyways.
19923
19924         Drop report instance variable too, now it is a global.
19925
19926         * driver.cs: Use try/catch on command line handling.
19927
19928         Add --probe option to debug the error reporting system with a test
19929         suite. 
19930
19931         * report.cs: Add support for exiting program when a probe
19932         condition is reached.
19933
19934 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19935
19936         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19937         we do a forcible conversion regardless of type, to check if 
19938         ForceConversion returns a null.
19939
19940         (Binary::error19): Use location to report error.
19941
19942         (Unary::error23): Use location here too.
19943
19944         * ../errors/cs0019.cs : Check in.
19945
19946         * ../errors/cs0023.cs : Check in.
19947
19948         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19949         case of a non-null MethodInfo object with a length of 0 !
19950
19951         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19952         an applicable member - according to the spec :-)
19953         Also fix logic to find members in base types.
19954
19955         (Unary::ResolveOperator): Same here.
19956
19957         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19958         as I was getting thoroughly confused between this and error19 :-)
19959
19960         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19961         (::FindMostEncompassedType): Implement.
19962         (::FindMostEncompassingType): Implement.
19963         (::StandardConversionExists): Implement.
19964
19965         (UserImplicitCast): Re-vamp. We now need info about most specific
19966         source and target types so that we can do the necessary conversions.
19967
19968         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19969         mathematical union with no duplicates.
19970
19971 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19972
19973         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19974         in order from base classes to child classes, so that we can in
19975         child classes look up in our parent for method names and
19976         attributes (required for handling abstract, virtual, new, override
19977         constructs: we need to instrospect our base class, and if we dont
19978         populate the classes in order, the introspection might be
19979         incorrect.  For example, a method could query its parent before
19980         the parent has any methods and would determine that the parent has
19981         no abstract methods (while it could have had them)).
19982
19983         (RootContext::CreateType): Record the order in which we define the
19984         classes.
19985
19986 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19987
19988         * class.cs (TypeContainer::Populate): Also method definitions can
19989         fail now, keep track of this.
19990
19991         (TypeContainer::FindMembers): Implement support for
19992         DeclaredOnly/noDeclaredOnly flag.
19993
19994         (Constructor::Emit) Return the ConstructorBuilder.
19995
19996         (Method::Emit) Return the MethodBuilder. 
19997         Check for abstract or virtual methods to be public.
19998
19999         * rootcontext.cs (RootContext::CreateType): Register all the
20000         abstract methods required for the class to be complete and the
20001         interface methods that must be implemented. 
20002
20003         * cs-parser.jay: Report error 501 (method requires body if it is
20004         not marked abstract or extern).
20005
20006         * expression.cs (TypeOf::Emit): Implement.
20007
20008         * typemanager.cs: runtime_handle_type, new global type.
20009
20010         * class.cs (Property::Emit): Generate code for properties.
20011
20012 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20013
20014         * expression.cs (Unary::ResolveOperator): Find operators on base type
20015         too - we now conform exactly to the spec.
20016
20017         (Binary::ResolveOperator): Same here.
20018
20019         * class.cs (Operator::Define): Fix minor quirk in the tests.
20020
20021         * ../errors/cs0215.cs : Added.
20022
20023         * ../errors/cs0556.cs : Added.
20024
20025         * ../errors/cs0555.cs : Added.
20026
20027 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20030         single integer which is really efficient
20031
20032 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20033
20034         *  expression.cs (Expression::ImplicitUserConversion): Use location
20035         even in the case when we are examining True operators.
20036  
20037         * class.cs (Operator::Define): Perform extensive checks to conform
20038         with the rules for operator overloading in the spec.
20039
20040         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20041         some of the other conversions mentioned in the spec.
20042
20043         * typemanager.cs (array_type): New static member for the System.Array built-in
20044         type.
20045
20046         (cloneable_interface): For System.ICloneable interface.
20047
20048         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20049         we start resolving the tree and populating types.
20050
20051         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20052  
20053 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20054
20055         * expression.cs (Expression::ExprClassFromMemberInfo,
20056         Expression::Literalize): Create literal expressions from
20057         FieldInfos which are literals.
20058
20059         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20060         type casts, because they were wrong.  The test suite in tests
20061         caught these ones.
20062
20063         (ImplicitNumericConversion): ushort to ulong requires a widening
20064         cast. 
20065
20066         Int32 constant to long requires widening cast as well.
20067
20068         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20069         for integers because the type on the stack is not i4.
20070
20071 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * expression.cs (report118): require location argument. 
20074
20075         * parameter.cs: Do not dereference potential null value.
20076
20077         * class.cs: Catch methods that lack the `new' keyword when
20078         overriding a name.  Report warnings when `new' is used without
20079         anything being there to override.
20080
20081         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20082
20083         * class.cs: Only add constructor to hashtable if it is non-null
20084         (as now constructors can fail on define).
20085
20086         (TypeManager, Class, Struct): Take location arguments.
20087
20088         Catch field instance initialization in structs as errors.
20089
20090         accepting_filter: a new filter for FindMembers that is static so
20091         that we dont create an instance per invocation.
20092
20093         (Constructor::Define): Catch errors where a struct constructor is
20094         parameterless 
20095
20096         * cs-parser.jay: Pass location information for various new
20097         constructs. 
20098
20099         * delegate.cs (Delegate): take a location argument.
20100
20101         * driver.cs: Do not call EmitCode if there were problesm in the
20102         Definition of the types, as many Builders wont be there. 
20103
20104         * decl.cs (Decl::Decl): Require a location argument.
20105
20106         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20107         into integers, and find the most appropiate integer for it.
20108
20109         * literal.cs: Implement ULongLiteral.
20110
20111         * rootcontext.cs: Provide better information about the location of
20112         failure when CreateType fails.
20113
20114 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20117         as well.
20118
20119         * expression.cs (Binary::CheckShiftArguments): Add missing type
20120         computation.
20121         (Binary::ResolveOperator): Add type to the logical and and logical
20122         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20123         before.
20124
20125         (Binary::DoNumericPromotions): In the case where either argument
20126         is ulong (and most signed types combined with ulong cause an
20127         error) perform implicit integer constant conversions as well.
20128
20129 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20130
20131         * expression.cs (UserImplicitCast): Method should always be
20132         non-null. 
20133         (Invocation::BetterConversion): Simplified test for IntLiteral.
20134
20135         (Expression::ImplicitNumericConversion): Split this routine out.
20136         Put the code that performs implicit constant integer conversions
20137         here. 
20138
20139         (Expression::Resolve): Become a wrapper around DoResolve so we can
20140         check eclass and type being set after resolve.
20141
20142         (Invocation::Badness): Remove this dead function
20143
20144         (Binary::ResolveOperator): Do not compute the expensive argumnets
20145         unless we have a union for it.
20146
20147         (Probe::Emit): Is needs to do an isinst and then
20148         compare against null.
20149
20150         (::CanConvert): Added Location argument.  If the Location argument
20151         is null (Location.Null), then we do not report errors.  This is
20152         used by the `probe' mechanism of the Explicit conversion.  We do
20153         not want to generate an error for something that the user
20154         explicitly requested to be casted.  But the pipeline for an
20155         explicit cast first tests for potential implicit casts.
20156
20157         So for now, if the Location is null, it means `Probe only' to
20158         avoid adding another argument.   Might have to revise this
20159         strategy later.
20160
20161         (ClassCast): New class used to type cast objects into arbitrary
20162         classes (used in Explicit Reference Conversions).
20163
20164         Implement `as' as well.
20165
20166         Reverted all the patches from Ravi below: they were broken:
20167
20168                 * The use of `level' as a mechanism to stop recursive
20169                   invocations is wrong.  That was there just to catch the
20170                   bug with a strack trace but not as a way of addressing
20171                   the problem.
20172
20173                   To fix the problem we have to *understand* what is going
20174                   on and the interactions and come up with a plan, not
20175                   just get things going.
20176
20177                 * The use of the type conversion cache that I proposed
20178                   last night had an open topic: How does this work across
20179                   protection domains.  A user defined conversion might not
20180                   be public in the location where we are applying the
20181                   conversion, a different conversion might be selected
20182                   (ie, private A->B (better) but public B->A (worse),
20183                   inside A, A->B applies, but outside it, B->A will
20184                   apply).
20185
20186                 * On top of that (ie, even if the above is solved),
20187                   conversions in a cache need to be abstract.  Ie, `To
20188                   convert from an Int to a Short use an OpcodeCast', not
20189                   `To convert from an Int to a Short use the OpcodeCast on
20190                   the variable 5' (which is what this patch was doing).
20191
20192 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20193
20194         * expression.cs (Invocation::ConversionExists): Re-write to use
20195         the conversion cache
20196
20197         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20198         cache all conversions done, not just user-defined ones.
20199
20200         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20201         to determine if a conversion exists instead of acutually trying to 
20202         perform the conversion. It's faster too.
20203
20204         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20205         and only then attempt the implicit conversion.
20206
20207 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20208
20209         * expression.cs (ConvertImplicit): Use a cache for conversions
20210         already found. Check level of recursion and bail out if necessary.
20211
20212 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20213
20214         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20215         Export standard methods that we expect for string operations.
20216
20217         * statement.cs (Block::UsageWarning): Track usage of variables and
20218         report the errors for not used variables.
20219
20220         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20221         operator. 
20222
20223 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * codegen.cs: remove unnneded code 
20226
20227         * expression.cs: Removed BuiltinTypeAccess class
20228
20229         Fix the order in which implicit conversions are
20230         done.  
20231
20232         The previous fixed dropped support for boxed conversions (adding a
20233         test to the test suite now)
20234
20235         (UserImplicitCast::CanConvert): Remove test for source being null,
20236         that code is broken.  We should not feed a null to begin with, if
20237         we do, then we should track the bug where the problem originates
20238         and not try to cover it up here.
20239
20240         Return a resolved expression of type UserImplicitCast on success
20241         rather than true/false.  Ravi: this is what I was talking about,
20242         the pattern is to use a static method as a "constructor" for
20243         objects. 
20244
20245         Also, do not create arguments until the very last minute,
20246         otherwise we always create the arguments even for lookups that
20247         will never be performed. 
20248
20249         (UserImplicitCast::Resolve): Eliminate, objects of type
20250         UserImplicitCast are born in a fully resolved state. 
20251
20252         * typemanager.cs (InitCoreTypes): Init also value_type
20253         (System.ValueType). 
20254
20255         * expression.cs (Cast::Resolve): First resolve the child expression.
20256
20257         (LValue): Add new method AddressOf to be used by
20258         the `&' operator.  
20259
20260         Change the argument of Store to take an EmitContext instead of an
20261         ILGenerator, because things like FieldExpr need to be able to call
20262         their children expression to generate the instance code. 
20263
20264         (Expression::Error, Expression::Warning): Sugar functions for
20265         reporting errors.
20266
20267         (Expression::MemberLookup): Accept a TypeContainer instead of a
20268         Report as the first argument.
20269
20270         (Expression::ResolvePrimary): Killed.  I still want to improve
20271         this as currently the code is just not right.
20272
20273         (Expression::ResolveMemberAccess): Simplify, but it is still
20274         wrong. 
20275
20276         (Unary::Resolve): Catch errors in AddressOf operators.
20277
20278         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20279         index to a byte for the short-version, or the compiler will choose
20280         the wrong Emit call, which generates the wrong data.
20281
20282         (ParameterReference::Emit, ::Store): same.
20283
20284         (FieldExpr::AddressOf): Implement.
20285
20286         * typemanager.cs: TypeManager: made public variable instead of
20287         property.
20288
20289         * driver.cs: document --fatal.
20290
20291         * report.cs (ErrorMessage, WarningMessage): new names for the old
20292         Error and Warning classes.
20293
20294         * cs-parser.jay (member_access): Turn built-in access to types
20295         into a normal simplename
20296
20297 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20298
20299         * expression.cs (Invocation::BetterConversion): Fix to cope
20300         with q being null, since this was introducing a bug.
20301
20302         * expression.cs (ConvertImplicit): Do built-in conversions first.
20303
20304 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20305
20306         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20307
20308 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20309
20310         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20311         I had introduced long ago (what's new ?).
20312
20313         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20314         the work of all the checking. 
20315         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20316         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20317
20318         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20319         that is the right way. 
20320
20321         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20322         overloading resolution. Use everywhere instead of cutting and pasting code.
20323
20324         (Binary::ResolveOperator): Use MakeUnionSet.
20325
20326         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20327         we have to convert to bool types. Not complete yet.
20328
20329 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * typemanager.cs (TypeManager::CSharpName): support ushort.
20332
20333         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20334         to provide an expression that performsn an implicit constant int
20335         conversion (section 6.1.6).
20336         (Expression::ConvertImplicitRequired): Reworked to include
20337         implicit constant expression conversions.
20338
20339         (Expression::ConvertNumericExplicit): Finished.
20340
20341         (Invocation::Emit): If InstanceExpression is null, then it means
20342         that we perform a call on this.
20343
20344 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20345
20346         * expression.cs (Unary::Emit): Remove some dead code.
20347         (Probe): Implement Resolve and Emit for `is'.
20348         (Expression::ConvertImplicitRequired): Attempt to do constant
20349         expression conversions here.  Maybe should be moved to
20350         ConvertImplicit, but I am not sure.
20351         (Expression::ImplicitLongConstantConversionPossible,
20352         Expression::ImplicitIntConstantConversionPossible): New functions
20353         that tell whether is it possible to apply an implicit constant
20354         expression conversion.
20355
20356         (ConvertNumericExplicit): Started work on explicit numeric
20357         conversions.
20358
20359         * cs-parser.jay: Update operator constants.
20360
20361         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20362         (Parameters::GetSignature): Hook up VerifyArgs here.
20363         (Parameters::VerifyArgs): Verifies that no two arguments have the
20364         same name. 
20365
20366         * class.cs (Operator): Update the operator names to reflect the
20367         ones that the spec expects (as we are just stringizing the
20368         operator names).
20369
20370         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20371         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20372         previous usage did only work for our methods.
20373         (Expression::ConvertImplicit): Handle decimal implicit numeric
20374         conversions as well.
20375         (Expression::InternalTypeConstructor): Used to invoke constructors
20376         on internal types for default promotions.
20377
20378         (Unary::Emit): Implement special handling for the pre/post
20379         increment/decrement for overloaded operators, as they need to have
20380         the same semantics as the other operators.
20381
20382         (Binary::ResolveOperator): ditto.
20383         (Invocation::ConversionExists): ditto.
20384         (UserImplicitCast::Resolve): ditto.
20385
20386 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20387
20388         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20389         operator, return after emitting body. Regression tests pass again !
20390
20391         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20392         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20393         (Invocation::OverloadResolve): Ditto.
20394         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20395
20396         * everywhere : update calls to the above methods accordingly.
20397
20398 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20401
20402         * expression.cs (ExpressionStatement): New base class used for
20403         expressions that can appear in statements, so that we can provide
20404         an alternate path to generate expression that do not leave a value
20405         on the stack.
20406
20407         (Expression::Emit, and all the derivatives): We no longer return
20408         whether a value is left on the stack or not.  Every expression
20409         after being emitted leaves a single value on the stack.
20410
20411         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20412         facilties of ExpressionStatement if possible.
20413
20414         * cs-parser.jay: Update statement_expression.
20415
20416 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20417
20418         * driver.cs: Change the wording of message
20419
20420 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20421
20422         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20423         the type of the expression to the return type of the method if
20424         we have an overloaded operator match ! The regression tests pass again !
20425         (Unary::ResolveOperator): Ditto.
20426
20427         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20428         to find "op_Implicit", not "implicit" ;-)
20429         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20430         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20431
20432         * everywhere : Correct calls to the above accordingly.
20433
20434         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20435         (ConvertImplicit): Do user-defined conversion if it exists.
20436
20437 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20438
20439         * assign.cs: track location.
20440         (Resolve): Use implicit conversions on assignment.
20441
20442         * literal.cs: Oops.  Not good, Emit of short access values should
20443         pass (Bytes) or the wrong argument will be selected.
20444
20445         * expression.cs (Unary::Emit): Emit code for -expr.
20446
20447         (Unary::ResolveOperator): Handle `Substract' for non-constants
20448         (substract from zero from the non-constants).
20449         Deal with Doubles as well. 
20450
20451         (Expression::ConvertImplicitRequired): New routine that reports an
20452         error if no implicit conversion exists. 
20453
20454         (Invocation::OverloadResolve): Store the converted implicit
20455         expressions if we make them
20456
20457 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20458
20459         * class.cs (ConstructorInitializer): Take a Location argument.
20460         (ConstructorBaseInitializer): Same here.
20461         (ConstructorThisInitializer): Same here.
20462
20463         * cs-parser.jay : Update all calls accordingly.
20464
20465         * expression.cs (Unary, Binary, New): Take location argument.
20466         Update accordingly everywhere.
20467
20468         * cs-parser.jay : Update all calls to the above to take a location
20469         argument.
20470
20471         * class.cs : Ditto.
20472
20473 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20474
20475         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20476         (Invocation::BetterConversion): Same here
20477         (Invocation::ConversionExists): Ditto.
20478
20479         (Invocation::ConversionExists): Implement.
20480
20481 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20482
20483         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20484         Also take an additional TypeContainer argument.
20485
20486         * All over : Pass in TypeContainer as argument to OverloadResolve.
20487
20488         * typemanager.cs (CSharpName): Update to check for the string type and return
20489         that too.
20490
20491         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20492         a given method.
20493
20494 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20495
20496         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20497         (Invocation::BetterFunction): Implement.
20498         (Invocation::BetterConversion): Implement.
20499         (Invocation::ConversionExists): Skeleton, no implementation yet.
20500
20501         Okay, things work fine !
20502
20503 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20504
20505         * typemanager.cs: declare and load enum_type, delegate_type and
20506         void_type. 
20507
20508         * expression.cs (Expression::Emit): Now emit returns a value that
20509         tells whether a value is left on the stack or not.  This strategy
20510         might be reveted tomorrow with a mechanism that would address
20511         multiple assignments.
20512         (Expression::report118): Utility routine to report mismatches on
20513         the ExprClass.
20514
20515         (Unary::Report23): Report impossible type/operator combination
20516         utility function.
20517
20518         (Unary::IsIncrementableNumber): Whether the type can be
20519         incremented or decremented with add.
20520         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20521         complemented. 
20522         (Unary::ResolveOperator): Implement ++, !, ~,
20523
20524         (Invocation::Emit): Deal with new Emit convetion.
20525
20526         * All Expression derivatives: Updated their Emit method to return
20527         whether they leave values on the stack or not.
20528
20529         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20530         stack for expressions that are statements. 
20531
20532 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * expression.cs (LValue): New interface.  Must be implemented by
20535         LValue objects.
20536         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20537         LValue interface.
20538
20539         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20540         interface for generating code, simplifies the code.
20541
20542 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20543
20544         * expression.cs (everywhere): Comment out return statements in ::Resolve
20545         methods to avoid the warnings.
20546
20547 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20548
20549         * driver.cs (parse): Report error 2001 if we can not open the
20550         source file.
20551
20552         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20553         not resolve it.
20554
20555         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20556         object. 
20557
20558         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20559         otherwise nested blocks end up with the same index.
20560
20561         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20562
20563         * expression.cs:  Instead of having FIXMEs in the Resolve
20564         functions, throw exceptions so it is obvious that we are facing a
20565         bug. 
20566
20567         * cs-parser.jay (invocation_expression): Pass Location information.
20568
20569         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20570         Use a basename for those routines because .NET does not like paths
20571         on them. 
20572
20573         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20574         already defined.
20575
20576 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20579         are loading the correct data types (throws an exception if not).
20580         (TypeManager::InitCoreTypes): Use CoreLookupType
20581
20582         * expression.cs (Unary::ResolveOperator): return the child
20583         expression for expressions which are just +expr.
20584         (Unary::ResolveOperator): Return negative literals for -LITERAL
20585         expressions (otherwise they are Unary {Literal}).
20586         (Invocation::Badness): Take into account `Implicit constant
20587         expression conversions'.
20588
20589         * literal.cs (LongLiteral): Implement long literal class.
20590         (IntLiteral): export the `Value' of the intliteral. 
20591
20592 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20593
20594         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20595
20596         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20597         instead of 'Operator'
20598
20599         * expression.cs (Binary::ResolveOperator): Update accordingly.
20600         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20601         and 'Minus'
20602
20603         * cs-parser.jay (unary_expression): Update to use the new names.
20604
20605         * gen-treedump.cs (GetUnary): Same here.
20606
20607         * expression.cs (Unary::Resolve): Implement.
20608         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20609         operators are found instead of making noise ;-)
20610         (Unary::ResolveOperator): New method to do precisely the same thing which
20611         Binary::ResolveOperator does for Binary expressions.
20612         (Unary.method, .Arguments): Add.
20613         (Unary::OperName): Implement.   
20614         (Unary::ForceConversion): Copy and Paste !
20615
20616         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20617         a unary operator.
20618
20619         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20620         for the inbuilt operators. Only overloading works for now ;-)
20621
20622 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20623
20624         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20625         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20626
20627         * expression.cs (This::Emit): Implement. 
20628         (This::Resolve): Implement.
20629         (TypeOf:Resolve): Implement.
20630         (Expression::ResolveSimpleName): Add an implicit this to instance
20631         field references. 
20632         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20633         Bind instance variable to Field expressions.
20634         (FieldExpr::Instance): New field used to track the expression that
20635         represents the object instance.
20636         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20637         binding 
20638         (FieldExpr::Emit): Implement.
20639
20640         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20641         the last instruction contains a return opcode to avoid generating
20642         the last `ret' instruction (this generates correct code, and it is
20643         nice to pass the peverify output).
20644
20645         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20646         initializer for static and instance variables.
20647         (Constructor::Emit): Allow initializer to be null in the case of
20648         static constructors.  Only emit initializer for instance
20649         constructors. 
20650
20651         (TypeContainer::FindMembers): Return a null array if there are no
20652         matches.
20653
20654         Also fix the code for the MemberTypes.Method branch, as it was not
20655         scanning that for operators (or tried to access null variables before).
20656
20657         * assign.cs (Assign::Emit): Handle instance and static fields. 
20658
20659         * TODO: Updated.
20660
20661         * driver.cs: Stop compilation if there are parse errors.
20662
20663         * cs-parser.jay (constructor_declaration): Provide default base
20664         initializer for non-static constructors.
20665         (constructor_declarator): Do not provide a default base
20666         initializers if none was specified.
20667         Catch the fact that constructors should not have parameters.
20668
20669         * class.cs: Do not emit parent class initializers for static
20670         constructors, that should be flagged as an error.
20671
20672 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20673
20674         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20675         Move back code into TypeContainer::Populate.
20676
20677 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20678
20679         * class.cs (TypeContainer::AddConstructor): Fix the check to
20680         compare against Name, not Basename. 
20681         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20682
20683         * cs-parser.jay : Update accordingly.
20684
20685         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20686         for methods, don't forget to look into the operators too.
20687         (RegisterMethodBuilder): Helper method to take care of this for
20688         methods, constructors and operators.
20689         (Operator::Define): Completely revamp.
20690         (Operator.OperatorMethod, MethodName): New fields.
20691         (TypeContainer::Populate): Move the registering of builders into
20692         RegisterMethodBuilder.
20693         (Operator::Emit): Re-write.
20694
20695         * expression.cs (Binary::Emit): Comment out code path to emit method
20696         invocation stuff for the case when we have a user defined operator. I am
20697         just not able to get it right !
20698
20699 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20700
20701         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20702         argument. 
20703
20704         (Expression::MemberLookup): Provide a version that allows to
20705         specify the MemberTypes and BindingFlags. 
20706
20707         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20708         so it was not fetching variable information from outer blocks.
20709
20710         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20711         Beforefieldinit as it was buggy.
20712
20713         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20714         that Ravi put here.  
20715
20716         * class.cs (Constructor::Emit): Only emit if block is not null.
20717         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20718         deal with this by semantically definining it as if the user had
20719         done it.
20720
20721         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20722         constructors as we now "emit" them at a higher level.
20723
20724         (TypeContainer::DefineDefaultConstructor): Used to define the
20725         default constructors if none was provided.
20726
20727         (ConstructorInitializer): Add methods Resolve and Emit. 
20728
20729         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20730
20731 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20732
20733         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20734         the default constructor builder with our hashtable for methodbuilders
20735         to methodcores.
20736
20737         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20738         and argument_count is 0 in which case we have a match.
20739         (Binary::ResolveOperator): More null checking and miscellaneous coding
20740         style cleanup.
20741
20742 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20743
20744         * rootcontext.cs (IsNameSpace): Compare against null.
20745
20746         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20747
20748         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20749         and Unary::Operator.
20750
20751         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20752         accordingly.
20753
20754         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20755         we have overloaded operators.
20756         (Binary::ResolveOperator): Implement the part which does the operator overload
20757         resolution.
20758
20759         * class.cs (Operator::Emit): Implement.
20760         (TypeContainer::Emit): Emit the operators we have too.
20761
20762         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20763         the case when we have a user-defined operator.
20764
20765 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20766
20767         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20768
20769 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20770
20771         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20772         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20773         (Constructor::Emit): Implement.
20774         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20775         if we have no work to do. 
20776         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20777         Emit method.
20778
20779         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20780         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20781
20782         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20783         of parent.parent.
20784
20785 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20786
20787         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20788         in the source.
20789         (Tree::RecordNamespace): Method to do what the name says ;-)
20790         (Tree::Namespaces): Property to get at the namespaces hashtable.
20791
20792         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20793         keep track.
20794
20795         * rootcontext.cs (IsNamespace): Fixed it :-)
20796
20797 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * class.cs (TypeContainer::FindMembers): Add support for
20800         constructors. 
20801         (MethodCore): New class that encapsulates both the shared aspects
20802         of a Constructor and a Method.  
20803         (Method, Constructor): Factored pieces into MethodCore.
20804
20805         * driver.cs: Added --fatal which makes errors throw exceptions.
20806         Load System assembly as well as part of the standard library.
20807
20808         * report.cs: Allow throwing exceptions on errors for debugging.
20809
20810         * modifiers.cs: Do not use `parent', instead use the real type
20811         container to evaluate permission settings.
20812
20813         * class.cs: Put Ravi's patch back in.  He is right, and we will
20814         have to cope with the
20815
20816 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20817
20818         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20819         FamORAssem, not FamANDAssem.
20820
20821 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * driver.cs: Added --parse option that only parses its input files
20824         and terminates.
20825
20826         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20827         incorrect.  IsTopLevel is not used to tell whether an object is
20828         root_types or not (that can be achieved by testing this ==
20829         root_types).  But to see if this is a top-level *class* (not
20830         necessarly our "toplevel" container). 
20831
20832 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20833
20834         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20835         parent instead of a direct call to GetType.
20836
20837 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20838
20839         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20840         Modifiers.TypeAttr. This should just be a call to that method.
20841
20842         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20843         object so that we can determine if we are top-level or not.
20844
20845         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20846         TypeContainer too.
20847
20848         * enum.cs (Enum::Define): Ditto.
20849
20850         * modifiers.cs (FieldAttr): Re-write.
20851
20852         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20853         (TypeContainer::HaveStaticConstructor): New property to provide access
20854         to precisely that info.
20855
20856         * modifiers.cs (MethodAttr): Re-write.
20857         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20858
20859         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20860         of top-level types as claimed.
20861
20862 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20863
20864         * expression.cs (MemberLookup): Fruitless attempt to lookup
20865         constructors.  Maybe I need to emit default constructors?  That
20866         might be it (currently .NET emits this for me automatically).
20867         (Invocation::OverloadResolve): Cope with Arguments == null.
20868         (Invocation::EmitArguments): new function, shared by the new
20869         constructor and us.
20870         (Invocation::Emit): Handle static and instance methods.  Emit
20871         proper call instruction for virtual or non-virtual invocations.
20872         (New::Emit): Implement.
20873         (New::Resolve): Implement.
20874         (MemberAccess:Resolve): Implement.
20875         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20876         to track instances.
20877         (FieldExpr::Resolve): Set type.
20878
20879         * support.cs: Handle empty arguments.
20880                 
20881         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20882         SimpleLookup): Auxiliary routines to help parse a qualifier
20883         identifier.  
20884
20885         Update qualifier_identifier rule.
20886
20887         * codegen.cs: Removed debugging messages.
20888
20889         * class.cs: Make this a global thing, this acts just as a "key" to
20890         objects that we might have around.
20891
20892         (Populate): Only initialize method_builders_to_methods once.
20893
20894         * expression.cs (PropertyExpr): Initialize type from the
20895         PropertyType. 
20896
20897         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20898         Resolve pattern.  Attempt to implicitly convert value to boolean.
20899         Emit code.
20900
20901         * expression.cs: Set the type for the int32/int32 argument case.
20902         (Binary::ResolveOperator): Set the return type to boolean for
20903         comparission operators
20904
20905         * typemanager.cs: Remove debugging print code.
20906
20907         (Invocation::Resolve): resolve type.
20908
20909         * class.cs: Allocate a MemberInfo of the correct size, as the code
20910         elsewhere depends on the test to reflect the correct contents.
20911
20912         (Method::) Keep track of parameters, due to System.Reflection holes
20913
20914         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20915         mapping here.
20916
20917         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20918         of the exact size and return that.
20919
20920         (Class::LookupMethodByBuilder): New function that maps
20921         MethodBuilders to its methods.  Required to locate the information
20922         on methods because System.Reflection bit us again.
20923
20924         * support.cs: New file, contains an interface ParameterData and
20925         two implementations: ReflectionParameters and InternalParameters
20926         used to access Parameter information.  We will need to grow this
20927         as required.
20928
20929         * expression.cs (Invocation::GetParameterData): implement a cache
20930         and a wrapper around the ParameterData creation for methods. 
20931         (Invocation::OverloadResolve): Use new code.
20932
20933 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20934
20935         * class.cs (TypeContainer::EmitField): Remove and move into 
20936         (Field::Define): here and modify accordingly.
20937         (Field.FieldBuilder): New member.
20938         (TypeContainer::Populate): Update accordingly.
20939         (TypeContainer::FindMembers): Implement.
20940
20941 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20942
20943         * statement.cs: (VariableInfo::VariableType): New field to be
20944         initialized with the full type once it is resolved. 
20945
20946 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20947
20948         * parameter.cs (GetParameterInfo): Use a type cache to compute
20949         things only once, and to reuse this information
20950
20951         * expression.cs (LocalVariableReference::Emit): Implement.
20952         (OpcodeCast::Emit): fix.
20953
20954         (ParameterReference::Resolve): Implement.
20955         (ParameterReference::Emit): Implement.
20956
20957         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20958         that are expressions need to stay as Expressions.
20959
20960         * typemanager.cs (CSharpName): Returns the C# name of a type if
20961         possible. 
20962
20963         * expression.cs (Expression::ConvertImplicit): New function that
20964         implements implicit type conversions.
20965
20966         (Expression::ImplicitReferenceConversion): Implements implicit
20967         reference conversions.
20968
20969         (EmptyCast): New type for transparent casts.
20970
20971         (OpcodeCast): New type for casts of types that are performed with
20972         a sequence of bytecodes.
20973
20974         (BoxedCast): New type used for casting value types into reference
20975         types.  Emits a box opcode.
20976
20977         (Binary::DoNumericPromotions): Implements numeric promotions of
20978         and computation of the Binary::Type.
20979
20980         (Binary::EmitBranchable): Optimization.
20981
20982         (Binary::Emit): Implement code emission for expressions.
20983
20984         * typemanager.cs (TypeManager): Added two new core types: sbyte
20985         and byte.
20986
20987 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20988
20989         * class.cs (TypeContainer::FindMembers): Method which does exactly
20990         what Type.FindMembers does, only we don't have to use reflection. No
20991         implementation yet.
20992
20993         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20994         typecontainer objects as we need to get at them.
20995         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20996
20997         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20998         typecontainer object.
20999
21000         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21001         of just a Report object.
21002
21003 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21004
21005         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21006         "remove_"
21007         (TypeContainer::Populate): Now define the delegates of the type too.
21008         (TypeContainer.Delegates): Property to access the list of delegates defined
21009         in the type.
21010
21011         * delegates.cs (Delegate::Define): Implement partially.
21012
21013         * modifiers.cs (TypeAttr): Handle more flags.
21014
21015 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21016
21017         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21018         and not <=
21019         (Operator::Define): Re-write logic to get types by using the LookupType method
21020         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21021         (Indexer::Define): Ditto.
21022         (Event::Define): Ditto.
21023         (Property::Define): Ditto.
21024
21025 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21026
21027         * class.cs (TypeContainer::Populate): Now define operators too. 
21028         (TypeContainer.Operators): New property to access the list of operators
21029         in a type.
21030         (Operator.OperatorMethodBuilder): New member to hold the method builder
21031         for the operator we are defining.
21032         (Operator::Define): Implement.
21033
21034 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21035
21036         * class.cs (Event::Define): Make the prefixes of the accessor methods
21037         addOn_ and removeOn_ 
21038
21039         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21040         of the location being passed in too. Ideally, this should go later since all
21041         error reporting should be done through the Report object.
21042
21043         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21044         (Populate): Iterate thru the indexers we have and define them too.
21045         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21046         for the get and set accessors.
21047         (Indexer::Define): Implement.
21048
21049 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21050
21051         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21052         my previous implementation, did not work.
21053
21054         * typemanager.cs: Add a couple of missing types (the longs).
21055
21056         * literal.cs: Use TypeManager.bool_type instead of getting it.
21057
21058         * expression.cs (EventExpr): New kind of expressions.
21059         (Expressio::ExprClassFromMemberInfo): finish
21060
21061 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21062
21063         * assign.cs: Emit stores to static fields differently.
21064
21065 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21066
21067         * Merge in changes and adjust code to tackle conflicts. Backed out my
21068         code in Assign::Resolve ;-) 
21069
21070 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21071
21072         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21073         instead Report.Error and also pass in the location.
21074         (CSharpParser::Lexer): New readonly property to return the reference
21075         to the Tokenizer object.
21076         (declare_local_variables): Use Report.Error with location instead of plain 
21077         old error.
21078         (CheckDef): Ditto.
21079
21080         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21081         (Operator.CheckBinaryOperator): Ditto.
21082
21083         * cs-parser.jay (operator_declarator): Update accordingly.
21084
21085         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21086         (CheckBinaryOperator): Same here.
21087
21088         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21089         on the name without any prefixes of namespace names etc. This is because we
21090         already might have something already fully qualified like 
21091         'System.Console.WriteLine'
21092
21093         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21094
21095 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21096
21097         * cs-tokenizer.cs (location): Return a string which also contains
21098         the file name.
21099
21100         * expression.cs (ElementAccess): New class for expressions of the
21101         type 'element access.'
21102         (BaseAccess): New class for expressions of the type 'base access.'
21103         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21104         respectively.
21105
21106         * cs-parser.jay (element_access): Implement action.
21107         (base_access): Implement actions.
21108         (checked_expression, unchecked_expression): Implement.
21109
21110         * cs-parser.jay (local_variable_type): Correct and implement.
21111         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21112
21113         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21114
21115         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21116         name and the specifiers.
21117
21118         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21119
21120         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21121         making them all public ;-)
21122
21123         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21124         class anyways.
21125
21126 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21127
21128         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21129         PropertyExprs.
21130         (FieldExpr, PropertyExprs): New resolved expressions.
21131         (SimpleName::MemberStaticCheck): Perform static checks for access
21132         to non-static fields on static methods. Maybe this should be
21133         generalized for MemberAccesses. 
21134         (SimpleName::ResolveSimpleName): More work on simple name
21135         resolution. 
21136
21137         * cs-parser.jay (primary_expression/qualified_identifier): track
21138         the parameter index.
21139
21140         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21141         (EmitContext::EmitBoolExpression): Chain to expression generation
21142         instead of temporary hack.
21143         (::EmitStatementExpression): Put generic expression code generation.
21144
21145         * assign.cs (Assign::Emit): Implement variable assignments to
21146         local variables, parameters and fields.
21147
21148 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21149
21150         * statement.cs (Block::GetVariableInfo): New method, returns the
21151         VariableInfo for a variable name in a block.
21152         (Block::GetVariableType): Implement in terms of GetVariableInfo
21153
21154         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21155         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21156
21157 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21158
21159         * cs-parser.jay (operator_declaration): Continue on my quest : update
21160         to take attributes argument.
21161         (event_declaration): Ditto.
21162         (enum_declaration): Ditto.
21163         (indexer_declaration): Ditto.
21164
21165         * class.cs (Operator::Operator): Update constructor accordingly.
21166         (Event::Event): Ditto.
21167
21168         * delegate.cs (Delegate::Delegate): Same here.
21169
21170         * enum.cs (Enum::Enum): Same here.
21171
21172 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21173
21174         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21175
21176         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21177
21178         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21179         being passed around as an arraylist.
21180         (Attributes::AddAttribute): Method to add attribute sections.
21181
21182         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21183         (struct_declaration): Update accordingly.
21184         (constant_declaration): Update.
21185         (field_declaration): Update.
21186         (method_header): Update.
21187         (fixed_parameter): Update.
21188         (parameter_array): Ditto.
21189         (property_declaration): Ditto.
21190         (destructor_declaration): Ditto.
21191
21192         * class.cs (Struct::Struct): Update constructors accordingly.
21193         (Class::Class): Ditto.
21194         (Field::Field): Ditto.
21195         (Method::Method): Ditto.
21196         (Property::Property): Ditto.
21197         (TypeContainer::OptAttribute): update property's return type.
21198
21199         * interface.cs (Interface.opt_attributes): New member.
21200         (Interface::Interface): Update to take the extra Attributes argument.
21201
21202         * parameter.cs (Parameter::Parameter): Ditto.
21203
21204         * constant.cs (Constant::Constant): Ditto.
21205
21206         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21207         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21208         the attributes as a parameter.
21209         (InterfaceProperty): Update constructor call.
21210         (InterfaceEvent): Ditto.
21211         (InterfaceMethod): Ditto.
21212         (InterfaceIndexer): Ditto.
21213
21214         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21215         pass the attributes too.
21216         (interface_event_declaration): Ditto.
21217         (interface_property_declaration): Ditto.
21218         (interface_method_declaration): Ditto.
21219         (interface_declaration): Ditto.
21220
21221 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21222
21223         * class.cs (Method::Define): Track the "static Main" definition to
21224         create an entry point. 
21225
21226         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21227         EntryPoint if we find it. 
21228
21229         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21230         (EmitContext::ig): Make this variable public.
21231
21232         * driver.cs: Make the default output file be the first file name
21233         with the .exe extension.  
21234
21235         Detect empty compilations
21236
21237         Handle various kinds of output targets.  Handle --target and
21238         rename -t to --dumper.
21239
21240         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21241         methods inherited from Expression return now an Expression.  This
21242         will is used during the tree rewriting as we resolve them during
21243         semantic analysis.
21244
21245         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21246         the spec.  Missing entirely is the information about
21247         accessability of elements of it.
21248
21249         (Expression::ExprClassFromMemberInfo): New constructor for
21250         Expressions that creates a fully initialized Expression based on
21251         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21252         a Type.
21253
21254         (Invocation::Resolve): Begin implementing resolution of invocations.
21255
21256         * literal.cs (StringLiteral):  Implement Emit.
21257
21258 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21259
21260         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21261         member.
21262
21263 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21264
21265         * cs-parser.jay (attribute_arguments): Implement actions.
21266         (attribute): Fix bug in production. Implement action.
21267         (attribute_list): Implement.
21268         (attribute_target): Implement.
21269         (attribute_target_specifier, opt_target_specifier): Implement
21270         (CheckAttributeTarget): New method to check if the attribute target
21271         is valid.
21272         (attribute_section): Implement.
21273         (opt_attributes): Implement.
21274
21275         * attribute.cs : New file to handle attributes.
21276         (Attribute): Class to hold attribute info.
21277
21278         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21279         (attribute_section): Modify production to use 2 different rules to 
21280         achieve the same thing. 1 s/r conflict down !
21281         Clean out commented, useless, non-reducing dimension_separator rules.
21282
21283         * class.cs (TypeContainer.attributes): New member to hold list
21284         of attributes for a type.
21285         (Struct::Struct): Modify to take one more argument, the attribute list.
21286         (Class::Class): Ditto.
21287         (Field::Field): Ditto.
21288         (Method::Method): Ditto.
21289         (Property::Property): Ditto.
21290
21291         * cs-parser.jay (struct_declaration): Update constructor call to
21292         pass in the attributes too.
21293         (class_declaration): Ditto.
21294         (constant_declaration): Ditto.
21295         (field_declaration): Ditto.
21296         (method_header): Ditto.
21297         (fixed_parameter): Ditto.
21298         (parameter_array): Ditto.
21299         (property_declaration): Ditto.
21300
21301         * constant.cs (Constant::Constant): Update constructor similarly.
21302         Use System.Collections.
21303
21304         * parameter.cs (Parameter::Parameter): Update as above.
21305
21306 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21307
21308         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21309         (TypeContainer.delegates): New member to hold list of delegates.
21310
21311         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21312         this time as I seem to be on crack ;-)
21313
21314 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21317         tell whether an identifier represents a namespace.
21318
21319         * expression.cs (NamespaceExpr): A namespace expression, used only
21320         temporarly during expression resolution.
21321         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21322         utility functions to resolve names on expressions.
21323
21324 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21325
21326         * codegen.cs: Add hook for StatementExpressions. 
21327
21328         * class.cs: Fix inverted test for static flag in methods.
21329
21330 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21331
21332         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21333         to make it coincide with MS' number.
21334         (Operator::CheckBinaryOperator): Ditto.
21335
21336         * ../errors/errors.txt : Remove error numbers added earlier.
21337
21338         * ../errors/cs1019.cs : Test case for error # 1019
21339
21340         * ../errros/cs1020.cs : Test case for error # 1020
21341
21342         * cs-parser.jay : Clean out commented cruft.
21343         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21344         used anywhere - non-reducing rule.
21345         (namespace_declarations): Non-reducing rule - comment out.
21346
21347         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21348         with TypeContainer::AddEnum.
21349
21350         * delegate.cs : New file for delegate handling classes.
21351         (Delegate): Class for declaring delegates.
21352
21353         * makefile : Update.
21354
21355         * cs-parser.jay (delegate_declaration): Implement.
21356
21357 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21358
21359         * class.cs (Event::Define): Implement.
21360         (Event.EventBuilder): New member.
21361
21362         * class.cs (TypeContainer::Populate): Update to define all enums and events
21363         we have.
21364         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21365         readonly fields for all these cases ?
21366
21367 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21368
21369         * class.cs (Property): Revamp to use the convention of making fields readonly.
21370         Accordingly modify code elsewhere.
21371
21372         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21373         the Define method of the Property class.
21374
21375         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21376         trivial bug.
21377         (TypeContainer::Populate): Update to define all the properties we have. Also
21378         define all enumerations.
21379
21380         * enum.cs (Define): Implement.
21381
21382 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21383
21384         * cs-parser.jay (overloadable_operator): The semantic value is an
21385         enum of the Operator class.
21386         (operator_declarator): Implement actions.
21387         (operator_declaration): Implement.
21388
21389         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21390         validity of definitions.
21391         (Operator::CheckBinaryOperator): Static method to check for binary operators
21392         (TypeContainer::AddOperator): New method to add an operator to a type.
21393
21394         * cs-parser.jay (indexer_declaration): Added line to actually call the
21395         AddIndexer method so it gets added ;-)
21396
21397         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21398         already taken care of by the MS compiler ?  
21399
21400 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21401
21402         * class.cs (Operator): New class for operator declarations.
21403         (Operator::OpType): Enum for the various operators.
21404
21405 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21406
21407         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21408         ostensibly handle this in semantic analysis.
21409
21410         * cs-parser.jay (general_catch_clause): Comment out
21411         (specific_catch_clauses, specific_catch_clause): Ditto.
21412         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21413         (catch_args, opt_catch_args): New productions.
21414         (catch_clause): Rewrite to use the new productions above
21415         (catch_clauses): Modify accordingly.
21416         (opt_catch_clauses): New production to use in try_statement
21417         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21418         and re-write the code in the actions to extract the specific and
21419         general catch clauses by being a little smart ;-)
21420
21421         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21422         Hooray, try and catch statements parse fine !
21423
21424 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21425
21426         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21427         string from the hashtable of variables.
21428
21429         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21430         I end up making that mistake ;-)
21431         (catch_clauses): Fixed gross error which made Key and Value of the 
21432         DictionaryEntry the same : $1 !!
21433
21434 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21435
21436         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21437
21438         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21439         when the add and remove accessors are specified. 
21440
21441 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21442
21443         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21444         information about indexer_declarator.
21445         (indexer_declarator): Implement actions.
21446         (parsing_indexer): New local boolean used to keep track of whether
21447         we are parsing indexers or properties. This is necessary because 
21448         implicit_parameters come into picture even for the get accessor in the 
21449         case of an indexer.
21450         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21451
21452         * class.cs (Indexer): New class for indexer declarations.
21453         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21454         (TypeContainer::indexers): New member to hold list of indexers for the
21455         type.
21456
21457 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21458
21459         * cs-parser.jay (add_accessor_declaration): Implement action.
21460         (remove_accessor_declaration): Implement action.
21461         (event_accessors_declaration): Implement
21462         (variable_declarators): swap statements for first rule - trivial.
21463
21464         * class.cs (Event): New class to hold information about event
21465         declarations.
21466         (TypeContainer::AddEvent): New method to add an event to a type
21467         (TypeContainer::events): New member to hold list of events.
21468
21469         * cs-parser.jay (event_declaration): Implement actions.
21470
21471 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21472
21473         * cs-parser.jay (dim_separators): Implement. Make it a string
21474         concatenating all the commas together, just as they appear.
21475         (opt_dim_separators): Modify accordingly
21476         (rank_specifiers): Update accordingly. Basically do the same
21477         thing - instead, collect the brackets here.
21478         (opt_rank_sepcifiers): Modify accordingly.
21479         (array_type): Modify to actually return the complete type string
21480         instead of ignoring the rank_specifiers.
21481         (expression_list): Implement to collect the expressions
21482         (variable_initializer): Implement. We make it a list of expressions
21483         essentially so that we can handle the array_initializer case neatly too.
21484         (variable_initializer_list): Implement.
21485         (array_initializer): Make it a list of variable_initializers
21486         (opt_array_initializer): Modify accordingly.
21487
21488         * expression.cs (New::NType): Add enumeration to help us
21489         keep track of whether we have an object/delegate creation
21490         or an array creation.
21491         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21492         members to hold data about array creation.
21493         (New:New): Modify to update NewType
21494         (New:New): New Overloaded contructor for the array creation
21495         case.
21496
21497         * cs-parser.jay (array_creation_expression): Implement to call
21498         the overloaded New constructor.
21499
21500 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21501
21502         * class.cs (TypeContainer::Constructors): Return member
21503         constructors instead of returning null.
21504
21505 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21506
21507         * typemanager.cs (InitCoreTypes): Initialize the various core
21508         types after we have populated the type manager with the user
21509         defined types (this distinction will be important later while
21510         compiling corlib.dll)
21511
21512         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21513         on Expression Classification.  Now all expressions have a method
21514         `Resolve' and a method `Emit'.
21515
21516         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21517         generation from working.     Also add some temporary debugging
21518         code. 
21519
21520 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * codegen.cs: Lots of code generation pieces.  This is only the
21523         beginning, will continue tomorrow with more touches of polish.  We
21524         handle the fundamentals of if, while, do, for, return.  Others are
21525         trickier and I need to start working on invocations soon.
21526
21527         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21528         s.InitStatement. 
21529
21530         * codegen.cs (EmitContext): New struct, used during code
21531         emission to keep a context.   Most of the code generation will be
21532         here. 
21533
21534         * cs-parser.jay: Add embedded blocks to the list of statements of
21535         this block.  So code generation proceeds in a top down fashion.
21536
21537 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21538
21539         * statement.cs: Add support for multiple child blocks.
21540
21541 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21542
21543         * codegen.cs (EmitCode): New function, will emit the code for a
21544         Block of code given a TypeContainer and its ILGenerator. 
21545
21546         * statement.cs (Block): Standard public readonly optimization.
21547         (Block::Block constructors): Link children. 
21548         (Block::Child): Child Linker.
21549         (Block::EmitVariables): Emits IL variable declarations.
21550
21551         * class.cs: Drop support for MethodGroups here, delay until
21552         Semantic Analysis.
21553         (Method::): Applied the same simplification that I did before, and
21554         move from Properties to public readonly fields.
21555         (Method::ParameterTypes): Returns the parameter types for the
21556         function, and implements a cache that will be useful later when I
21557         do error checking and the semantic analysis on the methods is
21558         performed.
21559         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21560         and made a method, optional argument tells whether this is a class
21561         or a structure to apply the `has-this' bit.
21562         (Method::GetCallingConvention): Implement, returns the calling
21563         convention. 
21564         (Method::Define): Defines the type, a second pass is performed
21565         later to populate the methods.
21566
21567         (Constructor::ParameterTypes): implement a cache similar to the
21568         one on Method::ParameterTypes, useful later when we do semantic
21569         analysis. 
21570
21571         (TypeContainer::EmitMethod):  New method.  Emits methods.
21572
21573         * expression.cs: Removed MethodGroup class from here.
21574
21575         * parameter.cs (Parameters::GetCallingConvention): new method.
21576
21577 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * class.cs (TypeContainer::Populate): Drop RootContext from the
21580         argument. 
21581
21582         (Constructor::CallingConvention): Returns the calling convention.
21583         (Constructor::ParameterTypes): Returns the constructor parameter
21584         types. 
21585
21586         (TypeContainer::AddConstructor): Keep track of default constructor
21587         and the default static constructor.
21588
21589         (Constructor::) Another class that starts using `public readonly'
21590         instead of properties. 
21591
21592         (Constructor::IsDefault): Whether this is a default constructor. 
21593
21594         (Field::) use readonly public fields instead of properties also.
21595
21596         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21597         track of static constructors;  If none is used, turn on
21598         BeforeFieldInit in the TypeAttributes. 
21599
21600         * cs-parser.jay (opt_argument_list): now the return can be null
21601         for the cases where there are no arguments. 
21602
21603         (constructor_declarator): If there is no implicit `base' or
21604         `this', then invoke the default parent constructor. 
21605
21606         * modifiers.cs (MethodAttr): New static function maps a set of
21607         modifiers flags into a MethodAttributes enum
21608         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21609         MethodAttr, TypeAttr to represent the various mappings where the
21610         modifiers are used.
21611         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21612
21613 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21614
21615         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21616         method arguments.
21617
21618         * interface.cs (PopulateIndexer): Implemented the code generator
21619         for interface indexers.
21620
21621 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * interface.cs (InterfaceMemberBase): Now we track the new status
21624         here.  
21625
21626         (PopulateProperty): Implement property population.  Woohoo!  Got
21627         Methods and Properties going today. 
21628
21629         Removed all the properties for interfaces, and replaced them with
21630         `public readonly' fields. 
21631
21632 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21635         initialize their hashtables/arraylists only when they are needed
21636         instead of doing this always.
21637
21638         * parameter.cs: Handle refs and out parameters.
21639
21640         * cs-parser.jay: Use an ArrayList to construct the arguments
21641         instead of the ParameterCollection, and then cast that to a
21642         Parameter[] array.
21643
21644         * parameter.cs: Drop the use of ParameterCollection and use
21645         instead arrays of Parameters.
21646
21647         (GetParameterInfo): Use the Type, not the Name when resolving
21648         types. 
21649
21650 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21653         and instead use public readonly fields.
21654
21655         * class.cs: Put back walking code for type containers.
21656
21657 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21658
21659         * class.cs (MakeConstant): Code to define constants.
21660
21661         * rootcontext.cs (LookupType): New function.  Used to locate types 
21662
21663
21664 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21665
21666         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21667         this System.Reflection code is.  Kudos to Microsoft
21668
21669         * typemanager.cs: Implement a type cache and avoid loading all
21670         types at boot time.  Wrap in LookupType the internals.  This made
21671         the compiler so much faster.  Wow.  I rule!
21672
21673         * driver.cs: Make sure we always load mscorlib first (for
21674         debugging purposes, nothing really important).
21675
21676         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21677         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21678
21679         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21680         on namespaces that have been imported using the `using' keyword.
21681
21682         * class.cs (TypeContainer::TypeAttr): Virtualize.
21683         (Class::TypeAttr): Return attributes suitable for this bad boy.
21684         (Struct::TypeAttr): ditto.
21685         Handle nested classes.
21686         (TypeContainer::) Remove all the type visiting code, it is now
21687         replaced with the rootcontext.cs code
21688
21689         * rootcontext.cs (GetClassBases): Added support for structs. 
21690
21691 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21692
21693         * interface.cs, statement.cs, class.cs, parameter.cs,
21694         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21695         Drop use of TypeRefs, and use strings instead.
21696
21697 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21698
21699         * rootcontext.cs: 
21700
21701         * class.cs (Struct::Struct): set the SEALED flags after
21702         checking the modifiers.
21703         (TypeContainer::TypeAttr): new property, returns the
21704         TypeAttributes for a class.  
21705
21706         * cs-parser.jay (type_list): Oops, list production was creating a
21707         new list of base types.
21708
21709         * rootcontext.cs (StdLib): New property.
21710         (GetInterfaceTypeByName): returns an interface by type name, and
21711         encapsulates error handling here.
21712         (GetInterfaces): simplified.
21713         (ResolveTree): Encapsulated all the tree resolution here.
21714         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21715         types. 
21716
21717         * driver.cs: Add support for --nostdlib, to avoid loading the
21718         default assemblies.
21719         (Main): Do not put tree resolution here. 
21720
21721         * rootcontext.cs: Beginning of the class resolution.
21722
21723 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * rootcontext.cs: Provide better error reporting. 
21726
21727         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21728
21729         * rootcontext.cs (CreateInterface): Handle the case where there
21730         are no parent interfaces.
21731
21732         (CloseTypes): Routine to flush types at the end.
21733         (CreateInterface): Track types.
21734         (GetInterfaces): Returns an array of Types from the list of
21735         defined interfaces.
21736
21737         * typemanager.c (AddUserType): Mechanism to track user types (puts
21738         the type on the global type hash, and allows us to close it at the
21739         end). 
21740
21741 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21742
21743         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21744         RecordInterface instead.
21745
21746         * cs-parser.jay: Updated to reflect changes above.
21747
21748         * decl.cs (Definition): Keep track of the TypeBuilder type that
21749         represents this type here.  Not sure we will use it in the long
21750         run, but wont hurt for now.
21751
21752         * driver.cs: Smaller changes to accomodate the new code.
21753
21754         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21755         when done. 
21756
21757         * rootcontext.cs (CreateInterface):  New method, used to create
21758         the System.TypeBuilder type for interfaces.
21759         (ResolveInterfaces): new entry point to resolve the interface
21760         hierarchy. 
21761         (CodeGen): Property, used to keep track of the code generator.
21762
21763 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21764
21765         * cs-parser.jay: Add a second production for delegate_declaration
21766         with `VOID'.
21767
21768         (enum_body): Put an opt_comma here instead of putting it on
21769         enum_body or enum_member_declarations so we can handle trailing
21770         commas on enumeration members.  Gets rid of a shift/reduce.
21771
21772         (type_list): Need a COMMA in the middle.
21773
21774         (indexer_declaration): Tell tokenizer to recognize get/set
21775
21776         * Remove old targets.
21777
21778         * Re-add the parser target.
21779
21780 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21781
21782         * cs-parser.jay: Add precendence rules for a number of operators
21783         ot reduce the number of shift/reduce conflicts in the grammar.
21784
21785 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21786
21787         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21788         and put it here.
21789
21790         Get rid of old crufty code.
21791
21792         * rootcontext.cs: Use this to keep track of the parsed
21793         representation and the defined types available to the program. 
21794
21795         * gen-treedump.cs: adjust for new convention.
21796
21797         * type.cs: Split out the type manager, and the assembly builder
21798         from here. 
21799
21800         * typemanager.cs: the type manager will live here now.
21801
21802         * cil-codegen.cs: And the code generator here. 
21803
21804 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21805
21806         * makefile: Fixed up for easy making.
21807
21808 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21809
21810         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21811         the 
21812
21813         (unary_expression): Expand pre_increment_expression and
21814         post_decrement_expression to reduce a shift/reduce.
21815
21816 2001-07-11  Simon Cozens
21817
21818         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21819
21820         Improve allow_keyword_as_indent name.
21821
21822 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21823
21824         * Adjustments for Beta2. 
21825
21826 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21827
21828         * decl.cs: Added `Define' abstract method.
21829         (InTransit): new property, used to catch recursive definitions. 
21830
21831         * interface.cs: Implement `Define'. 
21832
21833         * modifiers.cs: Map Modifiers.constants to
21834         System.Reflection.TypeAttribute flags.
21835
21836         * class.cs: Keep track of types and user-defined types.
21837         (BuilderInit): New method for creating an assembly
21838         (ResolveType): New function to launch the resolution process, only
21839         used by interfaces for now.
21840
21841         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21842         that are inserted into the name space. 
21843
21844 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21845
21846         * ARGH.  I have screwed up my tree so many times due to the use of
21847         rsync rather than using CVS.  Going to fix this at once. 
21848
21849         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21850         load types.
21851
21852 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21853
21854         * Experiment successful: Use System.Type rather that our own
21855         version of Type.  
21856
21857 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * cs-parser.jay: Removed nsAliases from here.
21860
21861         Use new namespaces, handle `using XXX;' 
21862
21863         * namespace.cs: Reimplemented namespace handling, use a recursive
21864         definition of the class.  Now we can keep track of using clauses
21865         and catch invalid using clauses.
21866
21867 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21868
21869         * gen-treedump.cs: Adapted for all the renaming.
21870
21871         * expression.cs (Expression): this class now has a Type property
21872         which returns an expression Type.
21873
21874         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21875         `Type', as this has a different meaning now in the base
21876
21877 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21878
21879         * interface.cs, class.cs: Removed from all the sources the
21880         references to signature computation, as we can not do method
21881         signature computation during the parsing time, as we are not
21882         trying to solve at that point distinguishing:
21883
21884         class X {
21885                 void a (Blah x) {}
21886                 void a (NS.Blah x) {}
21887         }
21888
21889         Which depending on the context might be valid or not, as we do not
21890         know if Blah is the same thing as NS.Blah at that point.
21891
21892         * Redid everything so the code uses TypeRefs now instead of
21893         Types.  TypeRefs are just temporary type placeholders, that need
21894         to be resolved.  They initially have a pointer to a string and the
21895         current scope in which they are used.  This is used later by the
21896         compiler to resolve the reference to an actual Type. 
21897
21898         * DeclSpace is no longer a CIR.Type, and neither are
21899         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21900         are all DeclSpaces, but no Types. 
21901
21902         * type.cs (TypeRefManager): This implements the TypeRef manager,
21903         which keeps track of all the types that need to be resolved after
21904         the parsing has finished. 
21905
21906 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21907
21908         * ARGH.  We are going to have to store `foreach' as a class rather
21909         than resolving it, as we need to verify error 1579 after name
21910         resolution.   *OR* we could keep a flag that says `This request to
21911         IEnumerator comes from a foreach statement' which we can then use
21912         to generate the error.
21913
21914 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21915
21916         * class.cs (TypeContainer.AddMethod): we now add methods to the
21917         MethodGroup instead of the method hashtable.  
21918
21919         * expression.cs: Add MethodGroup abstraction, which gets us one
21920         step closer to the specification in the way we handle method
21921         declarations.  
21922
21923         * cs-parser.jay (primary_expression): qualified_identifier now
21924         tried to match up an identifier to a local variable reference or
21925         to a parameter reference.
21926
21927         current_local_parameters is now a parser global variable that
21928         points to the current parameters for the block, used during name
21929         lookup.
21930
21931         (property_declaration): Now creates an implicit `value' argument to
21932         the set accessor.
21933
21934 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21935
21936         * parameter.cs: Do not use `param' arguments as part of the
21937         signature, per the spec.
21938
21939 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * decl.cs: Base class for classes, structs and interfaces.  This
21942         is the "Declaration Space" 
21943
21944         * cs-parser.jay: Use CheckDef for checking declaration errors
21945         instead of having one on each function.
21946
21947         * class.cs: Factor out some code for handling error handling in
21948         accordance to the "Declarations" section in the "Basic Concepts"
21949         chapter in the ECMA C# spec.
21950
21951         * interface.cs: Make all interface member classes derive from
21952         InterfaceMemberBase.
21953
21954 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * Many things: all interfaces are parsed and generated in
21957         gen-treedump.  Support for member variables, constructors,
21958         destructors, properties, constants is there.
21959
21960         Beginning of the IL backend, but very little done, just there for
21961         testing purposes. 
21962
21963 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21964
21965         * cs-parser.jay: Fix labeled statement.
21966
21967         * cs-tokenizer.cs (escape): Escape " and ' always.
21968         ref_line, ref_name: keep track of the line/filename as instructed
21969         by #line by the compiler.
21970         Parse #line.
21971
21972 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21973
21974         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21975         to match the values in System.CodeDOM.
21976
21977         Divid renamed to Divide.
21978
21979         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21980         statements. 
21981         (Statements.set): remove.
21982
21983         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21984         statements. 
21985
21986         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21987         falseStatements always have valid values. 
21988
21989         * cs-parser.jay: Use System.CodeDOM now.
21990