revert code that doesn't compile
[mono.git] / mcs / mcs / ChangeLog
1 2007-01-28  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #80531
4         * anonymous.cs (ScopeInfo.InflateParameters): New.
5         (AnonymousContainer.Resolve): Use it to redirect types of
6         delegate parameters.
7
8 2007-01-27  Raja R Harinath  <rharinath@novell.com>
9
10         Fix #80530
11         * expression.cs (Error_InvalidArguments): Don't use two different
12         messages for CS1503.  Use ExtraInformation and
13         SymbolRelatedToPreviousError instead.
14
15         Fix #80358
16         * decl.cs (DeclSpace.initialize_type_params): Don't access
17         'type_params' of a partial class directly.
18
19 2007-01-26  Miguel de Icaza  <miguel@novell.com>
20
21         * constant.cs: Removed a handful of out-of-range checks that were
22         not necessary. 
23
24 2007-01-25  Marek Safar  <marek.safar@gmail.com>
25
26         * expression.cs (CheckUselessComparison): Add additional check for char
27         constants.
28
29         * namespace.cs: Fixed typo.
30
31 2007-01-23  Miguel de Icaza  <miguel@novell.com>
32
33         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
34         gone, instead we inline the test, preventing the needless casts to
35         longs, ulongs and doubles for the parameters, avoiding calls to
36         methods that overchecked stuff, and instead inlined things
37         nicely. 
38
39 2007-01-20  Marek Safar  <marek.safar@gmail.com>
40
41         * cs-parser.jay: Better parameter error handling.
42
43 2007-01-17  Marek Safar  <marek.safar@gmail.com>
44
45         A fix for bug #80368, #80522
46         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
47         whether array initializer contains constants only.
48         (ArrayCreation.Emit): Use better formula to decide when
49         are array initializers for static initialization.
50         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
51         have to emit even constants otherwise they are pre-initialized.
52
53 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
54             Raja R Harinath  <rharinath@novell.com>
55
56         Fix emit order of 'get' vs. 'set'.
57         * support.cs (Accessors): New.
58         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
59         Note the order in which accessors are declared in the source.
60         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
61         Refactored from Property.Define and Indexer.Define.
62         (PropertyBase.DefineAccessors): New helper that calls the above in
63         appropriate order as noted by the parser.
64         (Property.Define, Indexer.Define): Update to changes.
65         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
66
67 2007-01-17  Raja R Harinath  <rharinath@novell.com>
68
69         Fix cs0029-6.cs and gcs0029-2.cs (regression)
70         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
71         there's an implicit conversion from the current type to the target
72         type before converting the underlying constant.
73
74 2007-01-16  Marek Safar  <marek.safar@gmail.com>
75
76         * const.cs (ResolveValue): Updated after constant conversion was made more
77         generic.
78
79         * constant.cs (GetAttributableValue): constant to object conversion is
80         used for attributes only.
81         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
82         constant conversions.
83         (LongConstant.ConvertImplicitly): Ditto.
84
85         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
86         (ImplicitConversionStandard): Handle constant conversion as extra step.
87         It solves the issue when constant conversion was called indirectly like
88         inside array initializer and constant folding was skipped.
89
90         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
91         this change.
92
93         * statement.cs(ImplicitConversionStandard): Updated after constant
94         conversion was made more generic.
95
96 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
97
98         * expression.cs (As.DoResolve): Use GenericConstraints instead of
99         Constraints, solves the problem where the compiler incorrectly
100         reported that a type parameter was not constrained to a class (Bug
101         80518)
102
103 2007-01-14  Marek Habersack  <grendello@gmail.com>
104
105         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
106
107 2007-01-14  Marek Safar  <marek.safar@gmail.com>
108
109         A fix for bug #80368
110         * assign.cs (FieldInitializer): New class implements field
111         initializer statement.
112
113         * attribute.cs: Update after FieldMember rename.
114
115         * class.cs (PropertyBasedMember): New common class for property based
116         types.
117         (InterfaceMemberBase): New base class for all members which can be used as
118         an interface members.
119         (MethodCore): Moved really common code to InterfaceMemberBase.
120         (Method.Define): Equal and GetHasCode detection is relevant for methods
121         only.
122         (MethodData.Define): Don't assume that public event implements an
123         interface automatically.
124         (MethodData.DefineMethodBuilder): Issue an error even if only extern
125         modifier is used.
126         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
127         (FieldMember): Merged with FieldBase.
128         (EventProperty.AEventPropertyAccessor): New specialization to check whether
129         event extern modifier can be used.
130         (EventField.EventFieldAccessor): Moved event field specific code here.
131         (Event.AllowedModifiers): Even event can be extern.
132         (Event.FindOutBaseMethod): New override specific to events.
133         (Indexer.parameters): Reintroduce parameters because base class holds
134         only properties common data.
135         (Indexer.CheckForDuplications): Indexers are threated as methods so we
136         need do extra parameters check.
137
138         * const.cs: Update after FieldMember rename.
139
140         * decl.cs (MemberCache.FindBaseEvent): New method.
141
142         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
143         to reflect that indexer is now derived from PropertyBased.
144
145         * ecore.cs (GetMemberType): Made public.
146         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
147         obsolete event.
148
149         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
150         
151         * typemanager.cs (CSharpSignature): Correctly print event accessors.
152         (RegisterEvent): Removed.
153         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
154         (GetPrivateFieldOfEvent): Renamed to GetEventField.
155
156 2007-01-11  Raja R Harinath  <rharinath@novell.com>
157
158         Fix #80249
159         * statement.cs (CollectionForeach.TryType): Prefer generic
160         GetEnumerator over non-generic variant.  Fix code to follow comments.
161
162 2007-01-09  Raja R Harinath  <rharinath@novell.com>
163
164         Fix #80446
165         * support.cs (ReflectionParameter): Don't use an invalid index on
166         the generic parameter data.
167
168 2007-01-08  Miguel de Icaza  <miguel@novell.com>
169
170         * driver.cs: Just add a tiny bit of infrastructure.
171
172 2007-01-02  Marek Safar  <marek.safar@gmail.com>
173
174         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
175         where field type is struct from current assembly.
176         
177         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
178         it is possible.
179
180 2007-01-02  Marek Safar  <marek.safar@gmail.com>
181
182         A fix for bug #80381
183         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
184         the core types.
185
186         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
187         messages.
188         (Namespace.LookupType): Always use core types from corlib when speficied.
189
190         * report.cs: A new warning.
191
192         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
193         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
194         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
195
196         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
197         (InitCoreTypes): Set expression type of object_type and value_type
198         immediately after lookup.
199
200 2007-01-01  Miguel de Icaza  <miguel@novell.com>
201
202         * cs-tokenizer.cs: Accept Pc class characters (Connector
203         Punctuation) as valid identifiers.  Fixes #78259
204
205         * expression.cs (Invocation.DoResolve): Moved the check for the
206         use of `this' for doing method calls to the Invocation resolution
207         step, after overload resolution has taken place instead of doing
208         the check at the low-level `This.DoResolve' level.
209
210         The `This.DoResolve' happens before overload resolution, so it has
211         no way of knowing if the method that will be called will be
212         instace or static, triggering an erroneous report for cs0188 (Bug
213         78113).
214
215         We now do the check for instance method invocations after we know
216         what method will be called.
217
218         (This.CheckThisUsage): Move the actual use of this structure
219         checking into its own method and expose it. 
220
221         * Everywhere that called Error_ValueCannotBeConverted: pass a new
222         EmitContext.
223
224         Exceptions: Null.ConvertImplicitly,
225         Constant.ImplicitConversionRequired as there are too many call
226         sites for passing the ec. 
227
228         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
229         EmitContext, if the value is null, then we do not try to provide
230         the extra information from the error (If a userdefined conversion
231         exists, as UserDefinedConversion requires a non null-EmitContext).
232
233         Fixes: #80347
234
235 2006-12-30  Raja R Harinath  <rharinath@novell.com>
236
237         * flowanalysis.cs (MyBitVector): Document some invariants.
238         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
239         introduced below, and add a couple of others, 
240
241 2006-12-30  Marek Safar  <marek.safar@gmail.com>
242
243         * attribute.cs (GetMethodObsoleteAttribute): Uses new
244         GetPropertyFromAccessor and GetEventFromAccessor.
245         
246         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
247         overrides non-obsolete one.
248         (Indexer.Define): Error message has been moved to the parser.
249
250         * cs-parser.jay: Better syntax errors handling.
251
252         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
253         when an invocation has no arguments.
254
255         * ecore.cs: Removed not used caching.
256
257         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
258         implementation.
259
260         * report.cs: Add a new warning.
261
262         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
263
264         * typemanager.cs (enumeration_type): Removed.
265         (CSharpSignature): Reuses IsSpecialMethod.
266         (IsEqual): Hack for MS BCL.
267         (GetPropertyFromAccessor): New method.
268         (GetEventFromAccessor): New method.
269         (IsSpecialMethod): Fixed to handle more cases.
270
271 2006-12-30  Marek Safar  <marek.safar@gmail.com>
272
273         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
274         Made white spaces array static.
275
276         * ecore.cs (RemoveGenericArity): Optimized.
277
278         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
279         10 times faster).
280         (MyBitVector.initialize_vector): Simplified.
281
282 2006-12-22  Miguel de Icaza  <miguel@novell.com>
283
284         * ecore.cs: Am not entirely happy with this hack, but it seems to
285         address the issue in 80257 (a small test case for
286         CreativeDocs.NET). 
287
288         I set the MethodGroupExpr.Type to an internal compiler type
289         (itself in this case) to force the resolution to take place.   Why
290         it does not take place with a null is beyond me.
291
292 2006-12-20  Marek Safar  <marek.safar@gmail.com>
293
294         A fix for bug #80288
295         * expression.cs (ResolveOperator): Consider user defined conversion for
296         logical and operator too.
297         (EmitBranchable): Optimization for logical and when full constant folding
298         could not be applied but one operand is constant.
299
300 2006-12-19  Marek Safar  <marek.safar@gmail.com>
301
302         * class.cs (GetClassBases): Write 5 times every day, will never use
303         FullName for error reporting.
304
305         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
306
307 2006-12-19  Martin Baulig  <martin@ximian.com>
308
309         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
310         the symbol file info here.
311
312 2006-12-18  Marek Safar  <marek.safar@gmail.com>
313
314         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
315         of `elseif' is taking then following sections are not taking.
316         Fixes an issue reported on mono mailing list.
317
318 2006-12-18  Marek Safar  <marek.safar@gmail.com>
319
320         A fix for bug #80300
321         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
322         a caller is not taking.
323
324 2006-12-18  Raja R Harinath  <rharinath@novell.com>
325
326         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
327         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
328         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
329         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
330         * class.cs: Update to changes.
331
332 2006-12-17  Marek Safar  <marek.safar@gmail.com>
333
334         A fix for bug #79934
335         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
336         partial container.
337
338         * class.cs (ResolveMembers): Register an iterator in current container and
339         not in shared one.
340
341 2006-12-16  Raja R Harinath  <rharinath@novell.com>
342
343         Fix test-543.cs
344         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
345         satisfy a params annotated parameter.
346
347 2006-12-16  Marek Safar  <marek.safar@gmail.com>
348
349         A fix for bug #77014
350         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
351         paramters correctly and not rely on hacks in Parameters class.
352         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
353         at any possition.
354         (Invocation.VerifyArgumentsCompat): Ditto.
355         (Invocation.EmitArguments): Changed to correctly emit params arguments at
356         any possition.
357
358         * parameter.cs (HasParams): Don't assume that params is the last one.
359
360         * support.cs (ReflectionParameters.ctor): Look for params attribute
361         correctly.
362         (ReflectionParameters.ParameterType): Removed hack when we returned last
363         parameter for out of range parameters.
364         (ParameterName, ParameterModifier): Ditto.
365
366 2006-12-14  Marek Safar  <marek.safar@gmail.com>
367
368         A fix for bug #79987
369         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
370         when assembly is not CLS compliant but type is. I have no idea why is this
371         allowed.
372
373         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
374
375 2006-12-13  Miguel de Icaza  <miguel@novell.com>
376
377         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
378         in struct constructors, they are basically no-ops.
379
380 2006-12-12  Marek Safar  <marek.safar@gmail.com>
381
382         * cs-tokenizer.cs (Position): Save preprocessor status too.
383
384 2006-12-12  Marek Safar  <marek.safar@gmail.com>
385
386         A fix for bug #77794
387         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
388
389 2006-12-12  Marek Safar  <marek.safar@gmail.com>
390
391         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
392         Fixes #69299.
393         (pp_expr): Report error for an invalid expression.
394         (handle_preprocessing_directive): Simplified; add more error checking.
395
396 2006-12-11  Marek Safar  <marek.safar@gmail.com>
397
398         A fix for bug #74939
399         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
400         directives handling.
401
402 2006-12-10  Marek Safar  <marek.safar@gmail.com>
403
404         A fix for bugs #80093, and #75984
405         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
406         logic, it seems to me as it worked before "by coincidence".
407         (xtoken): Simplified to use reworked handle_preprocessing_directive.
408         (cleanup): Enabled endif check.
409
410 2006-12-09  Marek Safar  <marek.safar@gmail.com>
411
412         A fix for bug #80162
413         * statement.cs (CollectionForeach.TryType): Generics and non-generics
414         enumerators are never ambiguous.
415
416 2006-12-08  Raja R Harinath  <rharinath@novell.com>
417
418         Fix #80060
419         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
420
421 2006-12-06  Marek Safar  <marek.safar@gmail.com>
422
423         A fix for bug #80144
424         * class.cs (EventProperty.Define): Explicit implementation means
425         that an even is used.
426
427 2006-12-06  Marek Safar  <marek.safar@gmail.com>
428
429         Fixes the operators implementation (part II)
430
431         * cfold.cs (DoConstantNumericPromotions): Renamed to
432         DoBinaryNumericPromotions and simplified.
433         (BinaryFold): Couple of conversion fixes; simplified.
434
435         * constant.cs, ecore.cs, literal.cs
436         (ToType): Renamed to ConvertImplicitly.
437         (Reduce): Renamed to ConvertExplicitly.
438
439         * class.cs, convert.cs: Updated.
440
441         * expression.cs: TryReduce doesn't throw an exception.
442
443 2006-12-01  Marek Safar  <marek.safar@gmail.com>
444
445         A fix for bug #80108
446         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
447         compatible.
448
449 2006-11-30  Marek Safar  <marek.safar@gmail.com>
450
451         Fixes unary operators implementation (part I)
452         Also fixes #80026
453
454         * cfold.cs (Error_CompileTimeOverflow): Made internal
455
456         * const.cs (IConstant): Changed to use reference to constant and
457         not constant itself.
458         Updated IConstant implementations.
459
460         * constant.cs (CreateConstant): New factory method.
461         Updated IConstant implementation.
462
463         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
464
465         * ecore.cs: Updated to use CreateConstantReference.
466
467         * enum.cs: Reflects IConstant changes.
468
469         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
470
471         * literal.cs (NullConstant): Change to be independently usable.
472
473 2006-11-29  Martin Baulig  <martin@ximian.com>
474
475         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
476         we need to emit the scope initializer before calling the base .ctor.
477
478         * anonymous.cs: Merged back from the new anonymous methods branch.
479         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
480
481         * expression.cs (ParameterReference.DoResolveBase): Create a
482         "normal" ScopeInfo when capturing parameters rather than using the
483         root scope; this makes things work with anonymous methods having
484         parameters.
485
486         * statement.cs
487         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
488
489 2006-11-22  Marek Safar  <marek.safar@gmail.com>
490
491         A fix for bug #79987
492         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
493         check to a base class.
494         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
495         only when assembly has missing attribute.
496         * report.cs: Update.
497
498 2006-11-21  Marek Safar  <marek.safar@gmail.com>
499
500         * cs-tokenizer.cs: Merged with gmcs version.
501
502 2006-11-20  Marek Safar  <marek.safar@gmail.com>
503
504         * cs-tokenizer.cs,
505         * cs-parser.jay: Better error message when partial keyword is misplaced.
506
507 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
508
509         A fix for bug #79810
510         report.cs: CS1058 only applies to 2.0 profile (gmcs).
511         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
512         a RuntimeWrappedException by default.
513
514 2006-11-18  Marek Safar  <marek.safar@gmail.com>
515
516         A fix for bug #79843
517         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
518         implementation.
519         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
520
521 2006-11-18  Marek Safar  <marek.safar@gmail.com>
522
523         * driver.cs, namespace.cs: Uses faster IndexOf version.
524
525 2006-11-17  Marek Safar  <marek.safar@gmail.com>
526
527         A fix for bug #79941
528         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
529         operators.
530         (Operator.Define): Implicit/Explicit operator of same type is duplicate
531         even if internal name is different.
532         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
533         (UserDefinedConversion): Simplified as the operators cannot be internal.
534         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
535         conversions.
536         (MethodLookup): Replaced EmitContext with parentType.
537         * expression.cs: Updated.
538
539 2006-11-09  Raja R Harinath  <rharinath@novell.com>
540
541         * driver.cs (BadAssembly): Handle all the ugliness of
542         DefineDynamicAssembly.
543
544 2006-11-08  Raja R Harinath  <rharinath@novell.com>
545
546         Address parts of #58244 -- most of what's left is in the runtime
547         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
548         CS1509 error checks, and handle them for all assembly loads, not
549         just the first invocation.
550         (LoadModule): Likewise.  Move handling of 'adder_method' ...
551         * codegen.cs (AssemblyClass.AddModule): ... here.
552
553 2006-11-02  Marek Safar  <marek.safar@gmail.com>
554
555         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
556         IEnumerable<T> is ambiguous.
557
558 2006-10-31  Marek Safar  <marek.safar@gmail.com>
559
560         A fix for bug #67689
561         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
562         GetEnumerator is ambiguous.
563
564         * report.cs: Add new warning.
565
566 2006-10-29  Marek Safar  <marek.safar@gmail.com>
567
568         A fix for bug #78602
569         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
570         to protected member can be nested type.
571
572 2006-10-28  Marek Safar  <marek.safar@gmail.com>
573
574         A fix for bug #78965
575         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
576         to protected member must derive from current type.
577
578 2006-10-27  Marek Safar  <marek.safar@gmail.com>
579
580         assign.cs: Reuses error method.
581
582         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
583         instead of type for constants.
584         (Expression.Error_ValueAssignment): Common error method.
585
586         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
587         for any assignment.
588
589 2006-10-27  Marek Safar  <marek.safar@gmail.com>
590
591         A fix for bug #79081
592         * expression.cs (MemberAccess.DoResolve): Check nested type
593         accessibility.
594
595 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
596
597         * doc.cs : nested delegates were not handled. Fixed bug #79754.
598
599 2006-10-26  Marek Safar  <marek.safar@gmail.com>
600
601         A fix for bug #76591
602         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
603
604 2006-10-26  Marek Safar  <marek.safar@gmail.com>
605
606         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
607         type forwarder of the same type multiple times.
608
609 2006-10-26  Raja R Harinath  <rharinath@novell.com>
610
611         Fix #78820
612         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
613         instance as an rvalue, even when we later resolve as an lvalue.
614
615 2006-10-25  Martin Baulig  <martin@ximian.com>
616
617         * anonymous.cs: Fix #79673.
618
619 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
620
621         A fix for bug #79666
622         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
623         ignored when is optimized (= default value) as its value is already set.
624
625 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
626
627         A fix for bug #79724
628         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
629         TypeContainer for type lookup.
630
631 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
632
633         A fix for bug #79231
634         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
635         * expression.cs (OverloadResolve): Always convert type name for
636         an error message.
637         (ResolveNamespaceOrType): Don't confuse a nested type with any 
638         other member.
639
640 2006-10-18  Martin Baulig <martin@ximian.com>
641
642         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
643
644 2006-10-17  Miguel de Icaza  <miguel@novell.com>
645
646         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
647         an int32, but requesting an int64 from the conversion
648
649 2006-10-12  Martin Baulig  <martin@ximian.com>
650
651         * anonymous.cs
652         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
653         
654 2006-10-12  Martin Baulig  <martin@ximian.com>
655
656         * statement.cs
657         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
658
659 2006-10-11  Miguel de Icaza  <miguel@novell.com>
660
661         * convert.cs: Remove broken code: I was doing the "Existance"
662         tests for Implicit conversions.
663
664 2006-10-10  Miguel de Icaza  <miguel@novell.com>
665
666         * convert.cs: Added one missing case in
667         ImplicitStandardConversionExists uint64 to intptr.
668
669         Fixes #59800
670         
671         * typemanager.cs (uintptr_type): another core known type.   
672
673         * ecore.cs (OperatorCast): routine used to do cast operations that
674         depend on op_Explicit.  We could change some of the Decimal
675         conversions to use this.
676
677         This one has a probe mechanism that checks both types for an op_
678         which it coudl be used to eliminate two classes: CastToDecimal
679         and CastFromDecimal.
680
681         * convert.cs: Implement the conversions documented in #59800
682         
683 2006-10-10  Martin Baulig  <martin@ximian.com>
684
685         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
686         before RootScope.ResolveMembers().
687
688         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
689         `CurrentType' if appropriate.
690
691 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
692
693         A fix for bug #78568
694         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
695         when contains binary operators.
696         * cs-parser.jay: Updated.
697
698 2006-10-09  Martin Baulig  <martin@ximian.com>
699
700         * delegate.cs
701         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
702         moved that into Define() and also do the other type parameter
703         checks there.  Fixes #79094.  Added gtest-292.cs.
704
705         * expression.cs
706         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
707         since that doesn't include type parameters; don't use `Ldelema'
708         for type parameters.  Fixes #78980.  Added gtest-293.cs.
709
710 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
711
712         A fix for #77796
713         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
714         conversion is allowed.
715
716 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
717
718         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
719         error reporting when no error occurs.
720
721 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
722
723         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
724         does not exist.
725
726 2006-10-06  Raja R Harinath  <rharinath@novell.com>
727
728         Fix #79584
729         * class.cs (DefineTypeBuilder): Check circular dependencies before
730         setting the parent of the TypeBuilder.
731         (CheckRecursiveDefinition): Don't use 'BaseType', since
732         it may not be valid until after DefineTypeBuilder.  Use
733         'base_type' instead.
734
735 2006-10-04  Martin Baulig  <martin@ximian.com>
736
737         Merged the Anonymous Methods patch.
738
739         * anonymous.cs, iterators.cs: The new anonymous methods code.
740
741         * statement.cs (Variable): New public abstract class.
742         (LocalInfo.Variable): New public property.
743         (LocalInfo.ResolveVariable): New public method.
744         (Block.Flags): Add `IsIterator'.
745         (Block.AddVariable): Improved the CS0136 check.
746         (Block.AnonymousChildren): New public property.
747         (Block.AddAnonymousChild): New public method.
748         (ToplevelBlock): Update to use the new anonymous method framework.
749         (ToplevelBlock.ctor): `container' is now a `Block' and not a
750         `ToplevelBlock'; this is required to correctly implement the
751         CS0136 check.
752         (Fixed, Using): Use `TemporaryVariable' instead of directly
753         creating the `LocalBuilder'.
754
755         * parameter.cs (Parameter.ResolveVariable): New public method.
756         (Parameters.ResolveVariable): Likewise.
757
758         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
759
760         * class.cs (TypeContainer): Replaced the `iterators' list and
761         corresponding methods with a list of `CompilerGeneratedClass'es.
762         (TypeContainer.ResolveMembers): New public method.
763         (Method): `IIteratorContainer' has been replaced by
764         `IAnonymousHost'.
765
766         * expression.cs (VariableReference): New public abstract base
767         class for `LocalVariableReference', `ParameterReference' and
768         `This'.
769
770         * codegen.cs (EmitContext): Removed `capture_context',
771         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
772         (EmitContext.EmitThis): Removed.
773
774         * cs-parser.jay: Replace `iterator_container' with
775         `anonymous_host'.       
776
777 2006-10-04  Martin Baulig  <martin@ximian.com>
778
779         * generic.cs (GenericMethod): Don't make this abstract.
780         (Constraints.Clone): Added dummy implementation.
781
782 2006-10-04  Raja R Harinath  <harinath@gmail.com>
783
784         Fix #79577
785         * namespace.cs (LookForAnyGenericType): Avoid nullref on
786         'declspaces'.  Avoid allocating arrays willy-nilly.
787
788         Fix #79553
789         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
790         cases out of the switch.
791
792 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
793
794         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
795         message when non-generic type is used with the type arguments.
796         * expression.cs: Updated.
797
798 2006-09-28  Raja R Harinath  <rharinath@novell.com>
799
800         Fix #79013
801         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
802         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
803         Change semantics slightly.  Don't insist on having only one
804         temporary EmptyExpression -- just throttle the creation of new ones.
805
806         Fix #79451
807         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
808         non-interfaces too.  If no methods are found, don't try to create
809         a MethodGroupExpr.
810
811 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
812
813         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
814         generic type.
815
816         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
817         us produce better error message.
818
819 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
820
821         * expression.cs (Binary.ResolveOperator): Warn about a side effect
822         of the `|' operator.
823
824         * report.cs: A new warning added.
825
826 2006-09-27  Martin Baulig  <martin@ximian.com>
827
828         * generic.cs (GenericMethod): Don't make this abstract.
829
830 2006-09-27  Martin Baulig  <martin@ximian.com>
831
832         * report.cs
833         (InternalErrorException): Added overloaded ctor taking a params array.
834
835 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
836
837         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
838         Fixed the cases when same error was reported twice.
839
840         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
841         now report symbol information.
842
843 2006-09-25  Martin Baulig  <martin@ximian.com>
844
845         * class.cs: Completely unified with the gmcs version.
846
847 2006-09-25  Martin Baulig  <martin@ximian.com>
848
849         * typemanager.cs (TypeManager.IsNullableType): New public function.
850         (TypeManager.IsNullableTypeOf): Likewise.
851         (TypeManager.IsNullableValueType): Likewise.
852
853         * class.cs (MethodCore): Added the `GenericMethod' argument from
854         gmcs and also unified all classes derived from `MethodCore' with gmcs.
855
856 2006-09-24  Raja R Harinath  <harinath@gmail.com>
857
858         * convert.cs: Unify with gmcs version.
859
860 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
861
862         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
863         verify them as well.
864
865         * report.cs: New warning.
866
867 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
868
869         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
870         for anonymous block with out argument.
871
872 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
873
874         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
875         not used private events only.
876
877 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
878
879         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
880
881         * const.cs (Const.Define): Check for constant type.
882         (Const.IsConstantTypeValid): Looks for valid constant types.
883
884         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
885
886         * ecore.cs (EmptyConstantCast): New common class for all constant based
887         EmptyCast(s).
888
889         * expression.cs (Is.DoResolve): Handle null constant especially.
890         (New.DoResolve): Check for new void().
891         (MemberAccess.DoResolve): Cope with all kind of nulls.
892
893         * literal.cs (NullConstant): Uses EmptyConstantCast.
894         (NullDefault): Based on EmptyConstantCast.
895         (NullLiteral): Uses EmptyConstantCast.
896
897         * statement.cs (Block.ResolveMeta): Check for constant type.
898
899 2006-09-22  Martin Baulig  <martin@ximian.com>
900
901         * delegate.cs, attribute.cs: Merged with the gmcs versions.
902
903 2006-09-22  Raja R Harinath  <rharinath@novell.com>
904
905         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
906         not the null type.
907
908         Fix part of #79451
909         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
910         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
911         code slightly.
912
913 2006-09-22  Martin Baulig  <martin@ximian.com>
914
915         * ecore.cs: Merged with the gmcs version.
916
917         * generic.cs (ConstructedType): New dummy class.
918         (TypeArguments): Don't make this abstract.
919
920         * typemanager.cs
921         (TypeManager.IsGenericTypeDefinition): New method.
922         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
923
924 2006-09-22  Raja R Harinath  <rharinath@novell.com>
925
926         * expression.cs (ComposedCast): Check for arrays of TypedReference
927         before creating the type, not after.
928
929 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
930
931         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
932         after ToType change.
933
934         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
935         when constant must be implicitly convertible.
936
937         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
938
939         * ecore.cs (NullCast): Derives from NullConstant.
940
941         * expression.cs (Is.DoResolve): Removed useless variables.
942         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
943         (New.Constantify): Add enum support.
944         (MemberAccess.DoResolve): Add warning when accessing null constant or
945         variable.
946
947         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
948         property.
949
950         * literal.cs (NullConstant): New abstract class with common
951         functionality for all null specializations.
952         (NullDefault): Represents default(X) when result can be
953         reduced to null.
954         (NullLiteral): Updated.
955
956         * report.cs: Add new warning.
957
958 2006-09-21  Martin Baulig  <martin@ximian.com>
959
960         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
961
962 2006-09-21  Martin Baulig  <martin@ximian.com>
963
964         * generic.cs (GenericConstraints): New dummy class.
965         (Constraints): Likewise.
966         (TypeParameter): Likewise.
967         (TypeParameterName): Likewise.
968         (GenericMethod): Likewise.
969
970         * typemanager.cs (TypeManager.GetGenericArguments): New method.
971
972         * decl.cs: Merged with the gmcs version.
973
974 2006-09-21  Raja R Harinath  <rharinath@novell.com>
975
976         * generic.cs (TypeParameter): Implement IMemberContainer.
977         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
978
979         * rootcontext.cs: Unify with gmcs version.
980
981         * report.cs: Unify with gmcs version.
982         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
983         from gmcs/generics.cs.
984         * generics.cs (TypeParameter): New dummy class.
985
986         * support.cs: Unify with gmcs version.
987
988 2006-09-20  Raja R Harinath  <rharinath@novell.com>
989
990         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
991         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
992
993         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
994         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
995         * mcs.exe.sources: Add generic.cs.
996
997         * codegen.cs: Unify with gmcs version.
998
999         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1000         (EmitContext): Add GenericDeclContainer implementation.
1001         * decl.cs (MemberCore, DeclSpace): Likewise.
1002         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1003
1004         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1005         MCS TypeManager has a corresponding dummy method.
1006
1007 2006-09-19  Martin Baulig  <martin@ximian.com>
1008
1009         * expression.cs: Completely merged with the gmcs version.
1010
1011 2006-09-19  Martin Baulig  <martin@ximian.com>
1012
1013         * expression.cs (Invocation): Merged with the gmcs version.
1014         (ArrayAccess.GetStoreOpcode): Likewise.
1015
1016 2006-09-19  Martin Baulig  <martin@ximian.com>
1017
1018         * typemanager.cs
1019         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1020         (TypeManager.IsGenericMethodDefinition): Likewise.
1021
1022 2006-09-19  Martin Baulig  <martin@ximian.com>
1023
1024         * typemanager.cs
1025         (TypeManager.IsEqual): Moved the gmcs implementation here.
1026         (TypeManager.DropGenericTypeArguments): Likewise.
1027         (TypeManager.DropGenericMethodArguments): Likewise.
1028         (TypeManager.GetTypeArguments): Moved here from gmcs.
1029         (TypeManager.HasGenericArguments): Likewise.
1030
1031 2006-09-19  Martin Baulig  <martin@ximian.com>
1032
1033         * expression.cs (Binary): Merged with the gmcs version.
1034
1035 2006-09-19  Martin Baulig  <martin@ximian.com>
1036
1037         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1038
1039 2006-09-19  Martin Baulig  <martin@ximian.com>
1040
1041         * typemanager.cs: Merged with the gmcs version.
1042
1043 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1044
1045         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1046         * driver.cs: Likewise.
1047
1048 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1049
1050         A fix for #79401
1051         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1052         only if parent type is class.
1053         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1054         update.
1055
1056 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1057
1058         * cs-parser.jay,
1059         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1060         keywords are used.
1061         * typemanager.cs(CSharpName): Converts NullType to null.
1062
1063 2006-09-15  Martin Baulig  <martin@ximian.com>
1064
1065         * typemanager.cs
1066         (TypeManager.GetMethodName): Added mcs implementation.
1067         (TypeManager.IsEqual): Likewise.
1068
1069         * ecore.cs
1070         (SimpleName.RemoveGenericArity): Added dummy implementation.
1071
1072         * pending.cs: Merged with the gmcs version.     
1073
1074 2006-09-15  Martin Baulig  <martin@ximian.com>
1075
1076         * statement.cs: Merge with the gmcs version.
1077
1078 2006-09-15  Martin Baulig  <martin@ximian.com>
1079
1080         * statement.cs (Switch): Merge with the gmcs implementation
1081         (without nullables), which is newer.
1082
1083 2006-09-15  Martin Baulig  <martin@ximian.com>
1084
1085         * statement.cs (Block.Variables): Make this public.
1086         (ToplevelBlock.Parameters): Make this a property.
1087         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1088
1089 2006-09-15  Martin Baulig  <martin@ximian.com>
1090
1091         * namespace.cs: Merge with the gmcs version.
1092
1093 2006-09-15  Martin Baulig  <martin@ximian.com>
1094
1095         * decl.cs (MemberName): Minor code cleanups.
1096
1097 2006-09-15  Martin Baulig  <martin@ximian.com>
1098
1099         * parameter.cs: Merge with the gmcs version.
1100
1101 2006-09-15  Martin Baulig  <martin@ximian.com>
1102
1103         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
1104         and an error in mcs.
1105
1106 2006-09-15  Martin Baulig  <martin@ximian.com>
1107
1108         * flowanalysis.cs: Merged from GMCS; added the generics code into
1109         a `GMCS_SOURCE' conditional so we can share this file.
1110
1111 2006-09-08  Martin Baulig  <martin@ximian.com>
1112
1113         * typemanager.cs (TypeManager.interlocked_type): New public field.
1114         (TypeManager.int_interlocked_compare-exchange): New public field.
1115         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
1116         enumerator types here and call InitGenericCoreTypes().
1117         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
1118         after calling InitEnumUnderlyingTypes().
1119
1120         * rootcontext.cs
1121         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
1122         `classes_second_stage'. 
1123
1124 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
1125
1126         * assign.cs, ecore.cs, expression.cs: Share error message text.
1127         * class.cs (FieldMember.Define): Check for varible of static type.
1128         * driver.cs (LoadAssembly): Uses error output for errors.
1129         * statement.cs: Updated.
1130
1131 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
1132
1133         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
1134         type instance.
1135
1136 2006-09-07  Martin Baulig  <martin@ximian.com>
1137
1138         * driver.cs
1139         (MainDriver): Revert r62663 from Marek; see #70506 for details.
1140
1141 2006-08-29  Miguel de Icaza  <miguel@novell.com>
1142
1143         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
1144         
1145 2006-08-17  Miguel de Icaza  <miguel@novell.com>
1146
1147         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
1148         #52019 and #79064, the use of the \uXXXX sequence in source code
1149         to represent unicode characters.
1150
1151 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
1152
1153         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
1154         support.
1155         * class.cs, ecore.cs, statement.cs: Merged to one error message.
1156
1157 2006-08-13  Miguel de Icaza  <miguel@novell.com>
1158
1159         * assign.cs: Catch attempts to assign to a method groups in += and
1160         report as 1656
1161
1162 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
1163
1164         A fix for #79056
1165         * cs-parser.jay: Don't destroy current array type by typeof of array's.
1166
1167 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
1168
1169         * class.cs (Method.Define): Issue a warning when generic method looks like
1170         an entry point.
1171         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
1172         as well.
1173
1174 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
1175  
1176         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
1177         looking for ctor.
1178         * decl.cs (MemberCache.FindMembers): When container is interface we need to
1179         search all base interfaces as a member can be ambiguous.
1180         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
1181         Constructor member type filter. 
1182         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
1183         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
1184         reporting for returned memberinfos.
1185         * report.cs: Updated.
1186         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
1187         version to work on all runtimes.
1188         (TypeManager.RealMemberLookup): Removed members filtering.
1189
1190 2006-08-08  Raja R Harinath  <rharinath@novell.com>
1191
1192         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
1193         (PropertyExpr.EmitAssign): Likewise.
1194         * expression.cs (Indirection.EmitAssign): Likewise.
1195         (LocalVariableReference.EmitAssign): Likewise.
1196         (ParameterReference.EmitAssign): Likewise.
1197         (Invocation.EmitArguments): Likewise.
1198         (ArrayAccess.EmitAssign): Likewise.
1199         (IndexerAccess.EmitAssign): Likewise.
1200         (This.EmitAssign): Likewise.
1201         (ConditionalLogicalOperator.Emit): Likewise.
1202
1203         Fix #79026
1204         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
1205         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
1206         leave it in after returning it.
1207         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
1208
1209 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
1210
1211         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
1212         message.
1213
1214 2006-08-03  Raja R Harinath  <rharinath@novell.com>
1215
1216         Fix cs0146-3.cs and cs0146-4.cs.
1217         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1218         enclosing types don't depend on the current type.
1219
1220 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1221
1222         Fix #77963
1223         * class.cs (TypeContainer.DoDefineMembers): Use
1224         FindBaseMemberWithSameName on Parent, since we're interested in
1225         whether we hide inherited members or not.
1226         (FindBaseMemberWithSameName): Make slightly more robust.
1227
1228         Fix the non-generic testcase from #77396
1229         * decl.cs (DeclSpace.DeclContainer): Remove override.
1230
1231         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1232         declspaces for doppelgangers too.
1233         (UsingEntry): Implement IResolveContext.
1234         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1235         'this' as the resolve context.
1236         (LocalAliasEntry): Likewise.
1237
1238         Implement parts of #77403
1239         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1240         toplevel declaration space.  Each namespace declaration introduces
1241         a "partial" root declaretion space.
1242         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1243         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1244         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1245         from 'current_namespace.SlaveDeclSpace'.
1246         (namespace_declaration): Likewise.
1247         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1248         check.  It can't happen now.
1249         * decl.cs (DeclSpace.LookupType): Likewise.
1250         * driver.cs (MainDriver): Sanity check.
1251
1252 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1253
1254         * decl.cs (DeclSpace.FindNestedType): Remove.
1255         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1256         LookupTypeContainer to get the container of the nested type.
1257         * class.cs (TypeContainer.FindNestedType): Make non-override.
1258
1259 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1260
1261         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1262         * class.cs (TypeContainer.PartialContainer): ... here.
1263         (TypeContainer.AddBasesForPart): New helper.
1264         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1265         instead.
1266         * cs-parser.jay (current_class): Convert to DeclSpace.
1267         (struct_declaration, interface_declaration, class_declaration):
1268         Use AddBasesForPart instead of .Bases directly.
1269         * const.cs, iterators.cs: Update to changes.
1270
1271 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1272
1273         * class.cs (TypeContainer.AddMemberType): Rename from
1274         AddToTypeContainer.
1275         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1276         (AddTypeContainer): New.  Combine AddClassOrStruct and
1277         AddInterface.
1278         (AddPartial): Update.  Add 'is_partial' argument.
1279         * roottypes.cs: Update to changes.
1280         * cs-parser.jay (push_current_class): New helper for handling
1281         current_container and current_class.
1282         (struct_declaration, interface_declaration, class_declaration):
1283         Use it.
1284
1285 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1286
1287         * roottypes.cs: Rename from tree.cs.
1288
1289         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1290         * tree.cs (Tree, ITreeDump): Remove types.
1291         * rootcontext.cs (tree, Tree): Remove fields.
1292         (root, ToplevelTypes): New.
1293         * *.cs: Update to rename.
1294
1295         * tree.cs (Tree.RecordDecl): Remove.
1296         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1297         namespace here.
1298         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1299
1300 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1301
1302         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1303         DoFlowAnalysis and OmitStructFlowAnalysis here.
1304         (ec.With): Rename from WithUnsafe and generalize.
1305         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1306         (ec.WithFlowAnalyis): New.
1307         * ecore.cs, expression.cs, statement.cs: Update.
1308
1309 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1310
1311         * statement.cs (Block.ResolveMeta): Simplify slightly.
1312
1313         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1314         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1315         check_state to flags.
1316         (CheckState, ConstantCheckState): Update.
1317         (InUnsafe): New read-only property.
1318         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1319         arbitrary flags.
1320         (WithUnsafe): New helper similar to WithCheckState.
1321         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1322         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1323
1324 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1325
1326         Make comparisons use the same IL irrespective of whether they're
1327         in a 'checked' or 'unchecked' context: one of the issues in #78899
1328         * codegen.cs (EmitContext.CheckState): Make read-only property.
1329         (EmitContext.ConstantCheckState): Likewise.
1330         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1331         helper that implement a save/restore stack for CheckState
1332         values.  This is the only way to change check-state.
1333         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1334         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1335         (CheckedExpr.EmitBranchable): New forwarding method.
1336         (UnCheckedExpr): Likewise.
1337         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1338         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1339         (Checked.Resolve, checked.DoEmit): Likewise.
1340
1341 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1342
1343         * anonymous.cs: Cache the resolved anonymous delegate, and return
1344         this so that the ResolveTopBlock is only triggered once, not
1345         twice.
1346
1347         Currently we trigger ResolvetopBlock twice due to a first pass of
1348         argument check compatibility, and a second pass that does the
1349         actual resolution.   
1350         
1351 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1352
1353         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1354         modifiers.
1355         * rootcontext.cs (Reset): Add helper_classes.
1356
1357 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1358
1359         A fix for #78860
1360         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1361         correctly.
1362
1363 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1364
1365         * statement.cs (Lock): Handle expressions of type
1366         TypeManager.null_type specially.  Fixes #78770
1367
1368 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1369
1370         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1371         to an event.
1372
1373 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1374
1375         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1376         for accessors as well.
1377         * ecore.cs (EventExpr): Add AccessorTable.
1378
1379 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1380
1381         A fix for #78738
1382         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1383         for CS0122 where appropriate.
1384         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1385         level attributes.
1386         (Filter): Assembly can be null in the case of top level attributes.
1387
1388 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1389
1390         A fix for #78690
1391
1392         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1393         is done at global level.
1394
1395 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1396
1397         A fix for #77002, Implemented TypeForwarder support.
1398
1399         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1400         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1401         * typemanager.cs (): Add type_forwarder_attr_type.
1402
1403 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1404
1405         * report.cs: Add CS0469 warning.
1406
1407 2006-06-21  Martin Baulig  <martin@ximian.com>
1408
1409         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1410         the `try'-block, so we also report CS0016 etc. there.
1411
1412 2006-06-21  Martin Baulig  <martin@ximian.com>
1413
1414         * delegate.cs
1415         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1416
1417 2006-06-21  Martin Baulig  <martin@ximian.com>
1418
1419         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1420         also report CS1686 for parameters.
1421
1422 2006-06-21  Martin Baulig  <martin@ximian.com>
1423
1424         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1425         instead of an error if the value is not implicitly convertible to
1426         the switch types; fixes #77964.
1427
1428 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1429
1430         Fix #78673
1431         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1432         FieldBuilder is null.
1433
1434         Fix #78662
1435         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1436         'left' and 'right' before error-checking.
1437
1438 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1439
1440         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1441         Fixed bug #78601.
1442         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1443         (FieldExpr.DoResolve): likewise.
1444         (PropertyExpr.InstanceResolve): likewise.
1445         (EventExpr.InstanceResolve): likewise. 
1446
1447 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1448
1449         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1450         attribute applicable tests for attribute argument.
1451
1452 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1453
1454         Fix #78079
1455         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1456         (Binary.OverloadResolve_PredefinedIntegral): New.
1457         (Binary.OverloadResolve_PredefinedFloating): New.
1458         (Binary.OverloadResolve_PredefinedString): New.
1459         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1460         Follow the standard more closely, and treat numeric promotions in
1461         terms of overload resolution.
1462         (Binary.CheckShiftArguments): Simplify.
1463
1464 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1465
1466         * flowanalysis.cs (MyBitVector): Simplify representation.
1467         (MyBitVector.Clone): Avoid allocating BitArray.
1468         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1469         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1470         (*): Update.  Change all references to MyBitVector.And and
1471         MyBitVector.Or to &= and |=.
1472
1473 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1474
1475         Fix cs0231-[34].cs.
1476         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1477         to param arguments too.
1478
1479 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1480
1481         * cs-parser.jay: Catch another parsing form for arglist being
1482         followed by other arguments.  Fixes #78313.
1483
1484 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1485
1486         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1487         checking of out parameters to ...
1488         (FlowBranchingToplevel.Merge): ... here.
1489         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1490         set, propagate the origin upward, and only complain if there was
1491         no other error.
1492         (FlowBranchingException.AddContinueOrigin): Likewise.
1493         (FlowBranchingException.AddReturnOrigin): Likewise.
1494         (FlowBranchingException.AddGotoOrigin): Likewise.       
1495
1496 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1497
1498         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1499         unreachable, skip it.
1500         (FlowBranchingException.Merge): Always propagate jumps, even if
1501         the finally block renders subsequent code unreachable.
1502
1503 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1504
1505         Fix #77601
1506         * statement.cs (Goto.Resolve): Move responsibility for resolving
1507         'goto' to FlowBranching.AddGotoOrigin.
1508         (Goto.SetResolvedTarget): New.  Callback to set the
1509         LabeledStatement that's the target of the goto.
1510         (Goto.DoEmit): Use Leave instead of Br when crossing an
1511         unwind-protect boundary.
1512         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1513         LookupLabel and adjust to new semantics.
1514         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1515         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1516         Goto.SetResolvedTarget to update target.
1517         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1518         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1519         AddBreakOrigin & co.  Delay propagation until ...
1520         (FlowBranchingException.Merge): ... this.
1521
1522         * statement.cs (Block.Resolve): Always depend on flow-branching to
1523         determine unreachability.  Kill workaround that originally emitted
1524         only one statement after an "unreachable" label (see infloop in
1525         test-515.cs).
1526
1527         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1528         This is still "wrong", but anything better would probably need a
1529         multi-pass algorithm.
1530         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1531         usage vector.  Force current usage vector to be reachable, to
1532         optimistically signify backward jumps.
1533         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1534         detected.
1535         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1536         detected, return the original salted-away usage vector instead,
1537         updated with appropriate changes.  Print unreachable warning if
1538         necessary.
1539         * statement.cs (Block.Resolve): Don't print unreachable warning on
1540         a labeled statement.
1541
1542 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1543
1544         * driver.cs: Pass filename without path to AssemblyBuilder's 
1545         AddResourceFile. Fixes bug #78407.
1546
1547 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1548
1549         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1550         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1551         (FlowBranching.MergeChild): Overwrite
1552         reachability information from Labeled branchings too.
1553
1554 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1555
1556         * statement.cs (Goto.Resolve): Merge jump origins here ...
1557         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1558
1559         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1560         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1561         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1562         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1563         here, ...
1564         * statement.cs (Goto.Resolve): ... not here.
1565         (Goto.Emit): Remove CS1632 check.
1566
1567 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1568
1569         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1570         error message.
1571
1572 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1573
1574         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1575         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1576         (FlowBranchingException.Label): Likewise.
1577
1578         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1579         given value.
1580         (MyBitVector.Or): Use it to avoid losing information (Count).
1581         (FlowBranching.MergeOrigins): Likewise.
1582
1583         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1584         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1585         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1586         (UsageVector.ToString): Simplify.
1587         (UsageVector.MergeSiblings): Move here from ...
1588         (FlowBranching.Merge): ... here.
1589         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1590         not a MyBitVector.
1591
1592 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1593
1594         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1595         null bitvector is treated as all-true.
1596
1597         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1598         (MyBitVector): Rationalize invariants.  'vector != null' implies
1599         that we have our own copy of the bitvector.  Otherwise,
1600         'InheritsFrom == null' implies all inherited bits are true.
1601
1602 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * statement.cs (LocalInfo): Add IsConstant.
1605         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1606         local variable for constants.
1607
1608 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1609
1610         * flowanalysis.cs (MyBitVector.Empty): New.
1611         (MyBitVector): Don't allow InheritedFrom to be null.
1612         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1613         (UsageVector, FlowBranching): Update to changes.
1614
1615         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1616         recursion.  The 'Parent == null' condition isn't sufficient for
1617         anonymous methods.
1618         (FlowBranching.AddBreakOrigin): Likewise.
1619         (FlowBranching.AddContinueOrigin): Likewise.
1620         (FlowBranching.AddReturnOrigin): Likewise.
1621         (FlowBranching.StealFinallyClauses): Likewise.
1622         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1623         (FlowBranching.CheckOutParameters): Likewise.
1624         (FlowBranchingToplevel): Terminate all the above recursions here.
1625         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1626         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1627
1628         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1629         toplevel block.
1630         (FlowBranchingToplevel): New.  Empty for now.
1631         (FlowBranching.MergeTopBlock): Update.
1632         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1633         branching for the anonymous delegate.
1634         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1635
1636         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1637         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1638         information at the start of the merge.  Reorganize.
1639
1640 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1641
1642         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1643
1644 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1645
1646         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1647         to newly introduced ctor.
1648
1649         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1650         message to one place.
1651         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1652         global namespace.
1653
1654 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1655
1656         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1657
1658         * ecore.cs (Expression.ResolveAsConstant): Updated.
1659
1660         * statement.cs (ResolveMeta): Updated.
1661
1662 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1663
1664         * cs-parser.jay: __arglist cannot be used in initializer.
1665
1666 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1667
1668         A fix for #77879
1669         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1670         private types.
1671
1672 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1673
1674         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1675         (LabeledStatement): Add 'name' parameter.
1676         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1677         (Block.AddLabel): Update to changes.
1678         * cs-parser.jay (labeled_statement): Likewise.
1679
1680         * flowanalysis.cs (BranchingType.Labeled): New.
1681         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1682         (FlowBranchingLabeled): New.  Does nothing for now, but will
1683         eventually handle 'goto' flows.
1684         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1685         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1686         that's terminated ...
1687         (Block.Resolve): ... here.
1688
1689         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1690         (UsageVector.MergeFinallyOrigins): Likewise.
1691         (FlowBranching.InTryOrCatch): Likewise.
1692         (FlowBranching.AddFinallyVector): Likewise.
1693         (FlowBranchingException): Update to changes.
1694
1695         Fix #78290
1696         * statement.cs (Return.Resolve): Move error checking to ...
1697         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1698         (FlowBranchingException): Handle return origins like break and
1699         continue origins.
1700         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1701
1702 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1703
1704         A fix for #76122
1705         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1706         filter.
1707
1708 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1709
1710         A fix for #77543
1711         * class.cs (MethodData.Define): Do public accessor check only when method
1712         implements an interface.
1713
1714 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1715
1716         Remove special handling of 'break'
1717         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1718         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1719         (UsageVector.Break): Remove.
1720         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1721         reachability.
1722         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1723
1724         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1725         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1726
1727 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1728
1729         A fix for #75726
1730         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1731         be the interface member.
1732
1733 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1734
1735         A fix for #60069
1736         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1737         for emitting small (int) values.
1738
1739 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1740
1741         Fix #59427
1742         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1743         control-flow passes through the 'finally' after merging-in all the
1744         control-flows from 'try' and the 'catch' clauses.
1745
1746         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1747         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1748         always true at the only non-recursive entry point.
1749         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1750         FlowBranchingBreakable.
1751         (FlowBranchingLoop): Remove.
1752         * statement.cs (Return.DoResolve): Update to changes.
1753
1754         Fix #76471, #76665
1755         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1756         (FlowBranching.CreateBranching): Handle it: create a
1757         FlowBranchingContinuable.
1758         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1759         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1760         except that it handles the 'continue' command.
1761         (FlowBranching.UsageVector.MergeOrigins): Rename from
1762         MergeBreakOrigins.
1763         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1764         except that it overrides AddContinueOrigin.
1765         (FlowBranchingException): Override AddContinueOrigin, similar to
1766         AddBreakOrigin.
1767         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1768         Create a new branching around the embedded statement.
1769         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1770         control flow after the embedded statement.
1771         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1772
1773         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1774         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1775         FlowBranchingBreakable.
1776         (FlowBranchingSwitch): Remove.
1777
1778         Fix test-503.cs
1779         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1780         error reporting to ...
1781         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1782         Rename from 'AddBreakVector'.  Add new location argument.  Return
1783         a bool indicating whether the 'break' crosses an unwind-protect.
1784         (FlowBranchingException.AddBreakOrigin): Add.
1785         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1786         flowbranching after updating with the effects of the 'finally'
1787         clause.
1788         (FlowBranchingBreakable): New common base class for
1789         FlowBranchingLoop and FlowBranchingSwitch.
1790
1791         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1792         embedded statement.
1793         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1794
1795 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1796
1797         * statement.cs (Do.Resolve): If the loop is infinite, set the
1798         barrier.
1799         (While.Resolve, For.Resolve): Set a barrier after the embedded
1800         statement.  There's no direct control flow that goes from the end
1801         of the embedded statement to the end of the loop.
1802         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1803         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1804         above ensure that the reachability is correctly computed.
1805
1806         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1807         (UsageVector.MergeBreakOrigins): If the current path is
1808         unreachable, treat it as if all parameters/locals are initialized.
1809         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1810         infinite loops before merging-in break origins.
1811
1812         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1813         (Reachability.Reachable): Split part into ...
1814         (Reachability.Unreachable): ... this.  Simplify.
1815         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1816
1817         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1818         (Reachability.SetThrowsSometimes): Likewise.
1819         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1820         TriState.Always, use corresponding property.
1821         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1822         (Block.Resolve): Likewise.  Remove some redundant checks.
1823
1824 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1825
1826         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1827         (Reachability.Meet): Don't bother checking AlwaysThrows --
1828         barrier is always set.
1829         (FlowBranchingBlock.Merge): Likewise.
1830
1831 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1832
1833         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1834         checks for unreachable.
1835
1836 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1837
1838         A fix for #77980
1839         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1840
1841         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1842         whether field is really assigned.
1843
1844 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1845
1846         * flowanalysis.cs (Reachability): Make 4-argument constructor
1847         private.
1848         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1849         (Reachability.Always): Rename from the highly misleading
1850         'Reachability.Never'.
1851         (FlowBranching.Merge): Update to changes.  Mark an impossible
1852         situation with a 'throw'.
1853         (*): Update to changes.
1854
1855 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1856
1857         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1858         Remove 'Undefined'.
1859         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1860         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1861         (*): Update to changes.
1862         * statement.cs: Update to changes.
1863
1864 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1865
1866         A fix for #78049
1867         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1868
1869 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1870
1871         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1872         dummy UsageVector.
1873
1874         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1875         argument to two arguments: an usage-vector and a bool.  Move call
1876         to FlowBranching.Merge () ...
1877         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1878
1879         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1880         handling of loop and switch reachability to ...
1881         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1882
1883 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1884
1885         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1886         handling to FlowBranchingLoop.InLoop.
1887         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1888
1889 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1890
1891         A fix for #78115
1892         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1893         anonymous method is allowed from AnonymousContainer here.
1894
1895         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1896
1897 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1898
1899         Fix #78156
1900         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1901
1902 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1903
1904         A fix for #49011.
1905         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1906         (DoubleConstant.Reduce): Ditto.
1907
1908 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1909
1910         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1911         Remove 'lvalue_right_side' argument.  Move parts to ...
1912         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1913         (LocalVariable.DoResolveLValue): ... these.
1914
1915 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1916
1917         Fix cs1655.cs
1918         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1919         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1920         (LocalVariableReference.DoResolveBase): Use it to implement new
1921         CS1655 check.
1922         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1923         (Argument.Resolve): Simplify.  Move CS1510 check ...
1924         * ecore.cs (Expression.ResolveLValue): ... here.
1925         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1926         (PropertyExpr.DoResolveLValue): Likewise.
1927         (FieldExpr.Report_AssignToReadonly): Likewise.
1928         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1929         LValueMemberAccess or LValueMemberOutAccess on instance depending
1930         on it.
1931         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1932         DoResolve as appropriate.
1933
1934 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1935
1936         Fix #75800
1937         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1938         implicit conversions on 'out' and 'ref' arguments.
1939
1940         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1941         improve clarity.  Remove dead code.
1942
1943         Fix #66031
1944         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1945         (Catch.Resolve): Resolve VarBlock if it exists.
1946
1947 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1948
1949         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1950         twice, this was some residual code, the enumerator was emitted
1951         properly in the two branche of if later.
1952
1953 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1954
1955         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1956         cast is never an lvalue.
1957         (Cast.DoResolve, Cast.ResolveRest): Combine.
1958         (Argument.Emit): Simplify slightly.  Move 'Expr is
1959         IMemoryLocation' check ...
1960         (Argument.Resolve): ... here.
1961         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1962
1963         Simplifications.  Fix cs0191-2.cs
1964         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1965         CS1649 and CS1651 to ...
1966         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1967         the actual selection of the error code and message to a lookup
1968         table.  Add a dummy return value to simplify callsites.
1969         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1970         readonly fields of other instances of the same type.  Move CS0197
1971         warning from ...
1972         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1973         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1974         resolution of an out or ref argument.  The code simplification
1975         above uses this invariant.
1976
1977 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1978
1979         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1980         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1981         CheckMarshallByRefAccess.  Drop parameter.
1982         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1983         warning.
1984         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1985         InstanceExpression.
1986         * report.cs (AllWarnings): Add CS1690.
1987         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1988         for ref access too.
1989         (LocalVariableReference.DoResolveBase): Update.
1990
1991 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1992
1993         * class.cs (MethodOrOperator): Moved common parts from method class.
1994         detect obsolete attributes.
1995         (Method.Define): Simplified as it reuses code from base.
1996         (Constructor.ValidAttributeTargets): Fixed issue found during
1997         refactoring.
1998         (Destructor.ValidAttributeTargets): Fixed issue found during
1999         refactoring.
2000         (Operator): Finished refactoring set off by #78020. Operator class is now
2001         ordinary method class.
2002
2003         * anonymous.cs: Updated.
2004
2005         * decl.cs (DeclSpace): Add IsGeneric
2006
2007 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2008
2009         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2010
2011 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2012
2013         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2014         detect obsolete attributes.
2015         (Method.CreateEmitContext): Moved to MethodOrOperator.
2016
2017 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2018
2019         A fix for #78048.
2020         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2021         customized exception to make crash detection easier.
2022         (MethodOrOperator): Started to work on new base class for methods and
2023         operators.
2024         (Method): Derives from MethodOrOperator.
2025         (Constructor.Emit): Emits its own attributes.
2026         (AbstractPropertyEventMethod.Emit): Ditto.
2027         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2028         patch.
2029         (Operator.Emit): It's temporary more tricky than should be.
2030         
2031         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2032
2033         * report.cs (InternalErrorException): Add ctor with inner exception.
2034
2035 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2036
2037         A fix for #76744.
2038         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2039         only not visible.
2040
2041 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2042
2043         A fix for #77916.
2044         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2045         array.
2046
2047 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2048
2049         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2050         attribute is present and Guid not.
2051         (Interface.ApplyAttributeBuilder): Ditto.
2052
2053         * attribute.cs: Add error message.
2054
2055 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2056
2057         A fix for #78020.
2058
2059         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2060         sources (it's composite) so hold them in extra array as they are used in
2061         Emit phase only. It worked in the previous versions by mistake.
2062         (Attribute.Emit): Emit attribute for more owners when exist.
2063
2064         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2065         it has now different behaviour.
2066
2067 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2068
2069         * constant.cs (Constant.IsDefaultInitializer): New method.
2070
2071         * class.cs: Updated.
2072
2073         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2074         re-initialize default values. It saves KBs almost for every assembly.
2075         Thanks Zoltan for the idea.
2076         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2077         (ArrayCreation.DoResolve): Resolve only once.
2078         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2079         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2080
2081 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2082
2083         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2084         From #77961.
2085
2086 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2089         in an embedded statement too.
2090
2091 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2092
2093         Fix #77958
2094         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2095
2096 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2097
2098         A fix for #77966.
2099
2100         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
2101         was not specified.
2102
2103         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
2104
2105 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
2106
2107         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
2108         phase.
2109
2110         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
2111         LocalTemporary change.
2112
2113         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
2114         TypeContainer.
2115         (ClassOrStruct.DefineFieldInitializers): Implemented static field
2116         initializers optimization.
2117         (ClassOrStruct.TypeAttr): Moved from modifiers.
2118         (Constructor.CheckBase): Don't crash when static ctor has parameters.
2119         (FieldBase.ResolveInitializer): Resolves initializer.
2120         (FieldBase.HasDefaultInitializer): New property.
2121
2122         * cs-parser.jay: Removed message.
2123
2124         * expression.cs (CompilerGeneratedThis): New specialization.
2125
2126         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
2127
2128 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
2129
2130         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
2131
2132 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2133
2134         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
2135         be now EnumConstants only.
2136
2137 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
2138
2139         * attribute.cs, driver.cs: Reset more caches.
2140
2141 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2142
2143         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
2144
2145 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2146
2147         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
2148         for easier reuse. Updated all overrides.
2149         (IntegralConstant): New base class for all integral constants.
2150         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
2151         of the constant range, report custom error.
2152         (UIntConstant.Reduce): Fixed uint conversion.
2153
2154         * ecore.cs, literal.cs: Reduce updates.
2155
2156 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2157
2158         A fix for #75813.
2159
2160         * class.cs (Constructor.Define): Removed extra if for default ctors.
2161         A patch from Atsushi Enomoto.
2162
2163 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
2164
2165         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
2166         GetAttributableValue.
2167
2168         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
2169         when required.
2170
2171         * convert.cs (ImplicitConversionRequired): Error message moved to
2172         DoubleLiteral.
2173
2174         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
2175         automatic implicit conversion of an output value.
2176         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
2177
2178         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
2179         conversion.
2180         (TypeOf.GetAttributableValue): Add extra handling for object type.
2181
2182         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
2183         special error message.
2184
2185 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
2186
2187         * class.cs (Constructor.Emit): Don't crash when struct ctor is
2188         InternalCall.
2189         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
2190         compatible with MS runtime.
2191
2192 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
2193
2194         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
2195         attribute arguments here.
2196
2197         * class.cs (Indexer.Define): The check was moved to attribute class.
2198
2199 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
2200
2201         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
2202         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
2203         easier.
2204
2205 2006-03-22  Raja R Harinath  <rharinath@novell.com>
2206
2207         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
2208         mcs to keep code differences small.
2209         * attribute.cs (Attribute.GetParameterDefaultValue): New.
2210         * typemanager.cs (parameter_default_value_attribute_type): New.
2211         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
2212         CS1908 check.
2213
2214 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2215
2216         * expression.cs (StringConcat.Append): Reverted back to no warning state.
2217
2218 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2219
2220         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2221
2222         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2223         the blocks too.
2224
2225 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2226
2227         * doc-bootstrap.cs : fix build.
2228
2229 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2230
2231         * expression.cs (StringConcat.Append): Issue a warning when empty string
2232         is going to append.
2233
2234 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2235
2236         * assign.cs (CompoundAssign.ResolveSource): Removed.
2237
2238         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2239         clean up.
2240
2241         * class.cs (TypeContainer.FindMethods): Removed.
2242         (TypeContainer.CheckMemberUsage): Made static.
2243
2244         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2245
2246         * constant.cs (CheckRange): Removed unused type argument.
2247         (CheckUnsigned): Removed unused type argument.
2248
2249         * cs-parser.jay: Updated after MemberAccess clean up.
2250         Uses Length for empty string test.
2251
2252         * cs-tokenizer.cs: Uses Length for empty string test.
2253         (IsCastToken): Made static.
2254         (is_hex): Made static.
2255         (real_type_suffix): Made static.
2256
2257         * decl.cs (SetupCache): Made static.
2258         (OnGenerateDocComment): Removed unused ds argument.
2259
2260         * delegate.cs (VerifyDelegate): Removed unused argument.
2261
2262         * doc.cs: Uses Length for empty string test.
2263
2264         * driver.cs: Uses Length for empty string test.
2265
2266         * enum.cs (IsValidEnumType): Made static
2267
2268         * expression.cs (EnumLiftUp): Removed unused argument.
2269         (ResolveMethodGroup): Ditto.
2270         (BetterConversion): Ditto.
2271         (GetVarargsTypes): Ditto.
2272         (UpdateIndices): Ditto.
2273         (ValidateInitializers): Ditto.
2274         (MemberAccess.ctor): Ditto.
2275         (GetIndexersForType): Ditto.
2276
2277         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2278
2279         * iterators.cs: Updated after MemberAccess clean up.
2280
2281         * location.cs: Uses Length for empty string test.
2282
2283         * namespace.cs: Uses Length for empty string test.
2284
2285          * report.cs (CheckWarningCode): Made static.
2286
2287         * statement.cs (LabeledStatement): Removed unused argument.
2288
2289         * typemanager.cs (FilterNone): Removed.
2290
2291 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2292
2293         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2294         obsolete.
2295
2296         * class.cs: Updated.
2297
2298 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2299
2300         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2301
2302 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2303
2304         A fix for #77822.
2305
2306         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2307         reporting, it's more tricky than I thought.
2308
2309 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2310
2311         A fix for #77816.
2312
2313         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2314         host container.
2315         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2316         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2317         Add more error reporting; Fixed issue with params.
2318
2319         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2320
2321         * cs-parser.jay: AnonymousMethod requires host container.
2322
2323         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2324
2325 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2326
2327         * class.cs: Change 'TypeContainer ds' constructor argument to
2328         'DeclSpace parent'.  Some classes were missed below due to
2329         different naming convention.
2330
2331         * class.cs (MemberCore.Parent): Delete.  This makes the
2332         ParentContainer changes below enforceable by the compiler.
2333
2334         Treat pointers to enclosing declaration space as 'DeclSpace', not
2335         'TypeContainer'.
2336         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2337         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2338
2339         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2340         of TypeContainer.
2341         (Block.AddThisVariable): Likewise.
2342         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2343         (AbstractPropertyEventMethod.Emit): Likewise.
2344         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2345         (GetMethod.Define, SetMethod.Define): Likewise.
2346         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2347         (DelegateMethod.EmitMethod): Likewise.
2348
2349         Fix regression test-partial-13.cs.
2350         Rationalize use of PartialContainer.  Ensure that the partial
2351         class semantics can be tied to type-correctness, i.e., any
2352         violation will cause a compile error.
2353         * class.cs, const.cs: Access all fields that belong to class
2354         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2355         Resolve()-like functions still use 'Parent'.
2356
2357         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2358         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2359         (PropertyMethod.CheckModifiers): Remove unused argument.
2360         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2361         DeclSpace.
2362
2363 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2364
2365         Make semantics of PartialContainer simpler.
2366         * decl.cs (DeclSpace.IsPartial): Remove.
2367         * class.cs (TypeContainer.IsPartial): Likewise.
2368         (TypeContainer..ctor): Set PartialContainer to point to self.
2369         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2370         (TypeContainer.FindNestedType): Likewise.
2371         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2372
2373 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2374
2375         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2376
2377 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2378
2379         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2380         classes.
2381
2382 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2383
2384         * class.cs (Operator.Define): An error for base conversion was not
2385         reported correctly.
2386
2387 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2388
2389         * iterator.cs : yield break is allowed in try statement which has
2390           catch clauses. Fixed bug #77767.
2391
2392 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2393
2394         A fix for #77593, #77574.
2395
2396         * class.cs (MethodCore.CheckBase): Another if for operator.
2397
2398 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2399
2400         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2401         were not resolved
2402
2403         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2404         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2405         conversion test.
2406         
2407         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2408         not needed.
2409
2410         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2411         Updated after another emitcontext usage was clean up. It should help us to
2412         synchronize with gmcs easier.
2413
2414 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2415
2416         A fix for #77353.
2417
2418         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2419         (Event.Define): ditto
2420         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2421
2422         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2423         Removed redundant code and set NewSlot for Invoke method too.
2424
2425         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2426         (Parameters.MergeGenerated): New method. Use this method when you merge
2427         compiler generated argument with user arguments.
2428
2429 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2430
2431         * attribute.cs (ResolveAsTypeTerminal): Removed.
2432
2433         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2434         specialization for predefined types; 30% speed up.
2435         Finally placed obsolete check to right place.
2436         (Expression.ResolveType): Removed.
2437
2438         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2439         Updated after ResolveType was removed.
2440
2441         * expression.cs (Cast.ctor): Check void cast.
2442         (Binary.ResolveAsTypeTerminal): Is never type.
2443         (Conditional.ResolveAsTypeTerminal): Is never type.
2444
2445         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2446
2447 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2448
2449         Fix #77679.
2450         * expression.cs (ParameterReference.DoResolveBase): Change return
2451         type to bool.
2452         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2453         Update.
2454
2455         Fix #77628.
2456         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2457
2458         Fix #77642.
2459         * typemanager.cs (GetFullNameSignature): Don't nullref on
2460         protected accessors.
2461
2462 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2463
2464         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2465         these two separated members to simplify the code.
2466         (Attribute.Resolve): Refactored to use new fields and methods.
2467         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2468         implemented obsolete attribute checking.
2469         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2470         implemented obsolete checking again. It look line never ending quest ;-)
2471         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2472
2473         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2474
2475         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2476
2477         *class.cs (Property.Define): Add RegisterProperty call.
2478
2479         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2480         argument groups (only 2).
2481
2482         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2483         encoding expression to arguments.
2484         (Expression.ExprClassToResolveFlags): Just turned to property.
2485
2486         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2487         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2488         optimized as well as implemented support for zero-length attributes.
2489
2490         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2491         Add caching of PropertyInfo's.
2492
2493 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2494
2495         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2496         error multiple times.
2497
2498 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2499
2500         New partial class implementation.
2501         A fix for #77027, #77029, #77403
2502
2503         * attribute.cs (Attributable): Made attributes protected.
2504
2505         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2506         the replacements of ClassPart and PartialContainer.
2507         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2508         (TypeContainer.AddInterface): Ditto.
2509         (TypeContainer.AddPartial): The main method for partial classes. It checks
2510         for errors and merges ModFlags and attributes. At the end class is added to
2511         partial_parts list.
2512         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2513         required here.
2514         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2515         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2516         from the rest of partial classes.
2517         (TypeContainer.GetClassBases): Simplified.
2518         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2519         DefineType.
2520         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2521         (TypeContainer.HasExplicitLayout): Uses Flags now.
2522         (PartialContainer): Removed.
2523         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2524         (StaticClass): Was merged with Class.
2525         (Class.GetClassBases): class and static class bases are verified here.
2526         (Class.TypeAttr): Added static attributes when class is static.
2527         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2528         (MemberBase): In some cases we need to call parent container for partial
2529         class. It should be eliminated but it's not easy now.
2530
2531         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2532
2533         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2534         partial classed to accumulate class comments.
2535         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2536
2537         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2538
2539         * driver.cs (MainDriver): Tree.GetDecl was removed.
2540
2541         * modifiers.cs (Modifiers): Add partial modifier.
2542
2543         * tree.cs (Tree.decl): Removed.
2544         (RootTypes): Started to use this class more often for root types
2545         specializations.
2546
2547 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2548
2549         A fix for #77615
2550
2551         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2552         external interface does not have an attribute.
2553
2554 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2555
2556         Another prerequisites for new partial classs implementation.
2557         
2558         * attribute.cs (Attribute.Equal): Implemented.
2559         (Attribute.Emit): Changed as attributes can be applied more than twice.
2560         (Attributes.Emit): Check for duplicate attributes here.
2561
2562         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2563         as a parameter, clean-up.
2564
2565 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2566
2567         A fix for #77485
2568
2569         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2570         contains obsolete attribute check which can in some cases look for base
2571         type of current class which is not initialized yet.
2572         (TypeContainer.BaseType): Replacement of ptype.
2573
2574         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2575
2576 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2577
2578         First of prerequisites for new partial classs implemention.
2579         
2580         * attribute.cs (Attributable): Extended by ResolveContext;
2581         Attributes finally have correct context for resolving in all cases.
2582         (AttachTo): Attribute owner is assigned here.
2583
2584         * codegen.cs (IResolveContext): Introduce new interface to hold
2585         all information needed in resolving phase.
2586         (EmitContext): Implements IResolveContext; more clean-up needed here.
2587         
2588         * decl.cs (MemberCore): Implemented IResolveContext.
2589
2590         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2591         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2592         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2593         Refactored to use new IResolveContext instead of EmitContext; cleanup
2594
2595 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2596
2597         * codegen.cs (EmitScopeInitFromBlock): check here the
2598         capture_context, there is no need to make two calls to the
2599         EmitContext. 
2600
2601         * anonymous.cs: Add some debugging messages that might help me
2602         track other instances of this problem in the future (the
2603         regression of test 467).
2604
2605         * cs-parser.jay: track the variable block, as we need to initalize
2606         any captured variables declared in this block for the "catch"
2607         portion of the "Try" statement.
2608
2609         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2610         scope initialization for captured variables. 
2611
2612         Also, move the emit for the variables after the block location has
2613         been marked.
2614
2615 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2616
2617         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2618
2619 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2620
2621         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2622         commit yesterday, the initialization for the roots is necessary.
2623         What is not necessary is the scope activation.
2624
2625 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2626
2627         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2628         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2629         CS0206 checks.
2630         (Argument.Resolve): Remove CS0206 checks.
2631
2632 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2633
2634         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2635         scopes for all the roots, the scopes will now be emitted when the
2636         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2637
2638         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2639         code.  This reduces a lot of existing cruft.
2640         
2641         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2642         that the ScopeInfo is generated as we enter the scope, not at the
2643         time of use, which is what we used to do before.
2644
2645         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2646         every time a Block is about to be emitted if we have a
2647         CaptureContext. 
2648
2649 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2650
2651         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2652         (Reset): Update.
2653         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2654
2655         * typemanager.cs (cons_param_array_attribute): Make private.
2656         (Reset): Set it to null.
2657         (InitCoreHelpers): Don't initialize it.
2658         (ConsParamArrayAttribute): New.  Initialize it as needed.
2659         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2660
2661 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2662
2663         * expression.cs: There might be errors reported during the
2664         selection of applicable methods.  If there are errors, do not
2665         continue execution as it will lead the compiler to crash.
2666
2667 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2668
2669         * expression.cs: Member access is not allowed on anonymous
2670         methods.  Fixes #77402.
2671
2672 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2673
2674         Fix #77401
2675         * cs-parser.jay (VariableDeclaration): Don't set
2676         current_array_type to null.
2677         (field_declaration, event_declaration, declaration_statement):
2678         Set it to null here.
2679
2680 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2681
2682         * typemanager.cs (GenericParameterPosition): New.
2683         * doc.cs: Use it.
2684
2685 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2686
2687         * doc.cs : To process "include" elements, first we should create
2688           another list than XmlNodeList, because it could result in node
2689           removal, which could result in that the XmlNodeList gives up
2690           yielding next node.
2691
2692           (Also made code identical to gmcs again.)
2693
2694 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2695
2696         * ecore.cs: Introduce an error report that we were not catching
2697         before, if not silent, we must report the error.  Gonzalo ran into
2698         it.
2699
2700 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2701
2702         A fix for bug: #76957
2703         
2704         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2705         ComputeMethodHost before creating the method, this is a new
2706         requirement. 
2707
2708         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2709         that this method references (RegisterScope).  The actual scope
2710         where the method is hosted is computed with the ComputeMethodHost
2711         before we create the method.
2712
2713         Moved the Deepest routine here.
2714
2715         (AnonymousContainer.ComputeMethodHost): New routine used to
2716         compute the proper ScopeInfo that will host the anonymous method.
2717
2718         (ScopeInfo): Deal with multiple roots.  The problem was that we
2719         did not have a unique root where all ScopeInfos could be hanged
2720         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2721         of roots.  
2722
2723         Remove AdjustMethodScope which is now computed at the end.  Remove
2724         LinkScope which did a partial link, instead link all ScopeInfos
2725         before code generation from the new "LinkScopes" routine. 
2726
2727         Simplify all the Add* routines as they no longer need to maintain
2728         the tree, they just need to record that they are using variables
2729         from a ScopeInfo.
2730
2731         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2732         routines to produce the forest of ScopeInfo trees.
2733
2734         * class.cs (TypeContainer.AppendMethod): This is just like
2735         AddMethod, but ensures that an interface implementation method
2736         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2737         methods, but at the end.
2738
2739         We use this functionality to ensure that the generated MoveNext
2740         method in the iterator class is resolved/emitted before the
2741         enumerator methods created.   
2742
2743         This is required because the MoveNext method computes the right
2744         ScopeInfo for the method.  And the other methods will eventually
2745         need to resolve and fetch information computed from the anonymous
2746         method. 
2747
2748 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2749             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2750
2751         Fix rest of #76995.
2752         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2753         the 'aliases' hash.
2754         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2755         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2756
2757 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2758
2759         Fix #76656, cs0231-2.cs.
2760         * cs-parser.jay (formal_parameter_list): Make error case catch
2761         more issues.
2762         (parenthesized_expression_0): Add CS1026 check.
2763         (invocation_expression): Remove unused { $$ = lexer.Location }.
2764
2765 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2766
2767         Fix #76824.
2768         * cs-parser.jay (statement_expression): Don't list out the
2769         individual statement-expressions.  Convert syntax error into
2770         CS0201 check.
2771
2772 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2773
2774         Fix #76874.
2775         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2776         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2777         CheckIntermediateModification.
2778         (FieldExpr.DoResolve): Add new two-argument version that
2779         allows us to resolve the InstanceExpression as an lvalue.
2780         The one-argument variant is now just a wrapper.
2781         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2782         Resolve the lhs as an lvalue if the it has a value type.
2783         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2784         from Assign.DoResolve.
2785         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2786         resolved as an lvalue.
2787         (PropertyExpr.DoResolve): Update.
2788         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2789         has a value type.  Move CS1612 check here from
2790         CheckIntermediateModification.
2791         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2792         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2793         'right_side' of a ResolveLValue on an 'out' argument.
2794         (EmptyExpression.LValueMemberAccess): New.  Used as the
2795         'right_side' of a propagated ResolveLValue on a value type.
2796         (LocalVariableReference.DoResolveBase): Recognize
2797         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2798         Add CS1654 check.
2799         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2800         EmptyExpression.Null.
2801
2802 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2803
2804         * typemanager.cs : added IsGenericParameter(). In mcs it always
2805           return false.
2806         * doc.cs : for generic parameters, use GenericParameterPosition,
2807           not FullName.
2808
2809 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2810
2811         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2812
2813 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2814
2815         This fixes the problem where we used ldfld instead of ldflda to
2816         load the "THIS" pointer on captured parameters, when THIS is a
2817         value type.  See bug #77205.
2818         
2819         * iterators.cs (CapturedThisReference.Emit): Pass false to
2820         EmitThis (we do not need the address).
2821
2822         * codegen.cs (EmitThis): it needs to know whether we need the
2823         address of `this' or not.  This is used by value types.  
2824
2825         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2826         every other call passes false.
2827
2828 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2829
2830         Fix #77221.
2831         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2832         GetOverride.
2833         * expression.cs (Invocation.OverloadResolve): Update.
2834         (Invocation.DoResolve): Avoid double resolution of invocation.
2835
2836 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2837
2838         Fix #77180.
2839         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2840         unary negation of floating point types as 0-expr; negation cannot
2841         overflow in floating point types.
2842
2843         Fix #77204.
2844         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2845         on operands of 'void' type.
2846
2847         Fix #77200.
2848         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2849         and ExclusiveOr for boolean constants too.
2850
2851 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2852
2853         Fix #75636.
2854         * expression.cs (Invocation.OverloadResolve): Replace reflected
2855         override methods with their base virtual methods, rather than
2856         skipping over them.
2857         * typemanager.cs (TypeManager.GetOverride): New.
2858
2859 2006-01-05  Jb Evain  <jbevain@gmail.com>
2860
2861         * class.cs (Property.Define, Indexer.Define): do not tag the
2862         properties as SpecialName | RTSpecialName.
2863
2864 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2865
2866         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2867         doing a low-level comparission of parameter types.  It was lacking
2868         a check for __argslist. 
2869
2870 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2871
2872         * expression.cs (ParameterReference.DoResolveBase): Allow
2873         reference parameters if they are local to this block. 
2874
2875         This allows the ref and out parameters of a delegate to be used in
2876         an anonymous method, for example:
2877
2878         delegate void set (out int x);
2879
2880         set s = delegate (out int x){
2881                 x = 0;
2882         };
2883
2884         This is used by functionality introduced late in the C# language.
2885         
2886         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2887         method that take ref and out parameters. 
2888
2889         Fixes #77119 which was a late change in the spec.
2890
2891 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2892
2893         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2894         parent if its the same scope.  Fixes #77060.
2895
2896 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2897
2898         * driver.cs: Report the case of no source files and no -out:
2899         argument provided.
2900
2901 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2902
2903         Fix #77035.
2904         * expression.cs (ComposedCast.GetSignatureForError): Define.
2905
2906 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2907
2908         Fix #76995
2909
2910         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2911         ListDictionary, to contain the ExternAliasEntry entries (in
2912         addition to the NamespaceEntry.aliases hashtable). This field is
2913         shared between the original entry and its doppelganger (bodyless 
2914         copy of it).
2915         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2916         extern_aliases field.
2917         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2918         lookup in extern_aliases.
2919
2920 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2921
2922         Fix #77006.
2923         * class.cs (TypeContainer.Mark_HasEquals): New.
2924         (TypeContainer.Mark_HasGetHashCode): New.
2925         (ClassPart): Override them.
2926         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2927
2928         Fix #77008.
2929         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2930         'parent' argument to the base constructor.
2931
2932         Remove all mention of TypeContainer from decl.cs.
2933         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2934         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2935         (DeclSpace.DeclSpace): Likewise.
2936         (DeclSpace.DefineMembers): Remove unused argument.
2937         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2938         debugging check -- we don't care if the debug code throws an
2939         InvalidCastException instead of an InternalErrorException.
2940         * class.cs (TypeContainer.DefineMembers): Update to changes.
2941         (TypeContainer.DoDefineMembers): Likewise.
2942         (TypeContainer.GetMethods): Likewise.
2943         (PropertyMember.Define): Likewise.
2944         (MemberBase.Parent): New property that forwards to
2945         MemberCore.Parent, but ensures that we get a TypeContainer.
2946         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2947         (RootContext.PopulateTypes): Likewise.  Remove special case code
2948         for !RootContext.StdLib: DefineMembers is idempotent.
2949
2950 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2951
2952         * convert.cs (ExplicitConversionCore): Check the return value from
2953         ExplicitConversionCore which can return null on failure.  Fixes #76914
2954
2955 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2956
2957         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2958
2959 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2960
2961         * doc.cs : The search for referenced namespace was insufficient to
2962           get global one as it used to do. Fixed bug #76965.
2963
2964 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2965
2966         * doc.cs : check name in cref in the last phase that whether it is
2967           namespace or not.
2968
2969 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2970
2971         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2972           Mono.C5.
2973
2974 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2975
2976         * doc.cs : so it turned out that we cannot skip override check for 
2977           interface members. Fixed bug #76954.
2978
2979 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2980
2981         * cs-tokenizer.cs : fixed bug #75984:
2982           - #warning and #error should not be handled when the source line
2983             is disabled.
2984           - #line is not checked strictly when the source line is disabled.
2985           - #define and #undef is on the other hand checked strictly at any
2986             state.
2987
2988 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2989
2990         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2991           CS1027 report.
2992
2993 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2994
2995         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2996
2997         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2998         event initializers.
2999         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3000         (FieldBase.Initializer): Initializer is now optional.
3001         (EventField.Define): Only event field can have initializer.
3002
3003         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3004
3005         * const.cs (Const): Reuse initializer.
3006
3007         * cs-parser.jay: Updated after FieldBase changes.
3008         Added current_array_type to simplify array initializers.
3009
3010         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3011
3012         * expression.cs, iterators.cs: Updated.
3013
3014         * namespace.cs (NamespaceEntry): Made UsingFound private.
3015
3016 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * parameterCollection.cs: Obsolete, removed.
3019         * parser.cs: Obsolete, removed.
3020
3021 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3022
3023         Fix #76849.
3024         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3025
3026         * enum.cs (Enum.Define): Set obsolete context here.
3027
3028 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3029
3030         * doc.cs :
3031           - FindDocumentedMember() now expects 1) paramList as null
3032             when "we don't have to check the number of parameters" and
3033             2) Type.EmptyTypes when "there is no arguments".
3034           - Introduced FoundMember struct to hold the exact type which was
3035             used to find the documented member (the above change broke
3036             test-xml-044; it might be better just to use DeclaringType than
3037             what MS does, like this change does, but it depends on usage.)
3038
3039 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3040
3041         * doc.cs : documented member might be from DeclaringType for nested
3042           types. Fixed bug #76782.
3043
3044 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3045
3046         * anonymous.cs: Have the param code handle leaving copies on the
3047         stack etc. Allows anonymous params to take part in the assignment
3048         code (++, +=, etc). Fixes bug #76550
3049
3050         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3051         it down to the anon code.
3052
3053         * iterators.cs: Use dummy var here
3054
3055         * codegen.cs: Handle new vars
3056
3057 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3058
3059         Fix #76849.
3060         * class.cs (MethodData.Define): Set proper Obsolete context.
3061
3062         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3063         obsolete context.
3064         (FieldExpr.DoResolve): Ditto.
3065
3066 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3067
3068         Fix #76849.
3069         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3070         parent is not obsolete.
3071
3072 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3073
3074         * doc.cs : (FindDocumentedMember) find parameterless members first
3075           and get CS0419 in the early stage. Fixed first case of bug #76727.
3076
3077 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3078
3079         Fix #76859.
3080         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3081         no error was reported.
3082
3083         *expression.cs (Binary.DoResolve): left can be null.
3084
3085 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3086
3087         Fix #76783.
3088         * class.cs (MethodData.Emit): Parameters should be labeled first.
3089
3090 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3091
3092         Fix #76761.
3093         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3094
3095 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3096
3097         * attribute.cs (AreParametersCompliant): Moved to Parameter.
3098
3099         * class.cs (MethodCore): Parameter clean up.
3100         (IMethodData): Added ParameterInfo.
3101         (MethodData): Parameter clean up.
3102         (Indexer.Define): Parameter clean up.
3103
3104         * anonymous.cs,
3105         * codegen.cs,
3106         * cs-parser.jay,
3107         * decl.cs,
3108         * doc.cs,
3109         * ecore.cs,
3110         * flowanalysis.cs,
3111         * iterators.cs,
3112         * pending.cs,
3113         * statement.cs,
3114         * typemanager.cs: Parameter clean up.
3115
3116         * delegate.cs (Define): Get rid of duplicated code.
3117
3118         * expression.cs (ParameterReference): Removed useless parameters
3119         and simplified.
3120         (Invocation): Ditto.
3121
3122         * parameter.cs (ParamsParameter): New class, params specialization.
3123         (ArglistParameter): Attemp to separate arglist.
3124         (Parameter): Refactored to be reusable and faster.
3125         (Parameter.Modifier): Made understandable.
3126         (Parameters): Changed to be used as a class for `this' assembly
3127         parameters. Refactored to use new specialized classes.
3128
3129         * support.cs (ParameterData): Added Types property.
3130         (InternalParameters): Deleted.
3131
3132 2005-08-20  Martin Baulig  <martin@ximian.com>
3133
3134         Merging this patch from GMCS to fix #75867.
3135
3136         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3137         scope if we don't already have it.
3138
3139 2005-11-17  Martin Baulig  <martin@ximian.com>
3140
3141         * anonymous.cs
3142         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
3143         inherit the scope from our parent.  Fixes #76653.
3144
3145 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3146
3147         * doc.cs : the previous patch does not actually fix the bug.
3148           PropertyInfo override check is now implemented and really fixed it.
3149         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
3150
3151 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3152
3153         * doc.cs : apply "override filter" also to properties.
3154           Fixed bug #76730.
3155
3156 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
3157
3158         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
3159           no need to check overrides. For classes, omit those results from 
3160           interfaces since they must exist in the class. Fixed bug #76726.
3161
3162 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3163
3164         * typemanager.cs : (GetFullNameSignature) differentiate indexers
3165           with different parameters. Fixed the second problem in #76685.
3166
3167 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3168
3169         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
3170           get expected 'protected' access in CheckValidFamilyAccess()).
3171           Fixed bug #76692.
3172
3173 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
3174
3175         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
3176           Fixed bug #76705.  CS1569 was incorrectly commented out.
3177
3178 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3179
3180         * doc.cs : use Invocation.IsOverride() to do real override check.
3181         * expression.cs : made Invocation.IsOverride() internal.
3182
3183 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
3184
3185         * doc.cs : use TypeManager.FindMembers() instead of (possible)
3186           TypeBuilder.FindMembers() and filter overriden base members out.
3187           Fixed bug #76990.
3188
3189 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3190
3191         * doc.cs : ref/out parameters are represented as '@' (instead of
3192           '&' in type FullName). Fixed bug #76630 (additionally crefs).
3193
3194 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3195
3196         * doc.cs : when there was no '.' in cref to methods in doc comment,
3197           then parameters were missing in the output. Fixed bug #76691.
3198
3199 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3200
3201         * driver.cs : don't output docs when there is an error.
3202           Fixed bug #76693.
3203
3204 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3205
3206         * doc.cs :
3207           Now it should detect indexers. Fixed primary concern in bug #76685.
3208           Fixed CS0419 message to not show the identical member signature in
3209           the message.
3210
3211 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
3212
3213         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
3214           instead of Type.FindMembers() since it does not handle events.
3215           Fixed bug #71604.
3216
3217 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3218
3219         * codegen.cs: Fixed typo (speficied -> specified).
3220
3221 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3222
3223         Fix #76369.
3224         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3225
3226 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3227
3228         * attribute.cs: Changed error message.
3229
3230         * cs-tokenizer.cs: One more check.
3231
3232 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3233
3234         * statement.cs (Block.Resolve): Ignore empty statement.
3235
3236 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3237
3238         * report.cs: Made error/warning methods more strict to avoid
3239         their misuse.
3240
3241         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3242         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3243         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3244         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3245
3246 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3249         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3250
3251         * class.cs (TypeContainer.IsComImport): New property.
3252         (Constructor.Define): Create proper ctor for ComImport types.
3253
3254         * expression.cs (New.CheckComImport): Fixed.
3255
3256 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3257
3258         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3259         that a parameter has been captured does not mean that we do not
3260         have to do the rest of the processing.  This fixes the second part
3261         of #76592.  If there was another anonymous method capturing
3262         values in the past, the Scope would never be set for the second
3263         method that captured the same parameter.
3264
3265         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3266         properly manipulate the stack.   Second part of fix for #76592.
3267
3268         * expression.cs (New): Add support for invoking "new" on
3269         interfaces that have been flagged with the ComImport attribute and
3270         the CoClass.  Fixes #76637 
3271
3272         * statement.cs (Try.DoEmit): When a variable is captured, do not
3273         try to emit the vi.LocalBuilder variable as it has been captured.
3274         Create a temporary variable and store the results on the
3275         FieldBuilder.  Fixes #76642
3276
3277 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3278
3279         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3280
3281         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3282
3283         * expression.cs (Binary.DoResolve): Added && optimalization.
3284     
3285         * typemanager.cs (AddUserType): Removed useless argument.
3286
3287 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3288
3289         * statement.cs (Block.variables): Uses ListDictionary.
3290
3291 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3292
3293         Fix #75969.
3294         * class.cs (PartialContainer.EmitType): Customized to emit
3295         security attributes.
3296         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3297         for partial classes.
3298
3299 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3300
3301         Fix #76599.
3302         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3303         access has to be fixed.
3304         
3305         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3306
3307 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3308
3309         Fix #76590.
3310         * ecore.cs (NullCast.Reduce): Implemented.
3311
3312         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3313         constant type.
3314         
3315         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3316         properly.
3317         (Foreach.Resolve): Catch null properly.
3318
3319 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3320  
3321         * cs-tokenizer.cs: Warning text fix.
3322
3323         * driver.cs: AllWarningNumbers exposed on public interface.
3324
3325         * report.cs (): Reviewed warning numbers.
3326         (IsValidWarning): Use binary search.
3327
3328 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3329  
3330         * driver.cs: Implemeted resource visibility.
3331         (Resources): New class for code sharing between /res: and
3332         /linkres:
3333  
3334 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3335
3336         Fix #76568.
3337         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3338         folding.
3339         
3340         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3341         contants only.
3342         
3343         * ecore.cs (NullCast): Child is contant only.
3344         
3345         * literal.cs (NullLiteral.Reduce): null can be converted to any
3346         reference type.
3347
3348 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3349
3350         * driver.cs: Use Encoding.Default as default code page instead
3351           of ISO-28591.
3352
3353 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3354
3355         Fix #76085.
3356         * expression.cs (Invocation.Error_InvalidArguments): Handle
3357         __arglist parameters.
3358         (Invocation.VerifyArgumentsCompat): Likewise.
3359         * support.cs (ReflectionParameters.GetSignatureForError): Print
3360         __arglist parameters.
3361         (InternalParamters.GetSignatureForError): Likewise.
3362         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3363
3364 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3365
3366         * attribute.cs (GetPropertyValue): Made public.
3367
3368         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3369         Resolve.
3370         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3371         attribute.
3372         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3373         is not defined.
3374         
3375         * driver.cs: Reflect method name change.
3376         
3377         * statement.cs (Try.Resolve): Warn when try has both general
3378         exception handlers.
3379         
3380         * typemanager.cs: runtime_compatibility_attr_type new predefined
3381         type.
3382
3383 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3384
3385         Fix #76419.
3386         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3387         treat it as an empty parameter list.
3388
3389 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3390
3391         Fix #76271.     
3392         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3393         ResolveAsTypeStep silent.
3394         * statement.cs (Block.AddConstant): Mark block as used.
3395         (Block.ResolveMeta): Avoid piling on error messages
3396         if a constant initializer resolution fails.
3397
3398 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3399
3400         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3401         Remove.
3402         (NamespaceEntry.VerifyAllUsing): New.
3403         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3404         behaviour.  Delegates actual resolution of alias to ...
3405         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3406         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3407         Update.
3408         * driver.cs (Driver.MainDriver): Update.
3409         
3410         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3411         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3412         property.
3413         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3414         Remove.
3415         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3416         RootNamespace.DefineNamespacesForAll.
3417
3418 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3419
3420         * typemanager.cs (assemblies, external_aliases, modules)
3421         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3422         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3423         overhead.  Move resposibility ...
3424         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3425         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3426
3427 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3428
3429         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3430         cached_namespaces.  Improve usage.
3431         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3432         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3433         Move from GlobalRootNamespace and simplify.
3434         (RootNamespace.Global): Make instance variable.
3435         (RootNamespace.RootNamespace): Add "alias name" parameter.
3436         (GlobalRootNamespace): Simplify drastically.
3437         (Namespace.Lookup): Don't use GetNamespace.
3438         * typemanager.cs (GetRootNamespace): Rename from
3439         ComputeNamespaceForAlias.
3440         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3441
3442 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3443
3444         * anonymous.cs (AnonymousContainer): Don't crash when container
3445         doesn't exist.
3446
3447 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3448
3449         * expression.cs (Binary.DoResolve): Warn when comparing same
3450         values.
3451
3452 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3453
3454         Fix #76486.
3455         * expression.cs (Binary.DoResolve): It looks like there are no
3456         convetsion rules in enum context.
3457
3458 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3459
3460         Add support for extern alias qualifiers.
3461         * typemanager.cs: Move some LookupTypeReflection code
3462         to namespace.cs, to have cleaner code. Added some methods
3463         to help us keep track of the extern aliased references.
3464         * driver.cs: Add suport for extern alias assemblies on command
3465         line and check for their warnings/errors. Also keep track of the
3466         extern aliased assemblies.
3467         * namespace.cs: Move the global functionality of Namespace
3468         to GlobalRootNamespace/RootNamespace. Now the global namespace
3469         is GlobalRootNamespace.Globa. Also the code moved from 
3470         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3471         Finally added LocalAliasEntry (AliasEntry before) and
3472         ExternAliasEntry, to handle alias statements.
3473         * cs-parser.jay: Add support in the grammar for extern alias
3474         statement.
3475         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3476         Update callings to Namespace (now in GlobalRootNamespace).
3477
3478 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3479
3480         Fix #76371.
3481         * class.cs (TypeContainer.DefineType): Move updating of
3482         topological sort earlier in the code.
3483         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3484
3485 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3486
3487         Fix #76273.
3488         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3489         
3490         * constant.cs (Constant.TryReduce): Moved from Cast class.
3491         (Reduce): Made little bit more OO and fixed missing conversions.
3492         
3493         * ecore.cs (Reduce): Implemented.
3494         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3495         
3496         * literal.cs (Reduce): Implemented.
3497         
3498         * class.cs: Reverted Miguel's wrong commit.
3499
3500 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3501
3502         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3503
3504 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3505
3506         * cs-parser.jay, expression.cs : CS0214 was missing error location
3507           for constants. Fixed bug #76404.
3508
3509 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3510
3511         Fix #76370.
3512         * convert.cs (ExplicitConversionCore): Fixed object->enum
3513         conversion.
3514
3515 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3516
3517         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3518         InstanceExpression.
3519         (PropertyExpr.EmitCall): Likewise.
3520         * expression.cs (Invocation.EmitArguments): Handle case where
3521         arguments == null.
3522         (Invocation.EmitCall): Avoid allocating temporary variable if
3523         there are no arguments.
3524
3525 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3526
3527         Fix #76323.
3528         * convert.cs (ImplicitConversionStandard): Move conversion of
3529         void* to arbitrary pointer types ...
3530         (ExplicitConversionStandard): .. here.
3531         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3532         error to always print typenames.
3533
3534 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3535
3536         * convert.cs (GetConversionOperator): Rename from
3537         GetConversionOperators.  Move operator selection code from ...
3538         (UserDefinedConversion): ... here.
3539
3540 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3541
3542         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3543         conversion.
3544
3545 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3546
3547         * assign.cs (Assign.DoResolve): Error method changed.
3548
3549         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3550         
3551         * const.cs (ResolveValue): Reset in_transit immediately.
3552         
3553         * constant.cs: Error method changed.
3554         
3555         * convert.cs: Removed useless location parameter.
3556         (ExplicitNumericConversion): Don't do double enum check.
3557         (ExplicitConversionCore): Renamed from ExplicitConversion.
3558         (ExplicitUnsafe): Extracted from ExplicitConversion.
3559         (ExplicitConversion): Uses for error reporting.
3560         
3561         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3562         error messages.
3563         (ResolveBoolean): Uses common error method.
3564         (CastToDecimal): Get rid of ec.
3565         (CastFromDecimal): Optimized.
3566         (ConvCast): Get rid of ec.
3567         
3568         * enum.cs (ResolveValue): Reset in_transit immediately.
3569         (Emit): Return after first error.
3570         
3571         * expression.cs: Convert changes.
3572         
3573         * literal.cs: Error method changed.
3574         
3575         * statement.cs: Error method changed.
3576
3577 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3578
3579         * support.cs (SeekableStreamReader.Position): Don't error out when
3580         the requested position is just beyond the end of the current
3581         buffered data.
3582
3583 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3584
3585         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3586         try to keep in sync with the byte count of the underlying Stream.
3587         However, this limits us to a window size of 2048 characters: i.e.,
3588         the maximum lookahead of our lexer/parser can be 2048 characters.
3589
3590 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3591
3592         Fix #76255.
3593         * driver.cs: Fix compilation files with full root path.
3594
3595 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3596
3597         * report.cs (SymbolRelatedToPreviousError): Format the output so
3598         it does not use an open parenthesis that is never closed. 
3599
3600         * driver.cs: Follow coding guidelines
3601
3602 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3603
3604         Fix #72930.
3605         * const.cs (Const.ResolveValue): Check for assigning non-null
3606         value to reference type.
3607
3608 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3609
3610         * anonymous.cs: Implemented ExprClassName.
3611         
3612         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3613         delegate.
3614         
3615         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3616         check.
3617         
3618         * class.cs (StaticClass.DefineContainerMembers): Report protected
3619         members as error.
3620         
3621         * codegen.cs: if(ed) PRODUCTION.
3622         
3623         * convert.cs (Error_CannotImplicitConversion): Better error
3624         distinction.
3625         
3626         * cs-parser.jay: More error checks.
3627         
3628         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3629         
3630         * driver.cs (CSCParseOption): Enabled wrong option check.
3631         
3632         * ecore.cs (Expression.ExprClassName): Turned to property.
3633         (MemberExpr.CheckIntermediateModification): For checking boxed
3634         value types     modification.
3635         
3636         * statement.cs (Fixed.Resolve): Expression type must be
3637         convertible to fixed type.
3638         (CollectionForeach.GetEnumeratorFilter,TryType):
3639         Small refactoring for easier error checking.
3640
3641 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3642
3643         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3644         attributes.
3645         
3646         * class.cs (GeneratedBaseInitializer): New class for customization
3647         compiler generated initializers.
3648         (MemberBase.DoDefine): Check Obsolete attribute here.
3649         (FieldMember.DoDefine): Ditto.
3650         
3651         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3652         constants.
3653         
3654         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3655         (MemberCore.GetObsoleteAttribute): Removed argument.
3656         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3657         (MemberCore.CheckObsoleteType): New helper.
3658         
3659         * delegate.cs,
3660         * enum.cs,
3661         * statement.cs: Updates after MemberCore changes.
3662         
3663         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3664         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3665         
3666         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3667         obsolete attribute for compiler construct.
3668         (As.DoResolve): Cache result.
3669         
3670         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3671
3672 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3673
3674         Fix #76133.
3675         * expression.cs (This.VerifyFixed): In a value type T, the type of
3676         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3677         value type R, 'this' is treated as a value parameter.
3678
3679 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3680
3681         * statement.cs (Lock): Use the TemporaryVariable class instead of
3682         manually using local variables as those do not work when variables
3683         are captured.
3684
3685         * ecore.cs: Moved the TemporaryVariable class from being a nested
3686         class inside Foreach to be a public class that can be employed in
3687         other places. 
3688
3689 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3690
3691         * cs-parser.jay: interface_accessors replaced by
3692         accessor_declarations.
3693
3694         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3695         location.
3696         
3697         * statement.cs (GotoCase.Resolve): Convert null constant to
3698         null case.
3699         (SwitchLabel.ResolveAndReduce): Ditto.
3700         (SwitchLabel.NullStringCase): Custom null stamp.
3701         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3702         
3703         typemanager.cs (CSharpSignature): Don't skip first argument
3704         for full names.
3705
3706 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3707
3708         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3709
3710         * location.cs (InEmacs): in this mode, do not report column
3711         location as it confuses Emacs.
3712
3713 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3714
3715         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3716         expression.cs, iterators.cs, literal.cs: Store constants and
3717         literals location.
3718         
3719         * class.cs (MemberBase.ShortName): Pass location.
3720         
3721         * cs-parser.jay: Some location fixes.
3722         
3723         * ecore.cs (Expression.Location): Made virtual.
3724
3725 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3726
3727         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3728         if the underlying types are the same, otherwise we need to produce
3729         code that will do the proper cast.
3730
3731         This was exposed by Marek's constant rewrite which produced
3732         invalid code for the call site:
3733
3734         enum X : long { a }
3735         void Method (X v) {}
3736
3737         Method ((X) 5)
3738
3739         This fixes test-49.cs
3740
3741 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3742
3743         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3744           Type/Object should be allowed as well. Fixed bug #75968.
3745
3746 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3747
3748         * expression.cs : (Binary.DoResolve): when one is enum constant and
3749           another is constant 0, then return enum one *as enum type*.
3750           Fixed bug 74846.
3751
3752 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3753
3754         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3755         internal.
3756
3757         Fix #75941.
3758         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3759         flow-branching for LocalVariableReferences in case we were invoked
3760         from a MemberAccess.
3761         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3762         Carved out of ...
3763         (LocalVariableReference.DoResolveBase): ... this.
3764         (MemberAccess.Resolve): Do the check that was disabled during
3765         SimpleNameResolve.
3766
3767 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3768
3769         * class.cs :
3770           (PartialContainer.Create): check abstract/sealed/static strictly
3771           but abstract/sealed can exist only at one side. Fixed bug #75883.
3772
3773 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3774
3775         Fix #75945.
3776         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3777         specified, don't default to UnmanagedType.I4.
3778
3779 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3780
3781         * expression.cs : conditional operator should check possibly
3782           incorrect assign expression. Fixed bug #75946.
3783
3784 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3785
3786         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3787           Reverting the change. gmcs is much complex than mcs on this matter.
3788
3789 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3790
3791         * cs-tokenizer.cs : To read another token ahead of the actual 
3792           consumption, use new SavedToken and cache token instead of moving
3793           back the stream with SeekableStreamReader (it seemed problematic).
3794         * cs-parser.jay,
3795           driver.cs : Thus use StreamReader directly.
3796         * support.cs : Thus removed SeekableStreamReader.
3797
3798 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3799
3800         Fix #75934.
3801         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3802         (ScopeInfo.EmitScopeType): Use it to construct field names from
3803         names of captured locals.
3804
3805         Fix #75929.
3806         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3807         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3808         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3809         (ExplicitConversion): Remove enum cases already handled by
3810         implicit conversion.  Move implicit conversion check to the beginning.
3811         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3812         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3813         Don't treat System.Enum as a struct.
3814
3815 2005-08-30  Jb Evain  <jbevain@gmail.com>
3816
3817         * attribute.cs: handles as expression in parameters.
3818
3819 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3820
3821         Fix #75802.
3822         * class.cs (TypeContainer.VerifyClsName): Don't use a
3823         PartialContainer when verifying CLS compliance.
3824         (AbstractPropertyEventMethod): Set Parent here, ...
3825         (PropertyMethod): ... not here.
3826
3827 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3828
3829         * attribute.cs : escaped attribute name should not be allowed to be
3830           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3831
3832 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3833
3834         Fix #75927.
3835         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3836         when converting a long constant to unsigned long.
3837         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3838         detect where IsApplicable and VerifyArgumentsCompat disagree.
3839
3840 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3841         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3842
3843         Fix #75848.
3844         * class.cs (TypeContainer.CanElideInitializer): New helper.
3845         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3846         can safely emitting the initializer of a field.
3847
3848 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3849
3850         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3851           allowed inside a switch (without loop). Fixed bug #75433.
3852
3853 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3854
3855         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3856         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3857
3858 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3859
3860         * driver.cs : kinda reverting the default encoding changes (not exact 
3861           revert since I noticed that "codepage:reset" might not work fine).
3862
3863 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3864
3865         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3866           Location. Now getter and setter store location correctly.
3867           (errors/cs0111-12.cs now reports the expected location.)
3868
3869 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3870
3871         * driver.cs : Use default encoding on the environment.
3872           Removed (now that) extra parameter for SeekableStreamReader.
3873         * support.cs : (SeekableStreamReader) third .ctor() argument for
3874           StreamReader is not required (always true). preamble size could
3875           be acquired in simpler and safe way.
3876
3877 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3878
3879         * cs-parser.jay: report CS0642 at warning level 3
3880           and report CS0642 for an if else statement also
3881           fixes bug #74745. Patch by John Luke (and a bit
3882           modified by me).
3883           Removed extra CS0642 warning check for "while",
3884           "for" and "fixed".
3885         * statement.cs: In Block.Resolve(), CS0642 check
3886           is reimplemented to check a sequence of an empty
3887           statement and a block.
3888
3889           Both fix bug #66777.
3890
3891 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3892
3893         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3894         detection until I fix it.
3895         
3896         * cs-tokenizer.cs: Changed error message.
3897         
3898         * cs-parser.jay: Fixed 2 error locations.
3899         
3900         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3901         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3902         properties.
3903         
3904         * enum.cs (GetSignatureForError): Fixed.
3905         
3906         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3907         method detection.
3908         
3909         * class.cs,
3910         * typemanager.cs (RegisterProperty): Removed.
3911         
3912         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3913
3914 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3915
3916         Fix #75874.
3917         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3918         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3919
3920 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3921
3922         * expression.cs : tiny fix is required for not warning positive ulong.
3923           See test-441.cs.
3924
3925 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3926
3927         * expression.cs : add CS0652 check for constant and integral
3928           expression. Fixed bug #53974.
3929
3930 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3931
3932         * expression.cs : in DoNumericPromotions(), check if there is implicit
3933           conversion overload for string (to check CS0034). Fixed bug #52492.
3934
3935 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3936
3937         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3938
3939 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3940
3941         * ecore.cs : report location when it is *not* Null.
3942
3943 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3944
3945         * codegen.cs,
3946           ecore.cs,
3947           flowanalysis.cs,
3948           expression.cs:
3949           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3950           correctly. Fixed bug #75721.
3951
3952 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3953
3954         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3955         loop that performs 'min (pos, char_count)'.
3956
3957         Fix #75862.
3958         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3959         converted value in Operator.OnesComplement.
3960
3961 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3962
3963         * anonymous.cs: If the anon method is pulled into a helper class,
3964         it needs to be `internal' not `private'. Fixes runtime behavior on
3965         msft. bug #75704
3966
3967 2005-08-20  Martin Baulig  <martin@ximian.com>
3968
3969         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3970         scope if we don't already have it.
3971
3972         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3973         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3974         fixes #75867.
3975
3976 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3977
3978         Fix #75803
3979         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3980         is a partial class.
3981
3982 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3983
3984         The big constants rewrite
3985         Fix #75746, #75685 and more
3986         As a side effect saved 1MB for MWF ;-)
3987         
3988         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3989         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3990         enum based for corlib compilation.
3991         
3992         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3993         subtractions.
3994         
3995         * class.cs (FixedField.Define): Use ResolveAsConstant.
3996         
3997         * const.cs (IConstant): Interface constants and enums.
3998         (Const.ResolveValue): New method for constant resolvning.
3999         (ExternalConstant): Constants from imported assemblies.
4000         
4001         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4002         conversion; like enums.
4003         (Constant.ToType): Converts this constant to different type.
4004         (Constant.Increment): Adds 1.
4005         
4006         * convert.cs (ImplicitConversionRequired): Simplified.
4007         
4008         * cs-parser.jay: Create EnumMember directly.
4009         
4010         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4011         
4012         * doc.cs (GenerateEnumDocComment): Removed.
4013         
4014         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4015         (ConvertIntLiteral): Removed.
4016         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4017         
4018         * enum.cs (EnumMember): Implement IConstant.
4019         (Enum.IsValidEnumConstant): Removed.
4020         (Enum.GetNextDefaultValue): Removed.
4021         (Enum.FindMembers): Updated.
4022         (Enum.GenerateDocComment): Iterate enum members.
4023         
4024         * expression.cs (Cast.TryReduce): Handle enums correctly.
4025         (New.Constantify): Made public.
4026         (MemberAccess.DoResolve): Removed contant specific if(s).
4027         
4028         * literal.cs (NullLiteral): Implement new abstract methods.
4029         
4030         * statement.cs (GotoCase.Resolve): Use new constant methods.
4031         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4032         
4033         * typemanager.cs (LookupEnum): Removed.
4034         (IsEnumType): Fixed to work with corlib.
4035         (RegisterConstant): Removed.
4036         (LookupConstant): Removed.
4037         (GetConstant): Changed to work with IConstant.
4038
4039 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4040
4041         * location.cs : Fixed overflown (>255) column number.
4042
4043 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4044
4045         First cut of the qualified-alias-member feature.
4046         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4047         token.
4048         * cs-parser.jay (DOUBLE_COLON): New token.
4049         (namespace_or_type_name): Add rule for recognizing
4050         qualified-alias-members.
4051         (primary_expression): Likewise.
4052         (element_access): Allow QualifiedAliasMember as a possible
4053         type-bearing expression.
4054         (local_variable_type, local_variable_pointer_type): Likewise.
4055         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4056         aliases in the current and enclosing namespace declarations.
4057         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4058         * decl.cs (MemberName.is_double_colon): New.
4059         (MemberName.MemberName): Add new constructor for alias-member.
4060         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4061         * expression.cs (QualifiedAliasMember): New expression type.
4062
4063 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4064
4065         * location.cs : it borked when no argument was specified.
4066
4067 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4068
4069         * location.cs : tiny ToString() format fix.
4070
4071 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4072
4073         * statement.cs : oops, it was missing.
4074
4075 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4076
4077         A set of fixes for precise line/column location.
4078
4079         * location.cs :
4080           "token" field now holds a file/line "delta", a line number offset 
4081           from the segment, and a column number. See also:
4082           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4083           December/009508.html
4084           Removed static IsNull. Use instance IsNull property instead.
4085         * cs-tokenizer.cs :
4086           For some tokens it stores Location. For Identifier it stores
4087           LocatedToken which is a pair of string name and location.
4088           Column numbers are adjusted only at getChar().
4089         * report.cs :
4090           Use Location.ToString() for reporting (it now contains column).
4091         * cs-parser.jay :
4092           Largely modified to use LocatedToken instead of
4093           string (IDENTIFIER), and to acquire Location from some tokens.
4094         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4095           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4096           codegen.cs :
4097           Now MemberName holds Location. DeclSpace.ctor() receives Location
4098           as a parameter. Removed extra parameters to all derived classes.
4099           Replaced Location.IsNull() with instance property.
4100         * assign.cs, expression.cs :
4101           Added .ctor() overload that omits Location.
4102         * attribute.cs :
4103           Added "nameEscaped" flag that indicates the identifier was escaped
4104           in the source file. This fixes bug #57047.
4105
4106 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
4107
4108         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
4109         New method, looking for lo-case imported cls type.
4110
4111         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
4112         here.
4113
4114         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
4115
4116         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
4117
4118         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
4119         all_imported_types.
4120         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
4121
4122         Optimized to save 3.5 MB for SWF compilation.
4123
4124 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4125
4126         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
4127         (PartialContainer.Create): Moved logic AddToContainer.
4128         (PartialContainer.MarkForDuplicationCheck): Shares name.
4129         
4130         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
4131         place.
4132         
4133         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
4134         initialization.
4135         (Namespace.GetSignatureForError): New method.
4136         
4137         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
4138         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
4139
4140 2005-08-01  Raja R Harinath  <rharinath@novell.com>
4141
4142         Fix #75669.
4143         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
4144         member lookup rather than qualifier_type, since qualifier_type can
4145         be null.
4146
4147 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
4148
4149         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
4150         enum member.
4151
4152 2005-07-31  Miguel de Icaza  <miguel@novell.com>
4153
4154         * statement.cs: Copy the local exception into the exception
4155         captured local.  Fixes 75674
4156
4157 2005-07-31  Raja R Harinath  <harinath@gmail.com>
4158
4159         Fix #75658.
4160         * expression.cs (Invocation.OverloadResolve): Don't report error
4161         CS1501 if error CS1502 has been reported.
4162         (New.DoResolve): Delegate CS1501 reporting to
4163         Invocation.OverloadResolve.
4164
4165         Fix #75656.
4166         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
4167         invariant-meaning-in-block property in an enclosing block if
4168         necessary.
4169
4170 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
4171
4172         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
4173         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
4174         (Switch.CheckSwitch): Just save 50kb for SWF.
4175
4176 2005-07-27  Martin Baulig  <martin@ximian.com>
4177
4178         * anonymous.cs (CaptureContext.AddField): Added
4179         `AnonymousContainer am' argument; compute its toplevel scope if
4180         it's not already computed.  Fixes #75649.
4181
4182 2005-07-26  Raja R Harinath  <rharinath@novell.com>
4183
4184         Fix #75628.
4185         * class.cs (Constructor.Emit): Reset block to null if the block
4186         resolve fails.
4187
4188 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4189
4190         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
4191
4192 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
4193
4194         * class.cs (MethodData.Define): Check whether accessor implementing
4195         interface is public.
4196
4197         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
4198
4199 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
4200
4201         Fix #57245
4202         * namespace.cs (LookupType): Moved same type check to...
4203         
4204         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
4205         with the same name.
4206
4207 2005-07-21  Raja R Harinath  <rharinath@novell.com>
4208
4209         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
4210         already found a typebuilder.
4211         * class.cs (MethodCore.IsDuplicateImplementation): Compare
4212         MemberNames, not strings.
4213
4214         * const.cs (Error_ExpressionMustBeConst): 
4215         Rename from Error_EpressionMustBeConst.
4216         * const.cs, class.cs, statement.cd: Update.
4217
4218 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4219
4220         Fix #65573
4221
4222         * const.cs (Const.LookupConstantValue): Report missing contant expression
4223         everytime.
4224         (Error_EpressionMustBeConstant): Only one error method.
4225
4226         * class.cs, statement.c: Updated.
4227
4228 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4229
4230         * statement.cs (Block.Flags): Add back HasVarargs.
4231         (Block.flags): Make protected.
4232         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4233
4234         * typemanager.cs (types, typecontainers, user_types): Remove.
4235         (UserTypes, TypeContainers): Likewise.
4236         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4237         (CleanUp, Reset): Update.
4238         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4239         (GetNestedType): Use Type.GetNestedType.
4240         (CoreLookupType): Take two arguments, the namespace and the
4241         basename of the type.  Update to use the Namespace.Lookup
4242         mechanism.
4243         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4244         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4245         string concatenation and substring matches.
4246         * class.cs, enum.cs, delegate.cs: Update to changes.
4247
4248 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4249
4250         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4251         Expression and made virtual.
4252
4253         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4254         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4255
4256         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4257
4258         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4259         error message.
4260
4261         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4262         change.
4263
4264 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4265
4266         Fix #57707
4267         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4268         AssemblyCultureAttribute is not used on executable.
4269
4270         * rootcontext.cs,
4271         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4272
4273 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4274
4275         Fix #60638.
4276         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4277         New.  Reports CS0252/CS0253.
4278         Mostly taken from preliminary patch by Duncak Mak.
4279         (Binary.DoResolveOperator): Store results of operator lookup.
4280         Use them to detect if we need to warn about unintended reference
4281         comparisons.
4282
4283 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4284
4285         Fix #72969.
4286         * namespace.cs (Namespace.Lookup): Add back location parameter.
4287         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4288         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4289
4290         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4291         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4292         (Namespace.LookupType): ... this.
4293         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4294         of namespaces.
4295         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4296         purported to handle pointers.
4297         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4298         CoreLookupType.
4299
4300 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4301
4302         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4303         type as namespace.
4304
4305 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4306
4307         * namespace.cs (Namespace.Lookup): Drop location parameter.
4308         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4309         (NamespaceEntry.Lookup): ... this.
4310         (NamespaceEntry.Error_AmbiguousTypeReference):
4311         Move here from DeclSpace.
4312         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4313         names ...
4314         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4315         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4316         Move to NamespaceEntry.
4317         * delegate.cs, expression.cs: Update to changes.
4318
4319 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4320
4321         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4322         CheckAttributeType and refactored.
4323         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4324         ResolveAsTypeTerminal error handling.
4325         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4326         handling.
4327         (GetSignatureForError): Print errors in same way.
4328
4329         * class.cs,
4330         * codegen.cs: Reflect attribute GetSignatureForError change.
4331
4332         * ecore.cs,
4333         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4334
4335         * namespace.cs (UsingEntry): Refactored to make fields private.
4336
4337         * assign.cs,
4338         statement.cs: Error_UnexpectedKind has extra parameter.
4339
4340 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4341
4342         * ecore.cs (IAlias): Remove.
4343         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4344         that implement the interface.
4345         * namespace.cs (Namespace): Likewise.
4346         (Namespace.declspaces): Renamed from 'defined_names'.
4347         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4348         DeclSpace instead of an IAlias.
4349         * tree.cs (Tree.AddDecl): Update.
4350
4351 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4352
4353         * statement.cs (Block.Flags); Remove HasVarargs.
4354         (Block.HasVarargs): Move to ToplevelBlock.
4355         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4356         (Block.Variables): Make protected.  Initialize variable hashtable
4357         if necessary.
4358         (Block.AddVariable): Update.
4359         (Block.Resolve): Update to changes.
4360         (ToplevelBlock.HasVarargs): New boolean.
4361         (ToplevelBlock.ThisVariable): Move here from Block.
4362         (ToplevelBlock.AddThisVariable): Likewise.
4363         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4364         * expression.cs (This.ResolveBase): Update to changes.
4365         (ArglistAccess.DoResolve): Likewise.
4366
4367 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4368
4369         Fix #75321
4370         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4371
4372         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4373         not used and not used & assigned.
4374         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4375
4376 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4377
4378         Fix #75053
4379         * expression.cs (Is.DoResolve): null is never provided type.
4380
4381 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4382
4383         Fix #52496
4384         * cs-parser.jay: Less strict event error rule to catch more errors.
4385
4386 2005-07-08  Martin Baulig  <martin@ximian.com>
4387
4388         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4389         gettter (allowed) or setter (not allowed).
4390
4391         * class.cs (Accessor): Implement IIteratorContainer.
4392         (Accessor.Yields): New public field.
4393         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4394         per-accessor basis.
4395
4396         * cs-parser.jay
4397         (get_accessor_declaration, set_accessor_declaration): Set the
4398         `yields' flag on the accessor, not the property.
4399         (property_declaration): Do the iterators check on a per-accessor
4400         basis and not for the whole property.
4401
4402 2005-07-08  Martin Baulig  <martin@ximian.com>
4403
4404         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4405         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4406
4407 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4408
4409         Fix #74975
4410         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4411         (ExtractSecurityPermissionSet): Cope with self referencing security
4412         attributes properly.
4413
4414         * driver.cs (SetOutputFile): Made public property OutputFile.
4415
4416 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4417
4418         Fix #75486.
4419         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4420         has_nonstatic_fields.  Make into a FieldBase pointer.
4421         (TypeContainer.AddField): Add CS0282 check.
4422         (TypeContainer.EmitType): Update.
4423
4424 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4425
4426         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4427         compare if they start with __.
4428
4429 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4430
4431         * statement.cs (Switch.SwitchGoverningType): Only look at
4432         UserCasts that don't need implicit standard conversions to one of
4433         the allowed switch types (Fixes test-322.cs).
4434         (LocalInfo.Resolve): Re-enable sanity-test.
4435
4436 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4437
4438         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4439         
4440         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4441         
4442         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4443
4444 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4445
4446         Fix #75472.
4447         * ecore.cs (SimpleName.GetSignatureForError): Add.
4448         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4449         (MemberAccess.GetSignatureForError): Add.
4450
4451 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4452  
4453         The big error and warning messages review.
4454         
4455         * anonymous.cs,
4456         * assign.cs,
4457         * attribute.cs,
4458         * class.cs,
4459         * codegen.cs,
4460         * convert.cs,
4461         * cs-parser.jay,
4462         * cs-tokenizer.cs,
4463         * decl.cs,
4464         * delegate.cs,
4465         * doc.cs,
4466         * driver.cs,
4467         * ecore.cs,
4468         * enum.cs,
4469         * expression.cs,
4470         * flowanalysis.cs,
4471         * iterators.cs,
4472         * literal.cs,
4473         * location.cs,
4474         * modifiers.cs,
4475         * namespace.cs,
4476         * parameter.cs,
4477         * pending.cs,
4478         * report.cs,
4479         * rootcontext.cs,
4480         * statement.cs,
4481         * support.cs,
4482         * tree.cs,
4483         * typemanager.cs: Updated.
4484         
4485         * class.cs: (MethodCore.SetYields): Moved here to share.
4486         (PropertyMethod.Define): Moved iterator setup here.
4487         
4488         * iterators.cs: Add orig_method to have full access to parent
4489         container.
4490
4491 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4492
4493         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4494         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4495         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4496         variable of struct type.
4497         * expression.cs (Unary.ResolveOperator): Update to change.
4498         (Indirection.VerifyFixed): Likewise.
4499         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4500         (ParameterReference.VerifyFixed): Value parameters are fixed.
4501         (This.VerifyFixed): Treat 'this' as a value parameter.
4502         * statement.cs (LocalInfo.IsFixed): Remove.
4503
4504 2005-07-01  Martin Baulig  <martin@ximian.com>
4505
4506         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4507         `ec.EmitThis ()' to get the correct scope.
4508
4509 2005-07-01  Martin Baulig  <martin@ximian.com>
4510
4511         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4512         instance is a ParameterReference; fixes #75299.
4513
4514 2005-07-01  Martin Baulig  <martin@ximian.com>
4515
4516         Reverted Marek's latest patch (r46725):
4517         - it contains structural changes which are neither mentioned in
4518           the ChangeLog nor explained anywhere; for example the additional
4519           argument of EmitContext's and Iterator's .ctor's and the
4520           TypeContainer.DefineMembers() change.
4521         - structural changes like this should go in in seperate patches
4522           and not be hidden in a huge patch which just seems to affect
4523           warnings and errors.
4524           a big and hard to understand patch.
4525         - it breaks iterators and causes regressions, for instance in
4526           test-iter-03.cs.      
4527
4528 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4529
4530         Fix #75412.
4531         * expression.cs (Indexers.map): Remove.
4532         (Indexers.Append): Filter out inaccessible setters and getters.
4533         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4534
4535         Fix #75283.
4536         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4537         Refactored from ...
4538         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4539         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4540         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4541         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4542
4543 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4544
4545         Fix #75322
4546         * class.cs (FieldBase.GetInitializerExpression): One more field
4547         for backup.
4548
4549 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4550
4551         * pending.cs: Do not define a proxy if the base method is virtual,
4552         it will be picked up by the runtime (bug 75270).
4553
4554 2005-06-08  Martin Baulig  <martin@ximian.com>
4555
4556         The big Iterators rewrite :-)
4557
4558         * iterators.cs: Rewrite this to use the anonymous methods framework.
4559
4560         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4561         before the TypeContainers; see 2test-21.cs.
4562
4563         * class.cs
4564         (TypeContainer.DefineType): Don't create a new EmitContext if we
4565         already have one (this only happens if we're an Iterator).
4566         (TypeContainer.Define): Also call Define() on all our iterators.
4567         (Method.CreateEmitContext): Added support for iterators.
4568
4569         * anonymous.cs
4570         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4571         (AnonymousContainer.CreateMethodHost): Moved here from
4572         AnonymousMethod and made abstract.
4573         (AnonymousContainer.CreateScopeType): New abstract method.
4574         (AnonymousContainer.IsIterator): New public property.
4575         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4576         get the ScopeTypeBuilder rather than manually defining it here. 
4577         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4578         iterators here.
4579
4580         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4581         before RootContext.DefineTypes().
4582
4583         * codegen.cs (EmitContext.RemapToProxy): Removed.
4584         (EmitContext.CurrentAnonymousMethod): Changed type from
4585         AnonymousMethod -> AnonymousContainer.
4586         (EmitContext.ResolveTopBlock): Protect from being called twice.
4587         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4588         (EmitContext.EmitThis): Removed the iterators hacks; use the
4589         anonymous methods framework for that.
4590
4591         * statement.cs
4592         (ToplevelBlock.Container): Make this a property, not a field.
4593         (ToplevelBlock.ReParent): New public method; move the
4594         ToplevelBlock into a new container.
4595         (Foreach.TemporaryVariable): Simplify.
4596
4597 2005-06-05  Martin Baulig  <martin@ximian.com>
4598
4599         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4600         (Block.AddTemporaryVariable): New public method; creates a new
4601         `LocalInfo' for a temporary variable.
4602         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4603         variables here.
4604         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4605         non-iterator variables.
4606
4607 2005-06-05  Martin Baulig  <martin@ximian.com>
4608
4609         * statement.cs (Foreach.TemporaryVariable): Create the
4610         LocalBuilder in the Emit phase and not in Resolve since in some
4611         situations, we don't have an ILGenerator during Resolve; see
4612         2test-19.cs for an example.
4613
4614 2005-06-04  Martin Baulig  <martin@ximian.com>
4615
4616         **** Merged r45395 from GCS ****
4617
4618         The big Foreach rewrite - Part II.
4619
4620         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4621         with `PropertyInfo ienumerator_getcurrent'.
4622
4623         * codegen.cs (VariableStorage): Removed.
4624
4625         * statement.cs
4626         (Foreach): Derive from Statement, not ExceptionStatement.
4627         (Foreach.CollectionForeach): New nested class.  Moved all the code
4628         dealing with collection foreach here.
4629         (Foreach.ForeachHelperMethods): Removed.
4630         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4631
4632 2005-05-23  Martin Baulig  <martin@ximian.com>
4633
4634         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4635         don't need to.  Fix #75014.
4636
4637 2005-05-20  Martin Baulig  <martin@ximian.com>
4638
4639         Merged r44808 from GMCS.
4640
4641         * class.cs (TypeContainer.CircularDepException): Removed.
4642         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4643         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4644         (CS0146) and interface (CS0529) dependencies here.
4645
4646 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4647
4648         * expression.cs (Invocation.EmitCall): Fix initialization
4649         'this_call' to reflect current behaviour.  Fix indentation.
4650
4651         * convert.cs (FindMostEncompassedType): Add two trivial special
4652         cases (number_of_types == 0 || number_of_types == 1).
4653         (FindMostEncompasingType): Likewise.
4654
4655 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4656
4657         Some cleanups preparing for the fix of #75283.
4658         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4659         error testing.
4660         (EventExpr.InstanceResolve): Likewise.
4661         (EventExpr.DoResolve): Remove redundant checks.
4662
4663 2005-06-10  Duncan Mak  <duncan@novell.com>
4664
4665         * cs-tokenizer.cs (process_directives): New flag for controlling
4666         the processing of preprocessor directives.
4667         (x_token): After seeing a '#', return Token.NONE instead of going
4668         to handle_preprocessing_directive() when not processing
4669         directives. This avoids unnecessary processing during the token peek in
4670         is_punct().
4671
4672         This fixes #74939.
4673
4674         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4675         the existing error reporting methods instead of Report.Error.
4676
4677         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4678         after Raja's rewrite.
4679
4680 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4681
4682         * class.cs: Small fix.
4683
4684 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4685
4686         Fix #75160.
4687         * class.cs (GetPartialBases): Fix return value check of
4688         part.GetClassBases.
4689
4690 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4691
4692         Ensure that partial classes are registered in their enclosing
4693         namespace.  Initial part of fix of #75160.
4694         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4695         Register declspace with namespace here, not in
4696         DeclSpace.RecordDecl.
4697         * cs-parser.jay: Pass namespace to RecordDecl.
4698         * class.cs (PartialContainer.Create): Likewise.
4699         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4700         called.
4701         * decl.cs (Declspace.RecordDecl): Remove.
4702         * namespace.cs (NamespaceEntry.DefineName): Remove.
4703
4704 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4705
4706         * rootcontext.cs: Reset TargetExt as well.
4707
4708 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4709
4710         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4711         -langversion:ISO-1.
4712
4713 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4714
4715         Fix #75080, cs0119.cs.
4716         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4717         of ...
4718         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4719         allowing ExprClass.Type and ExprClass.Namespace for
4720         ResolveFlags.VariableOrValue.
4721         (Expression.Resolve) [1-argument variant]: Change default resolve
4722         flags based on language version.
4723         (Expression.Error_UnexpectedKind): Use a simple string array
4724         rather than an ArrayList.
4725         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4726         not ExprClass.Type.
4727         (TypeOfVoid.DoResolve): Likewise.
4728         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4729         flags argument -- it always has the same value.
4730
4731 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4732
4733         Fix #75081.
4734         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4735         Use it in the error message.
4736         * assign.cs, expression.cs, statement.cs: Update.
4737
4738 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4739
4740         Fix #75088.
4741         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4742         the "almostMatchedMember" case too.
4743         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4744         that failed the accessibility checks to 'almost_match'.
4745
4746 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4747
4748         * attribute.cs: Use internal MethodBuilder methods to set
4749         ExactSpelling and SetLastError on PInvoke methods, instead
4750         of passing them via charset.  Fixes #75060.
4751
4752 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4753
4754         * parameter.cs (Parameter): Remove TODO comment.
4755         (Parameter.DefineParameter): Remove Location parameter.
4756         (Parameters.LabelParameters): Likewise.
4757         * class.cs (Constructor.Emit): Update to change.
4758         (MethodData.Emit): Likewise.
4759         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4760         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4761
4762 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4763
4764         * parameter.cs,
4765           Removed Parameters.Location and added Parameter.Location instead.
4766           Removed Location parameter from Emit() and GetSignature().
4767         * anonymous.cs,
4768           class.cs,
4769           cs-parser.jay,
4770           delegate.cs,
4771           iterators.cs,
4772           statement.cs :
4773           Modified all related calls.
4774
4775 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4776
4777         Improve user-defined conversion handling.
4778         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4779         applicable operators.
4780         (AddConversionOperators): New.  Helper for GetConversionOperators.
4781         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4782         there is only one most encompassed/encompassing type.
4783         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4784         "applicable operator" handling.
4785         (UserConversion): Move cache here from GetConversionOperators.
4786         Directly cache the chosen operator, rather than the whole
4787         MethodGroup.
4788         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4789         case.  Allow conversion of decimal to sbyte and byte too.
4790         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4791         New static methods.  Used to avoid allocating EmptyExpressions in
4792         convert.cs.
4793
4794 2005-05-24  Duncan Mak  <duncan@novell.com>
4795
4796         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4797         another class, used in Convert.ExplicitNumericConversion.
4798         (CastToDecimal): New class, similar to above, but casts to
4799         System.Decimal, used in Convert.ImplicitNumericConversion and also
4800         in explicit convesion from double/float to decimal.
4801
4802         * convert.cs (ImplicitNumericConversion): Handle implicit
4803         conversions to System.Decimal.
4804         (ExplicitNumericConversion): handle explicit conversions to
4805         System.Decimal.
4806
4807         This fixes #68711.
4808         
4809 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4810
4811         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4812         know the type at this stage, just break through.   Fixes #75008 
4813
4814 2005-05-19  Martin Baulig  <martin@ximian.com>
4815
4816         * delegate.cs
4817         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4818         to disable error reporting.
4819
4820         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4821         here since we don't want to report an error; see the new test-336.cs.
4822
4823 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4824
4825         * statement.cs (ToplevelBlock.GetParameterReference)
4826         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4827         Move here from class Block.
4828         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4829         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4830
4831 2005-05-18  Martin Baulig  <martin@ximian.com>
4832
4833         Fix #74978.
4834
4835         * flowanalysis.cs
4836         (FlowBranching.Reachability): Add non-static public And() and Or()
4837         methods.
4838         (FlowBranchingSwitch): New class; do the `break_origins' thing
4839         like in FlowBranchingLoop.
4840         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4841         reachability, not just locals and parameters.
4842         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4843         switch; MergeBreakOrigins() now takes care of that.
4844
4845 2005-05-18  Martin Baulig  <martin@ximian.com>
4846
4847         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4848         a loop and may leave it, reset the barrier; fixes #74974.
4849
4850 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4851         
4852         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4853         is back.
4854         
4855         * cs-parser.jay: Catch more lexical errors.
4856         
4857         * report.cs: Add one more Error method.
4858         
4859         * rootcontext.cs,
4860         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4861
4862 2005-05-17  Martin Baulig  <martin@ximian.com>
4863
4864         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4865         #70970. 
4866
4867 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4868
4869         Fix test-382.cs.  Emit values of decimal constants.
4870         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4871         Carved out of ...
4872         (TypeContainer.AddField): ... this.
4873         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4874         with initializers to include 'Const's.
4875         (ClassPart.RegisterFieldForInitialization): Forward to
4876         PartialContainer.
4877         * const.cs (Const.Const): Pass initializer to base class.
4878         (Const.Define): In case of decimal constants, register them for
4879         initialization in a static constructor.
4880
4881 2005-05-14  Martin Baulig  <martin@ximian.com>
4882
4883         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4884         do not call ResolveUnreachable() on unreachable statements in
4885         here, see the comment in the source code.
4886
4887 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4888
4889         Fix #74934.
4890         * expression.cs (BinaryResolveOperator): If one of the operands of
4891         an equality comparison is 'null' and the other is a pointer type,
4892         convert the null to a NullPointer.
4893         * convert.cs (ImplicitReferenceConversion): If the expression is a
4894         NullLiteral and the target type is a pointer type, return a
4895         NullPointer instead.
4896         (ImplicitConversionStandard): Likewise.
4897
4898 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4899         
4900         * cs-parser.jay: Set readonly context based on special constructs.
4901         
4902         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4903         readonly variable error handling.
4904         
4905         * rootcontext.cs (EmitCode): Don't verify members when error
4906         occurred.
4907         
4908         * statement.cs (LocalInfo): Add reaodnly context information.
4909         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4910
4911 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4912
4913         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4914         for #74041 to initialize 'resolved' to false only for explicit
4915         blocks.  Fixes #74873.
4916
4917 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4918
4919         Fix #74920.
4920         * typemanager.cs (unmanaged_enclosing_types): New.
4921         (IsUnmanagedType): Avoid infloops by using
4922         'unmanaged_enclosing_types' to talk with recursive invocations.
4923
4924 2005-05-13  Martin Baulig  <martin@ximian.com>
4925
4926         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4927         instance variable, not a local.  Fix #74873.
4928         (Block.ResolveUnreachable): Set it to true here.
4929
4930 2005-05-11  Duncan Mak  <duncan@novell.com>
4931
4932         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4933         continuing to process for 'arg'.
4934         (handle_preprocessing_directive): Check the argument of the #endif
4935         directive and report error CS1025 if there are any trailing
4936         characters.
4937
4938         According to the C# spec, having even whitespace after the #endif
4939         directive is illegal; however, because we call arg.TrimEnd ()
4940         beforehand, we have the same behavior as csc, allowing whitespace
4941         after the directive.
4942
4943         Fixes #74892.
4944
4945 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4946
4947         Fix #74863.
4948         
4949         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4950         (Constructor.GetObsoleteAttribute): Implemented correctly.
4951
4952 2005-05-10  Martin Baulig  <martin@ximian.com>
4953
4954         * support.cs (ReflectionParameters.ParameterModifier): Use
4955         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4956         and `ParameterAttributes.In'.  Fixes #74884.
4957
4958 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4959
4960         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4961         
4962         * expression.cs (Argument.GetParameterModifier): Turned to property.
4963         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4964         
4965         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4966         its C# equivalent.
4967         
4968 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4969
4970         Fix #74852.
4971         * decl.cs (MemberCache.AddMethods): Register override methods,
4972         rather than non-override methods.
4973         * typemanager.cs (RegisterOverride): New.
4974         (IsOverride): Update.
4975
4976 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4977
4978         Fix #73105.
4979         
4980         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4981         recursive declaration.
4982         
4983         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4984         
4985 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4986
4987         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4988         
4989         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4990
4991 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4992
4993         Fix #74797.
4994         * decl.cs (DeclSpace.FamilyAccessible): 
4995         Use TypeManager.IsNestedFamilyAccessible.
4996
4997         Fix reopened #64812.
4998         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4999         internal'.
5000
5001 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5002             Abin Thomas  <projectmonokochi@rediffmail.com>
5003             Anoob V E  <projectmonokochi@rediffmail.com>
5004             Harilal P R  <projectmonokochi@rediffmail.com>
5005
5006         Fix #64812.
5007         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5008         allow access to all static members.
5009
5010 2005-05-04  Martin Baulig  <martin@ximian.com>
5011
5012         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5013
5014 2005-05-04  Martin Baulig  <martin@ximian.com>
5015
5016         Fix #74655.
5017
5018         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5019         section at the end; make things work if `default' is not the last
5020         section.        
5021
5022 2005-05-04  Martin Baulig  <martin@ximian.com>
5023
5024         Fix #70400.
5025
5026         * statement.cs (Switch): Replaced the `got_default' field with a
5027         `default_section' one.
5028         (Switch.CheckSwitch): Set `default_section' here.
5029         (Switch.Resolve): If we're a constant switch and the constant is
5030         not found, use the default section.
5031
5032 2005-05-03  Martin Baulig  <martin@ximian.com>
5033
5034         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5035
5036         * statement.cs (Foreach.ArrayForeach): New nested class.
5037         (Foreach.TemporaryVariable): New nested class.
5038         (Foreach.EmitArrayForeach): Removed; this is now in the new
5039         ArrayForeach class.
5040
5041 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5042
5043         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5044         more conservative.
5045         (VerifyPendingMethods): Revert change below.
5046
5047         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5048         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5049         that used to trigger warning -28.  Remove warning -28.
5050         * expression.cs (Invocation.OverloadResolve): Use
5051         TypeManager.IsOverride to distinguish override methods.
5052
5053         Fix #74773.
5054         * pending.cs (VerifyPendingMethods): If a base type implements the
5055         requested interface, don't bother checking individual methods of
5056         the base type.  As a side-effect, this prevents the creation of
5057         unnecessary proxies.
5058
5059 2005-05-02  Martin Baulig  <martin@ximian.com>
5060
5061         Fix #70182.
5062
5063         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5064         Also `And' the locals if the old vector is null.
5065         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5066         null; in this case we basically reset all the variables.        
5067
5068 2005-05-02  Martin Baulig  <martin@ximian.com>
5069
5070         Fix #74529.
5071
5072         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5073         Added `FlowBranching branching' argument; always `and' the
5074         variables instead of `or'ing them unless we're an infinite loop.
5075
5076         * statement.cs (While.Resolve): Create a new sibling unless we're
5077         infinite.       
5078
5079 2005-05-02  Martin Baulig  <martin@ximian.com>
5080
5081         Fix #70140.
5082
5083         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5084         arguments; use it instead of creating a new TopLevelBlock.
5085         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5086         our ConstructorInitializer.
5087
5088         * statement.cs
5089         (TopLevelBlock.TopLevelBranching): New public property.
5090         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5091         and create our `TopLevelBranching'.
5092
5093         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5094         anonymous method host, use `block.TopLevelBranching' rather than
5095         creating a new branching.
5096
5097 2005-04-20  Miguel de Icaza  <miguel@novell.com>
5098
5099         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
5100         a ScopeInfo, if any of the current children is a child of the new
5101         entry, move those children there.
5102
5103 2005-04-30  Martin Baulig  <martin@ximian.com>
5104
5105         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
5106         at the beginning of a SwitchSection.  Fix #73335.
5107
5108 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
5109
5110         Fix #74378
5111         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
5112         
5113         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
5114         (FieldExpr.DoResolve): Obsolete members are ignored for field
5115         initializers.
5116         
5117 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
5118
5119         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
5120         of arrays detection.
5121
5122         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
5123         verification.
5124         (Field.VerifyClsCompliance): Volatile fields are not compliant.
5125
5126         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
5127         arrays report.
5128
5129 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
5130
5131         * cs-parser.jay: Use the prefered version of -unsafe in error
5132         message.
5133
5134 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
5135
5136         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
5137         circumstances.
5138
5139 2005-04-20  John Luke  <john.luke@gmail.com>
5140
5141         * driver.cs: fix typo in error message, --outout to --output
5142
5143 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
5144
5145         * codegen.cs (InRefOutArgumentResolving): New field.
5146         
5147         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
5148         fields outside contructor.
5149         
5150         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
5151         
5152 2005-04-19  Miguel de Icaza  <miguel@novell.com>
5153
5154         * anonymous.cs (CaptureContext.EmitParameterInstance): The
5155         parameter code was not completed ever, so it was not as up-to-date
5156         as local variables.  Must finish it.
5157
5158         The bug fix was to compare the Toplevel of the block, not the
5159         current block.  Thanks for Ben for pointing this out. 
5160
5161 2005-04-19  Raja R Harinath  <rharinath@novell.com>
5162
5163         * decl.cs (AddMethods): Use the declaring type of the problem
5164         method to determine if we want to squash a warning.
5165
5166 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
5167
5168         * attribute.cs: Removed debug output.
5169
5170         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5171         
5172         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5173         Report.Stderr.
5174         
5175 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5176
5177         Fix #74481.
5178         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5179         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5180         all null comparisons against reference types.
5181
5182 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5183
5184         Fix# 74565
5185         * class.cs (TypeContainer.CircularDepException) New nested
5186         exception class.
5187         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5188         (TypeContainer.DefineType): Removed error, reset InTransit before
5189         exit.
5190         (Class.DefineType): Throw exception when is in Transit.
5191         Catch exception and report error.
5192         (Struct.DefineType): Throw exception when is in Transit.
5193         Catch exception and report error.
5194         (Interface.DefineType): Throw exception when is in Transit.
5195         Catch exception and report error.
5196
5197         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5198         handle nested exception handlers.
5199
5200         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5201         a catch.
5202
5203         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5204         InFinally and InCatch storage.
5205
5206         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5207         (Catch.Resolve): Set and Restore ec.InCatch.
5208         (Try.Resolve): Set and Restore ec.InFinally.
5209         (Try.HasCatch): True when try has catch.
5210
5211 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5212
5213         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5214           for the same event member, so exclude such cases from warning 419.
5215           Fixed bug #74633.
5216
5217 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5218
5219         * expression.cs (Binary.ResolveOperator): Apply patch from John
5220         Luke to fix bug 59864: operators &, | and ^ on enumerations
5221         require that the same enum type on both sides.
5222
5223         * driver.cs: Add warnings to old flag usage, this is to assist
5224         people who produce Makefiles and hope that the Makefiles will be
5225         used on Windows.
5226
5227         * class.cs (TypeContainer.EmitType): Moved the definition of the
5228         special $PRIVATE$ field from the resolve phase to the Emit phase.
5229         During resolve we do not know if we are a struct with
5230         HasExplicitLayout, we know this only after the attributes for the
5231         type are emitted.
5232
5233         Set the FieldOffset to zero on the dummy field that we create for
5234         the class.   Fixes 74590.
5235
5236 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5237
5238         Fix #73834.
5239         * ecore.cs (PropertyExpr.resolved): New.
5240         (DoResolve): Use it to handle a case of double resolution here.
5241         Handle a case of identical-name-and-type-name.
5242         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5243         resolution by storing the results of expression resolution back
5244         into the "probes" array.
5245
5246 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5247
5248         Fix cs0208-7.cs and cs0208-8.cs.
5249         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5250         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5251         error reporting to point out the reason a struct is not unmanaged.
5252
5253 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5254
5255         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5256           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5257
5258 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5259
5260         Fix #74528.
5261         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5262         IdenticalNameAndTypeName here.
5263         (EventExpr.InstanceResolve): Likewise.
5264
5265 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5266
5267         C# 2.0 DefaultCharSetAttribute implementation
5268         
5269         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5270         which allows us to set GlobalNamespace for every resolve.
5271         (Attribute.ResolveArguments): Cut from Resolve.
5272         (Attribute.GetCharSetValue): Returns CharSet named argument.
5273         (Attribute.DefinePInvokeMethod): Gets default charset from
5274         module settings.
5275         (GlobalAttribute.ResolveAsTypeStep): Override.
5276         (GlobalAttribute.ResolveArguments): Override.
5277         
5278         * class.cs (TypeAttr): Is protected.
5279         
5280         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5281         (ModuleClass.DefaultCharSetType): New memeber.
5282         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5283         
5284         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5285         charset from module.
5286         
5287         * delegate.cs (TypeAttr): Override.
5288         (Delegate.DefineType): Use this TypeAttr.
5289         
5290         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5291         at very early stage (before types are defined) to resolve model
5292         module attributes. It will probably not work with corlib but it
5293         should be ok.
5294         
5295         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5296         charset from module.
5297         
5298         * typemanager.cs (default_charset_type): New type.
5299
5300 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5301
5302         * decl.cs (MemberCache.AddMethods): Don't warn if
5303         System.Object.Finalize has buggy MethodAttributes.
5304
5305         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5306         removed below.
5307
5308 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5309
5310         * doc.cs : detect ambiguous reference to overloaded members.
5311           Fixed bug #71603. MS 1.1 csc does not detect it.
5312
5313 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5314
5315         * doc.cs : delegates must not be referenced with parameters.
5316           Fixed bug #71605.
5317
5318 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5319
5320         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5321
5322 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5323
5324         * driver.cs (MainDriver): Stop processing if the CLS stage found
5325         errors. 
5326
5327         (CompilerCallableEntryPoint.InvokeCompiler): Always
5328         reset after execution;   Take a TextWriter argument for the
5329         output.
5330
5331         * report.cs: Use the error stream instead of hardcoding stderr. 
5332
5333 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5334
5335         * class.cs: Reduce code paths to test, too small of an
5336         optimization to make it worth the extra testing.  Always perform
5337         it. 
5338
5339 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5340
5341         Fix #74510.
5342         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5343         operators that had errors reported on them.
5344
5345 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5348         argument types.
5349         (Attribute.Resolve): Add named argument type checking.
5350         
5351         * class.cs (FixedField.Define): Use IsPrimitiveType
5352         
5353         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5354         
5355         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5356         unsafe parameter types.
5357         
5358         * statement.cs (Using.ResolveExpression): Add better error description.
5359         
5360         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5361         
5362 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5363
5364         Fix #74484.
5365         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5366         AttributeUsageAttribute in the emitcontext of the attribute class,
5367         not in the emitcontext of the attributable entity it was attached to.
5368         * cs-parser.jay: Use 'current_class', not 'current_container',
5369         when creating a GlobalAttribute.
5370
5371 2005-04-08  Alp Toker  <alp@atoker.com>
5372
5373         * pending.cs: The fix to #58413 failed to compile methods implementing
5374         interfaces with/without params modifiers and vice versa, even though
5375         params modifiers aren't part of the signature. Make the modifier check
5376         less strict as in csc.
5377
5378 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5379             Anoob V E  <projectmonokochi@rediffmail.com>
5380             Harilal P R  <projectmonokochi@rediffmail.com>
5381
5382         Fix #58413.
5383         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5384         modifiers of pending methods.
5385         (PendingImplementation.PendingImplementation): Initialize it.
5386         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5387         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5388         with ParameterData.  Add check for modifiers.
5389         * class.cs (MethodData.Define): Update to changes.
5390
5391 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5392
5393         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5394
5395 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5396
5397         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5398         property.
5399         
5400         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5401         
5402         * rootcontext.cs,
5403         * typemanager.cs: Registered RequiredAttributeAttribute.
5404         
5405 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5406
5407         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5408         Warning CS0169 is back at level 3.
5409         (IMethodData.SetMemberIsUsed): New method.
5410         
5411         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5412         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5413         
5414         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5415
5416         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5417         contants.
5418         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5419         is used.
5420         
5421         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5422         is used.
5423         
5424         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5425         to avoid the problems with nested types.
5426
5427 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5428             Anoob V.E  <projectmonokochi@rediffmail.com>
5429             Harilal P.R  <projectmonokochi@rediffmail.com>
5430             Raja R Harinath  <rharinath@novell.com>
5431
5432         Fix #73820.
5433         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5434         attribute.
5435         * typemanager (GetConstructor): Make public.
5436
5437 2005-04-05  John Luke  <john.luke@gmail.com>
5438             Raja R Harinath  <rharinath@novell.com>
5439
5440         Fix #62232.
5441         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5442         struct too.  Return false quicker in a few cases.
5443         (VerifyUnManaged): Use it.
5444
5445 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5446
5447         Fix #74041.
5448         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5449         not 'unreachable_seen'.
5450
5451 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5452
5453         * attribute.cs (Attribute.GetValue): Removed unused.
5454         
5455         * codegen.cs (CodeGen.TrimExt): Removed unused.
5456         
5457         * cs-parser.jay (output): Removed unused.
5458         
5459         * cs-tokenizer.cs (hex_digits): Removed unused.
5460         
5461         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5462         
5463         * expression.cs (Indirection.LoadExprValue): Removed unused.
5464         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5465         
5466         * iterators.cs (Iterator.param_types): Removed unused.
5467         
5468         * statement.cs (Goto.block): Removed unused.
5469         (ToplevelBlock.did): Removed unused.
5470         (Switch.ResolveConstantSwitch): Removed unused.
5471
5472 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5473
5474         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5475         resetting thingy.
5476
5477 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix #74232 and cs0208-3.cs.
5480         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5481         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5482         unmanaged type.  Don't use FieldBuilders when 't' is a
5483         TypeBuilder.  Use ModFlags and MemberType fields.
5484         * class.cs (MemberBase.member_type): Rename from MemberType.
5485         (MemberBase.MemberType): New property.  Determines member_type on
5486         demand.
5487         (MemberBase.DoDefine): Don't initialize MemberType here.
5488         (FieldMember.Define): Likewise.
5489
5490 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5491
5492         Fix #74241
5493         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5494         Attributes are emitted there.
5495         
5496 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5497
5498         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5499         keyword in 'partial enum' too.
5500         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5501         is not allowed).
5502         Report from Kamil Skalski <nazgul@omega.pl>.
5503
5504         Fix #74309.
5505         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5506         have partial containers too.
5507
5508         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5509         in block' checks to Block.CheckInvariantMeaningInBlock.
5510         * statement.cs (Block.GetKnownVariableInfo): Make private.
5511         (Block.IsVariableUsedInChildBlock): Remove.
5512         (Block.IsVariableUsedInBlock): Likewise.
5513         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5514         conflicting declaration.
5515         (Block.AddVariable): Make error messages less long-winded and more
5516         specific.  Show location of conflicting declaration.
5517         * parameter.cs (Parameters.Location): New readonly property.
5518
5519 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5520
5521         Clean up semantics of invoking ResolveMemberAccess.
5522         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5523         can have an instance, ensure that we pass in a non-TypeExpression
5524         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5525         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5526         argument.  Update to changes and simplify.
5527         (FieldExpr.Emitinstance): Remove CS0120 check.
5528         (PropertyExpr.EmitInstance): Likewise.
5529         * expression.cs (Argument.Resolve): Likewise.
5530         (Invocation.DoResolve): Update to changes in semantics of
5531         InstanceExpression.
5532
5533 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5534
5535         Fix #74241
5536         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5537         customization.
5538         
5539         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5540
5541 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5542
5543         Fix difference in behaviour with commandline invocation.
5544         * driver.cs (Driver.Reset): New.
5545         (CompilerCallableEntryPoint): Call it.
5546
5547         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5548         variable" warnings if the boolean expression failed to resolve.
5549
5550 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5551
5552         * attribute.cs: Fix the union of several permissions when some of them
5553         are unrestricted (so the result isn't an unrestricted permission set).
5554         Fix #74036.
5555
5556 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5557
5558         * ecore.cs (MemberExpr): New class.  Convert from interface
5559         IMemberExpr.
5560         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5561         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5562         error checks.
5563         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5564         (MethodGroupExpr.IsExplicitImpl): Remove.
5565         (Expression.GetFieldFromEvent): Remove.
5566         (SimpleName.MemberStaticCheck): Remove.
5567         (SimpleName.DoSimpleNameResolve): Update to changes.
5568         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5569         (MemberAccess.IdenticalNameAndTypeName): Remove.
5570         (MemberAccess.error176): Move to MemberExpr.
5571         (MemberAccess.DoResolve): Update to changes.
5572         (BaseAccess.DoResolve): Likewise.
5573
5574 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5575
5576         C# 2.0 Conditional attribute class implementation
5577         
5578         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5579         Analyzes class whether it has attribute which has ConditionalAttribute
5580         and its condition is not defined.
5581         
5582         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5583         (Class.IsExcluded): New method. Search for at least one defined
5584         condition in ConditionalAttribute of attribute class.
5585
5586 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5587
5588         * ecore.cs (PropertyExpr): Derive from Expression, not
5589         ExpressionStatement.
5590         (PropertyExpr.EmitStatement): Remove.
5591
5592 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5593
5594         Fix #74060.
5595         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5596         internal field "value__" of an enum be private.  The examples for
5597         "value__" that I found on MSDN all used FieldAttributes.Private.
5598
5599         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5600         Don't mention IL method attribute names.
5601
5602         Fix #47991.  Remove a TODO.
5603         * statement.cs (Block.Toplevel): Make into a field.
5604         (Block.Parameters): Move into ToplevelBlock.
5605         (Block.known_variables): Rename from child_variable_names.
5606         (Block.Block): Remove variants that take Parameters.  Initialize
5607         'Toplevel' with the immediately surrounding toplevel block.
5608         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5609         LocalInfo parameter.
5610         (Block.GetKnownVariableInfo): New.
5611         (Block.IsVariableNameUsedInChildBlock): Update.
5612         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5613         the block, even though it may not be in scope.
5614         (Block.AddVariable): Remove Parameters parameter.  Use
5615         Toplevel.Parameters instead.
5616         (Block.AddConstant): Remove Parameters parameter.
5617         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5618         (Block.IsParamaterReference): Likewise.
5619         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5620         (ToplevelBlock.Parameters): New.  Moved from Block.
5621         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5622         initialize Parameters to a non-null value.
5623         * cs-parser.jay: Update to changes.
5624         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5625         simple names that mean different things in the same block.  Use
5626         Block.IsVariableNameUsedInBlock.
5627
5628 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5629
5630         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5631         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5632         GetTypeHandle.  It is possible for a reflected type to derive from
5633         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5634         System.Array during mscorlib compilation).
5635         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5636         contain a method_hash, don't create one either.  Don't create a
5637         deep copy of the base cache's method_hash.
5638         (MemberCache.SetupCache): Rename back from DeepCopy.
5639         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5640         already initialized.  If we see an override function, add its
5641         underlying base virtual function to the member_hash too.
5642
5643         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5644
5645 2005-03-26  Raja R Harinath  <harinath@acm.org>
5646
5647         Fix #73038.
5648         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5649         fails to resolve, ensure that the LHS is still resolved as an
5650         lvalue.
5651
5652 2005-03-25  Raja R Harinath  <harinath@acm.org>
5653
5654         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5655         ec.ContainerType.
5656         (Enum.current_ec): Remove.
5657         (Enum.LookupEnumValue): Remove EmitContext argument.
5658         Just uses the one created during DefineType.
5659         (Enum.FindMembers): Update.
5660         * expression.cs (MemberAccess.DoResolve): Update.
5661
5662 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * assign.cs (Assign.DoResolve): Check for CS1717 when
5665         source and target are same (uses Equals).
5666
5667         * expression.cs (LocalVariableReference, ParameterReference,
5668         This): Implemented Equals, GetHashCode.
5669
5670         * statement.cs (Block.GetParameterReference): Removed useless
5671         local variable.
5672
5673 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5674
5675         Fix cs0128.cs
5676         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5677         blocks before deciding whether the error is cs0136 or cs0128.
5678
5679         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5680         (using_alias_directive, using_namespace_directive): Pass
5681         MemberName, not an expression to Namespace.UsingAlias and
5682         Namespace.Using.
5683         (MakeName): Use the MemberName of the namespace.
5684         * namespace.cs (Namespace.MemberName): New.
5685         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5686         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5687         Likewise.
5688         * decl.cs (MemberName.Name): Make readonly.
5689         (MemberName.FromDotted): New "constructor".
5690         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5691         (MemberCore.Name): Compute from MemberName on demand.
5692         (MemberCore.SetMemberName): Provide a way to change the
5693         MemberName.
5694         (MemberCore.AddToContainer): Don't take a fullname parameter.
5695         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5696         fully qualified name of the container to the member name.
5697         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5698         only if the type is a member of the root container.
5699         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5700         MemberName.Left rather than searching for an embedded ".".
5701         (PartialContainer.CreatePart): Update to changes in RootContext.
5702         (MemberBase.ShortName): Turn into a property.  Use
5703         MemberCore.SetMemberName.
5704         (MemberBase.ExplicitInterfaceName): Remove.
5705         (MemberBase.UpdateMemberName): Remove.
5706         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5707         (PropertyBase.SetMemberName): New override.
5708         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5709         (Tree.GetDecl): New.
5710         (Tree.AllDecls): Rename from Decls.
5711         * attribute.cs, enum.cs, report.cs: Update to changes.
5712         * driver.cs (MainDriver): Use MemberName.FromDotted on
5713         RootContext.MainClass.
5714
5715 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5716
5717         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5718         checks.
5719
5720         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5721
5722 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5723
5724         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5725         property accessor modifiers.
5726
5727         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5728         fixed buffer attribute (CS1716).
5729         (PropertyMethod.HasCustomAccessModifier): When property accessor
5730         has custom modifier.
5731
5732         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5733         modifiers.
5734         (PropertyExpr.DoResolveLValue): Add CS0272.
5735
5736 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5737
5738         * convert.cs: When converting to a pointer, use the proper Conv.U
5739         or Conv.I depending on the source data type.
5740
5741         * cs-tokenizer.cs: Make the size for large decimal constants,
5742         fixes #72957.
5743
5744 2005-03-17  Martin Baulig  <martin@ximian.com>
5745
5746         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5747         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5748
5749 2005-03-17  Martin Baulig  <martin@ximian.com>
5750
5751         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5752         to bool so we can return an error condition.
5753         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5754         returned an error.
5755
5756 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5757
5758         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5759         attributes.
5760
5761 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5762
5763         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5764         Refactor to avoid traversing the list of assemblies, and to avoid
5765         string concatenation.
5766         * typemanager.cs (guid_attr_type): Remove.
5767         (negative_hits, pointers, references): Remove hashes.
5768         (type_hash): New.
5769         (GetConstructedType): New.  Uses type_hash to handle constructed
5770         types (arrays, references, pointers).
5771         (GetReferenceType, GetPointerType): Use it.
5772         (GetNestedType): New.  Uses type_hash to handle nested types of
5773         reflected types.
5774         (LookupType, LookupTypeDirect): Remove.
5775         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5776         'types' hash and LookupTypeReflection directly.
5777         (params_string, params_object): Use GetConstructedType.
5778         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5779         top-level types.
5780         (Namespace.Lookup): Use cached_types.
5781         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5782         provided by old TypeManager.LookupType.
5783         * rootcontext.cs (MakeFQN): Remove.
5784         * decl.cs (DeclSpace.MakeFQN): Likewise.
5785         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5786         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5787         TypeManager.GetConstructedType.
5788         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5789
5790 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5791
5792         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5793         indexers.
5794
5795         * cs-parser.jay: Reports CS1527 for any namespace element.
5796
5797         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5798         Added CS0407.
5799
5800         * expression.cs (ParameterReference.IsAssigned): Changed error to
5801         CS0269.
5802         (Error_WrongNumArguments): Moved CS0245 detection here.
5803
5804         * statement.cs (Return.Resolve): Add CS1622 report.
5805
5806 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5809
5810 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5811
5812         * attribute.cs expression.cs: Get rid of some allocations.
5813
5814 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5815
5816         * doc.cs : just eliminate the latest change.
5817
5818 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5819
5820         * doc.cs : commented out the latest change. It breaks xml-030.cs
5821
5822 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5823
5824         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5825           fail. So invoke CreateType() in FindDocumentedType().
5826
5827 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5828
5829         * cs-tokenizer.cs : added IsKeyword().
5830         * doc.cs : Detect keyword incorrectly used as identifier.
5831           Allow identifiers prefixed by @.
5832
5833 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5834
5835         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5836         It caused exception in namespace resolving (again!).
5837         
5838         * class.cs (Class.ctor): Removed exit.
5839         (PropertyMethod.ctor): ditto.
5840         
5841         * codegen.cs (Codegen.Reset): Reset static data.
5842         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5843         
5844         * cs-tokenizer.cs (Cleanup): Removed.
5845         
5846         * driver.cs (GetSystemDir): Rewrote to one line command.
5847         It caused problem with unloaded dynamic modules.
5848         (UnixParseOption): Removed Exit.
5849         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5850         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5851         Now can be mcs used as library.
5852         
5853         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5854         empty location.
5855         
5856         * location.cs (Reset): Reset static data.
5857         
5858         * namespace.cs (Reset): Reset static data.
5859         
5860         * report.cs (Report.Reset): Reset static data.
5861         
5862         * rootcontext.cs (RootContext.Reset): Reset static data.
5863         
5864         * tree.cs (RootTypes.ctor): Use Location.Null
5865         
5866         * typemanager.cs (TypeManager.Reset): Reset static data.
5867         (CoreLookupType): Removed Exit.
5868         (TypeHandle.Reset): Reset static data.
5869         
5870 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5871
5872         Fix #73516.
5873         * typemanager.cs (ComputeNamespaces): Import namespaces from
5874         referenced modules too.
5875
5876 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5877
5878         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5879         than '.'.
5880
5881 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5882
5883         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5884         enclosing DeclSpace.  This ensures that a name-lookup populates
5885         more caches and there are fewer 'TypeExpression's.  Carve out
5886         nested type lookup into ...
5887         (LookupNestedTypeInHierarchy): ... this.
5888
5889 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5890
5891         Clean up a few partial-class semantics.  
5892         Fixes test-357.cs and cs1618-2.cs.
5893         * cs-parser.jay (struct_declaration): Use 'current_class' as
5894         parent of newly-created struct.  Remove call to Register ().
5895         Use 'pop_current_class' to complete handing the current struct.
5896         (interface_declaration): Likewise.
5897         (class_declaration): Likewise.
5898         (enum_declaration): Use 'current_class' as parent of newly created
5899         enum.
5900         (delegate_declaration): Likewise.
5901         (pop_current_class): New function.  This is used to handle closing
5902         up the 'current_class' and 'current_container', and pointing them
5903         to the enclosing class/container.
5904         (CSharpParser): Initialize 'current_class' too.
5905         * decl.cs (MemberCore): Add check for invariant: a partial
5906         container is not a parsed entity, and thus does not enclose any
5907         parsed members.
5908         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5909         (DeclSpace.BaseTypeExpr): Use it.
5910         (DeclSpace.LookupType): Add check for invariant.
5911         * class.cs (TypeContainer): Add check for invariant: a nested
5912         class should have the same NamespaceEntry as its enclosing class.
5913         (TypeContainer.EmitFieldInitializers): Make virtual.
5914         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5915         MemberCore.
5916         (TypeContainer.Register): Remove.
5917         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5918         null.  Use TypeResolveEmitContext for resolving base types and
5919         interfaces.  Move initialization of Parts.TypeBuilder here from
5920         ...
5921         (TypeContainer.DefineNestedTypes): ... here.
5922         (PartialContainer): Take a Namespace not a NamespaceEntry.
5923         (PartialContainer.Create): Don't use Register.  Call the
5924         appropriate Add... function directly.
5925         (ClassPart): Take both the PartialContainer and the enclosing
5926         class as constructor arguments.
5927         (ClassPart.EmitFieldInitializers): Override.
5928         (ClassPart.PartFindNestedTypes): Remove.
5929         (FieldBase.GetInitializerExpression): Resolve the initializer
5930         expression in the emit context of the enclosing class.
5931         * tree.cs (RootTypes): Remove Register ().
5932         
5933 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5934
5935         * cs-parser.jay: Removed CS0134.
5936         
5937         * driver.cs: Removed CS1901.
5938         
5939         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5940         for predefined types.
5941
5942 2005-03-07  Duncan Mak  <duncan@novell.com>
5943
5944         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5945         well. Fixes bug #73454.
5946
5947 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5948
5949         * cs-tokenizer.cs (xtoken): Add CS1035.
5950         
5951         * class.cs (MethodData.Define): Add CS0683.
5952         (FieldMember.ctor): Add CS0681.
5953
5954 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5955
5956         * ecore.cs (SimpleName.DoResolve): Rename from
5957         SimpleName.DoResolveAllowStatic.
5958         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5959         Pass 'intermediate' flag to MemberStaticCheck.
5960         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5961         of "intermediate" lookups via MemberAccess.
5962         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5963         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5964
5965 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5966
5967         Fix #73394.
5968         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5969         slipped in because of variable names that are identical to a
5970         builtin type's BCL equivalent ('string String;', 'int Int32;').
5971         (PropertyExpr.EmitInstance): Likewise.
5972
5973 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5974
5975         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5976         
5977         * report.cs (warning_ignore_table): Made public.
5978
5979 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5980
5981         Fix #73282.
5982         * class.cs (MethodData.Emit): Pass 'container' to
5983         container.GetObsoleteAttribute instead of 'container.Parent'.
5984
5985 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5986
5987         * cs-parser.jay: Add 1534 error test.
5988
5989         * iterators.cs (Yield.CheckContext): Add error 1629.
5990         (Iterator.ctor): Save unsafe modifier.
5991         (MoveNextMethod.DoEmit): Restore unsafe context.
5992
5993         * namespace.cs (UsingAlias): Better error message.
5994
5995 2005-03-03  Dan Winship  <danw@novell.com>
5996
5997         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5998         the warning message [#73219]
5999
6000 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6001
6002         Fix compile with MCS 1.0.0.0.
6003         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6004         w_restore to not depend on string constant folding.
6005
6006 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6007
6008         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6009         CS0246 check to users who passed 'silent = false'.
6010         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6011         check.
6012         (SimpleName.SimpleNameResolve): Update.
6013         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6014         (MemberAccess.IdenticalNameAndTypeName): Update.
6015         * doc.cs (FindDocumentedTypeNonArray): Update.
6016
6017 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6018
6019         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6020         * parameters.cs (ComputeAndDefineParameters): Remove.
6021         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6022         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6023         Use GetParameterInfo.
6024
6025 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6026
6027         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6028
6029 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6030
6031         Unify DeclSpace.LookupType and DeclSpace.FindType.
6032         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6033         is in charge of defining nested types on demand.
6034         (DeclSpace.LookupType): Use it when the current_type is a
6035         TypeBuilder.  Use LookupTypeDirect for reflected types.
6036         (DeclSpace.FindType): Remove.
6037         (DeclSpace.LookupInterfaceOrClass): Likewise.
6038         (DeclSpace.DefineTypeAndParents): Likewise.
6039         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6040         DeclSpace.LookupType.
6041         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6042         * typemanager.cs (LookupType): Simplify.
6043         (AddUserType): Remove type from negative_hits.
6044         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6045         * class.cs (TypeContainer.FindMembers): Move handling of nested
6046         types ...
6047         (TypeContainer.FindMembers_NestedTypes): ... here.
6048         (TypeContainer.FindNestedType): Implement override.
6049         (ClassPart.FindNestedType): Delegate to PartialContainer.
6050         (ClassPart.PartFindNestedType): Looks up the nested types of the
6051         part alone.
6052
6053 2005-03-02  Martin Baulig  <martin@ximian.com>
6054
6055         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6056         static constructor in static classes.
6057
6058 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6059
6060         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6061         sizeParamIndex is not specified.
6062
6063 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6064
6065         Fix #73117
6066         * report.cs (WarningMessage.IsEnabled): Missing null check.
6067
6068 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6069
6070         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6071         in the fields and not in the properties.
6072
6073 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6074
6075         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6076         fields as well.
6077
6078 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6079
6080         * attribute.cs: Small refactoring (improved robustness).
6081         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6082         (ValidateGuid): Removed.
6083         (Resolve): Removed referenced to above mentioned.
6084         (GetAttributeUsage): Made private and changed to work without
6085         class assistance.
6086         (GetIndexerAttributeValue): Don't crash.
6087         (GetConditionalAttributeValue): Ditto.
6088         (GetClsCompliantAttributeValue): Ditto.
6089         (ExtractSecurityPermissionSet): All attributes exceptions are
6090         error 648.
6091         (GetPropertyValue): New helper.
6092         (GetMethodImplOptions): New method.
6093         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6094         some missing properties.
6095         
6096         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6097         (Method.ApplyAttributeBuilder): Updated.
6098         
6099         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
6100         exception.
6101
6102 2005-02-28  Raja R Harinath  <rharinath@novell.com>
6103
6104         Fix #73052.
6105         * report.cs (Report.SymbolRelatedToPreviousError): Handle
6106         non-simple types (array, pointer, reference).
6107
6108 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6109
6110         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
6111
6112         * class.cs (MethodCore.IsDuplicateImplementation): Special error
6113         for operators.
6114         (Method.CheckBase): Catch wrong destructor here.
6115         (MethodData.Define): Add errors 550, 668.
6116
6117         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
6118
6119         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
6120
6121         * pending.cs (VerifyPendingMethods): Add error 551.
6122
6123         * typemanager.cs (CSharpName): Next error report helper.
6124
6125 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
6126
6127         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
6128         attributes. Removed useless attribute double check.
6129         It saves almost 2MBs for corlib.
6130
6131 2005-02-25  Raja R Harinath  <rharinath@novell.com>
6132
6133         Fix #72924.
6134         * statement.cs (ExpressionStatement.Resolve): Make robust to being
6135         called twice in case of error.
6136
6137 2005-02-23  Chris Toshok  <toshok@ximian.com>
6138
6139         Fix compiler portions of #72827.
6140         * statement.cs (Block.Emit): call Begin/EndScope on the
6141         EmitContext instead of the ILGenerator.
6142
6143         * codegen.cs (EmitContext.BeginScope): new method, call
6144         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6145         we have one.)
6146         (EmitContext.BeginScope): same, but EndScope and CloseScope
6147
6148         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6149         offset and call the superclass's OpenScope(int) with it.
6150         (SymbolWriter.CloseScope): get the current il
6151         offset and call superclass's CloseScope(int) with it.
6152
6153 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6154
6155         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6156         CS1677 for out and ref as well.
6157
6158         * class.cs (Method.Define): Add error CS1599 detection.
6159         
6160         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6161         
6162         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6163         
6164         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6165         
6166         * support.cs.cs (ModifierDesc): New helper method.
6167
6168 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6169             Abin Thomas  <projectmonokochi@rediffmail.com>
6170             Anoob V E  <projectmonokochi@rediffmail.com>
6171             Harilal P R  <projectmonokochi@rediffmail.com>
6172
6173         Fix #57851, #72718.
6174         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6175         MemberLookup (used for error reporting) actually returns a result.
6176         Fix error report number (122, not 112).
6177
6178 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6179             Anoob V E  <projectmonokochi@rediffmail.com>
6180             Harilal P R  <projectmonokochi@rediffmail.com>
6181
6182         Fix #71134.
6183         * pending.cs (PendingImplementation.GetAbstractMethods):
6184         Find NonPublic members too.
6185
6186 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6187
6188         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6189         Fixed error 217.
6190         
6191         * class.cs (MethodCore.CheckMethodAgainstBase):
6192         Add error 239 report.
6193
6194 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6195
6196         Fix #68955.
6197         * expression.cs (Invocation.IsApplicable): Make public.
6198         (Invocation.IsParamsMethodApplicable): Likewise.
6199         * delegate.cs (Delegate.VerifyApplicability): Don't use
6200         Invocation.VerifyArgumentCompat for parameter applicability
6201         testing.  Use Invocation.IsApplicable and
6202         Invocation.IsParamsMethodApplicable.
6203
6204 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6205
6206         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6207         
6208         * class.cs (Operator.Define): Add error 217 report.
6209         
6210 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6211
6212         * namespace.cs (UsingEntry.Resolve): Undo change below.
6213
6214 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6215
6216         Fix #72756.
6217         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6218         disable the error message when the extended MemberLookup also
6219         fails.
6220         (Expression.MemberLookupFinal): Update.
6221         (SimpleName.DoSimpleNameResolve): Update.
6222         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6223         Don't use MemberLookupFinal.
6224         (New.DoResolve): Update.
6225         (BaseAccess.CommonResolve): Update.
6226
6227 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6228
6229         Fix #72732.
6230         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6231         occured previously, don't resolve again.
6232
6233 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6234
6235         Fix #69949
6236         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6237         argument. Call ResolveAttributeUsage for unresolved.
6238         when types doesn't match ctor arguments.
6239         
6240         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6241         for nested attribute classes.
6242         (Class.attribute_usage): Removed.
6243         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6244         for attribute class.
6245         
6246         * ecore.cs (IsAttribute): Removed.
6247         
6248         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6249         
6250         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6251         now normal types.
6252         (attribute_types): Removed.
6253         (EmitCode): Global attributes are emited as the latest.
6254
6255 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6256
6257         * class.cs (EmitFieldInitializers): Don't emit field initializer
6258         for default values when optimilization is on.
6259         
6260         * constant.cs (Constant.IsDefaultValue): New property.
6261         
6262         * driver.cs: Add /optimize handling.
6263         
6264         * constant.cs,
6265         * ecore.cs,
6266         * literal.cs: Implement new IsDefaultValue property.
6267         
6268         * rootcontext.cs (Optimize): New field, holds /optimize option.
6269
6270 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6271
6272         Fix crasher in re-opened #72347.
6273         * namespace.cs (Namespace.Lookup): Return null if
6274         DeclSpace.DefineType returns null.
6275
6276         Fix #72678.
6277         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6278
6279 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6280
6281         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6282         now returns null if it cannot resolve to an lvalue.
6283         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6284         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6285         returned null.  Remove check for SimpleName.
6286         (EventExpr.DoResolveLValue): New.
6287         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6288         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6289         error from ...
6290         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6291         avoid CS0131 error.
6292         (Unary.ResolveOperator): Move CS0211 check ...
6293         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6294         CS0131 error.
6295         (Unary.DoResolveLValue): Simplify.
6296         (AddressOf.DoResolveLValue): New.
6297         (ArrayAccess.DoResolveLValue): New.
6298
6299 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6300
6301         * attribute.cs (Attribute.Resolve): Add arguments casting for
6302         when types doesn't match ctor arguments.
6303
6304 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6305
6306         Fix parts of #63202.
6307         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6308         lookup of operator in base type.  Ensure that all checks happen
6309         when the operator resolves to an "op_..." method.
6310
6311 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6312
6313         Fix #71992.
6314         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6315         'ignore_cs0104' parameter.  Pass it to ...
6316         (NamespaceEntry.Lookup): ... this.
6317         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6318         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6319         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6320         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6321         Update.  Request that cs0104 errors be ignored.
6322         (ComposedCast.ResolveAsTypeStep): Update.
6323
6324 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6325
6326         Fix #59209.
6327         * expression.cs (Invocation.BetterFunction): Remove support for
6328         comparing virtual functions and their overrides.
6329         (Invocation.IsOverride): New.
6330         (Invocation.OverloadResolve): Don't consider 'override' functions
6331         during candidate selection.  Store them in a lookaside list.
6332         If the selected method is a 'virtual' function, use the list to
6333         find any overrides that are closer to the LHS type.
6334
6335 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6336
6337         * expression.cs (New.DoResolve): Add complex core type reduction.
6338         (New.Constantify): Converts complex core type syntax like 'new int ()'
6339         to simple constant.
6340         
6341 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6342
6343         * decl.cs (EntryType.EntryType): New constructor to create an
6344         updated copy of a cache entry.
6345         (MemberCache.AddMethods): Use it.
6346         (MemberCache.ClearDeclaredOnly): Remove.
6347         (MemberCache.MemberCache): Update.
6348
6349 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6350
6351         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6352         variable.  This one is represents the actual low-level declaration
6353         of the method, as opposed to the semantic level `IsStatic'.   
6354
6355         An anonymous method which is hosted into a static method might be
6356         actually an instance method.  IsStatic would reflect the
6357         container, while MethodIsStatic represents the actual code
6358         generated.
6359
6360         * expression.cs (ParameterReference): Use the new MethodIsStatic
6361         instead of IsStatic.
6362
6363         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6364         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6365         set on the current EmitContext. 
6366
6367         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6368         resolve our casted expression as an LValue.  This triggers the
6369         proper LValue processing that is later required by Assign.
6370
6371         This fixes 72347.
6372
6373         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6374
6375 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6376
6377         C# 2.0 Fixed buffer implementation
6378
6379         * anonymous.cs: Update after RegisterHelperClass renaming.
6380
6381         * attribute.cs (AttributeTester.fixed_buffer_cache):
6382         Cache of external fixed buffers.
6383         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6384         implementation if field is fixed buffer else null.
6385
6386         * class.cs
6387         (TypeContainer.AddField): Accept FieldMember instead of Field.
6388         (FieldBase.IsFieldClsCompliant): Extracted code from
6389         VerifyClsCompliance descendant customization.
6390         (FixedField): New class handles fixed buffer fields.
6391         (FixedFieldExternal): Keeps information about imported fixed
6392         buffer.
6393         (IFixedField): Make access to internal or external fixed buffer
6394         same.
6395
6396         * cs-parser.jay: Add fixed buffer parsing.
6397
6398         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6399         buffer.
6400
6401         * expression.cs (Indirection): Extended implementation to accept
6402         fixed buffer field.
6403         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6404         (ElementAccess.MakePointerAccess): Get type as parameter.
6405         (DoResolve): Add fixed buffer field expression conversion.
6406         (DoResolveLValue): Ditto.
6407         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6408         (ArrayPtr): Derives from FixedBufferPtr.
6409         (ArrayPtr.Emit): Add extra emit for array elements.
6410
6411         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6412
6413         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6414         for compiler generated types.
6415         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6416
6417         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6418         and consume less memory.
6419         (Fixed.Resolve): Add fixed buffer case.
6420
6421         * typemanager.cs (compiler_generated_attr_ctor,
6422         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6423         (HasElementType): Add our own implementation to work on every
6424         runtime.
6425
6426 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6427
6428         * anonymous.cs (CaptureContext): Track whether `this' has been
6429         referenced.   
6430
6431         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6432         only captured `this' if it was implicitly done (instance
6433         methods/variables were used). 
6434
6435         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6436         `this' must be captured.
6437
6438 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6439  
6440         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6441         is null it means that there has been no need to capture anything,
6442         so we just create a sibling.
6443
6444         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6445
6446         Just a partial fix.  The other half is fairly elusive.
6447         
6448 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6449
6450         Fix #52586, cs0121-4.cs.
6451         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6452         and return a hashtable.
6453         (MemberCache.ClearDeclaredOnly): New.
6454         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6455         the method_hash of a base type too.
6456         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6457         type methods.  Overwrite entries with the same MethodHandle so
6458         that the ReflectedType is correct.  The process leaves in base
6459         virtual functions and their overrides as distinct entries.
6460         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6461         matters since it was boxed in a ArrayList before.
6462         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6463         modifier.
6464         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6465         case of a virtual function and its override (choose the overload
6466         as better).
6467         (Invocation.OverloadResolve): Avoid 'override' members during
6468         'applicable_type' calculation.
6469
6470 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6471
6472         Combine two near-redundant caches.
6473         * typemanager.cs (method_params): Rename from method_internal_params.
6474         (TypeManager.GetParameterData): New.  Replace
6475         Invocation.GetParameterData.
6476         (TypeManager.LookupParametersByBuilder): Remove.
6477         * expression.cs (Invocation.method_parameter_cache): Remove.
6478         (Invocation.GetParameterData): Remove.
6479         Update to changes.
6480         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6481         Update to changes.
6482
6483 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6484
6485         Fix #72015.
6486         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6487         TypeManager.multicast_delegate_type is null, resolve it by looking
6488         up "System.MulticastDelegate".
6489         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6490
6491 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6492             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6493             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6494
6495         Fix cs0164.cs.
6496         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6497         (LabeledStatement.AddReference): New.  Set 'referenced'.
6498         (Goto.Resolve): Use it.
6499
6500 2005-02-05  John Luke  <john.luke@gmail.com>
6501
6502         * driver.cs: remove duplicate -doc line in Usage ()
6503
6504 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6505
6506         * location.cs (Location.AddFile): Fix CS2002 error report.
6507
6508 2005-02-02  Martin Baulig  <martin@ximian.com>
6509
6510         * delegate.cs (Delegate.DefineType): Report an internal error if
6511         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6512         details.        
6513
6514 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6515
6516         Fix a crasher in a variant of #31984.
6517         * const.cs (Constant.CheckBase): New override that defers the
6518         new-or-override check in case the base type hasn't been populated
6519         yet.
6520         (Constant.Define): Ensure the new-or-override check is performed.
6521
6522 2005-02-01  Duncan Mak  <duncan@ximian.com>
6523
6524         * const.cs (LookupConstantValue): Check that `ce' is not null
6525         before calling GetValue ().
6526
6527 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6528
6529         Fix test-334.cs (#69519).
6530         * cs-parser.jay (using_alias_directive): Pass in an expression to
6531         NamespaceEntry.UsingAlias.
6532         (using_namespace_directive): Pass in an expression to
6533         NamespaceEntry.Using.
6534         (namespace_name): Don't flatten to a string.
6535         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6536         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6537         ResolveAsTypeStep.
6538         (NamespaceEntry.UsingEntry): Likewise.
6539         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6540         changes.
6541         (NamespaceEntry.LookupForUsing): Remove.
6542         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6543         names.
6544         (NamespaceEntry.Lookup): Remove support for dotted names.
6545
6546 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6547
6548         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6549         split into two.
6550         (NamespaceEntry.ImplicitParent): Compute on demand.
6551         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6552         parallels the current.
6553         (NamespaceEntry.LookupForUsing): Use it.
6554         (NamespaceEntry.Lookup): If the current namespace-entry is
6555         implicit, don't search aliases and using tables.
6556
6557 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6558
6559         Fix #31984.
6560         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6561         BaseCache here.
6562         (TypeContainer.BaseCache): Compute on demand.
6563         (TypeContainer.FindMembers): Define constants and types if they're
6564         not already created.
6565         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6566         check.
6567         * const.cs (Constant.Define): Make idempotent.
6568
6569 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6570
6571         * pending.cs: Produce better code (no nops produced by using Ldarg
6572         + value).
6573         
6574         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6575         i - 1' it should be arg + 1.
6576
6577         Fixes bug #71819.
6578
6579 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6580
6581         * attribute.cs (Attribute.CheckAttributeType): Make private
6582         non-virtual.
6583         (Attribute.ResolveType): Make virtual.
6584         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6585         handling of RootContext.Tree.Types.
6586
6587 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6588
6589         Update attribute-handling to use the SimpleName/MemberAccess
6590         mechanisms.
6591         * cs-parser.jay (attribute): Pass in an expression to the
6592         constructors of Attribute and GlobalAttribute.
6593         * attribute.cs (Attribute): Take an expression for the name.
6594         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6595         passed in attribute name expression.
6596         (Attribute.CheckAttributeType): Use it.
6597         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6598         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6599         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6600         argument to prevent error messages if the lookup fails.
6601
6602 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6603
6604         * expression.cs (Indirection): Implemented IVariable interface
6605         to support indirection in AddressOf operator.
6606         (PointerArithmetic.Emit): Add optimalization for case where
6607         result can be precomputed.
6608
6609 2005-01-26  Martin Baulig  <martin@ximian.com>
6610
6611         * class.cs (TypeContainer.AttributeTargets): Return the correct
6612         AttributeTargets depending on our `Kind' instead of throwing an
6613         exception; fixes #71632.
6614
6615 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6616
6617         Fix #71257
6618         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6619         constant members.
6620
6621 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6622
6623         Fix #71602.
6624         * expression.cs (MemberAccess.DoResolve): Don't complain with
6625         cs0572 when the LHS of a member access has identical name and type
6626         name.
6627
6628 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6629
6630         Fix #71651, #71675
6631         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6632         CreatePermission.
6633         Create custom PermissionSet only for PermissionSetAttribute.
6634
6635 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6636
6637         Fix #71649
6638         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6639         delegates in static class.
6640
6641 2005-01-24  Martin Baulig  <martin@ximian.com>
6642
6643         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6644         merging an implicit block, just use its reachability.
6645
6646         * statement.cs (Block.Resolve): Make the unreachable code check
6647         work wrt. implicit blocks; see test-337 from #63842.
6648
6649 2005-01-21  Alp Toker  <alp@atoker.com>
6650  
6651         * cs-parser.jay: destructor_declaration's container is PartialContainer
6652         not Class when partial types are used, so use Kind prop instead of
6653         'is'.
6654         
6655 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6656
6657         * cs-parser.jay: Improve error reporting when an interface
6658         declares new types.
6659
6660 2005-01-20  Dick Porter  <dick@ximian.com>
6661
6662         * support.cs: SeekableStreamReader fix from Sandor Dobos
6663         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6664         chars are read.  Fixes bug 70369.
6665
6666 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6667
6668         * cs-parser.jay (catch_clause): Simplify current_block handling
6669         somewhat.
6670
6671 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6672
6673         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6674         code with ImplicitStandardConversion to handle the implicit
6675         conversion of method groups into valid delegate invocations. 
6676
6677         The problem is that in parameter handling we were using this code
6678         path.  Fixes bug #64698
6679
6680 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6681
6682         * cs-parser.jay: Fix several infelicities.
6683         - Avoid assigning to the parser value stack.  Code like 
6684           '$3 = null' is unclean.  Synthesize a value for the code block
6685           instead. 
6686         - Avoid using oob_stack for storing location information.  Use ...
6687         (_mark_): ... this.  New (empty) rule.  Saves the current location
6688         in $$.
6689         (foreach_statement): Avoid using oob_stack for current_block
6690         handling.  Use technique used in for_statement and
6691         using_statement.  Synthesize a value for the code block to store
6692         additional intermediate information.
6693
6694 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6695
6696         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6697         of a different type is only allowed to private fields of a
6698         containing type, not on fields of a base class.
6699
6700         See test-174.cs and error cs0122-9.cs
6701
6702 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6703
6704         Fix test-335.cs (bug #58126).
6705         * cs-parser.jay (argument): Split out non-expression parts of the
6706         rule into 'non_simple_argument'.
6707         (invocation_expression): Support parenthesized invocations with
6708         multiple arguments, and with single non-simple arguments.
6709
6710 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6711
6712         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6713         places.
6714
6715 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6716
6717         Fix cs0038-1.cs, cs1640-6.cs.
6718         * ecore.cs (Expression.Resolve): Remove special-case for
6719         SimpleName in error-handling.
6720         (Expression.almostMatchedMembers): Relax access permission to
6721         protected.
6722         (Expression.MemberLookupFailed): Handle duplicates in
6723         almostMatchedMembers list.
6724         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6725         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6726         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6727         overload if the passed in MemberInfo is a MethodBase.
6728
6729 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6730
6731         Fix #70749
6732         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6733         for non-CAS & merge permission sets properly.
6734
6735 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6736
6737         Improve standard-compliance of simple name and member access 
6738         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6739         * ecore.cs (FullNamedExpression): New abstract base class 
6740         for Namespaces and TypeExpressions.
6741         (ResolveFlags.SimpleName): Remove.
6742         (SimpleName): Remove support for dotted names.
6743         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6744         DeclSpace.FindType and DeclSpace.LookupType.
6745         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6746         (Expression.ExprClassName): Make member function.
6747         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6748         a namespace.  Remove creation of dotted "SimpleName"s.
6749         (MemberAccess.DoResolve): Likewise.
6750         * decl.cs (DeclSpace.Cache): Make private.
6751         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6752         (DeclSpace.FindType): Update.
6753         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6754         FullNamedExpression.
6755         * namespace.cs (Namespace): Derive from FullNamedExpression
6756         so that it can be part of expression resolution.
6757         (Namespace.Lookup): Return an FullNamedExpression.
6758         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6759         namespace.
6760         * rootcontext.cs (NamespaceLookup): Remove.
6761         (LookupType): Move to DeclSpace.
6762         * attribute.cs (CheckAttributeType): Update.
6763         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6764         (FindDocumentedTypeNonArray): Likewise.
6765
6766 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6767
6768         Fix cs0509.cs, cs1632.cs.
6769         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6770         is the same as IsInterface.
6771         (TypeContainer.GetClassBases): Likewise.
6772         * statement.cs (LabeledStatement.ig): New field.
6773         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6774         label.
6775         (LabeledStatement.DoEmit): Check that the label was created with
6776         the same ILGenerator.
6777
6778 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6779
6780         Fix #71058
6781         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6782         accessors to its properties.
6783
6784         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6785         from accessors to property.
6786         
6787 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6788
6789         Fix #70722
6790         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6791         only for overrides.
6792         
6793 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6794
6795         * attribute.cs: Check for null and empty strings.  
6796
6797         I have lost another battle to Paolo.
6798
6799 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6800
6801         Fix #70942
6802         * class.cs (PropertyMethod): Set Parent field in ctors.
6803         (SetMethod.InternalParameters): Add unsafe switch hack.
6804         Override MarkForDuplicationCheck where it is appropriate.
6805
6806         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6807         It says whether container allows members with the same name.
6808         Base default is no.
6809         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6810         Removed is_method parameter.
6811
6812 2005-01-06  Duncan Mak  <duncan@ximian.com>
6813
6814         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6815         because the previous change led to incorrect reporting of CS1032
6816         ("Cannot define/undefine preprocessor symbols after first token in
6817         file"). Instead of using `tokens_seen' as the only flag that
6818         triggers CS1040, introduce `comments_seen'. This new flag is used
6819         to signify having seen comments on the current line, so it is
6820         unset after a newline.
6821
6822 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6823
6824         * doc.cs : When searching for a type, find nested type too.
6825           This fixes bug #71040.
6826
6827 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6828
6829         * doc.cs :
6830           - Warn missing member comment on those classes which also does not
6831             have doc comments. Fixed bug #71041.
6832           - Don't warn missing doc comment on default constructor.
6833             Fixed bug #71042.
6834
6835 2005-01-06  Duncan Mak  <duncan@ximian.com>
6836
6837         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6838         comments, set `tokens_seen' to true. This allows us to detect
6839         misplaced preprocessor directives (i.e. not at the beginning of
6840         the a line, nor after whitespaces). In that case, report error
6841         CS1040. This fixes bug #56460.
6842
6843         * cs-parser.jay (interface_member_declaration): Add checks for
6844         IsExplicitImpl, and report CS0541 error if an interface member is
6845         defined as an explicit interface declaration.
6846
6847 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6848
6849         Fix #70817
6850         * class.cs (PropertyMethod): Set Parent field in ctors.
6851         (SetMethod.InternalParameters): Add unsafe switch hack.
6852         
6853         * decl.cs (MemberCore.Parent): Cannot be readonly.
6854
6855 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6856
6857         * decl.cs (DeclSpace.ResolveType): Remove.
6858         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6859         Merge in code from ...
6860         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6861         * class.cs, enum.cs: Update to changes.
6862
6863 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6864
6865         * anonymous.cs: Ensure that we init the scope of our parent if it
6866         has not been initialized yet.
6867
6868 2004-12-30  Duncan Mak  <duncan@ximian.com>
6869
6870         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6871         if field.FieldBuilder is null. Fixes #70758.
6872
6873         * convert.cs: Fixed some typos and updated some of the comments.
6874         (ImplicitStandardConversionExists):
6875         (TryImplicitIntConversion): If `target_type' is an interface and
6876         the type of `ic' implements this interface, return true or a new
6877         BoxedCast instead of null. This fixes #70468.
6878
6879 2004-12-29  Duncan Mak  <duncan@ximian.com>
6880
6881         * expression.cs (Argument.Emit): Check that Expr is
6882         IMemoryLocation before casting to it, and report CS1510 otherwise.
6883
6884         This fixes #70402.
6885
6886 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6887
6888         * statement.cs (Block.ThisVariable): remove the recursion here, to
6889         make the --profile more sane.
6890
6891 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6892
6893         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6894         assembly, by JB Evain.
6895
6896 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6897
6898         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6899           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6900         "parent" refers to enclosing type/class.  "base" refers to superclass.
6901
6902 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6903
6904         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6905         Ensure that we only have GlobalAttributes.
6906         * attribute.cs (Attribute.Emit): Make non-virtual.
6907         (GlobalAttribute.Emit): Remove.
6908         (Attribute.Resolve): Make virtual.
6909         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6910         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6911         the argument. Don't create one.
6912         (Attribute.GetObsoleteAttribute): Likewise.
6913         (Attribute.GetClsCompliantAttributeValue): Likewise.
6914         * class.cs, decl.cs: Update to changes.
6915
6916 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6917
6918         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6919         
6920         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6921         
6922         * statement.cs (Foreach.Resolve): Add error 186 report.
6923
6924 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6925
6926         * expression.cs (Conditional.DoResolve): Add warning 429.
6927         
6928         * statement.cs (If.Resolve): Add warning 665.
6929
6930 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6931
6932         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6933         except when in the parser, and in GlobalAttribute.
6934         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6935         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6936         RootContext.Tree.Types.NamespaceEntry once work is done.
6937         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6938         and resets RootContext.Tree.Types.NamespaceEntry.
6939
6940 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6941
6942         * cs-parser.jay: Don't create a block for every variable.
6943
6944 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6945
6946         * location.cs: Provide extra information.
6947
6948         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6949         variables from the captured environment, it is the ldarg_0.
6950
6951 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6952
6953         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6954         find a conclusion.
6955         
6956         * class.cs: Changed warning level for 169 to avoid developer
6957         displeasure from warning flooding. It will be changed back when they
6958         fix most of current BCL warnings.
6959         
6960         * RootContext.cs: Pushed default WarningLevel to 3.
6961         
6962         * statement.cs: Removed unused variable.
6963
6964 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6965
6966         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6967         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6968         Add error 502 report.
6969         (StaticClass.DefineType): Add error 441 report.
6970         (Class.AllowedModifiersProp): New virtual property as temporary
6971         extension to AllowedModifiers.
6972         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6973         to share implementation with StaticClass and don't call virtual
6974         methods from ctor.
6975         
6976         * driver.cs (MainDriver): Add error 1558 test.
6977
6978         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6979         report. Moved error 36 test here.
6980
6981         * statement.cs (Throw.Resolve): Add error 724 report.
6982
6983         * typemanager.cs: Add out_attribute_type core type.
6984         
6985 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6986
6987         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6988         3018 report.
6989         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6990
6991         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6992         3017 report.
6993         
6994         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6995
6996         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6997         Add error 3023 report.
6998         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6999
7000         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7001         implementation.
7002
7003 2004-12-12  John Luke  <john.luke@gmail.com>
7004
7005         * driver.cs (AddArgs): take -- into account when
7006         adding arguments, fixes bug 65710 
7007
7008 2004-12-12  Martin Baulig  <martin@ximian.com>
7009
7010         * expression.cs (Unary.TryReduceNegative): Added support for
7011         SByteConstant and ByteConstant.
7012         (Unary.Reduce): Check error values from TryReduceNegative().
7013
7014 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7015
7016         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7017         and report exception as error 182.
7018
7019 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7020
7021         * driver.cs (Main): Fix message when there are warnings.
7022
7023 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7024
7025         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7026
7027 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7028
7029         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7030         Reduced number of warnings.
7031         
7032         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7033
7034 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7035
7036         * driver.cs: Removed message.
7037
7038         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7039
7040 2004-12-08    <vargaz@freemail.hu>
7041
7042         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7043
7044 2004-12-08  Martin Baulig  <martin@ximian.com>
7045
7046         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7047         instead of a CS3002 for properties and indexer.
7048
7049 2004-12-08  Martin Baulig  <martin@ximian.com>
7050
7051         * decl.cs (MemberName.ToString): Make this work again.
7052
7053 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7054
7055         * attribute.cs (Resolve): Add error 591 detection.
7056
7057         * class.cs (FieldMember.Define): Add error 1547 detection.
7058         (Indexer.Define): Add error 620 detection.
7059         (Operator.Define): Add error 590 detection.
7060
7061         * ecore.cs: Missing argument for error 79.
7062
7063         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7064         detection.
7065
7066 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7067
7068         Fix #70106
7069         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7070         only.
7071
7072 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7073
7074         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7075           Some operator comments were suppressed.
7076         * doc.cs : Implicit/explicit operator name in doc comments are like
7077           "op_Explicit(type)~returnType", so added suffix handling.
7078
7079 2004-12-07  Martin Baulig  <martin@ximian.com>
7080
7081         * decl.cs
7082         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7083         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7084         (DeclSpace.ec): New protected field; store the EmitContext here.
7085         (DeclSpace.EmitContext): New public property; moved here from
7086         `TypeContainer'.
7087         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7088         EmitContext.
7089
7090         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7091         (Enum.Emit): Don't create a new EmitContext.
7092
7093         * delegate.cs (Delegate.DefineType): Always create the
7094         EmitContext.
7095
7096         * iterators.cs (Iterators.DefineIterator): Create a new
7097         EmitContext and store it in `ec'.
7098
7099 2004-08-24  Martin Baulig  <martin@ximian.com>
7100
7101         * typemanager.cs
7102         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7103         this for accessibility checks.
7104         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7105         IsNestedFamilyAccessible.
7106         (TypeManager.IsSubclassOf): New method, do what the name actually
7107         says.   
7108
7109 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7110
7111         Fix crash on cs0657-17.cs.
7112         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7113         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7114         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7115         the case where the NamespaceEntry gets overwritten.
7116
7117 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7118
7119         Fixed #69195, #56821
7120         * ecore.cs (ResolveBoolean): Tiny refactoring.
7121
7122         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7123         of right expression resolving when left is false constant and
7124         operator is LogicalAnd OR true constant and operator is LogicalOr.
7125
7126         * statement.cs (ResolveUnreachable): Always reports warning.
7127
7128 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7129
7130         * class.cs: Distinguish between 1721 and 1722 (just a little help
7131         for the programmer).
7132
7133 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7134
7135         * delegate.cs: Only allow this on new versions of the language. 
7136
7137 2004-12-02  Duncan Mak  <duncan@ximian.com>
7138
7139         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7140         Expression class.
7141         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7142         here as a static method. Take an additional bool out parameter
7143         `must_do_cs1540_check' for signaling to InstanceResolve.
7144         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7145         member field from PropertyExpr class and made it an argument of
7146         the method instead.
7147         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7148         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7149         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7150         and `remove_accessor' as well as InstanceResolve: report CS0122
7151         where applicable.
7152
7153         Fixes #70129.
7154
7155 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7156
7157         Fix test-327.cs, test-328.cs, and put in early infrastructure
7158         for eventually fixing #52697.
7159         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7160         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7161         from other methods.
7162         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7163         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7164         (VerifyUsing, error246): Update.
7165         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7166         'NamespaceEntry.LookupNamespaceOrType'.
7167
7168 2004-12-03  Martin Baulig  <martin@ximian.com>
7169
7170         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7171         method as our child, call AnonymousMethod.Compatible() on it.
7172
7173 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7174
7175         Disable XML documentation support in 'basic' profile.
7176         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
7177         Redirect XmlElement to System.Object.
7178         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
7179         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
7180         * mcs.exe.sources: Add doc-bootstrap.cs.
7181         * doc-bootstrap.cs: New file.  Contains empty stub implementation
7182         of doc.cs.
7183
7184 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7185
7186         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7187           comments are allowed.
7188
7189 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7190
7191         * delegate.cs: Add checks for subtypes in paramaters and return values
7192         in VerifyMethod () to add support for Covariance/Contravariance
7193         in delegates.
7194         
7195 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7196
7197         * report.cs: Remove extra closing parenthesis.
7198
7199         * convert.cs (Error_CannotImplicitConversion): If the name of the
7200         types are the same, provide some extra information.
7201
7202         * class.cs (FieldBase): Use an unused bit field from the field to
7203         encode the `has_offset' property from the FieldMember.  This saves
7204         a couple of Ks on bootstrap compilation.
7205
7206         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7207         method as our child, return the AnonymousMethod resolved
7208         expression.
7209
7210         * expression.cs (New.DoResolve): Allow return values from
7211         NewDelegate to also include AnonymousMethods.
7212
7213         Fixes #70150.
7214
7215 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7216
7217         Fix bug #70102
7218         * attribute.cs (Resolve): Improved implementation of params
7219         attribute arguments.
7220
7221         * support.cs (ParameterData): Add HasParams to be faster.
7222
7223 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7224
7225         all things are for /doc support:
7226
7227         * doc.cs: new file that supports XML documentation generation.
7228         * mcs.exe.sources: added doc.cs.
7229         * driver.cs:
7230           Handle /doc command line option.
7231           Report error 2006 instead of 5 for missing file name for /doc.
7232           Generate XML documentation when required, after type resolution.
7233         * cs-tokenizer.cs:
7234           Added support for picking up documentation (/// and /** ... */),
7235           including a new XmlCommentState enumeration.
7236         * cs-parser.jay:
7237           Added lines to fill Documentation element for field, constant,
7238           property, indexer, method, constructor, destructor, operator, event
7239           and class, struct, interface, delegate, enum.
7240           Added lines to warn incorrect comment.
7241         * rootcontext.cs :
7242           Added Documentation field (passed only when /doc was specified).
7243         * decl.cs:
7244           Added DocComment, DocCommentHeader, GenerateDocComment() and
7245           OnGenerateDocComment() and some supporting private members for
7246           /doc feature to MemberCore.
7247         * class.cs:
7248           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7249         * delegate.cs:
7250           Added overriden DocCommentHeader.
7251         * enum.cs:
7252           Added overriden DocCommentHeader and GenerateDocComment().
7253
7254 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7255
7256         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7257         unwrapping the enumeration values, chain to
7258         DoConstantNumericPromotions again, so we can promote things to the
7259         fundamental types (takes care of enums that are bytes, sbytes).
7260
7261         Fixes bug #62054.
7262
7263 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7264
7265         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7266         Fix long-standing bug in type-lookup.  Use FindType instead of
7267         LookupType when ec.ResolvingTypeTree.
7268         (Attribute.ResolveType, Attribute.Resolve)
7269         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7270         Update to changes.
7271         (Attributes.Search): Remove internal version.  Update.
7272         (Attributes.SearchMulti): Update.
7273         (Attributes.GetClsCompliantAttribute): Remove.
7274         (Attributes.GetIndexerNameAttribute): Remove.
7275         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7276         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7277         * class.cs (Indexer.Define): Likewise.
7278
7279 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7280
7281         Fix bug #68790
7282         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7283         MarshallByReference members access.
7284
7285         * expression.cs: Use CheckMarshallByRefAccess;
7286         Better error CS0197 message.
7287
7288         * report.cs: Print whole related error message.
7289
7290 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7291
7292         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7293         the current directory to help debugging.
7294
7295 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7296
7297         * class (GetClassBases): Better error 60 report.
7298         (EventProperty): Disabled warning 67 detection.
7299
7300 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7301
7302         Fix bug #60324
7303         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7304
7305         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7306         precise values.
7307
7308 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7309
7310         Fix bug #49488
7311         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7312
7313         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7314
7315 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7316
7317         * attribute.cs (Attribute.Resolve): Refine error reporting and
7318         report a cs0117 if the identifier does not exist, to distinguish
7319         from 0617 which is a miss-use of the actual identifier.
7320
7321         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7322         between cs0070 and cs0079.
7323
7324         * class.cs (MemberBase.DoDefine): When reporting a wrong
7325         accessibility level, we use MethodCore to compare instead of
7326         Method (this was a regression in some refactoring effort).
7327
7328         So now we correctly report cs0056 again.
7329
7330         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7331         testing the target_type (which was known to be object_type) and
7332         not the source type (which is anonymous_method).
7333
7334         Fixed reporting of error cs1660.
7335
7336         * expression.cs (UserCast.Source): Expose the underlying cast.
7337
7338         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7339         allowed types to find a match to int32 first (most common).
7340
7341         In addition, it ignores any ImplicitUserConversions that did an
7342         internal implicit conversion (as the switch statement allows only
7343         one integral conversion to exist).
7344
7345         * class.cs (PartialContainer.Create): rename `name' to
7346         `member_name' for clarity.  Then replace the string calls with a
7347         call to MemberName.GetPartialName, as now using
7348         MemberName.ToString is an error (this is due to the side effects
7349         it had, that were fixed in the past).
7350
7351         This will restore the error reporting on a number of partial class
7352         errors that were missusing this (and getting an exception as a
7353         results, which is now just a plain textual warning, because
7354         yyparse debug output would crash otherwise).
7355
7356 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7357
7358         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7359
7360 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7361
7362         * rootcontext.cs (LookupType): Make sure to cache lookups that
7363         don't give us a negative result. This saves about 5% of corlib
7364         compilation time.
7365
7366 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7367
7368         * report.cs (AbstractMessage.Print): messages are sent to stderr
7369
7370         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7371         non-interface in the list of interfaces (at this point, either
7372         parent was properly set, or a base class is being listed in the
7373         interfaces section).
7374
7375         This flags error 1722, and resolves the crash from bug 69259.
7376
7377 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7378
7379         * statement.cs (Using.EmitExpressionFinally): make this work right
7380         for valuetypes. Fixes 69926.
7381
7382 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7383
7384         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7385         converted to an enum" here, before we try to change the underlying
7386         type.  This code exists, but it is a different code path than the
7387         one used while encoding constants.
7388
7389         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7390         old bug: when converting from the null literal to a pointer,
7391         return an EmptyCast, not the NullLiteral.
7392
7393         This fixes #69921, the recent null_type changes probably made this
7394         bug more prominent.
7395
7396         (ImplicitReferenceConversionExists): In addition, resynchronized
7397         the code here, so it matches the same code in
7398         ImplicitReferenceConversionExists for the `from any class-type S
7399         to any interface-type T'.
7400         
7401
7402 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7403
7404         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7405
7406 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7407
7408         * cs-parser.jay: Use verbosity accordingly. 
7409
7410 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7411
7412         * expression.cs (Unary.ResolveOperator): Do not report warning;
7413         AddressOf reads from variable.
7414         
7415         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7416
7417 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7418
7419         Fix bug #69462
7420
7421         * attribute.cs (Attributable): Removed CheckTargets.
7422         (Attributes.Emit): Explicit attribute targets are tested here.
7423
7424         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7425         not enabled for interfaces.
7426
7427         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7428         (GetAssemblyName): Ouch next bug there.
7429
7430 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7431
7432         * expression.cs: Error 275 added.
7433         
7434 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7435
7436         Fix bug #69177 (Implemented decimal constant support)
7437
7438         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7439         (BinaryFold): Add DecimalConstant.
7440
7441         * const.cs (Define): Decimal constant 
7442         (is not constant.
7443         (ChangeType): Add decimal type handling.
7444         (LookupConstantValue): Don't set value for decimal type but
7445         emit DecimalConstantAttribute. Needed for constant optimization.
7446
7447         * constant.cs (ToDecimal): New method.
7448         (ConvertToDecimal): New method.
7449         (IntConstant): Implemented ConvertToDecimal.
7450         (DecimalConstant.Emit): Emit optimized version for decimals in
7451         int range.
7452
7453         * expression.cs (ResolveOperator): Changed order of constant
7454         reduction to work correctly with native types which have
7455         overloaded operators.
7456         (ResolveMemberAccess): Extract constant value from attribute
7457         for decimal type.
7458
7459         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7460
7461         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7462         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7463         (ChangeType): Decimal is special.
7464         (TypeToCoreType): Add decimal type.
7465
7466 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7467
7468         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7469         decimal types.
7470
7471 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7472
7473         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7474         test cs1667-5.cs.
7475
7476 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7477
7478         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7479
7480         * pending.cs (PendingImplementation): Grab only interfaces.
7481
7482 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7483
7484         * statement.cs (ForeachHelperMethods): Add location member and
7485         error 202 detection.
7486
7487 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7488
7489         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7490         automatically handled by executable.make.
7491         (PROGRAM): Make profile-specific.
7492
7493 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7494
7495         * expression.cs (DoResolveBase): Fixed wrong warning for out
7496         variables.
7497
7498 2004-11-18  Martin Baulig  <martin@ximian.com>
7499
7500         Merged latest changes into gmcs.  Please keep this comment in
7501         here, it makes it easier for me to see what changed in MCS since
7502         the last time I merged.
7503
7504 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7505
7506         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7507         (TypeHandle.GetMemberCache): New.
7508         (TypeHandle.TypeHandle): Update.
7509         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7510         (TypeManager.LookupParentInterfacesCache):
7511         Rename from LookupInterfaceCache.  Optimize slightly.
7512         (TypeManager.MemberLookup_FindMembers): Update.
7513         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7514         multi-type variant.
7515         (AddCacheContents): Rename from AddHashtable.
7516         * class.cs (TypeContainer.parent_container): Remove.
7517         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7518         (TypeContainer.DoDefineMembers): Don't initialize it.
7519         Update to name changes.
7520         
7521 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7522
7523         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7524         that factors the code to check access modifiers on override.  
7525
7526         (PropertyBase): Use the code here.
7527
7528         Patch from Lluis S'anchez, fixes bug #69361.
7529
7530 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7531
7532         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7533         routine that is used to report the use of a captured variable
7534         whose address has been taken.
7535
7536         There are two checks: one when variables are being captured and
7537         the other check is when the address of a variable is taken. 
7538         
7539         (because an anonymous methods might be resolved before *or* after
7540         the address has been taken) and 
7541
7542         * expression.cs (Conditional.DoResolve): Remove the special
7543         casing that Martin added to trueExpr and falseExpr being both
7544         NullLiteral.  We get the right behavior now just by introducing
7545         the null_type into the compiler. 
7546
7547         * convert.cs (ExplicitConversion): Change the code to use
7548         null_type instead of testing `expr is NullLiteral'.
7549         (ImplicitConversionStandard): use null_type too.
7550         (ImplicitReferenceConversionExists): use null_type too.
7551         (ImplicitReferenceConversion): use null_type too.
7552
7553         * literal.cs: The type of `NullLiteral' is now null_type instead
7554         of object_type. 
7555         (Resolve): Set the type here.
7556
7557         * typemanager.cs: Introduce null_type.
7558
7559 2004-11-17  Martin Baulig  <martin@ximian.com>
7560
7561         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7562         direction, like FindMembers() does.  Fixes #69546, testcase is in
7563         test-315.cs.    
7564
7565 2004-11-16  Martin Baulig  <martin@ximian.com>
7566
7567         This is based on a patch from Marek Safar, see bug #69082.
7568         Fixes bugs #63705 and #67130.
7569
7570         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7571         method; create a MemberCache for an interface type and cache the
7572         result.
7573
7574         * decl.cs (IMemberContainer.ParentContainer): Removed.
7575         (IMemberContainer.ParentCache): New property.
7576         (MemberCache.SetupCacheForInterface): Removed.
7577         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7578         to create a cache for an interface's "parent".
7579
7580         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7581         interfaces too.
7582
7583 2004-11-16  Martin Baulig  <martin@ximian.com>
7584
7585         Merged back from gmcs; these changes already went into gmcs a
7586         couple of weeks ago.
7587
7588         * typemanager.cs
7589         (TypeManager.AddUserType): Removed the `ifaces' argument.
7590         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7591         `TypeExpr []'.
7592         (TypeManager.AddUserInterface): Removed.
7593         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7594         `TypeExpr []'.
7595         (TypeManager.GetInterfaces): Likewise.
7596         (TypeManager.GetExplicitInterfaces): Likewise.
7597
7598         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7599
7600         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7601         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7602
7603 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7604
7605         * statement.cs: Avoid adding bools to a hashtable.
7606
7607 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7608
7609         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7610         calling an unsafe method from a safe location.
7611
7612 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7613
7614         Fix #69167
7615         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7616
7617 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7618
7619         * namespace.cs (VerifyUsing): use GetPartialName instead of
7620         ToString. 
7621
7622 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7623
7624         * statement.cs (Return.Resolve): Fix regression in typo: if
7625         `in_exc', we have to request a NeedReturnLabel, this was a typo
7626         introduced in the anonymous method check-in.  Fixes #69131.
7627
7628         * Indexers were using the ShortName when defining themselves,
7629         causing a regression in the compiler bootstrap when applying the
7630         patch from 2004-11-02 (first part), now they use their full name
7631         and the bug is gone.
7632
7633 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7634
7635         * driver.cs: Strip the path from the names of embedded resources. Fixes
7636         #68519.
7637
7638 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7639
7640         Fix error message regression: cs0104-2.cs.
7641         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7642         (AliasEntry.Resolve): Update.
7643         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7644         'silent' flag.
7645         (RootContext.LookupType): Update.
7646
7647 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7648
7649         * cs-parser.jay: Add support for handling accessor modifiers
7650         * class: Add support port accessor modifiers and error checking,
7651         define PropertyMethod.Define as virtual (not abstract anymore)
7652         * ecore.cs: Add checking for proeprties access with access modifiers
7653         * iterators.cs: Modify Accessor constructor call based in the modified
7654         constructor
7655 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7656
7657         * expression.cs (StringConcat): Handle being called twice,
7658         as when we have a concat in a field init with more than two
7659         ctors in the class
7660
7661 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7662
7663         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7664         special case explicit implementations, we should always produce
7665         the .property or .event declaration.
7666         
7667         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7668         since it will not return correct data if people use this
7669         unresolved in the presence of using statements (see test-313).
7670
7671         * class.cs (MethodData.Define): If we are an explicit interface
7672         implementation, set the method name to the full name of the
7673         interface plus the name of the method.  
7674
7675         Notice that using the method.MethodName.GetFullName() does not
7676         work, as it will only contain the name as declared on the source
7677         file (it can be a shorthand in the presence of using statements)
7678         and not the fully qualifed type name, for example:
7679
7680         using System;
7681
7682         class D : ICloneable {
7683                 object ICloneable.Clone ()  {
7684                 }
7685         }
7686
7687         Would produce a method called `ICloneable.Clone' instead of
7688         `System.ICloneable.Clone'.
7689
7690         * namespace.cs (Alias.Resolve): Use GetPartialName.
7691         
7692 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7693
7694         * cs-parser.jay: Add error 1055 report.
7695
7696 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7697
7698         * assign.cs (Assign.DoResolve): Only do the transform of
7699         assignment into a New if the types are compatible, if not, fall
7700         through and let the implicit code deal with the errors and with
7701         the necessary conversions. 
7702
7703 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7704
7705         * cs-parser.jay: Add error 1031 report.
7706
7707         * cs-tokenizer.cs: Add location for error 1038.
7708
7709 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7710
7711         * cs-parser.jay: Add error 1016 report.
7712
7713 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7714
7715         * cs-parser.jay: Add errors 1575,1611 report.
7716
7717 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7718
7719         * cs-parser.jay: Add error 1001 report.
7720
7721 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7722
7723         Fix #68850
7724         * attribute.cs (GetMarshal): Add method argument for
7725         caller identification.
7726
7727         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7728         agument for GetMarshal and RuntimeMissingSupport.
7729
7730 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7731
7732         * attribute.cs (ExtractSecurityPermissionSet): Removed
7733         TypeManager.code_access_permission_type.
7734
7735         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7736
7737 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7738
7739         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7740         for obsolete use of a variable here.   Fixes regression on errors
7741         cs0619-25 and cs0619-26.
7742
7743 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7744
7745         Fix #62358, implemented security attribute encoding.
7746
7747         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7748         Tests permitted SecurityAction for assembly or other types.
7749         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7750         data from SecurityPermissionAttribute to PermisionSet class.
7751
7752         * class.cs (ApplyAttributeBuilder): Added special handling
7753         for System.Security.Permissions.SecurityAttribute based types.
7754
7755         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7756         special handling for System.Security.Permissions.SecurityAttribute
7757         based types.
7758
7759         * enum.cs (ApplyAttributeBuilder): Added special handling
7760         for System.Security.Permissions.SecurityAttribute based types.
7761
7762         * parameter.cs (ApplyAttributeBuilder): Added special handling
7763         for System.Security.Permissions.SecurityAttribute based types.
7764
7765         * rootcontext.cs: Next 2 core types.
7766
7767         * typemanager.cs (TypeManager.security_permission_attr_type):
7768         Built in type for the SecurityPermission Attribute.
7769         (code_access_permission_type): Build in type.
7770
7771 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7772
7773         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7774         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7775         all of this information into
7776         EmitContext.EmitCapturedVariableInstance.
7777         
7778         * codegen.cs (EmitCapturedVariableInstance): move here the
7779         funcionality of emitting an ldarg.0 in the presence of a
7780         remapping.   This centralizes the instance emit code.
7781
7782         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7783         then emit a load of this: it means that we have reached the
7784         topmost ScopeInfo: the one that contains the pointer to the
7785         instance of the class hosting the anonymous method.
7786
7787         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7788         captures to the topmost CaptureContext.
7789
7790 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7791
7792         * expression.cs (LocalVariableReference): Move the knowledge about
7793         the iterators into codegen's EmitCapturedVariableInstance.
7794
7795 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7796
7797         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7798         all code paths return a value from an anonymous method (it is the
7799         same as the 161 error, but for anonymous methods).
7800
7801 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7802
7803         The introduction of anonymous methods in the compiler changed
7804         various ways of doing things in the compiler.  The most
7805         significant one is the hard split between the resolution phase
7806         and the emission phases of the compiler.
7807
7808         For instance, routines that referenced local variables no
7809         longer can safely create temporary variables during the
7810         resolution phase: they must do so from the emission phase,
7811         since the variable might have been "captured", hence access to
7812         it can not be done with the local-variable operations from the runtime.
7813         
7814         * statement.cs 
7815
7816         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7817         is a toplevel block.
7818
7819         (ToplevelBlock): A new kind of Block, these are the blocks that
7820         are created by the parser for all toplevel method bodies.  These
7821         include methods, accessors and anonymous methods.
7822
7823         These contain some extra information not found in regular blocks:
7824         A pointer to an optional CaptureContext (for tracking captured
7825         local variables and parameters).  A pointer to the parent
7826         ToplevelBlock.
7827         
7828         (Return.Resolve): Catch missmatches when returning a value from an
7829         anonymous method (error 1662).
7830         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7831         phase.
7832
7833         (Break.Resolve): ditto.
7834
7835         (SwitchLabel): instead of defining the labels during the
7836         resolution phase, we now turned the public ILLabel and ILLabelCode
7837         labels into methods called GetILLabelCode() and GetILLabel() that
7838         only define the label during the Emit phase.
7839
7840         (GotoCase): Track the SwitchLabel instead of the computed label
7841         (its contained therein).  Emit the code by using
7842         SwitchLabel.GetILLabelCode ().
7843
7844         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7845         whether the Local has been captured or not.
7846
7847         (LocalInfo.IsCaptured): New property, used to tell whether the
7848         local has been captured.
7849         
7850         * anonymous.cs: Vastly updated to contain the anonymous method
7851         support.
7852
7853         The main classes here are: CaptureContext which tracks any
7854         captured information for a toplevel block and ScopeInfo used to
7855         track the activation frames for various local variables.   
7856
7857         Each toplevel block has an optional capture context associated
7858         with it.  When a method contains an anonymous method both the
7859         toplevel method and the anonymous method will create a capture
7860         context.   When variables or parameters are captured, they are
7861         recorded on the CaptureContext that owns them, for example:
7862
7863         void Demo () {
7864              int a;
7865              MyDelegate d = delegate {
7866                  a = 1;
7867              }
7868         }
7869
7870         Here `a' will be recorded as captured on the toplevel
7871         CapturedContext, the inner captured context will not have anything
7872         (it will only have data if local variables or parameters from it
7873         are captured in a nested anonymous method.
7874
7875         The ScopeInfo is used to track the activation frames for local
7876         variables, for example:
7877
7878         for (int i = 0; i < 10; i++)
7879                 for (int j = 0; j < 10; j++){
7880                    MyDelegate d = delegate {
7881                         call (i, j);
7882                    }
7883                 }
7884
7885         At runtime this captures a single captured variable `i', but it
7886         captures 10 different versions of the variable `j'.  The variable
7887         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7888         recorded on a child.  
7889
7890         The toplevel ScopeInfo will also track information like the `this'
7891         pointer if instance variables were referenced (this is necessary
7892         as the anonymous method lives inside a nested class in the host
7893         type of the method). 
7894
7895         (AnonymousMethod): Expanded to track the Toplevel, implement
7896         `AnonymousMethod.Compatible' to tell whether an anonymous method
7897         can be converted to a target delegate type. 
7898
7899         The routine now also produces the anonymous method content
7900
7901         (AnonymousDelegate): A helper class that derives from
7902         DelegateCreation, this is used to generate the code necessary to
7903         produce the delegate for the anonymous method that was created. 
7904
7905         * assign.cs: API adjustments for new changes in
7906         Convert.ImplicitStandardConversionExists.
7907
7908         * class.cs: Adjustments to cope with the fact that now toplevel
7909         blocks are of type `ToplevelBlock'. 
7910
7911         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7912         insteda of standard blocks.
7913
7914         Flag errors if params arguments are passed to anonymous methods.
7915
7916         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7917         `CurrentAnonymousMethod' which points to the current Anonymous
7918         Method.  The variable points to the AnonymousMethod class that
7919         holds the code being compiled.  It is set in the new EmitContext
7920         created for the anonymous method.
7921
7922         (EmitContext.Phase): Introduce a variable and an enumeration to
7923         assist in enforcing some rules about when and where we are allowed
7924         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7925         only one that enfonces this right now).
7926
7927         (EmitContext.HaveCaptureInfo): new helper method that returns
7928         whether we have a CapturedContext initialized.
7929
7930         (EmitContext.CaptureVariable): New method used to register that a
7931         LocalInfo must be flagged for capturing. 
7932
7933         (EmitContext.CapturedParameter): New method used to register that a
7934         parameters must be flagged for capturing. 
7935         
7936         (EmitContext.CapturedField): New method used to register that a
7937         field must be flagged for capturing. 
7938
7939         (EmitContext.HaveCapturedVariables,
7940         EmitContext.HaveCapturedFields): Return whether there are captured
7941         variables or fields. 
7942
7943         (EmitContext.EmitMethodHostInstance): This is used to emit the
7944         instance for the anonymous method.  The instance might be null
7945         (static methods), this (for anonymous methods that capture nothing
7946         and happen to live side-by-side with the current method body) or a
7947         more complicated expression if the method has a CaptureContext.
7948
7949         (EmitContext.EmitTopBlock): Routine that drives the emission of
7950         code: it will first resolve the top block, then emit any metadata
7951         and then emit the code.  The split is done so that we can extract
7952         any anonymous methods and flag any captured variables/parameters.
7953         
7954         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7955         during this phase, the ILGenerator should not be used as labels
7956         and local variables declared here might not be accessible to any
7957         code that is part of an anonymous method.  
7958
7959         Exceptions to this include the temporary variables that are
7960         created by some statements internally for holding temporary
7961         variables. 
7962         
7963         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7964         metadata for a cb
7965
7966         (EmitContext.TemporaryReturn): This method is typically called
7967         from the Emit phase, and its the only place where we allow the
7968         ReturnLabel to be defined other than the EmitMeta.  The reason is
7969         that otherwise we would have to duplicate a lot of logic in the
7970         Resolve phases of various methods that today is on the Emit
7971         phase. 
7972
7973         (EmitContext.NeedReturnLabel): This no longer creates the label,
7974         as the ILGenerator is not valid during the resolve phase.
7975
7976         (EmitContext.EmitThis): Extended the knowledge in this class to
7977         work in anonymous methods in addition to iterators. 
7978
7979         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7980         code is necessary on the stack to access the instance to a local
7981         variable (the variable will be accessed as a field).
7982
7983         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7984         EmitContext.EmitAddressOfParameter): Routines to support
7985         parameters (not completed at this point). 
7986         
7987         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7988         will also remove the parameters.
7989
7990         * convert.cs (Convert): Define a `ConstantEC' which points to a
7991         null.  This is just to prefity some code that uses
7992         ImplicitStandardConversion code and do not have an EmitContext
7993         handy.
7994
7995         The idea is to flag explicitly that at that point in time, it is
7996         known that the conversion will not trigger the delegate checking
7997         code in implicit conversions (which requires a valid
7998         EmitContext). 
7999
8000         Everywhere: pass new EmitContext parameter since
8001         ImplicitStandardConversionExists now requires it to check for
8002         anonymous method conversions. 
8003
8004         (Convert.ImplicitStandardConversionExists): If the type of an
8005         expression is the anonymous_method_type, and the type is a
8006         delegate, we invoke the AnonymousMethod.Compatible method to check
8007         whether an implicit conversion is possible. 
8008
8009         (Convert.ImplicitConversionStandard): Only do implicit method
8010         group conversions if the language level is not ISO_1.
8011
8012         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8013         MethodInfo for the Invoke method.  used by Delegate and
8014         AnonymousDelegate.
8015
8016         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8017         method conversions if the target type is a delegate.
8018
8019         Removed extra debugging nops.
8020
8021         (LocalVariableReference): Turn the `local_info' into a public
8022         field. 
8023
8024         Add `prepared' field, the same hack used for FieldExprs to cope
8025         with composed assignments, as Local variables do not necessarily
8026         operate purely on the stack as they used to: they can be captured
8027         fields. 
8028
8029         Add `temp' for a temporary result, like fields.
8030
8031         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8032
8033         It now copes with Local variables that are captured and emits the
8034         proper instance variable to load it from a field in the captured
8035         case. 
8036
8037         (ParameterReference.DoResolveBase): During the resolve phase,
8038         capture parameters if we are in an anonymous method.
8039
8040         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8041         anonymous method, use the EmitContext helper routines to emit the
8042         parameter reference.
8043
8044         * iterators.cs: Set RemapToProxy to true/false during the
8045         EmitDispose class.
8046
8047         * parameters.cs (GetParameterByName): New helper method. 
8048
8049         * typemanager.cs (anonymous_method_type) a new type that
8050         represents an anonyous method.  This is always an internal type,
8051         used as a fencepost to test against the anonymous-methodness of an
8052         expression. 
8053         
8054 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8055
8056         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8057         561 report.
8058         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8059
8060 2004-10-18  Martin Baulig  <martin@ximian.com>
8061
8062         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8063         `Type' directly, but call ResolveType() on it.
8064         (Catch.Resolve): Likewise.
8065         (Foreach.Resolve): Likewise.
8066
8067 2004-10-18  Martin Baulig  <martin@ximian.com>
8068
8069         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8070         `Type' directly, but call ResolveType() on it.
8071         (Probe.DoResolve): Likewise.
8072         (ArrayCreation.LookupType): Likewise.
8073         (TypeOf.DoResolve): Likewise.
8074         (SizeOf.DoResolve): Likewise.
8075
8076 2004-10-18  Martin Baulig  <martin@ximian.com>
8077
8078         * expression.cs (Invocation.BetterFunction): Put back
8079         TypeManager.TypeToCoreType().
8080
8081 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8082
8083         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8084         the ResolveType.
8085
8086 2004-10-18  Martin Baulig  <martin@ximian.com>
8087
8088         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8089         `Type' directly, but call ResolveType() on it.
8090
8091 2004-10-18  Martin Baulig  <martin@ximian.com>
8092
8093         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8094         `Type' directly, but call ResolveType() on it.
8095         (MemberBase.DoDefine): Likewise.
8096
8097         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8098         `Type' directly, but call ResolveType() on it.
8099         (ComposedCast.DoResolveAsTypeStep): Likewise.
8100
8101         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8102         `Type' directly, but call ResolveType() on it.
8103
8104 2004-10-17  John Luke  <john.luke@gmail.com>
8105
8106         * class.cs (Operator.GetSignatureForError): use CSharpName
8107
8108         * parameter.cs (Parameter.GetSignatureForError): Returns
8109         correct name even if was not defined.
8110
8111 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8112
8113         Fix #65816.
8114         * class.cs (TypeContainer.EmitContext): New property.
8115         (DefineNestedTypes): Create an emitcontext for each part.
8116         (MethodCore.DoDefineParameters): Use container's emitcontext.
8117         Pass type array to InternalParameters.
8118         (MemberBase.DoDefine): Use container's emitcontext.
8119         (FieldMember.Define): Likewise.
8120         (Event.Define): Likewise.
8121         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8122         Pass type array to InternalParameters.
8123         (SetIndexerMethod.GetParameterInfo): Likewise.
8124         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8125         * delegate.cs (Define): Pass emitcontext to
8126         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8127         array to InternalParameters.
8128         * expression.cs (ParameterReference.DoResolveBase): Pass
8129         emitcontext to GetParameterInfo.
8130         (ComposedCast.DoResolveAsTypeStep): Remove check on
8131         ec.ResolvingTypeTree.
8132         * parameter.cs (Parameter.Resolve): Change argument to
8133         EmitContext.  Use ResolveAsTypeTerminal.
8134         (Parameter.GetSignature): Change argument to EmitContext.
8135         (Parameters.ComputeSignature): Likewise.
8136         (Parameters.ComputeParameterTypes): Likewise.
8137         (Parameters.GetParameterInfo): Likewise.
8138         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8139         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8140         * support.cs (InternalParameters..ctor): Remove variant that takes
8141         a DeclSpace.
8142         * typemanager.cs (system_intptr_expr): New.
8143         (InitExpressionTypes): Initialize it.
8144
8145 2004-10-12  Chris Toshok  <toshok@ximian.com>
8146
8147         * cs-parser.jay: fix location for try_statement and catch_clause.
8148
8149 2004-10-11  Martin Baulig  <martin@ximian.com>
8150
8151         * report.cs: Don't make --fatal abort on warnings, we have
8152         -warnaserror for that.
8153
8154 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8155
8156         More DeclSpace.ResolveType avoidance.
8157         * decl.cs (MemberCore.InUnsafe): New property.
8158         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8159         with newly created EmitContext.
8160         (FieldMember.Define): Likewise.
8161         * delegate.cs (Delegate.Define): Likewise.
8162         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8163         only if normal name-lookup fails.
8164         (TypeExpr.DoResolve): Enable error-checking.
8165         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8166         (SizeOf.DoResolve): Likewise.
8167         (ComposedCast.DoResolveAsTypeStep): Likewise.
8168         (StackAlloc.DoResolve): Likewise.
8169         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8170         (Block.Unsafe): New property.
8171         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8172         (Unsafe): Set 'unsafe' flag of contained block.
8173         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8174         (Fixed.Resolve): Likewise.
8175         (Catch.Resolve): Likewise.
8176         (Using.ResolveLocalVariableDecls): Likewise.
8177         (Foreach.Resolve): Likewise.
8178
8179 2004-10-05  John Luke <john.luke@gmail.com>
8180
8181         * cs-parser.jay: add location to error CS0175
8182
8183 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8184
8185         * ecore.cs (Expression.Constantity): Add support for turning null
8186         into a constant.
8187
8188         * const.cs (Const.Define): Allow constants to be reference types
8189         as long as the value is Null.
8190
8191 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8192
8193         * namespace.cs (NamespaceEntry.Using): No matter which warning
8194         level is set, check if this namespace name has already been added.
8195
8196 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8197
8198         * expression.cs: reftype [!=]= null should always use br[true,false].
8199         # 67410
8200
8201 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8202
8203         Fix #67108
8204         * attribute.cs: Enum conversion moved to 
8205         GetAttributeArgumentExpression to be applied to the all
8206         expressions.
8207
8208 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8209
8210         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8211         * class.c (TypeContainer.DefineType): Flag error if
8212         base types aren't accessible due to access permissions.
8213         * decl.cs (DeclSpace.ResolveType): Move logic to
8214         Expression.ResolveAsTypeTerminal.
8215         (DeclSpace.ResolveTypeExpr): Thin layer over
8216         Expression.ResolveAsTypeTerminal.
8217         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8218         Refactor code into NestedAccess.  Use it.
8219         (DeclSpace.NestedAccess): New.
8220         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8221         argument to silence errors.  Check access permissions.
8222         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8223         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8224         (Cast.DoResolve): Likewise.
8225         (New.DoResolve): Likewise.
8226         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8227         (TypeOf.DoResolve): Likewise.
8228
8229         * expression.cs (Invocation.BetterConversion): Return the Type of
8230         the better conversion.  Implement section 14.4.2.3 more faithfully.
8231         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8232         section 14.4.2.2 explicit.
8233         (Invocation.OverloadResolve): Update.
8234         (Invocation): Remove is_base field.
8235         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8236         (Invocation.Emit): Likewise.
8237
8238 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8239
8240         * README: Update to changes.
8241
8242 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8243
8244         * cs-parser.jay: Reverted 642 warning fix.
8245
8246 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8247
8248         Fix bug #66615
8249         * decl.cs (FindMemberWithSameName): Indexer can have more than
8250         1 argument.
8251
8252 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8253
8254         * expression.cs (LocalVariableReference.DoResolveLValue):
8255         Do not report warning 219 for out values.
8256         (EmptyExpression.Null): New member to avoid extra allocations.
8257
8258 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8259
8260         * cs-parser.jay: Fix wrong warning 642 report.
8261
8262         * cs-tokenizer.cs (CheckNextToken): New helper;
8263         Inspect next character if is same as expected.
8264
8265 2004-09-23  Martin Baulig  <martin@ximian.com>
8266
8267         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8268         (Convert.ImplicitReferenceConversionExists): Likewise.
8269
8270 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8271
8272         * class.cs (Operator.Define): Add error 448 and 559 report.
8273
8274 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8275
8276         * class.cs (MemberBase.IsTypePermitted): New protected
8277         method for checking error CS0610.
8278
8279 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * class.cs (TypeContainer.HasExplicitLayout): New property
8282         Returns whether container has StructLayout attribute set Explicit.
8283         (FieldMember): New abstract class for consts and fields.
8284         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8285         (Field): Reuse FieldMember.
8286
8287         * const.cs (Const): Reuse FieldMember.
8288
8289         * rootcontext.cs: EmitConstants call moved to class.
8290
8291 2004-09-22  Martin Baulig  <martin@ximian.com>
8292
8293         Thanks to Peter Sestoft for this bug report.
8294
8295         * expression.cs (Conditional): If both the `trueExpr' and the
8296         `falseExpr' is a NullLiteral, return a NullLiteral.
8297
8298 2004-09-22  Martin Baulig  <martin@ximian.com>
8299
8300         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8301         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8302         for the "get_Current" call.
8303
8304 2004-09-22  Martin Baulig  <martin@ximian.com>
8305
8306         Marek and me just fixed one of our oldest bugs: #28562 :-)
8307
8308         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8309
8310         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8311         we're an EnumConstant, just return that.
8312         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8313         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8314         to get the value which'll actually be written into the attribute.
8315         However, we have to use GetValue() to access the attribute's value
8316         in the compiler.        
8317
8318 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8319
8320         * constant.cs (Constant.IsNegative): New abstract property
8321         IsNegative.
8322
8323         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8324         (StackAlloc.DoResolve): Reused IsNegative.
8325
8326 2004-09-21  Martin Baulig  <martin@ximian.com>
8327
8328         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8329         if we're used in an iterator, we may be called from different
8330         methods.
8331
8332         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8333         we actually have an exception block.
8334
8335 2004-09-20  John Luke <jluke@cfl.rr.com>
8336
8337         * class.cs, cs-parser.jay: Improve the error report for 1520:
8338         report the actual line where the error happens, not where the
8339         class was declared.
8340
8341         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8342         Pass location information that was available elsewhere.
8343
8344 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8345
8346         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8347         runtime to delay sign assemblies.
8348
8349 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8350
8351         * cs-parser.jay: Do not report the stack trace, this is barely
8352         used nowadays.
8353
8354 2004-08-22  John Luke  <john.luke@gmail.com>
8355  
8356         * driver.cs : check that a resource id is not already used
8357         before adding it, report CS1508 if it is, bug #63637
8358
8359 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8360
8361         * ecore.cs: Removed dead code.
8362
8363 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8364
8365         * class.cs: Do not report warning CS0067 on the interfaces.
8366
8367 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8368
8369         * cs-parser.jay: Add error 504 report.
8370
8371 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8372
8373         * rootcontext.cs: WarningLevel is 4 by default now.
8374
8375         * statement.cs (Fixed.Resolve): Do not null
8376         VariableInfo.
8377
8378 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8379
8380         Fixed bug #55780
8381         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8382         deep search when property is not virtual.
8383         (PropertyExpr.ResolveAccessors): Make one call for both
8384         accessors.
8385
8386 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8387
8388         Fixed bug #65766
8389         * statement.cs: Error 152 report constains also location.
8390
8391 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8392
8393         Fixed bug #65766
8394         * const.cs: Explicitly set constant as static.
8395
8396 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8397
8398         Fixed bug #64226
8399         * cs-parser.jay: Add error 1017 report.
8400
8401 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8402
8403         Fixed bug #59980, #64224
8404         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8405
8406         * typemanager.cs (IsSpecialMethod): Simplified
8407
8408 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8409
8410         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8411         condition with better params.
8412
8413 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8414
8415         Fixed bug #65238
8416         * attribute.cs (Resolve): Property has to have both
8417         accessors.
8418
8419 2004-09-14  Martin Baulig  <martin@ximian.com>
8420
8421         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8422
8423 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8424
8425         Fixed bug #61902
8426         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8427         called and is obsolete then this member suppress message
8428         when call is inside next [Obsolete] method or type.
8429
8430         * expression.cs: Use TestObsoleteMethodUsage member.
8431
8432 2004-09-14  Martin Baulig  <martin@ximian.com>
8433
8434         * cs-parser.jay: Sync a bit with the GMCS version.
8435
8436 2004-09-14  Martin Baulig  <martin@ximian.com>
8437
8438         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8439         (CSharpParser.yacc_verbose_flag): New public field.
8440
8441         * genericparser.cs: Removed.
8442
8443 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8444
8445         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8446
8447 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8448
8449         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8450
8451 2004-09-10  Martin Baulig  <martin@ximian.com>
8452
8453         Backported my MemberName changes from GMCS into MCS.
8454
8455         - we are now using a special `MemberName' class instead of using
8456         strings; in GMCS, the `MemberName' also contains the type
8457         arguments.
8458
8459         - changed the grammar rules a bit:
8460           * the old `member_name' is now a `namespace_or_type_name':
8461             The rule is that we use `namespace_or_type_name' everywhere
8462             where we expect either a "member name" (GetEnumerator) or a
8463             "member name" with an explicit interface name
8464             (IEnumerable.GetEnumerator).
8465             In GMCS, the explicit interface name may include type arguments
8466             (IEnumerable<T>.GetEnumerator).
8467           * we use `member_name' instead of just `IDENTIFIER' for
8468             "member names":
8469             The rule is that we use `member_name' wherever a member may
8470             have type parameters in GMCS.       
8471
8472         * decl.cs (MemberName): New public class.
8473         (MemberCore.MemberName): New public readonly field.
8474         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8475         (DeclSpace): Likewise.
8476
8477         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8478         * enum.cs (Enum.ctor): Likewise.
8479
8480         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8481         MemberName.     
8482         (AliasEntry.ctor): Take a MemberName, not an Expression.
8483         (AliasEntry.UsingAlias): Likewise.
8484
8485         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8486         (IMethodData.MemberName): Changed type from string to MemberName.
8487         (MemberBase.ExplicitInterfaceName): Likewise.
8488         (AbstractPropertyEventMethod.SetupName): Make this private.
8489         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8490         argument; compute the member name here.
8491         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8492         on the `member.MemberName' and the `prefix'.
8493
8494         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8495         not `type_name'.
8496         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8497         thus, we get a `MemberName' instead of a `string'.  These
8498         declarations may have type parameters in GMCS.
8499         (interface_method_declaration, delegate_declaration): Likewise.
8500         (class_declaration, interface_declaration): Likewise.
8501         (method_header): Use `namespace_or_type_name' instead of
8502         `member_name'.  We may be an explicit interface implementation.
8503         (property_declaration, event_declaration): Likewise.
8504         (member_name): This is now just an `IDENTIFIER', not a
8505         `namespace_or_type_name'.
8506         (type_name, interface_type): Removed.
8507         (namespace_or_type_name): Return a MemberName, not an Expression.
8508         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8509         call GetTypeExpression() on the MemberName to get an expression.
8510         (IndexerDeclaration.interface_type): Changed type from string to
8511         MemberName.
8512         (MakeName): Operate on MemberName's instead of string's.
8513
8514 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8515
8516         Fix bug #55770.
8517         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8518         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8519         lookup to avoid symbols introduced by 'using'.
8520         * rootcontext.cs (NamespaceLookup): Update.
8521
8522 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8523
8524         * class.cs (TypeContainer.DoDefineMembers): Do not call
8525         DefineDefaultConstructor for static classes.
8526
8527 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8528
8529         * attribute.cs (Attribute.Resolve): Add error 653 report.
8530
8531         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8532         report.
8533         (Method.ApplyAttributeBuilder): Add error 685 report.
8534         (Operator.Define): Add error 564 report.
8535
8536         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8537
8538         * expression.cs (Invocation.DoResolve): Add error
8539         245 and 250 report.
8540
8541         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8542         error 674 report.
8543
8544 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8545
8546         * class.cs (ConstructorInitializer.Resolve):
8547         Wrong error number (515->516).
8548
8549 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8550
8551         * class.cs (Indexer.Define): Add error 631 report.
8552
8553 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8554
8555         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8556
8557 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8558
8559         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8560
8561 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8562
8563         * cs-parser.jay: Added error CS0241 report.
8564
8565 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8566
8567         * cs-parser.jay (fixed_statement): Introduce a scope for the
8568         declaration in the 'fixed' statement.
8569
8570 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8571
8572         * cs-parser.jay: Added CS0230 error report.
8573
8574 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8575
8576         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8577
8578 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8579
8580         * expression.cs (Argument.Resolve): Added error CS0192 and
8581         CS0199 report.
8582
8583 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8584
8585         C# 2.0 #pragma warning feature
8586
8587         * cs-tokenizer.cs (PreProcessPragma): New method; 
8588         Handles #pragma directive.
8589
8590         * report.cs (WarningRegions): New class; Support
8591         class for #pragma warning directive. It tests whether
8592         warning is enabled for a given line.
8593
8594 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8595
8596         * const.cs: Add more descriptive error report, tahnks to
8597         Sebastien. 
8598
8599 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8600
8601         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8602
8603 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8604
8605         * expression.cs: Apply patch from Ben: Remove dead code from
8606         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8607         as that code just threw an exception anwyays.
8608
8609         * const.cs: Remove the call to the turnintoconstant, for details
8610         see bug: #63144
8611         
8612         * literal.cs: The type of the null-literal is the null type;  So
8613         we use a placeholder type (literal.cs:System.Null, defined here)
8614         for it.
8615
8616         * expression.cs (Conditional.DoResolve): Remove some old code that
8617         is no longer needed, conversions have been fixed.
8618
8619         (ArrayCreationExpression.DoResolve): Return false if we fail to
8620         resolve the inner expression.
8621
8622 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8623
8624         Fix test-290.cs.
8625         * cs-parser.jay (delegate_declaration): Record a delegate
8626         declaration as a type declaration.
8627         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8628
8629 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8630
8631         * parameter.cs: Do not crash if the type can not be resolved. 
8632
8633         * expression.cs: Report errors with unsafe pointers, fixes #64896
8634
8635 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8636
8637         * expression.cs: Pointer arith always needs to do a conv.i
8638         if the operand is a long. fix 65320
8639
8640 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8641
8642         Fixed cs0619-37.cs, cs0619-38.cs
8643
8644         * enum.cs (GetObsoleteAttribute): Removed.
8645
8646         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8647         on Enum member is double staged. The first is tested member
8648         and then enum.
8649
8650 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8651
8652         Fixed #56986, #63631, #65231
8653
8654         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8655         adds member to name container.
8656         (TypeContainer.AddToTypeContainer): New method, adds type to
8657         name container.
8658         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8659         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8660         AddOperator): Simplified by reusing AddToMemberContainer.
8661         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8662         instead of field.
8663         (Method.CheckForDuplications): Fixed implementation to test all
8664         possibilities.
8665         (MemberBase): Detection whether member is explicit interface
8666         implementation is now in constructor.
8667         (MemberBase.UpdateMemberName): Handles IndexerName.
8668         (Accessor): Changed to keep also location information.
8669         (AbstractPropertyEventMethod): Is derived from MemberCore.
8670         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8671         will be emited or not.
8672         (PropertyBase.AreAccessorsDuplicateImplementation):
8673         Tests whether accessors are not in collision with some method.
8674         (Operator): Is derived from MethodCore to simplify common
8675         operations.
8676
8677         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8678         must be performed.
8679         (DeclSpace.AddToContainer): Adds the member to defined_names
8680         table. It tests for duplications and enclosing name conflicts.
8681
8682         * enum.cs (EnumMember): Clean up to reuse the base structures
8683
8684 2004-09-03  Martin Baulig  <martin@ximian.com>
8685
8686         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8687         into TypeContainer, to make partial classes work again.
8688
8689 2004-09-03  Martin Baulig  <martin@ximian.com>
8690
8691         * rootcontext.cs (RootContext.V2): Removed.
8692
8693 2004-03-23  Martin Baulig  <martin@ximian.com>
8694
8695         * expression.cs (Invocation.OverloadResolve): Added `bool
8696         may_fail' argument and use it instead of the Location.IsNull() hack.
8697
8698 2004-09-03  Martin Baulig  <martin@ximian.com>
8699
8700         Merged latest changes into gmcs.  Please keep this comment in
8701         here, it makes it easier for me to see what changed in MCS since
8702         the last time I merged.
8703
8704 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8705
8706         Fix #61128.
8707         * expression.cs (BetterConversion): Don't allow either conversion 
8708         to be null.  Remove redundant implicit conversion test when 'q ==
8709         null' -- when this function is invoked, we already know that the
8710         implicit conversion exists.
8711         (BetterFunction): Assume that 'best' is non-null.  Remove
8712         redundant reimplementation of IsApplicable when 'best' is null.
8713         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8714         number of arguments.
8715         (IsAncestralType): Extract from OverloadResolve.
8716         (OverloadResolve): Make robust to the MethodGroupExpr being
8717         unsorted.  Implement all the logic of Section 14.5.5.1, and
8718         support overloading of methods from multiple applicable types.
8719         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8720
8721         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8722         (RealError, Warning): Append type of report to related symbol.
8723
8724 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8725
8726         * enum.cs: Fixed CLS-Compliance checks for enum members.
8727         Error tests cs3008-8.cs, cs3014-8.cs
8728
8729 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8730
8731         Fixed bug #62342, #63102
8732         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8733         like ImplementMethod.
8734
8735 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8736
8737         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8738         Fixed bug #65170.
8739
8740 2004-09-02  Martin Baulig  <martin@ximian.com>
8741
8742         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8743         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8744         on the MethodBase.
8745
8746 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8747
8748         C# 2.0 Static classes implemented
8749
8750         * class.cs (TypeContainer): instance_constructors,
8751         initialized_fields, initialized_static_fields,
8752         default_constructor, base_inteface_types are protected to be
8753         accessible from StaticClass.
8754         (TypeContainer.DefineDefaultConstructor): New virtual method
8755         for custom default constructor generating
8756         (StaticClass): New class to handle "Static classes" feature.
8757
8758         * cs-parser.jay: Handle static keyword on class like instance
8759         of StaticClass.
8760
8761         * driver.cs: Added "/langversion" command line switch with two
8762         options (iso-1, default).
8763
8764 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8765
8766         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8767
8768 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8769
8770         * delegate.cs: Style.
8771
8772 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8773
8774         * delegate.cs: Add seperate instance expr field for miguel.
8775
8776 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8777
8778         * PointerArithmetic (Resolve): make sure we are not doing
8779         pointer arith on void*. Also, make sure we are resolved
8780         by not setting eclass until resolve.
8781
8782         All callers: Make sure that PointerArithmetic gets resolved.
8783
8784 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8785
8786         * ArrayCreation (LookupType): If the type does not resolve 
8787         to an array, give an error.
8788
8789 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8790
8791         * statement.cs (Try.Resolve): Fixed bug #64222
8792
8793 2004-08-27  Martin Baulig  <martin@ximian.com>
8794
8795         * class.cs
8796         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8797         crash here.     
8798
8799 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8800
8801         * ecore.cs (Constantify): Get underlying type via
8802         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8803         Windows in special cases.
8804
8805 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8806
8807         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8808         for obtaining also private methods.
8809         (GetRemoveMethod): Used GetRemoveMethod (true)
8810         for obtaining also private methods.
8811
8812 2004-08-24  Martin Baulig  <martin@ximian.com>
8813
8814         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8815         MethodAttributes.HideBySig for operators.
8816
8817 2004-08-23  Martin Baulig  <martin@ximian.com>
8818
8819         Back to the old error reporting system :-)
8820
8821         * report.cs (Message): Removed.
8822         (Report.MessageData, ErrorData, WarningData): Removed.
8823         (Report.Error, Warning): Back to the old system.
8824
8825 2004-08-23  Martin Baulig  <martin@ximian.com>
8826
8827         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8828
8829         * class.cs (TypeContainer.ParentContainer): New public virtual
8830         method; replaces the explicit interface implementation.
8831         (ClassPart.ParentContainer): Override.
8832
8833 2004-08-23  Martin Baulig  <martin@ximian.com>
8834
8835         * statement.cs (Switch): Added support for constant switches; see
8836         #59428 or test-285.cs.
8837
8838 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8839
8840         Fixed bug #62740.
8841         * statement.cs (GetEnumeratorFilter): Removed useless
8842         logic because C# specs is strict. GetEnumerator must be
8843         public.
8844
8845 2004-08-22  Martin Baulig  <martin@ximian.com>
8846
8847         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8848         a switch and may break, reset the barrier.  Fixes #59867.
8849
8850 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8851
8852         CLS-Compliance speed up (~5% for corlib)
8853
8854         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8855         New method. Tests container for CLS-Compliant names
8856
8857         * class.cs (TypeContainer.VerifyClsName): New method.
8858         Checks whether container name is CLS Compliant.
8859         (Constructor): Implements IMethodData.
8860
8861         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8862         low-case table for CLS Compliance test.
8863         (MemberCache.VerifyClsParameterConflict): New method.
8864         Checks method parameters for CS3006 error.
8865
8866         * enum.cs (EnumMember): Is derived from MemberCore.
8867         (Enum.VerifyClsName): Optimized for better performance.
8868
8869 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8870
8871         * report.cs: Renamed Error_T to Error and changed all
8872         references.
8873
8874 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8875
8876         * class.cs (TypeContainer.IndexerArrayList): New inner class
8877         container for indexers.
8878         (TypeContainer.DefaultIndexerName): New constant for default
8879         indexer name. Replaced all "Item" with this constant.
8880         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8881
8882         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8883         DefaultMemberAttribute constructor.
8884
8885 2004-08-05  Martin Baulig  <martin@ximian.com>
8886
8887         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8888         Fix bug #59429.
8889
8890 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8891
8892         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8893         multi platforms problem.
8894
8895         * compiler.csproj: Included shared files.
8896
8897 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8898
8899         Fix bug 60333, 55971 in the more general way
8900         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8901         Added arg_type argument for constant conversion.
8902         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8903
8904 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8905
8906         Fix bug #59760
8907         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8908         OperatorArrayList, MethodCoreArrayList for typecontainer
8909         containers. Changed class member types to these new types.
8910         (MethodArrayList.DefineMembers): Added test for CS0659.
8911
8912 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8913
8914         * cfold.cs: Synchronize the folding with the code in expression.cs
8915         Binary.DoNumericPromotions for uint operands.
8916
8917         * attribute.cs: Revert patch from Raja, it introduced a regression
8918         while building Blam-1.2.1 (hard to isolate a test case).
8919
8920 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8921
8922         Fix for #55382
8923         * class.cs:
8924         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8925         name collision.
8926         (MethodCore.parent_method): New member. The method we're overriding
8927         if this is an override method.
8928         (MethodCore.CheckBase): Moved from Method class and made common.
8929         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8930         private.
8931         (MethodCore.CheckForDuplications): New abstract method. For custom
8932         member duplication search in a container
8933         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8934         method and its return type.
8935         (Event.conflict_symbol): New member. Symbol with same name in the
8936         parent class.
8937
8938         * decl.cs:
8939         (MemberCache.FindMemberWithSameName): New method. The method
8940         is looking for conflict with inherited symbols.
8941
8942 2004-08-04  Martin Baulig  <martin@ximian.com>
8943
8944         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8945
8946         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8947
8948 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8949
8950         * report.cs (Message): New enum for better error, warning reference in
8951         the code.
8952         (MessageData): New inner abstract class. It generally handles printing of
8953         error and warning messages.
8954         Removed unused Error, Warning, Message methods.
8955
8956 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8957
8958         Fix for cs0592-8.cs test
8959         * attribute.cs
8960         (Attributable.ValidAttributeTargets): Made public.
8961         (Attribute.ExplicitTarget): New member for explicit target value.
8962         (Attribute.CheckTargets): Now we translate explicit attribute
8963         target to Target here.
8964
8965 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8966
8967         * ecore.cs (MethodGroupExpr): new IsBase property.
8968
8969         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8970
8971         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8972         rather than an instance expr.
8973
8974         (DelegateCreation.Emit): Use the method group rather than
8975         the instance expression. Also, if you have base.Foo as the
8976         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8977
8978         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8979
8980         (NewDelegate.DoResolve): Only check for the existance of Invoke
8981         if the method is going to be needed. Use MethodGroupExpr.
8982
8983         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8984
8985         * expression.cs: For pointer arith., make sure to use
8986         the size of the type, not the size of the pointer to
8987         the type.
8988
8989 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8990
8991         Fix for #60722
8992         * class.cs (Class): Added error CS0502 test.
8993
8994 2004-08-03  John Luke  <jluke@cfl.rr.com>
8995             Raja R Harinath  <rharinath@novell.com>
8996
8997         Fix for #60997.
8998         * attribute.cs (Attribute.complained_before): New flag.
8999         (Attribute.ResolveType, Attribute.Resolve),
9000         (Attribute.DefinePInvokeMethod): Set it.
9001         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9002         
9003 2004-08-03  Martin Baulig  <martin@ximian.com>
9004
9005         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9006         use a user-defined operator; we still need to do numeric
9007         promotions in case one argument is a builtin type and the other
9008         one has an implicit conversion to that type.  Fixes #62322.
9009
9010 2004-08-02  Martin Baulig  <martin@ximian.com>
9011
9012         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9013         (LocalInfo.IsThis): New public property.
9014         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9015
9016 2004-08-01  Martin Baulig  <martin@ximian.com>
9017
9018         * class.cs (TypeContainer.GetClassBases): Don't set the default
9019         here since we may get called from GetPartialBases().
9020         (TypeContainer.DefineType): If GetClassBases() didn't return a
9021         parent, use the default one.
9022
9023 2004-07-30  Duncan Mak  <duncan@ximian.com>
9024
9025         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9026
9027 2004-07-30  Martin Baulig  <martin@ximian.com>
9028
9029         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9030
9031         * class.cs (SourceMethod): New public class, derive from the
9032         symbol writer's ISourceMethod.
9033         (Method): Use the new symbol writer API.
9034
9035         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9036         as argument and use the new symbol writer.
9037
9038         * location.cs
9039         (SourceFile): Implement the symbol writer's ISourceFile.
9040         (Location.SymbolDocument): Removed.
9041         (Location.SourceFile): New public property.
9042
9043         * symbolwriter.cs: Use the new symbol writer API.
9044
9045 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9046
9047         * Makefile (install-local): Remove.  Functionality moved to
9048         executable.make.
9049
9050 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9051
9052         * Makefile: Install mcs.exe.config file together with mcs.exe.
9053         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9054         correct runtime version.
9055         
9056 2004-07-25  Martin Baulig  <martin@ximian.com>
9057
9058         * class.cs
9059         (TypeContainer.RegisterOrder): Removed, this was unused.
9060         (TypeContainer, interface_order): Removed.
9061         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9062         TypeContainer as argument since we can also be called with a
9063         `PartialContainer' for a partial class/struct/interface.
9064         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9065         of checking whether we're an `Interface' - we could be a
9066         `PartialContainer'.
9067         (PartialContainer.Register): Override; call
9068         AddClass()/AddStruct()/AddInterface() on our parent.
9069
9070         * cs-parser.jay (interface_member_declaration): Add things to the
9071         `current_container', not the `current_class'.
9072
9073         * rootcontext.cs (RegisterOrder): The overloaded version which
9074         takes an `Interface' was unused, removed.
9075
9076         * typemanager.cs (TypeManager.LookupInterface): Return a
9077         `TypeContainer', not an `Interface'.
9078         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9079         contain a `PartialContainer' for an interface, so check it's
9080         `Kind' to figure out what it is.
9081
9082 2004-07-25  Martin Baulig  <martin@ximian.com>
9083
9084         * class.cs (Class.DefaultTypeAttributes): New public constant.
9085         (Struct.DefaultTypeAttributes): Likewise.
9086         (Interface.DefaultTypeAttributes): Likewise.
9087         (PartialContainer.TypeAttr): Override this and add the
9088         DefaultTypeAttributes.
9089
9090 2004-07-25  Martin Baulig  <martin@ximian.com>
9091
9092         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9093         we can just use the `Parent' field instead.
9094
9095 2004-07-25  Martin Baulig  <martin@ximian.com>
9096
9097         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9098
9099 2004-07-25  Martin Baulig  <martin@ximian.com>
9100
9101         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9102         our parts before defining any methods.
9103         (TypeContainer.VerifyImplements): Make this virtual.
9104         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9105         on our PartialContainer.
9106
9107 2004-07-25  Martin Baulig  <martin@ximian.com>
9108
9109         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9110
9111         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9112         argument, we can just use the `Parent' field instead.
9113
9114         * class.cs
9115         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9116         (MemberBase.DoDefine): Likewise.
9117
9118 2004-07-24  Martin Baulig  <martin@ximian.com>
9119
9120         * decl.cs (MemberCore.Parent): New public field.
9121         (DeclSpace.Parent): Moved to MemberCore.
9122
9123         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9124         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9125         parent's .ctor.
9126         (FieldBase, Field, Operator): Likewise.
9127         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9128         (EventField, Event): Likewise.
9129
9130 2004-07-23  Martin Baulig  <martin@ximian.com>
9131
9132         * class.cs (PartialContainer): New public class.
9133         (ClassPart): New public class.
9134         (TypeContainer): Added support for partial classes.
9135         (TypeContainer.GetClassBases): Splitted some of the functionality
9136         out into GetNormalBases() and GetPartialBases().
9137
9138         * cs-tokenizer.cs (Token.PARTIAL): New token.
9139         (Tokenizer.consume_identifier): Added some hacks to recognize
9140         `partial', but only if it's immediately followed by `class',
9141         `struct' or `interface'.
9142
9143         * cs-parser.jay: Added support for partial clases.
9144
9145 2004-07-23  Martin Baulig  <martin@ximian.com>
9146
9147         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9148         a `DeclSpace' and also made it readonly.
9149         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9150         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9151         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9152
9153         * cs-parser.jay: Pass the `current_class', not the
9154         `current_container' (at the moment, this is still the same thing)
9155         to a new Method, Property, Event, Indexer or Constructor.
9156
9157 2004-07-23  Martin Baulig  <martin@ximian.com>
9158
9159         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9160         and removed the `current_interface' one.
9161         (struct_declaration, class_declaration, interface_declaration):
9162         Set `current_class' to the newly created class/struct/interface;
9163         set their `Bases' and call Register() before parsing their body.
9164
9165 2004-07-23  Martin Baulig  <martin@ximian.com>
9166
9167         * class.cs (Kind): New public enum.
9168         (TypeContainer): Made this class abstract.
9169         (TypeContainer.Kind): New public readonly field.
9170         (TypeContainer.CheckDef): New public method; moved here from
9171         cs-parser.jay.
9172         (TypeContainer.Register): New public abstract method.
9173         (TypeContainer.GetPendingImplementations): New public abstract
9174         method.
9175         (TypeContainer.GetClassBases): Removed the `is_class' and
9176         `is_iface' parameters.
9177         (TypeContainer.DefineNestedTypes): Formerly known as
9178         DoDefineType().
9179         (ClassOrStruct): Made this class abstract.
9180
9181         * tree.cs (RootTypes): New public type. 
9182
9183 2004-07-20  Martin Baulig  <martin@ximian.com>
9184
9185         * tree.cs (Tree.RecordNamespace): Removed.
9186         (Tree.Namespaces): Removed.
9187
9188         * rootcontext.cs (RootContext.IsNamespace): Removed.
9189
9190         * cs-parser.jay (namespace_declaration): Just create a new
9191         NamespaceEntry here.
9192
9193 2004-07-20  Martin Baulig  <martin@ximian.com>
9194
9195         * statement.cs (ExceptionStatement): New abstract class.  This is
9196         now used as a base class for everyone who's using `finally'.
9197         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
9198         our local variables before using them.
9199
9200         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
9201         virtual method.  This is used by Yield.Resolve() to "steal" an
9202         outer block's `finally' clauses.
9203         (FlowBranchingException): The .ctor now takes an ExceptionStatement
9204         argument.
9205
9206         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
9207         version which takes an ExceptionStatement.  This version must be
9208         used to create exception branchings.
9209
9210         * iterator.cs
9211         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
9212         (Iterator.EmitMoveNext): Added exception support; protect the
9213         block with a `fault' clause, properly handle 'finally' clauses.
9214         (Iterator.EmitDispose): Run all the `finally' clauses here.
9215
9216 2004-07-20  Martin Baulig  <martin@ximian.com>
9217
9218         * iterator.cs: This is the first of a set of changes in the
9219         iterator code.  Match the spec more closely: if we're an
9220         IEnumerable, then GetEnumerator() must be called.  The first time
9221         GetEnumerator() is called, it returns the current instance; all
9222         subsequent invocations (if any) must create a copy.
9223
9224 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9225
9226         * expression.cs: Resolve the constant expression before returning
9227         it. 
9228
9229 2004-07-19  Martin Baulig  <martin@ximian.com>
9230
9231         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9232         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9233         the return type of the new EmitContext.
9234
9235 2004-07-18  Martin Baulig  <martin@ximian.com>
9236
9237         * class.cs (Property.Define): Fix iterators.
9238
9239         * iterators.cs (Iterator.Define): Moved the
9240         `container.AddInterator (this)' call here from the .ctor; only do
9241         it if we resolved successfully.
9242
9243 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9244
9245         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9246         `true' for preprocessing directives that we parse.  The return
9247         value indicates whether we should return to regular tokenizing or
9248         not, not whether it was parsed successfully.
9249
9250         In the past if we were in: #if false ... #line #endif, we would
9251         resume parsing after `#line'.  See bug 61604.
9252
9253         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9254         building: IsEnumType should return true only for enums, not for
9255         enums or System.Enum itself.  This fixes #61593.
9256
9257         Likely what happened is that corlib was wrong: mcs depended on
9258         this bug in some places.  The bug got fixed, we had to add the
9259         hack, which caused bug 61593.
9260
9261         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9262         that was a workaround for the older conditions.
9263
9264 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9265
9266         * assign.cs: IAssignMethod has a new interface, as documented
9267         inline. All assignment code now uses this new api.
9268
9269         * ecore.cs, expression.cs: All classes which implement
9270         IAssignMethod now use the new interface.
9271
9272         * expression.cs (Invocation): add a hack to EmitCall so that
9273         IndexerAccess can be the target of a compound assignment without
9274         evaluating its arguments twice.
9275
9276         * statement.cs: Handle changes in Invocation api.
9277
9278 2004-07-16  Martin Baulig  <martin@ximian.com>
9279
9280         * iterators.cs: Rewrote this.  We're now using one single Proxy
9281         class for both the IEnumerable and the IEnumerator interface and
9282         `Iterator' derives from Class so we can use the high-level API.
9283
9284         * class.cs (TypeContainer.AddIterator): New method.
9285         (TypeContainer.DoDefineType): New protected virtual method, which
9286         is called from DefineType().
9287         (TypeContainer.DoDefineMembers): Call DefineType() and
9288         DefineMembers() on all our iterators.
9289         (TypeContainer.Emit): Call Emit() on all our iterators.
9290         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9291
9292         * codegen.cs (EmitContext.CurrentIterator): New public field.
9293
9294 2004-07-15  Martin Baulig  <martin@ximian.com>
9295
9296         * typemanager.cs
9297         (TypeManager.not_supported_exception_type): New type.   
9298
9299 2004-07-14  Martin Baulig  <martin@ximian.com>
9300
9301         * iterators.cs: Use real error numbers.
9302
9303 2004-07-14  Martin Baulig  <martin@ximian.com>
9304
9305         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9306         requires this to be a System.Collection.IEnumerable and not a
9307         class implementing that interface.
9308         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9309
9310 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9311
9312         * class.cs: Fixed previous fix, it broke some error tests.
9313
9314 2004-07-12  Martin Baulig  <martin@ximian.com>
9315
9316         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9317         Fixes #61293.
9318
9319 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9320
9321         * assign.cs (LocalTemporary): Add new argument: is_address,If
9322         `is_address' is true, then the value that we store is the address
9323         to the real value, and not the value itself.
9324         
9325         * ecore.cs (PropertyExpr): use the new local temporary
9326         stuff to allow us to handle X.Y += z (where X is a struct)
9327
9328 2004-07-08  Martin Baulig  <martin@ximian.com>
9329
9330         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9331         not always return, just like we're doing in Using.Resolve().
9332
9333 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9334
9335         * cs-parser.jay (fixed_statement): flag this as Pinned.
9336
9337 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9338
9339         * typemanager.cs (TypeManager): Removed MakePinned method, this
9340         mechanism is replaced with the .NET 2.x compatible mechanism of
9341         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9342
9343         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9344         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9345         `IsFixed' property which has a different meaning.
9346
9347 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9348
9349         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9350         visible from inside a nested class, not just the names of the
9351         immediately enclosing class.
9352         Fix for bug #60730.
9353
9354 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9355
9356         * expression.cs (BetterConversion): Remove buggy special-case
9357         handling of "implicit constant expression conversions".  At this
9358         point, we already know that the conversion is possible -- we're
9359         only checking to see which is better.
9360
9361 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9362
9363         * cs-parser.jay: Added error CS0210 test.
9364
9365 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9366
9367         * cs-parser.jay: Added error CS0134 test.
9368
9369 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9370
9371         Fix bug #52507
9372         * cs-parser.jay: Added error CS0145 test.
9373
9374 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9375
9376         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9377
9378 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9379         
9380         * expression.cs (StackAlloc.Resolve): The argument may not
9381         be a constant; deal with this case.
9382         
9383 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9384
9385         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9386         GetIndexerAttributeValue.
9387         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9388
9389         * class.cs (Indexer.Define): Added error tests for CS0415,
9390         CS0609.
9391
9392 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9393
9394         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9395         property code.
9396
9397 2004-06-23  Martin Baulig  <martin@ximian.com>
9398
9399         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9400         neither return nor throw, reset the barrier as well.  Fixes #60457.
9401
9402 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9403
9404         * class.cs : EventAttributes is now set to None by default.
9405           This fixes bug #60459.
9406
9407 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9408
9409         Fix bug #60219
9410         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9411         Don't throw exception but return null (it's sufficient now).
9412
9413 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9414
9415         * typemanager.cs (GetArgumentTypes): Faster implementation.
9416
9417 2004-06-18  Martin Baulig  <martin@ximian.com>
9418
9419         * attribute.cs (Attribute.Resolve): Check whether we're an
9420         EmptyCast which a Constant child.  Fixes #60333.
9421
9422 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9423
9424         * statement.cs (EmitCollectionForeach): Account for the fact that
9425         not all valuetypes are in areas which we can take the address of.
9426         For these variables, we store to a temporary variable. Also, make
9427         sure that we dont emit a `callvirt' on a valuetype method.
9428
9429 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9430
9431         * expression.cs (StackAlloc.DoReSolve): Added test for
9432         negative parameter (CS0247).
9433
9434 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9435
9436         Fix bug #59792
9437         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9438
9439 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9440
9441         Fix bug #59781
9442         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9443         ulong.
9444
9445 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9446
9447         Fix bug #58254 & cs1555.cs, cs1556.cs
9448         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9449
9450 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9451
9452         * cs-parser.jay: Added error CS1669 test for indexers.
9453
9454 2004-06-11  Martin Baulig  <martin@ximian.com>
9455
9456         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9457         call this twice: for params and varargs methods.
9458
9459 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9460
9461         * class.cs:
9462         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9463
9464 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9465
9466         * attribute.cs (Attribute.GetValidTargets): Made public.
9467
9468         * class.cs: 
9469         (AbstractPropertyEventMethod): New class for better code sharing.
9470         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9471         CS1667 report.
9472         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9473
9474 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9475
9476         Fix bug #59477.
9477         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9478         that the call to Resolve is part of a MemberAccess.
9479         (Expression.Resolve): Use it for SimpleName resolution.
9480         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9481         Add 'intermediate' boolean argument.
9482         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9483         error message when the SimpleName can be resolved ambiguously
9484         between an expression and a type.
9485         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9486         public.
9487         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9488         call on the left-side.
9489
9490 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9491
9492         * class.cs:
9493         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9494
9495 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9496
9497         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9498
9499 2004-06-11  Martin Baulig  <martin@ximian.com>
9500
9501         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9502         varargs methods if applicable.
9503
9504 2004-06-11  Martin Baulig  <martin@ximian.com>
9505
9506         * expression.cs (Invocation.EmitCall): Don't use
9507         `method.CallingConvention == CallingConventions.VarArgs' since the
9508         method could also have `CallingConventions.HasThis'.
9509
9510 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9511
9512         * class.cs (Event.GetSignatureForError): Implemented.
9513         Fixed crash in error test cs3010.cs
9514
9515 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9516
9517         * cs-tokenizer.cs: Change the way we track __arglist to be
9518         consistent with the other keywords.
9519
9520 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9523         tomorrow.
9524
9525 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9526
9527         * codegen.cs: Check that all referenced assemblies have a strongname
9528         before strongnaming the compiled assembly. If not report error CS1577.
9529         Fix bug #56563. Patch by Jackson Harper.
9530         * typemanager.cs: Added a method to return all referenced assemblies.
9531         Fix bug #56563. Patch by Jackson Harper.
9532
9533 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9534
9535         * class.cs:
9536         (Method.ApplyAttributeBuilder): Moved and added conditional
9537         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9538
9539         * delegate.cs:
9540         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9541
9542 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9543
9544         Fixed #59640
9545         * class.cs: (EventField.attribute_targets): Changed default target.
9546
9547 2004-06-08  Martin Baulig  <martin@ximian.com>
9548
9549         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9550
9551 2004-06-08  Martin Baulig  <martin@ximian.com>
9552
9553         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9554
9555 2004-06-07  Martin Baulig  <martin@ximian.com>
9556
9557         Added support for varargs methods.
9558
9559         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9560         keyword.
9561
9562         * cs-parser.jay: Added support for `__arglist'.
9563
9564         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9565
9566         * expression.cs (Argument.AType): Added `ArgList'.
9567         (Invocation): Added support for varargs methods.
9568         (ArglistAccess): New public class.
9569         (Arglist): New public class.
9570
9571         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9572
9573         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9574         a method's top-level block if the method has varargs.
9575
9576         * support.cs (ReflectionParameters, InternalParameters): Added
9577         support for varargs methods.    
9578
9579 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9580
9581         * class.cs: Provide location in indexer error report.
9582
9583         * driver.cs: Use standard names.
9584
9585         * namespace.cs: Catch the use of using after a namespace has been
9586         declared also on using aliases.
9587
9588 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9589
9590         Bug #50820.
9591         * typemanager.cs (closure_private_ok, closure_invocation_type)
9592         (closure_qualifier_type, closure_invocation_assembly)
9593         (FilterWithClosure): Move to ...
9594         (Closure): New internal nested class.
9595         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9596         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9597         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9598         (MemberLookup, MemberLookupFailed): Use it.
9599         * expression.cs (New.DoResolve): Treat the lookup for the
9600         constructor as being qualified by the 'new'ed type.
9601         (Indexers.GetIndexersForTypeOrInterface): Update.
9602
9603 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9604
9605         * attribute.cs
9606         (GetConditionalAttributeValue): New method. Returns
9607         condition of ConditionalAttribute.
9608         (SearchMulti): New method.  Returns all attributes of type 't'.
9609         Use it when attribute is AllowMultiple = true.
9610         (IsConditionalMethodExcluded): New method.
9611
9612         * class.cs
9613         (Method.IsExcluded): Implemented. Returns true if method has conditional
9614         attribute and the conditions is not defined (method is excluded).
9615         (IMethodData): Extended interface for ConditionalAttribute support.
9616         (PropertyMethod.IsExcluded): Implemented.
9617
9618         * decl.cs
9619         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9620
9621         * expression.cs
9622         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9623         on the method.
9624
9625 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9626
9627         * expression.cs (ArrayCreationExpression): Make this just an
9628         `expression'. It can't be a statement, so the code here was
9629         dead.
9630
9631 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9632
9633         Fixed #59072
9634         * typemanager.cs (GetFullNameSignature): New method for
9635         MethodBase types.
9636
9637 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9638
9639         Fixed #56452
9640         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9641         Use this method when MethodBuilder is null.
9642         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9643         Added test for error CS0626 (MONO reports error for this situation).
9644         (IMethodData.GetSignatureForError): Extended interface.
9645
9646 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9647
9648         * attribute.cs
9649         (AttributeTester.GetObsoleteAttribute): Returns instance of
9650         ObsoleteAttribute when type is obsolete.
9651
9652         * class.cs
9653         (TypeContainer.VerifyObsoleteAttribute): Override.
9654         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9655         (MethodCode.VerifyObsoleteAttribute): Override.
9656         (MemberBase.VerifyObsoleteAttribute): Override.
9657
9658         * decl.cs
9659         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9660         and report proper error.
9661
9662         *delegate.cs
9663         Delegate.VerifyObsoleteAttribute): Override.
9664
9665         * ecore.cs
9666         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9667         and report proper error.
9668         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9669
9670         * enum.cs
9671         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9672         and enum member.
9673
9674         * expression.cs
9675         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9676         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9677         Added test for ObsoleteAttribute.
9678
9679         * statement.cs
9680         (Catch): Derived from Statement.
9681
9682 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9683  
9684         Fixed bug #59071 & cs0160.cs
9685  
9686         * statement.cs (Try.Resolve): Check here whether order of catch
9687         clauses matches their dependencies.
9688
9689 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9690
9691         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9692         caused a regression: #59343.  Referencing nested classes from an
9693         assembly stopped working.
9694
9695 2004-05-31  Martin Baulig  <martin@ximian.com>
9696
9697         MCS is now frozen for beta 2.
9698
9699 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9700
9701         * convert.cs: add a trivial cache for overload operator resolution.
9702
9703 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9704
9705         * decl.cs: If possible, use lookuptypedirect here. We can only do
9706         this if there is no `.' after the namespace. Avoids using
9707         LookupType, which does lots of slow processing.
9708         (FindNestedType) New method, does what it says :-).
9709         * namespace.cs: use LookupTypeDirect.
9710         * rootcontext.cs: use membercache, if possible.
9711         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9712
9713 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9714
9715         * expression.cs:
9716         According to the spec, 
9717
9718         In a member access of the form E.I, if E is a single identifier,
9719         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9720         field, property, localvariable, or parameter with the same type as
9721         the meaning of E as a type-name (§3.8), then both possible
9722         meanings of E are permitted.
9723
9724         We did not check that E as a simple-name had the same type as E as
9725         a type name.
9726
9727         This trivial check gives us 5-7% on bootstrap time.
9728
9729 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9730
9731         * expression.cs (Invocation.OverloadResolve): Avoid the
9732         use of hashtables and boxing here by allocating on demand.
9733
9734 2004-05-30  Martin Baulig  <martin@ximian.com>
9735
9736         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9737         we're doing a silent lookup.  Don't try to lookup nested types in
9738         TypeManager.object_type (thanks to Ben Maurer).
9739
9740 2004-05-30  Martin Baulig  <martin@ximian.com>
9741
9742         Committing a patch from Ben Maurer.
9743
9744         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9745
9746 2004-05-29  Martin Baulig  <martin@ximian.com>
9747
9748         * class.cs (IMethodData.ShouldIgnore): New method.
9749
9750         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9751         `Location' argument, we don't need it anywhere.  Use
9752         `IMethodData.ShouldIgnore ()' instead of
9753         `MethodData.GetMethodFlags ()'.
9754         (TypeManager.AddMethod): Removed.
9755         (TypeManager.AddMethod2): Renamed to AddMethod.
9756
9757 2004-05-29  Martin Baulig  <martin@ximian.com>
9758
9759         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9760
9761         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9762         converting from a class type S to an interface type and we already
9763         have an object on the stack, don't box it again.  Fixes #52578.
9764
9765 2004-05-29  Martin Baulig  <martin@ximian.com>
9766
9767         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9768         Added support for `params' parameters.  Fixes #59267.
9769
9770 2004-05-29  Martin Baulig  <martin@ximian.com>
9771
9772         * literal.cs (NullPointer): Provide a private .ctor which sets
9773         `type' to TypeManager.object_type.  Fixes #59048.
9774
9775 2004-05-29  Martin Baulig  <martin@ximian.com>
9776
9777         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9778         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9779
9780         * ecore.cs (EventExpr.instance_expr): Make the field private.
9781
9782 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9783
9784         Fixed bug #50080 & cs0214-2.cs
9785         * expression.cs (Cast.DoResolve): Check unsafe context here.
9786         
9787         * statement.cs (Resolve.DoResolve): Likewise.
9788
9789 2004-05-26  Martin Baulig  <martin@ximian.com>
9790
9791         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9792
9793         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9794         (RootContext.LookupType): Pass down the `silent' flag.
9795
9796 2004-05-25  Martin Baulig  <martin@ximian.com>
9797
9798         * expression.cs
9799         (MethodGroupExpr.IdenticalTypeName): New public property.
9800         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9801         expression actually refers to a type.
9802
9803 2004-05-25  Martin Baulig  <martin@ximian.com>
9804
9805         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9806         for #56176 and made it actually work.
9807
9808 2004-05-25  Martin Baulig  <martin@ximian.com>
9809
9810         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9811         (FieldExpr, PropertyExpr): Override and implement
9812         CacheTemporaries.  Fixes #52279.
9813
9814 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9815
9816         * location.cs: In the new compiler listing a file twice is a
9817         warning, not an error.
9818
9819 2004-05-24  Martin Baulig  <martin@ximian.com>
9820
9821         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9822         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9823
9824 2004-05-24  Martin Baulig  <martin@ximian.com>
9825
9826         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9827         walking the `using' list.  Fixes #53921.
9828
9829 2004-05-24  Martin Baulig  <martin@ximian.com>
9830
9831         * const.cs (Const.LookupConstantValue): Added support for
9832         EmptyCast's; fixes #55251.
9833
9834 2004-05-24  Martin Baulig  <martin@ximian.com>
9835
9836         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9837         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9838         which does the CS0135 check.  The reason is that we first need to
9839         check whether the variable actually exists.
9840
9841 2004-05-24  Martin Baulig  <martin@ximian.com>
9842
9843         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9844         than RootContext.LookupType() to find the explicit interface
9845         type.  Fixes #58584.
9846
9847 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9848
9849         * Makefile: Simplify.  Use executable.make.
9850         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9851
9852 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9853
9854         * decl.cs:
9855         * enum.cs:
9856         Use the invariant culture when doing String.Compare for CLS case
9857         sensitivity.
9858         
9859 2004-05-23  Martin Baulig  <martin@ximian.com>
9860
9861         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9862         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9863
9864         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9865         
9866 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9867
9868         * class.cs (MemberBase.Define): Reuse MemberType member for 
9869         resolved type. Other methods can use it too.
9870
9871 2004-05-23  Martin Baulig  <martin@ximian.com>
9872
9873         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9874         the variable also exists in the current block (otherwise, we need
9875         to report a CS0103).  Fixes #58670.
9876
9877 2004-05-23  Martin Baulig  <martin@ximian.com>
9878
9879         * flowanalysis.cs (Reachability.Reachable): Compute this
9880         on-the-fly rather than storing it as a field.
9881
9882 2004-05-23  Martin Baulig  <martin@ximian.com>
9883
9884         * flowanalysis.cs (Reachability.And): Manually compute the
9885         resulting `barrier' from the reachability.      
9886        
9887 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9888
9889         Fix bug #57835
9890         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9891         instance of ObsoleteAttribute when symbol is obsolete.
9892
9893         * class.cs
9894         (IMethodData): Extended interface for ObsoleteAttribute support.
9895
9896 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9897
9898         * attribute.cs: Fix bug #55970
9899
9900 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9901
9902         Fix bug #52705
9903         * attribute.cs
9904         (GetObsoleteAttribute): New method. Creates the instance of
9905         ObsoleteAttribute.
9906         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9907         ObsoleteAttribute when member is obsolete.
9908         (AttributeTester.Report_ObsoleteMessage): Common method for
9909         Obsolete error/warning reporting.
9910
9911         * class.cs
9912         (TypeContainer.base_classs_type): New member for storing parent type.
9913
9914         * decl.cs
9915         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9916         for this MemberCore.
9917
9918 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9919
9920         * attribute.cs, const.cs: Fix bug #58590
9921
9922 2004-05-21  Martin Baulig  <martin@ximian.com>
9923
9924         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9925         out parameters if the end of the method is unreachable.  Fixes
9926         #58098. 
9927
9928 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9929
9930         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9931         Hari was right, why extra method.
9932
9933 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9934
9935         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9936
9937 2004-05-20  Martin Baulig  <martin@ximian.com>
9938
9939         Merged this back from gmcs to keep the differences to a minumum.
9940
9941         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9942         instead of a Declspace.
9943         (Attribute.ResolveType): Likewise.
9944         (Attributes.Search): Likewise.
9945         (Attributes.Contains): Likewise.
9946         (Attributes.GetClsCompliantAttribute): Likewise.
9947
9948         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9949         argument.
9950         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9951         DeclSpace.
9952
9953 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9954
9955         Fix bug #58688 (MCS does not report error when the same attribute
9956         is assigned twice)
9957
9958         * attribute.cs (Attribute.Emit): Distinction between null and default.
9959
9960 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9961
9962         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9963         of a top-level attribute without an attribute target.
9964         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9965         Make non-static.
9966         (Attribute.Conditional_GetConditionName), 
9967         (Attribute.Obsolete_GetObsoleteMessage): Update.
9968         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9969         part of ScanForIndexerName.
9970         (Attribute.CanIgnoreInvalidAttribute): New function.
9971         (Attribute.ScanForIndexerName): Move to ...
9972         (Attributes.ScanForIndexerName): ... here.
9973         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9974         (Attributes.Search): New internal variant that can choose not to
9975         complain if types aren't resolved.  The original signature now
9976         complains.
9977         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9978         complaints suppressed.
9979         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9980         only if it not useful.
9981         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9982         top-level for attributes that are shared between the assembly
9983         and a top-level class.
9984         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9985         * class.cs: Update to reflect changes.
9986         (DefineIndexers): Fuse loops.
9987         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9988         a couple more variants of attribute names.
9989
9990 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9991
9992         Fix bug #52585 (Implemented explicit attribute declaration)
9993
9994         * attribute.cs:
9995         (Attributable.ValidAttributeTargets): New abstract method. It gets
9996         list of valid attribute targets for explicit target declaration.
9997         (Attribute.Target): It holds target itself.
9998         (AttributeSection): Removed.
9999         (Attribute.CheckTargets): New method. It checks whether attribute
10000         target is valid for the current element.
10001
10002         * class.cs:
10003         (EventProperty): New class. For events that are declared like
10004         property (with add and remove accessors).
10005         (EventField): New class. For events that are declared like field.
10006         class.cs
10007
10008         * cs-parser.jay: Implemented explicit attribute target declaration.
10009
10010         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10011         Override ValidAttributeTargets.
10012
10013         * parameter.cs:
10014         (ReturnParameter): Class for applying custom attributes on 
10015         the return type.
10016         (ParameterAtribute): New class. Class for applying custom
10017         attributes on the parameter type.
10018
10019 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10020
10021         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10022         definitions. 
10023
10024         (Method): Allow UNSAFE here.
10025
10026         * modifiers.cs: Support unsafe reporting.
10027
10028 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10029
10030         * decl.cs: Fix bug #58478.
10031
10032 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10033
10034         * statement.cs: When checking for unreachable code on an EmptyStatement,
10035         set the location. Fixes bug #58488.
10036
10037 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10038
10039         * driver.cs: Add -pkg handling.
10040
10041         From Gonzalo: UseShelLExecute=false
10042
10043 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10044
10045         * attribute.cs:
10046         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10047         for attribute.
10048         (Attribute.IsClsCompliaceRequired): Moved to base for better
10049         accesibility.
10050         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10051         when attribute is AttributeUsageAttribute.
10052         (Attribute.GetValidTargets): Simplified.
10053         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10054         attribute for this type.
10055         (Attribute.ApplyAttributes): Method renamed to Emit and make
10056         non-static.
10057         (GlobalAttributeSection): New class for special handling of global
10058         attributes (assembly, module).
10059         (AttributeSection.Emit): New method.
10060
10061         * class.cs: Implemented Attributable abstract methods.
10062         (MethodCore.LabelParameters): Moved to Parameter class.
10063         (Accessor): Is back simple class.
10064         (PropertyMethod): Implemented Attributable abstract class.
10065         (DelegateMethod): Implemented Attributable abstract class.
10066         (Event): New constructor for disctintion between normal Event
10067         and Event with accessors.
10068
10069         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10070
10071         * codegen.cs, const.cs, decl.cs, delegate.cs:
10072         (CommonAssemblyModulClass): Implemented Attributable abstract class
10073         and simplified.
10074
10075         * enum.cs: Implement IAttributeSupport interface.
10076         (EnumMember): New class for emum members. Implemented Attributable
10077         abstract class
10078
10079         * parameter.cs:
10080         (ParameterBase): Is abstract.
10081         (ReturnParameter): New class for easier [return:] attribute handling.
10082
10083         * typemanager.cs: Removed builder_to_attr.
10084
10085 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10086
10087         Fix bug #57151.
10088         * attribute.cs (Attribute.GetPositionalValue): New function.
10089         * class.cs (TypeContainer.VerifyMembers): New function.
10090         (TypeContainer.Emit): Use it.
10091         (ClassOrStruct): New base class for Class and Struct.
10092         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10093         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10094         class.
10095         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10096         then each non-static field should have a FieldOffset attribute.
10097         Otherwise, none of the fields should have a FieldOffset attribute.
10098         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10099         and FieldOffset attributes.
10100         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10101         (TypeManager.field_offset_attribute_type): New core types.
10102         (TypeManager.InitCoreTypes): Initialize them.
10103
10104 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10105
10106         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10107         Return correct type.
10108         From bug #58270.
10109
10110 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10111
10112         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10113         be implicitly converted to ulong.
10114         
10115         * expression.cs: The logic for allowing operator &, | and ^ worked
10116         was wrong, it worked before because we did not report an error in
10117         an else branch.  Fixes 57895.
10118
10119         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10120         allow volatile fields to be reference types.
10121
10122 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10123
10124         * driver.cs: Add support for /debug-
10125
10126 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10127
10128         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10129         Add a 'complain' parameter to silence errors.
10130         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10131         silently overlooked type-resolutions.
10132         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10133         to reflect changes.
10134         (Attributes.Search): New function.
10135         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10136         (Attributes.GetAttributeFullName): Remove hack.
10137         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10138         Update to reflect changes.
10139         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10140         Use Attributes.Search instead of nested loops.
10141
10142 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10143
10144         * decl.cs:
10145         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10146         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10147         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10148
10149         * report.cs: (Report.Warning): Renamed to Warning_T because of
10150         parameter collision.
10151
10152 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10153
10154         * expression.cs (MemberAccess.ResolveMemberAccess):
10155         Exit with non-zero status after Report.Error.
10156         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10157         Likewise.
10158         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10159
10160 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10161
10162         * support.cs: Don't hang when the file is empty.
10163
10164 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10165
10166         * support.cs: In SeekableStreamReader, compute the preamble size of the
10167           underlying stream. Position changes should take into account that initial
10168           count of bytes.
10169
10170 2004-05-03  Todd Berman  <tberman@sevenl.net>
10171
10172         * driver.cs: remove unused GetSysVersion function.
10173
10174 2004-05-03  Todd Berman  <tberman@sevenl.net>
10175
10176         * driver.cs: Remove the hack from saturday, as well as the hack
10177         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10178         link_paths to get that bit proper.
10179
10180 2004-05-01  Todd Berman  <tberman@sevenl.net>
10181
10182         * driver.cs: Try a LoadFrom before a Load, this checks the current
10183         path. This is currently a bug in mono that is be fixed, however, this
10184         provides a workaround for now. This will be removed when the bug
10185         is fixed.
10186
10187 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10188
10189         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10190         incomplete key pairs (#57941).
10191
10192 2004-05-01  Todd Berman  <tberman@sevenl.net>
10193
10194         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10195         from the GAC
10196
10197 2004-04-30  Jackson Harper  <jackson@ximian.com>
10198
10199         * codegen.cs: Open keys readonly.
10200         
10201 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10202
10203         * typemanager.cs: don't report cyclic struct layout when a struct
10204         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10205         which has 2 Pango.Rectangle fields.
10206
10207 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10208
10209         * expression.cs: Handle IntPtr comparisons with IL code
10210         rather than a method call.
10211
10212 2004-04-29  Martin Baulig  <martin@ximian.com>
10213
10214         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10215         the list of PropertyInfo's in class hierarchy and find the
10216         accessor.  Fixes #56013.
10217
10218 2004-04-29  Martin Baulig  <martin@ximian.com>
10219
10220         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10221
10222 2004-04-29  Martin Baulig  <martin@ximian.com>
10223
10224         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10225
10226         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10227
10228 2004-04-29  Martin Baulig  <martin@ximian.com>
10229
10230         * class.cs (ConstructorInitializer.Resolve): Check whether the
10231         parent .ctor is accessible.  Fixes #52146.
10232
10233 2004-04-29  Martin Baulig  <martin@ximian.com>
10234
10235         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10236
10237         * statement.cs (Using.EmitLocalVariableDecls): Use
10238         TypeManager.idisposable_type, not typeof (IDisposable).
10239         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10240
10241 2004-04-29  Martin Baulig  <martin@ximian.com>
10242
10243         * class.cs (Event.Define): Don't emit the field and don't set
10244         RTSpecialName and SpecialName for events on interfaces.  Fixes
10245         #57703. 
10246
10247 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10248
10249         Refactor Attribute.ApplyAttributes.
10250         * attribute.cs (Attributable): New base class for objects that can
10251         have Attributes applied on them.
10252         (Attribute): Make AttributeUsage fields public.
10253         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10254         (Attribute.IsInternalCall): New property.
10255         (Attribute.UsageAttr): Convert to a public read-only property.
10256         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10257         (Attribute.ResolveType, Attribute.Resolve)
10258         (Attribute.ScanForIndexerName): Update to reflect changes.
10259         (Attribute.CheckAttributeTarget): Re-format.
10260         (Attribute.ApplyAttributes): Refactor, to various
10261         Attributable.ApplyAttributeBuilder methods.
10262         * decl.cs (MemberCore): Make Attributable.
10263         * class.cs (Accessor): Make Attributable.
10264         (MethodData.ApplyAttributes): Use proper attribute types, not
10265         attribute names.
10266         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10267         (TypeContainer.ApplyAttributeBuilder)
10268         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10269         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10270         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10271         (Operator.ApplyAttributeBuilder): New factored-out methods.
10272         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10273         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10274         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10275         * parameter.cs (ParameterBase): New Attributable base class
10276         that can also represent Return types.
10277         (Parameter): Update to the changes.
10278
10279 2004-04-29  Jackson Harper  <jackson@ximian.com>
10280
10281         * driver.cs: Prefer the corlib system version when looking for
10282         assemblies in the GAC. This is still a hack, but its a better hack
10283         now.
10284         
10285 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10286
10287         * decl.cs, enum.cs: Improved error 3005 reporting.
10288   
10289         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10290         (related_symbols): New private member for list of symbols
10291         related to reported error/warning.
10292         
10293         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10294
10295 2004-04-29  Martin Baulig  <martin@ximian.com>
10296
10297         * ecore.cs (Expression.Constantify): If we're an enum and
10298         TypeManager.TypeToCoreType() doesn't give us another type, use
10299         t.UnderlyingSystemType.  Fixes #56178.  
10300
10301 2004-04-29  Martin Baulig  <martin@ximian.com>
10302
10303         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10304         interfaces and for each interface, only add members directly
10305         declared in that interface.  Fixes #53255.
10306
10307 2004-04-28  Martin Baulig  <martin@ximian.com>
10308
10309         * expression.cs (ConditionalLogicalOperator): Use a temporary
10310         variable for `left' to avoid that we evaluate it more than once;
10311         bug #52588.
10312
10313 2004-04-28  Martin Baulig  <martin@ximian.com>
10314
10315         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10316         `void[]' (CS1547).
10317
10318 2004-04-28  Martin Baulig  <martin@ximian.com>
10319
10320         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10321         void (CS1547).
10322
10323         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10324         whether the type is not void (CS1547).
10325
10326 2004-04-28  Martin Baulig  <martin@ximian.com>
10327
10328         * expression.cs (Unary.DoResolveLValue): Override this and report
10329         CS0131 for anything but Operator.Indirection.
10330
10331 2004-04-28  Martin Baulig  <martin@ximian.com>
10332
10333         Committing a patch from Ben Maurer; see bug #50820.
10334
10335         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10336         check for classes.
10337
10338         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10339         classes.        
10340
10341 2004-04-28  Martin Baulig  <martin@ximian.com>
10342
10343         Committing a patch from Ben Maurer; see bug #50820.
10344
10345         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10346         check for classes.
10347
10348         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10349         classes.        
10350
10351 2004-04-28  Martin Baulig  <martin@ximian.com>
10352
10353         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10354         (Block.AddLabel): Call DoLookupLabel() to only search in the
10355         current block.
10356
10357 2004-04-28  Martin Baulig  <martin@ximian.com>
10358
10359         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10360         comparing StringConstants and NullLiterals in Equality and Inequality.
10361
10362 2004-04-28  Jackson Harper  <jackson@ximian.com>
10363
10364         * driver.cs: Attempt to load referenced assemblies from the
10365         GAC. This is the quick and dirty version of this method that
10366         doesnt take into account versions and just takes the first
10367         canidate found. Will be good enough for now as we will not have more
10368         then one version installed into the GAC until I update this method.
10369
10370 2004-04-28  Martin Baulig  <martin@ximian.com>
10371
10372         * typemanager.cs (TypeManager.CheckStructCycles): New public
10373         static method to check for cycles in the struct layout.
10374
10375         * rootcontext.cs (RootContext.PopulateTypes): Call
10376         TypeManager.CheckStructCycles() for each TypeContainer.
10377         [Note: We only need to visit each type once.]
10378
10379 2004-04-28  Martin Baulig  <martin@ximian.com>
10380
10381         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10382
10383         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10384         success and added `out object value'.  Use a `bool resolved' field
10385         to check whether we've already been called rather than
10386         `ConstantValue != null' since this breaks for NullLiterals.
10387
10388 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10389
10390         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10391         setting of this flag, since the 'set' method may be non-public.
10392
10393 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10394
10395         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10396         check on current_vector.Block.
10397
10398 2004-04-27  Martin Baulig  <martin@ximian.com>
10399
10400         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10401         a field initializer.  Fixes #56459.
10402
10403 2004-04-27  Martin Baulig  <martin@ximian.com>
10404
10405         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10406         we're not attempting to use an indexer.  Fixes #52154.
10407
10408 2004-04-27  Martin Baulig  <martin@ximian.com>
10409
10410         * statement.cs (Return): Don't create a return label if we don't
10411         need it; reverts my change from January 20th.  Thanks to Ben
10412         Maurer for this.
10413
10414 2004-04-27  Martin Baulig  <martin@ximian.com>
10415
10416         According to the spec, `goto' can only leave a nested scope, but
10417         never enter it.
10418
10419         * statement.cs (Block.LookupLabel): Only lookup in the current
10420         block, don't recurse into parent or child blocks.
10421         (Block.AddLabel): Check in parent and child blocks, report
10422         CS0140/CS0158 if we find a duplicate.
10423         (Block): Removed this indexer for label lookups.
10424         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10425         this already does the error reporting for us.
10426
10427         * flowanalysis.cs
10428         (FlowBranching.UsageVector.Block): New public variable; may be null.
10429         (FlowBranching.CreateSibling): Added `Block' argument.
10430         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10431         label for the target of a `goto' and check whether we're not
10432         leaving a `finally'.
10433
10434 2004-04-27  Martin Baulig  <martin@ximian.com>
10435
10436         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10437         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10438         just for returns).
10439
10440 2004-04-27  Martin Baulig  <martin@ximian.com>
10441
10442         * statement.cs (Block.AddLabel): Also check for implicit blocks
10443         and added a CS0158 check.
10444
10445 2004-04-27  Martin Baulig  <martin@ximian.com>
10446
10447         * flowanalysis.cs (FlowBranchingLoop): New class.
10448         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10449         UsageVector's instead of an ArrayList.
10450         (FlowBranching.Label): Likewise.
10451         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10452         (FlowBranching.AddBreakVector): New method.
10453
10454 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10455
10456         * attribute.cs: Small regression fix: only convert the type if we
10457         the type is different, fixes System.Drawing build.
10458
10459 2004-04-27  Martin Baulig  <martin@ximian.com>
10460
10461         * attribute.cs (Attribute.Resolve): If we have a constant value
10462         for a named field or property, implicity convert it to the correct
10463         type.
10464
10465 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10466
10467         * statement.cs (Block.Block): Implicit blocks share
10468         'child_variable_names' fields with parent blocks.
10469         (Block.AddChildVariableNames): Remove.
10470         (Block.AddVariable): Mark variable as "used by a child block" in
10471         every surrounding block.
10472         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10473         been used in a child block, complain about violation of "Invariant
10474         meaning in blocks" rule.
10475         * cs-parser.jay (declare_local_variables): Don't use
10476         AddChildVariableNames.
10477         (foreach_statement): Don't create an implicit block: 'foreach'
10478         introduces a scope.
10479
10480 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10483         converting from 0L to ulong.  Fixes 57522.
10484
10485 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10486
10487         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10488         derived class hides via 'new' keyword field from base class (test-242.cs).
10489         TODO: Handle this in the more general way.
10490         
10491         * class.cs (CheckBase): Ditto.
10492
10493 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10494
10495         * decl.cs (caching_flags): New member for storing cached values
10496         as bit flags.
10497         (MemberCore.Flags): New enum where bit flags for caching_flags
10498         are defined.
10499         (MemberCore.cls_compliance): Moved to caching_flags.
10500         (DeclSpace.Created): Moved to caching_flags.
10501
10502         * class.cs: Use caching_flags instead of DeclSpace.Created
10503         
10504 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10505
10506         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10507         if we are only a derived class, not a nested class.
10508
10509         * typemanager.cs: Same as above, but do this at the MemberLookup
10510         level (used by field and methods, properties are handled in
10511         PropertyExpr).   Allow for the qualified access if we are a nested
10512         method. 
10513
10514 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10515
10516         * class.cs: Refactoring.
10517         (IMethodData): New inteface; Holds links to parent members
10518         to avoid member duplication (reduced memory allocation).
10519         (Method): Implemented IMethodData interface.
10520         (PropertyBase): New inner classes for get/set methods.
10521         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10522         (Event): New inner classes for add/remove methods.
10523         (Event.DelegateMethod): Implemented IMethodData interface.
10524
10525         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10526         EmitContext (related to class.cs refactoring).
10527
10528 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10529
10530         * delegate.cs (Delegate.VerifyApplicability): If the number of
10531         arguments are the same as the number of parameters, first try to
10532         verify applicability ignoring  any 'params' modifier on the last
10533         parameter.
10534         Fixes #56442.
10535
10536 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10537
10538         * class.cs (TypeContainer.AddIndexer): Use
10539         'ExplicitInterfaceName' to determine if interface name was
10540         explicitly specified.  'InterfaceType' is not initialized at this time.
10541         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10542         Indexers array is already in the required order.  Initialize
10543         'IndexerName' only if there are normal indexers.
10544         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10545         (TypeContainer.Emit): Emit DefaultMember attribute only if
10546         IndexerName is initialized.
10547         Fixes #56300.
10548
10549 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10550
10551         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10552         Fixes #57007
10553
10554 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10555
10556         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10557         attributes.
10558         Fix for #56456.
10559
10560         * attribute.cs (Attribute.Resolve): Check for duplicate named
10561         attributes.
10562         Fix for #56463.
10563
10564 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10565
10566         * iterators.cs (MarkYield): track whether we are in an exception,
10567         and generate code accordingly.  Use a temporary value to store the
10568         result for our state.
10569
10570         I had ignored a bit the interaction of try/catch with iterators
10571         since their behavior was not entirely obvious, but now it is
10572         possible to verify that our behavior is the same as MS .NET 2.0
10573
10574         Fixes 54814
10575
10576 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10577
10578         * iterators.cs: Avoid creating temporaries if there is no work to
10579         do. 
10580
10581         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10582         Enumerations, use TypeManager.EnumToUnderlying and call
10583         recursively. 
10584
10585         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10586         bug #57013
10587
10588         (This.Emit): Use EmitContext.EmitThis to emit our
10589         instance variable.
10590
10591         (This.EmitAssign): Ditto.
10592
10593         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10594         codepaths, we will move all the functionality into
10595         Mono.CSharp.This 
10596
10597         (FieldExpr.EmitAssign): Ditto.
10598
10599         This fixes several hidden bugs that I uncovered while doing a code
10600         review of this today.
10601
10602         * codegen.cs (EmitThis): reworked so the semantics are more clear
10603         and also support value types "this" instances.
10604
10605         * iterators.cs: Changed so that for iterators in value types, we
10606         do not pass the value type as a parameter.  
10607
10608         Initialization of the enumerator helpers is now done in the caller
10609         instead of passing the parameters to the constructors and having
10610         the constructor set the fields.
10611
10612         The fields have now `assembly' visibility instead of private.
10613
10614 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10615
10616         * expression.cs (Argument.Resolve): Check if fields passed as ref
10617         or out are contained in a MarshalByRefObject.
10618
10619         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10620         another compiler type.
10621
10622 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10623
10624         * class.cs (Indexer.Define): use the new name checking method.
10625         Also, return false on an error.
10626         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10627         (is_identifier_[start/part]_character): make static.
10628
10629 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10630
10631         * expression.cs (Binary.ResolveOperator): Do no append strings
10632         twice: since we can be invoked more than once (array evaluation)
10633         on the same concatenation, take care of this here.  Based on a fix
10634         from Ben (bug #56454)
10635
10636 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10637
10638         * codegen.cs: Fix another case where CS1548 must be reported (when 
10639         delay-sign isn't specified and no private is available #56564). Fix
10640         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10641         error when MCS is used on the MS runtime and we need to delay-sign 
10642         (which seems unsupported by AssemblyBuilder - see #56621).
10643
10644 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10645
10646         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10647         (TypeManager.ComputeNamespaces): Faster implementation for
10648         Microsoft runtime.
10649
10650         * compiler.csproj: Updated AssemblyName to mcs.
10651
10652 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10653
10654         * rootcontext.cs: Add new types to the boot resolution.
10655
10656         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10657         MulticastDelegate is not allowed.
10658
10659         * typemanager.cs: Add new types to lookup: System.TypedReference
10660         and ArgIterator.
10661
10662         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10663         check for TypedReference or ArgIterator, they are not allowed. 
10664
10665         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10666         makes us properly catch 1510 in some conditions (see bug 56016 for
10667         details). 
10668
10669 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10670
10671         * CryptoConvert.cs: update from corlib version
10672         with endian fixes.
10673
10674 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10675
10676         * class.cs (Indexer.Define): Check indexername declaration
10677
10678 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10679
10680         * attribute.cs (IsClsCompliant): Fixed problem with handling
10681         all three states (compliant, not-compliant, undetected).
10682
10683 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10684
10685         * attribute.cs (Attribute): Location is now public.
10686         (Resolve): Store resolved arguments (pos_values) in attribute class.
10687         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10688         (GetClsCompliantAttributeValue): New method that gets
10689         CLSCompliantAttribute value.
10690         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10691         if exists else null.
10692         (AttributeTester): New class for CLS-Compliant verification routines.
10693
10694         * class.cs (Emit): Add CLS-Compliant verification.
10695         (Method.GetSignatureForError): Implemented.
10696         (Constructor.GetSignatureForError): Implemented
10697         (Constructor.HasCompliantArgs): Returns if constructor has
10698         CLS-Compliant arguments.
10699         (Constructor.Emit): Override.
10700         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10701         is needed to test only parameters.
10702         (FieldBase.GetSignatureForError): Implemented.
10703         (TypeContainer): New member for storing base interfaces.
10704         (TypeContainer.FindMembers): Search in base interfaces too.
10705
10706         * codegen.cs (GetClsComplianceAttribute): New method that gets
10707         assembly or module CLSCompliantAttribute value.
10708         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10709         for assembly.
10710         (ModuleClass.Emit): Add error 3012 test.
10711
10712         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10713
10714         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10715         state for all decl types.
10716         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10717         if CLS-Compliant tests are required.
10718         (IsClsCompliaceRequired): New method. Analyze whether code
10719         must be CLS-Compliant.
10720         (IsExposedFromAssembly): New method. Returns true when MemberCore
10721         is exposed from assembly.
10722         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10723         value or gets cached value.
10724         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10725         is explicitly marked with CLSCompliantAttribute.
10726         (IsIdentifierClsCompliant): New abstract method. This method is
10727         used to testing error 3005.
10728         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10729         for identifier and parameters CLS-Compliant testing.
10730         (VerifyClsCompliance): New method. The main virtual method for
10731         CLS-Compliant verifications.
10732         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10733         null. I don't know why is null (too many public members !).
10734         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10735         and get value of first CLSCompliantAttribute that found.
10736
10737         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10738         (VerifyClsCompliance): Override and add extra tests.
10739
10740         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10741         clscheck- disable CLS-Compliant verification event if assembly is has
10742         CLSCompliantAttribute(true).
10743
10744         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10745         ApllyAttribute is now called in emit section as in the other cases.
10746         Possible future Emit integration.
10747         (IsIdentifierClsCompliant): New override.
10748         (VerifyClsCompliance): New override.
10749         (GetEnumeratorName): Returns full enum name.
10750
10751         * parameter.cs (GetSignatureForError): Implemented.
10752
10753         * report.cs (WarningData): New struct for Warning message information.
10754         (LocationOfPreviousError): New method.
10755         (Warning): New method. Reports warning based on the warning table.
10756         (Error_T): New method. Reports error based on the error table.
10757
10758         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10759         verifications are done here.
10760
10761         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10762
10763         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10764         CLSCompliantAttribute.
10765         (all_imported_types): New member holds all imported types from other
10766         assemblies.
10767         (LoadAllImportedTypes): New method fills static table with exported types
10768         from all referenced assemblies.
10769         (Modules): New property returns all assembly modules.
10770
10771 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10772
10773         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10774         throwing a parser error.
10775
10776         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10777         which removes the hardcoded get_/set_ prefixes for properties, as
10778         IL allows for the properties to be named something else.  
10779
10780         Bug #56013
10781
10782         * expression.cs: Do not override operand before we know if it is
10783         non-null.  Fix 56207
10784
10785 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10786
10787         * typemanager.cs: support for pinned variables.
10788
10789 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10790
10791         * decl.cs, typemanager.cs: Avoid using an arraylist
10792         as a buffer if there is only one result set.
10793
10794 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10795
10796         * expression.cs: Make sure you cant call a static method
10797         with an instance expression, bug #56174.
10798
10799 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10800
10801         * class.cs (IsDuplicateImplementation): Improve error reporting to
10802         flag 663 (method only differs in parameter modifier).
10803
10804         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10805         in preprocessor directives.
10806
10807         * location.cs (LookupFile): Allow for the empty path.
10808
10809         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10810         better approach for some of that patch, but its failing with the
10811         CharSet enumeration.  For now try/catch will do.
10812
10813         * typemanager.cs: Do not crash if a struct does not have fields.
10814         Fixes 56150.
10815
10816 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10817
10818         * expression.cs: cs0213, cant fix a fixed expression.
10819         fixes 50231.
10820
10821 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10822
10823         * cs-parser.jay: detect invalid embeded statements gracefully.
10824         bug #51113.
10825
10826 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10827
10828         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10829         As a regex:
10830         s/
10831         the invocation type may not be a subclass of the tye of the item/
10832         The type of the item must be a subclass of the invocation item.
10833         /g
10834
10835         Fixes bug #50820.
10836
10837 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10838
10839         * attribute.cs: Added methods to get a string and a bool from an
10840         attribute. Required to information from AssemblyKeyFileAttribute,
10841         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10842         * codegen.cs: Modified AssemblyName creation to include support for
10843         strongnames. Catch additional exceptions to report them as CS1548.
10844         * compiler.csproj: Updated include CryptoConvert.cs.
10845         * compiler.csproj.user: Removed file - user specific configuration.
10846         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10847         Mono.Security assembly. The original class is maintained and tested in
10848         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10849         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10850         like CSC 8.0 (C# v2) supports.
10851         * Makefile: Added CryptoConvert.cs to mcs sources.
10852         * rootcontext.cs: Added new options for strongnames.
10853
10854 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10855
10856         * driver.cs: For --expect-error, report error code `2'
10857         if the program compiled with no errors, error code `1' if
10858         it compiled with an error other than the one expected.
10859
10860 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10861
10862         * compiler.csproj: Updated for Visual Studio .NET 2003.
10863         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10864         * compiler.sln: Updated for Visual Studio .NET 2003.
10865
10866 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10867
10868         * expression.cs: Fix bug #47234. We basically need to apply the
10869         rule that we prefer the conversion of null to a reference type
10870         when faced with a conversion to 'object' (csc behaviour).
10871
10872 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10873
10874         * statement.cs: Shorter form for foreach, eliminates
10875         a local variable. r=Martin.
10876
10877 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10878
10879         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10880         checks if we can use brtrue/brfalse to test for 0.
10881         * expression.cs: use the above in the test for using brtrue/brfalse.
10882         cleanup code a bit.
10883
10884 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10885
10886         * expression.cs: Rewrite string concat stuff. Benefits:
10887
10888         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10889         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10890         rather than a concat chain.
10891
10892         * typemanager.cs: Add lookups for more concat overloads.
10893
10894 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10895
10896         * expression.cs: Emit shorter il code for array init.
10897
10898         newarr
10899         dup
10900         // set 1
10901
10902         // set 2
10903
10904         newarr
10905         stloc.x
10906
10907         ldloc.x
10908         // set 1
10909
10910         ldloc.x
10911         // set 2
10912
10913 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10914
10915         * statement.cs: Before, two switch blocks would be merged if the
10916         total size of the blocks (end_item - begin_item + 1) was less than
10917         two times the combined sizes of the blocks.
10918
10919         Now, it will only merge if after the merge at least half of the
10920         slots are filled.
10921
10922         fixes 55885.
10923
10924 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10925
10926         * class.cs : csc build fix for GetMethods(). See bug #52503.
10927
10928 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10929
10930         * expression.cs: Make sure fp comparisons work with NaN.
10931         This fixes bug #54303. Mig approved this patch a long
10932         time ago, but we were not able to test b/c the runtime
10933         had a related bug.
10934
10935 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10936
10937         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10938
10939 2004-03-19  Martin Baulig  <martin@ximian.com>
10940
10941         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10942         error here and not in our caller.
10943
10944 2004-03-19  Martin Baulig  <martin@ximian.com>
10945
10946         * interface.cs: Completely killed this file.
10947         (Interface): We're now a TypeContainer and live in class.cs.
10948
10949         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10950         argument; we're now also called for interfaces.
10951         (TypeContainer.DefineMembers): Allow this method being called
10952         multiple times.
10953         (TypeContainer.GetMethods): New public method; formerly known as
10954         Interface.GetMethod().  This is used by PendingImplementation.
10955         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10956         it's now private and non-static.
10957         (Interface): Moved this here; it's now implemented similar to
10958         Class and Struct.
10959         (Method, Property, Event, Indexer): Added `bool is_interface'
10960         argument to their .ctor's.
10961         (MemberBase.IsInterface): New public field.
10962
10963         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10964         instances instead of InterfaceMethod, InterfaceProperty, etc.
10965         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10966         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10967
10968 2004-03-19  Martin Baulig  <martin@ximian.com>
10969
10970         * class.cs (MethodCore.IsDuplicateImplementation): New private
10971         method which does the CS0111 checking.
10972         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10973         Use IsDuplicateImplementation().
10974
10975 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10976
10977         * decl.cs (FindMemberToOverride): New method to find the correct
10978         method or property to override in the base class.
10979         * class.cs
10980             - Make Method/Property use the above method to find the
10981               version in the base class.
10982             - Remove the InheritableMemberSignatureCompare as it is now
10983               dead code.
10984
10985         This patch makes large code bases much faster to compile, as it is
10986         O(n) rather than O(n^2) to do this validation.
10987
10988         Also, it fixes bug 52458 which is that nested classes are not
10989         taken into account when finding the base class member.
10990
10991         Reviewed/Approved by Martin.
10992
10993 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10994
10995         * interface.cs: In all interface classes removed redundant
10996         member initialization.
10997
10998 2004-03-16  Martin Baulig  <martin@ximian.com>
10999
11000         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11001
11002 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11003
11004         * decl.cs (DefineTypeAndParents): New helper method to define a
11005         type's containers before the type itself is defined;  This is a
11006         bug exposed by the recent changes to Windows.Forms when an
11007         implemented interface was defined inside a class that had not been
11008         built yet.   
11009
11010         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11011
11012         (Check): Loop correctly to report errors modifiers
11013         (UNSAFE was not in the loop, since it was the same as TOP).
11014
11015         * interface.cs: Every interface member now takes a ModFlags,
11016         instead of a "is_new" bool, which we set on the base MemberCore. 
11017
11018         Every place where we called "UnsafeOk" in the interface, now we
11019         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11020         the unsafe settings from the member declaration instead of the
11021         container interface. 
11022
11023         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11024
11025         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11026         `set_indexer_name' to the pending bits (one per type).
11027
11028         We fixed a bug today that was picking the wrong method to
11029         override, since for properties the existing InterfaceMethod code
11030         basically ignored the method name.  Now we make sure that the
11031         method name is one of the valid indexer names.
11032
11033 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11034  
11035         * support.cs (SeekableStreamReader): Keep track of stream byte
11036         positions and don't mix them with character offsets to the buffer.
11037
11038         Patch from Gustavo Giráldez
11039
11040 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11041
11042         * interface.cs (InterfaceSetGetBase): Removed double member
11043         initialization, base class does it as well.
11044
11045 2004-03-13  Martin Baulig  <martin@ximian.com>
11046
11047         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11048         when compiling corlib.
11049
11050 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11051
11052         * convert.cs (ExplicitConversion): We were reporting an error on
11053         certain conversions (object_type source to a value type, when the
11054         expression was `null') before we had a chance to pass it through
11055         the user defined conversions.
11056
11057         * driver.cs: Replace / and \ in resource specifications to dots.
11058         Fixes 50752
11059
11060         * class.cs: Add check for duplicate operators.  Fixes 52477
11061
11062 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11065         that are in the middle of the statements, not only at the end.
11066         Fixes #54987
11067
11068         * class.cs (TypeContainer.AddField): No longer set the
11069         `HaveStaticConstructor' flag, now we call it
11070         `UserDefineStaticConstructor' to diferentiate the slightly
11071         semantic difference.
11072
11073         The situation is that we were not adding BeforeFieldInit (from
11074         Modifiers.TypeAttr) to classes that could have it.
11075         BeforeFieldInit should be set to classes that have no static
11076         constructor. 
11077
11078         See:
11079
11080         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11081
11082         And most importantly Zoltan's comment:
11083
11084         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11085
11086         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11087          before its static fields are used', i.e. initialization does not need
11088          to be triggered by the first access to the type. Setting this flag
11089          helps the JIT to compile better code, since it can run the static
11090          constructor at JIT time, and does not need to generate code to call it
11091          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11092          this flag for lots of classes like String. 
11093          
11094          csc sets this flag if the type does not have an explicit static 
11095          constructor. The reasoning seems to be that if there are only static
11096          initalizers for a type, and no static constructor, then the programmer
11097          does not care when this initialization happens, so beforefieldinit
11098          can be used.
11099          
11100          This bug prevents the AOT compiler from being usable, since it 
11101          generates so many calls to mono_runtime_class_init that the AOT code
11102          is much slower than the JITted code. The JITted code is faster, 
11103          because it does not generate these calls if the vtable is type is
11104          already initialized, which is true in the majority of cases. But the
11105          AOT compiler can't do this."
11106
11107 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11108
11109         * class.cs (MethodData.Emit): Refactor the code so symbolic
11110         information is generated for destructors;  For some reasons we
11111         were taking a code path that did not generate symbolic information
11112         before. 
11113
11114 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11115
11116         * class.cs: Create a Constructor.CheckBase method that
11117         takes care of all validation type code. The method
11118         contains some code that was moved from Define.
11119
11120         It also includes new code that checks for duplicate ctors.
11121         This fixes bug #55148.
11122
11123 2004-03-09  Joshua Tauberer <tauberer@for.net>
11124
11125         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11126         a { ... }-style array creation invokes EmitStaticInitializers
11127         which is not good for reference-type arrays.  String, decimal
11128         and now null constants (NullCast) are not counted toward
11129         static initializers.
11130
11131 2004-03-05  Martin Baulig  <martin@ximian.com>
11132
11133         * location.cs (SourceFile.HasLineDirective): New public field;
11134         specifies whether the file contains or is referenced by a "#line"
11135         directive.
11136         (Location.DefineSymbolDocuments): Ignore source files which
11137         either contain or are referenced by a "#line" directive.        
11138
11139 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11140
11141         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11142         direct access to our parent, so check the method inline there.
11143
11144 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11145
11146         * expression.cs (Invocation.EmitCall): Miguel's last commit
11147         caused a regression. If you had:
11148
11149             T t = null;
11150             t.Foo ();
11151
11152         In Foo the implict this would be null.
11153
11154 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11155
11156         * expression.cs (Invocation.EmitCall): If the method is not
11157         virtual, do not emit a CallVirt to it, use Call.
11158
11159         * typemanager.cs (GetFullNameSignature): Improve the method to
11160         cope with ".ctor" and replace it with the type name.
11161
11162         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11163         as an argument the ConstructorBuilder where it is being defined,
11164         to catch the recursive constructor invocations.
11165
11166 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11167
11168         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11169         routines to check if a type is an enumerable/enumerator allow
11170         classes that implement the IEnumerable or IEnumerator interfaces.
11171
11172         * class.cs (Property, Operator): Implement IIteratorContainer, and
11173         implement SetYields.
11174
11175         (Property.Define): Do the block swapping for get_methods in the
11176         context of iterators.   We need to check if Properties also
11177         include indexers or not.
11178
11179         (Operator): Assign the Block before invoking the
11180         OperatorMethod.Define, so we can trigger the Iterator code
11181         replacement. 
11182
11183         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11184         Property and Operator classes are not created when we parse the
11185         declarator but until we have the block completed, so we use a
11186         singleton SimpleIteratorContainer.Simple to flag whether the
11187         SetYields has been invoked.
11188
11189         We propagate this setting then to the Property or the Operator to
11190         allow the `yield' to function.
11191
11192 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11193
11194         * codegen.cs: Implemented attribute support for modules.
11195         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11196         Assembly/Module functionality.
11197
11198         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11199         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11200         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11201
11202 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11203
11204         * interface.cs (FindMembers): The operation is performed on all base
11205         interfaces and not only on the first. It is required for future CLS Compliance patch.
11206
11207 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11208
11209         * statement.cs, codegen.cs:
11210         This patch deals with patterns such as:
11211
11212         public class List : IEnumerable {
11213
11214                 public MyEnumerator GetEnumerator () {
11215                         return new MyEnumerator(this);
11216                 }
11217
11218                 IEnumerator IEnumerable.GetEnumerator () {
11219                         ...
11220                 }
11221                 
11222                 public struct MyEnumerator : IEnumerator {
11223                         ...
11224                 }
11225         }
11226
11227         Before, there were a few things we did wrong:
11228         1) we would emit callvirt on a struct, which is illegal
11229         2) we emited ldarg when we needed to emit ldarga
11230         3) we would mistakenly call the interface methods on an enumerator
11231         type that derived from IEnumerator and was in another assembly. For example:
11232
11233         public class MyEnumerator : IEnumerator
11234
11235         Would have the interface methods called, even if there were public impls of the
11236         method. In a struct, this lead to invalid IL code.
11237
11238 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11239
11240         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11241           renamed to Emit.
11242
11243         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11244
11245 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11246
11247         * cs-parser.jay: Fix small regression: we were not testing V2
11248         compiler features correctly.
11249
11250         * interface.cs: If the emit context is null, then create one
11251
11252 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11253
11254         * decl.cs (GetSignatureForError): New virtual method to get full name
11255           for error messages.
11256
11257         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11258           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11259
11260         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11261           Duplicated members and code in these classes has been removed.
11262           Better encapsulation in these classes.
11263
11264 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * assign.cs (Assign.DoResolve): When dealing with compound
11267         assignments, there is a new rule in ECMA C# 2.4 (might have been
11268         there before, but it is documented here) that states that in:
11269
11270         a op= b;
11271
11272         If b is of type int, and the `op' is a shift-operator, then the
11273         above is evaluated as:
11274
11275         a = (int) a op b 
11276
11277         * expression.cs (Binary.ResolveOperator): Instead of testing for
11278         int/uint/long/ulong, try to implicitly convert to any of those
11279         types and use that in pointer arithmetic.
11280
11281         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11282         method to print information for from the type, not from the
11283         null-method we were given.
11284
11285 2004-02-01  Duncan Mak  <duncan@ximian.com>
11286
11287         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11288         parsing for cmd, fixes bug #53694.
11289
11290 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11291
11292         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11293         in the member name duplication tests. Property and operator name duplication
11294         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11295
11296 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11297
11298         * interface.cs (PopulateMethod): Fixed crash when interface method
11299         returns not existing type (error test cs0246-3.cs).
11300
11301 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11302
11303         * cs-parser.jay (interface_accessors): Re-write actions to also
11304         store attributes attached to get and set methods. Fix spelling
11305         while at it.
11306
11307         (inteface_property_declaration): Modify accordingly.
11308
11309         (InterfaceAccessorInfo): New helper class to store information to pass
11310         around between rules that use interface_accessors.
11311
11312         * interface.cs (Emit): Apply attributes on the get and set
11313         accessors of properties and indexers too.
11314
11315         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11316         right MethodBuilder when applying attributes to the get and set accessors.
11317
11318 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11319
11320         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11321
11322 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11323
11324         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11325
11326 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11327
11328         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11329         changes that treat `yield' specially when present before `break'
11330         or `return' tokens.
11331
11332         * cs-tokenizer.cs: yield is no longer a keyword.
11333
11334 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11335
11336         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11337         setting for default constructors.
11338         For default constructors are almost every time set wrong Modifier. The
11339         generated IL code has been alright. But inside mcs this values was
11340         wrong and this was reason why several of my CLS Compliance tests
11341         failed.
11342
11343 2004-01-22  Martin Baulig  <martin@ximian.com>
11344
11345         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11346         not a QualifiedIdentifier.  This is what `type_name_expression'
11347         was previously doing.
11348         (type_name_expression): Removed; the code is now in
11349         `namespace_or_type_name'.
11350         (qualified_identifier): Removed, use `namespace_or_type_name'
11351         instead.
11352         (QualifiedIdentifier): Removed this class.      
11353
11354 2004-01-22  Martin Baulig  <martin@ximian.com>
11355
11356         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11357         not a string as alias name.
11358
11359 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11360
11361         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11362         #52730 bug, and instead compute correctly the need to use a
11363         temporary variable when requesting an address based on the
11364         static/instace modified of the field and the constructor.
11365  
11366 2004-01-21  Martin Baulig  <martin@ximian.com>
11367
11368         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11369         class and namespace before looking up aliases.  Fixes #52517.
11370
11371 2004-01-21  Martin Baulig  <martin@ximian.com>
11372
11373         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11374         assinged in a 'try'; fixes exception4.cs.
11375
11376 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11377         * class.cs : Implemented parameter-less constructor for TypeContainer
11378
11379         * decl.cs: Attributes are now stored here. New property OptAttributes
11380
11381         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11382
11383         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11384
11385 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11386
11387         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11388           (CSharpSignature): New method for indexer and property signature.
11389
11390 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11391
11392         * pending.cs (IsVirtualFilter): Faster implementation.
11393
11394 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11395
11396         * typemanager.cs: Avoid inclusion of same assembly more than once.
11397
11398 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11399
11400         * cs-parser.jay: Fixed problem where the last assembly attribute
11401           has been applied also to following declaration (class, struct, etc.)
11402           
11403 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11404
11405         * class.cs: Added error CS0538, CS0539 reporting.
11406         Fixed crash on Microsoft runtime when field type is void.
11407
11408         * cs-parser.jay: Added error CS0537 reporting.
11409
11410         * pending.cs: Added error CS0535 reporting.
11411         Improved error report for errors CS0536, CS0534.
11412
11413 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11414
11415         Merge a few bits from the Anonymous Method MCS tree.
11416
11417         * statement.cs (ToplevelBlock): New class for toplevel methods,
11418         will hold anonymous methods, lifted variables.
11419
11420         * cs-parser.jay: Create toplevel blocks for delegates and for
11421         regular blocks of code. 
11422
11423 2004-01-20  Martin Baulig  <martin@ximian.com>
11424
11425         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11426         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11427         and `NeedExplicitReturn'; added `IsLastStatement'.
11428         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11429         have a `ReturnLabel' or we're not unreachable.
11430
11431         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11432         child's reachability; don't just override ours with it.  Fixes
11433         #58058 (lluis's example).
11434         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11435         InFinally(), InLoop(), InSwitch() and
11436         BreakCrossesTryCatchBoundary() methods.
11437
11438         * statement.cs (Return): Do all error checking in Resolve().
11439         Unless we are the last statement in a top-level block, always
11440         create a return label and jump to it.
11441         (Break, Continue): Do all error checking in Resolve(); also make
11442         sure we aren't leaving a `finally'.
11443         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11444         statement in a top-level block.
11445         (Block.Flags): Added `IsDestructor'.
11446         (Block.IsDestructor): New public property.
11447
11448 2004-01-20  Martin Baulig  <martin@ximian.com>
11449
11450         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11451
11452 2004-01-20  Martin Baulig  <martin@ximian.com>
11453
11454         * statement.cs (Statement.ResolveUnreachable): New public method.
11455         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11456         (Block.Resolve): Resolve unreachable statements.
11457
11458 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11459
11460         * expression.cs: We need to fix the case where we do
11461         not have a temp variable here.
11462
11463         * assign.cs: Only expression compound assignments need
11464         temporary variables.
11465
11466 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11467
11468         * flowanalysis.cs: Reduce memory allocation in a few ways:
11469           - A block with no variables should not allocate a bit
11470             vector for itself.
11471           - A method with no out parameters does not need any tracking
11472             for assignment of the parameters, so we need not allocate
11473             any data for it.
11474           - The arrays:
11475                 public readonly Type[] VariableTypes;
11476                 public readonly string[] VariableNames;
11477             Are redundant. The data is already stored in the variable
11478             map, so we need not allocate another array for it.
11479           - We need to add alot of checks for if (params | locals) == null
11480             due to the first two changes.
11481
11482 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11483
11484         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11485         implement IMemoryLocation, we store a copy on a local variable and
11486         take the address of it.  Patch from Benjamin Jemlich
11487
11488         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11489         to use a special "type_name_expression" rule which reduces the
11490         number of "QualifiedIdentifier" classes created, and instead
11491         directly creates MemberAccess expressions.
11492
11493 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11494
11495         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11496         that fixes #52853.  Null literal assignment to ValueType
11497
11498         * class.cs (MethodData.Emit): Instead of checking the name of the
11499         method to determine if its a destructor, create a new derived
11500         class from Method called Destructor, and test for that.  
11501
11502         * cs-parser.jay: Create a Destructor object instead of a Method.  
11503
11504         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11505
11506         Fixes: 52933
11507
11508 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * expression.cs (Binary.ResolveOperator): Perform an implicit
11511         conversion from MethodGroups to their delegate types on the
11512         Addition operation.
11513
11514         * delegate.cs: Introduce a new class DelegateCreation that is the
11515         base class for `NewDelegate' and `ImplicitDelegateCreation',
11516         factor some code in here.
11517
11518         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11519         conversion from MethodGroups to compatible delegate types. 
11520
11521         * ecore.cs (Expression.Resolve): Do not flag error 654
11522         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11523         we allow conversions from MethodGroups to delegate types now.
11524
11525         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11526         assignments in v2 either.
11527
11528 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11531         static read-only fields in ctors.
11532
11533         Applied patch from Benjamin Jemlich 
11534
11535         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11536
11537 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11538
11539         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11540         here to return true, as they can be used like this:
11541
11542                 (XXX) int.MEMBER ()
11543
11544         Fixed 49836 and all the other dups
11545
11546 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11547
11548         * driver.cs: Implement /win32res and /win32icon.
11549
11550 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11551
11552         * cs-parser.jay: Add a rule to improve error handling for the
11553         common mistake of placing modifiers after the type.
11554
11555 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11556
11557         * cs-parser.jay (interface_event_declaration): Catch
11558         initialization of events on interfaces, and report cs0068
11559
11560         * cs-parser.jay (interface_event_declaration): Catch
11561         initialization of events. 
11562
11563         * ecore.cs: Better report missing constructors.
11564
11565         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11566         the error reporting done in the wrong place.  Fix.
11567
11568         * expression.cs (Binary.ResolveOperator): Catch the 
11569         operator + (E x, E y) error earlier, and later allow for implicit
11570         conversions in operator +/- (E e, U x) from U to the underlying
11571         type of E.
11572
11573         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11574         52596, if the container class is abstract, the default constructor
11575         is protected otherwise its public (before, we were always public).
11576
11577         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11578         fixed statement.
11579
11580         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11581         Jemlich that fixes bug #52597, MCS was generating invalid code for
11582         idisposable structs.   Thanks to Ben for following up with this
11583         bug as well.
11584
11585 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11586
11587         * driver.cs: Allow assemblies without code to be generated, fixes
11588         52230.
11589
11590 2004-01-07  Nick Drochak <ndrochak@gol.com>
11591
11592         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11593
11594 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11595
11596         * cs-parser.jay: Add rules to improve error reporting if fields or
11597         methods are declared at the namespace level (error 116)
11598
11599         * Add rules to catch event add/remove
11600
11601 2004-01-04  David Sheldon <dave-mono@earth.li>
11602
11603   * expression.cs: Added matching ")" to error message for 
11604   CS0077
11605
11606 2004-01-03 Todd Berman <tberman@gentoo.org>
11607
11608         * ecore.cs, attribute.cs:
11609         Applying fix from #52429.
11610
11611 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11612
11613         * ecore.cs, expression.cs, statement.cs:
11614         Total rewrite of how we handle branching. We
11615         now handle complex boolean expressions with fewer
11616         jumps. As well if (x == 0) no longer emits a ceq.
11617
11618         if (x is Foo) is much faster now, because we generate
11619         better code.
11620
11621         Overall, we get a pretty big improvement on our benchmark
11622         tests. The code we generate is smaller and more readable.
11623
11624         I did a full two-stage bootstrap. The patch was reviewed
11625         by Martin and Miguel.
11626
11627 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11628
11629         * cs-parser.jay: Make primary_expression not take a QI.
11630         we dont need this because the member_access rule covers
11631         us here. So we replace the rule with just IDENTIFIER.
11632
11633         This has two good effects. First, we remove a s/r conflict.
11634         Second, we allocate many fewer QualifiedIdentifier objects.
11635
11636 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11637
11638         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11639         set the correct information via SRE. This prevents
11640         hanging on the MS runtime. Fixes #29374.
11641
11642 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11643
11644         * convert.cs: correctly handle conversions to value types
11645         from Enum and ValueType as unboxing conversions.
11646
11647         Fixes bug #52569. Patch by Benjamin Jemlich.
11648
11649 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11650
11651         * expression.cs (BetterConversion): Prefer int -> uint
11652         over int -> ulong (csc's behaviour). This fixed bug #52046.
11653
11654 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11655
11656         * decl.cs (MemberCache.FindMembers): now returns a
11657         MemberInfo [].
11658
11659         * typemanager.cs: In general, go with with ^^.
11660         (CopyNewMethods): take an IList.
11661         (RealMemberLookup): Only allocate an arraylist
11662         if we copy from two sets of methods.
11663
11664         This change basically does two things:
11665         1) Fewer array lists allocated due to CopyNewMethods.
11666         2) the explicit cast in MemberList costed ALOT.
11667
11668 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11669
11670         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11671         a hashtable to avoid needless string allocations when an identifier is
11672         used more than once (the common case).
11673
11674 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11675
11676         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11677         is broken, it will not return anything. So, we
11678         have to use the information we have in mcs to
11679         do the task.
11680
11681         * typemanager.cs: Add a cache for GetInterfaces,
11682         since this will now be used more often (due to ^^)
11683
11684         (GetExplicitInterfaces) New method that gets the
11685         declared, not effective, interfaces on a type
11686         builder (eg, if you have interface IFoo, interface
11687         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11688         { IBar }.
11689
11690         This patch makes MCS able to bootstrap itself on
11691         Windows again.
11692
11693 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11694
11695         * expression.cs: Remove the Nop's that Miguel put
11696         in by mistake.
11697
11698 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11699
11700         * report.cs, codegen.cs: Give the real stack trace to
11701         the error when an exception is thrown.
11702
11703 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11704
11705         * decl.cs: only allocate hashtables for ifaces if 
11706         it is an iface!
11707
11708 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11709
11710         * expression.cs: fix the error from cs0121-2.cs
11711         (a parent interface has two child interfaces that
11712         have a function with the same name and 0 params
11713         and the function is called through the parent).
11714
11715 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11716
11717         * class.cs, rootcontext.cs, typmanager.cs: do not
11718         leak pointers.
11719
11720 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11721
11722         * codegen.cs: remove stack for the ec flow branching.
11723         It is already a linked list, so no need.
11724
11725 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11726
11727         * Makefile: Allow custom profiler here.
11728
11729 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11730
11731         * typemanager.cs (LookupType):
11732           - Use a static char [], because split takes
11733             a param array for args, so it was allocating
11734             every time.
11735           - Do not store true in a hashtable, it boxes.
11736
11737 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11738
11739         * flowanalysis.cs: bytify common enums.
11740
11741 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11742
11743         * modifiers.cs: Add a new set of flags for the
11744         flags allowed on explicit interface impls.
11745         * cs-parser.jay: catch the use of modifiers in
11746         interfaces correctly.
11747         * class.cs: catch private void IFoo.Blah ().
11748
11749         All related to bug #50572.
11750
11751 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11752
11753         * decl.cs: Rewrite the consistant accessability checking.
11754         Accessability is not linear, it must be implemented in
11755         a tableish way. Fixes #49704.
11756
11757 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11758
11759         * expression.cs: Handle negation in a checked context.
11760         We must use subtraction from zero. Fixes #38674.
11761
11762 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11763
11764         * class.cs: Ignore static void main in DLLs.
11765         * rootcontext.cs: Handle the target type here,
11766         since we are have to access it from class.cs
11767         * driver.cs: account for the above.
11768
11769 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11770
11771         * report.cs: Give line numbers and files if available.
11772
11773 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11774
11775         * driver.cs: Implement /addmodule.
11776
11777         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11778         ModuleBuilders.
11779
11780 2003-12-20  Martin Baulig  <martin@ximian.com>
11781
11782         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11783         (FieldBase.IsAssigned): Removed this field.
11784         (FieldBase.SetAssigned): New public method.
11785         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11786
11787 2003-12-20  Martin Baulig  <martin@ximian.com>
11788
11789         * expression.cs (LocalVariableReference.DoResolve): Don't set
11790         `vi.Used' if we're called from DoResolveLValue().
11791
11792         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11793         returns the usage vector it just merged into the current one -
11794         pass this one to UsageWarning().
11795         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11796         of the `EmitContext', don't call this recursively on our children.
11797
11798 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11799
11800         * driver.cs: Implement /target:module.
11801
11802 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11803
11804         * support.cs (CharArrayHashtable): New helper class.
11805
11806         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11807         char arrays, not strings, so we can avoid creating a string in
11808         consume_identifier if the identifier is a keyword.
11809
11810 2003-12-16  Martin Baulig  <martin@ximian.com>
11811
11812         * statement.cs (LocalInfo.Assigned): Removed this property.
11813         (LocalInfo.Flags): Removed `Assigned'.
11814         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11815         and uses flow analysis.
11816         (Block.UsageWarning): Made this method private.
11817         (Block.Resolve): Call UsageWarning() if appropriate.
11818
11819         * expression.cs (LocalVariableReference.DoResolve): Always set
11820         LocalInfo.Used here.
11821
11822 2003-12-13  Martin Baulig  <martin@ximian.com>
11823
11824         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11825         any value here; we're now using flow analysis to figure out
11826         whether a statement/block returns a value.
11827
11828 2003-12-13  Martin Baulig  <martin@ximian.com>
11829
11830         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11831         working again.
11832         (FlowBranching.MergeFinally): Don't call
11833         `branching.CheckOutParameters()' here, this is called in
11834         MergeTopBlock().
11835         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11836         when adding the `finally' vector.       
11837
11838 2003-12-13  Martin Baulig  <martin@ximian.com>
11839
11840         * flowanalysis.cs
11841         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11842         actually work and also fix #48962.
11843
11844 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11845
11846         * decl.cs: Do not check System.Object for nested types,
11847         since we know it does not have any. Big bang for buck:
11848
11849         BEFORE:
11850            Run 1:   8.35 seconds
11851            Run 2:   8.32 seconds
11852            corlib:  17.99 seconds
11853         AFTER:
11854            Run 1:   8.17 seconds
11855            Run 2:   8.17 seconds
11856            corlib:  17.39 seconds
11857
11858 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11859
11860         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11861         time we are returning 0 members, so we save alot here.
11862
11863 2003-12-11  Martin Baulig  <martin@ximian.com>
11864
11865         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11866         `MergeChild()', also just take the `FlowBranching' as argument;
11867         call Merge() on it and return the result.
11868         (FlowBranching.Merge): We don't need to do anything if we just
11869         have one sibling.
11870
11871 2003-12-11  Martin Baulig  <martin@ximian.com>
11872
11873         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11874         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11875         Maurer for this idea.
11876
11877 2003-12-11  Martin Baulig  <martin@ximian.com>
11878
11879         * flowanalysis.cs (MergeResult): This class is now gone; we now
11880         use the `UsageVector' for this.  The reason for this is that if a
11881         branching just has one sibling, we don't need to "merge" them at
11882         all - that's the next step to do.
11883         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11884         `MergeResult'.
11885
11886 2003-12-11  Martin Baulig  <martin@ximian.com>
11887
11888         Reworked flow analyis and made it more precise and bug-free.  The
11889         most important change is that we're now using a special `Reachability'
11890         class instead of having "magic" meanings of `FlowReturns'.  I'll
11891         do some more cleanups and optimizations and also add some more
11892         documentation this week.
11893
11894         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11895         largely reworked this class.
11896         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11897         the new `Reachability' class instead of having "magic" values here.
11898         (FlowBranching): We're now using an instance of `Reachability'
11899         instead of having separate `Returns', `Breaks' etc. fields.
11900
11901         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11902         based on flow analysis; ignore the return value of block.Emit ().
11903
11904 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11905
11906         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11907         if they are private.
11908
11909 2003-12-09  Martin Baulig  <martin@ximian.com>
11910
11911         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11912         call them directly on the UsageVector.
11913
11914 2003-12-09  Martin Baulig  <martin@ximian.com>
11915
11916         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11917         Changed return type from `FlowReturns' to `Reachability'.
11918
11919 2003-12-09  Martin Baulig  <martin@ximian.com>
11920
11921         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11922         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11923         `Reachable' fields with a single `Reachability' one.
11924
11925 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11926
11927         * class.cs (FindMembers): Remove foreach's.
11928
11929         Bootstrap times:
11930
11931         BEFORE
11932                 Run 1:   8.74 seconds
11933                 Run 2:   8.71 seconds
11934
11935         AFTER
11936                 Run 1:   8.64 seconds
11937                 Run 2:   8.58 seconds
11938
11939
11940 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11941
11942         * cs-parser.jay:
11943         * gen-treedump.cs:
11944         * statement.cs:
11945         This patch does a few things:
11946                 1. EmptyStatement is now a singleton, so it is never reallocated.
11947                 2. All blah is EmptyStatement constructs have been changed to
11948                    blah == EmptyStatement.Value, which is much faster and valid
11949                    now that EmptyStatement is a singleton.
11950                 3. When resolving a block, rather than allocating a new array for
11951                    the non-empty statements, empty statements are replaced with
11952                    EmptyStatement.Value
11953                 4. Some recursive functions have been made non-recursive.
11954         Mainly the performance impact is from (3), however (1) and (2) are needed for
11955         this to work. (4) does not make a big difference in normal situations, however
11956         it makes the profile look saner.
11957
11958         Bootstrap times:
11959
11960         BEFORE
11961         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11962         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11963         Total memory allocated: 56397 KB
11964
11965         AFTER
11966         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11967         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11968         Total memory allocated: 55666 KB
11969
11970 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11971
11972         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11973         than the hashtable in a hashtable version
11974
11975         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11976         we always end up concating a string. This results in a huge perf
11977         loss, because many strings have to be tracked by the GC. In this
11978         patch, we first use a hashtable that works with two keys, so that
11979         the strings do not need to be concat'ed.
11980
11981         Bootstrap times:
11982         BEFORE
11983                 Run 1:   8.74 seconds
11984                 Run 2:   8.71 seconds
11985
11986         AFTER
11987                 Run 1:   8.65 seconds
11988                 Run 2:   8.56 seconds
11989
11990 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11991
11992         * Makefile: Add a new target `do-time' that does a quick and simple
11993         profile, leaving easy to parse output.
11994
11995 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11996
11997         * codegen.cs (Init): Create the dynamic assembly with 
11998         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11999
12000 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12001
12002         * support.cs: Make the PtrHashtable use only one
12003         instance of its comparer.
12004
12005 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12006
12007         * typemanager.cs: Fix lookup of GetNamespaces.
12008
12009 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12010
12011         * expression.cs: Removed redundant line.
12012
12013         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12014         ArrayLists, use for loops with bounds.  
12015
12016         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12017         arraylist.
12018
12019         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12020         arraylists, use for loop with bounds.
12021
12022         The above three changes give us a 0.071 second performance
12023         improvement out of 3.294 seconds down to 3.223.  On my machine
12024         the above changes reduced the memory usage by 1,387 KB during
12025         compiler bootstrap.
12026
12027         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12028         QualifiedIdentifiers.  Before we created a new string through
12029         concatenation, and mostly later on, the result would be
12030         manipulated by DecomposeQI through string manipulation.
12031
12032         This reduced the compiler memory usage for bootstrapping from
12033         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12034         compile times in 0.05 seconds.
12035
12036 2003-11-28  Dick Porter  <dick@ximian.com>
12037
12038         * support.cs: Do string compares with the Invariant culture.
12039
12040         * rootcontext.cs: 
12041         * gen-treedump.cs: 
12042         * expression.cs: 
12043         * driver.cs: 
12044         * decl.cs: 
12045         * codegen.cs: 
12046         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12047         the comparison is done with the Invariant culture.
12048
12049 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12052         GetEnumerator method.
12053
12054         (ProbeCollectionType): Iterate starting at the most specific type
12055         upwards looking for a GetEnumerator
12056
12057         * expression.cs: Shift count can be up to 31 for int/uint and 63
12058         for long/ulong.
12059
12060 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12061
12062         * statement.cs (Block.LookupLabel): Also look for the label on the
12063         children blocks.  Use a hash table to keep track of visited
12064         nodes. 
12065
12066         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12067         we actually did transform the other operand, otherwise fall back
12068         to the common codepath that casts to long.
12069
12070         * cs-tokenizer.cs: Use the same code pattern as the int case.
12071         Maybe I should do the parsing myself, and avoid depending on the
12072         Parse routines to get this done.
12073
12074 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12075
12076         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12077         which fixes bug 51347.  This time test it.
12078
12079         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12080         attributes for example can not tell the difference between these.
12081         The difference was only a syntax feature of the language. 
12082
12083         * attribute.cs: Apply attributes to delegates.
12084
12085         * delegate.cs: Call the apply attributes method.
12086
12087 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12090         comparing 0 vs Byte.MinValue, not the value
12091
12092         (ImplicitConversionRequired): When reporting a conversion error,
12093         use error 31 to print out the constant error instead of the
12094         simpler 29.
12095
12096         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12097         which fixes bug 51347.
12098
12099 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12100
12101         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12102         which fixes the -warnaserror command line option.
12103
12104 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12105
12106         * cfold.cs (DoNumericPromotions): During constant folding of
12107         additions on UIntConstant, special case intconstants with
12108         IntConstants like we do on the expression binary operator. 
12109
12110 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * convert.cs (ImplicitReferenceConversion): We were missing a case
12113         (System.Enum are not value types or class types, so we need to
12114         classify them separatedly).
12115
12116         * driver.cs: We do not support error 2007.
12117
12118 2003-11-12 Jackson Harper <jackson@ximian.com>
12119
12120         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12121         system directory. Also use the full file name so users can
12122         libraries names mscorlib-o-tron.dll in a non system dir.
12123
12124 2003-11-10  Martin Baulig  <martin@ximian.com>
12125
12126         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12127         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12128         calling `ResolveType()' on them, directly assign their `Type'.
12129
12130 2003-11-08  Martin Baulig  <martin@ximian.com>
12131
12132         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12133         return value and the `out parent' parameter.
12134         (TypeContainer.DefineType): Moved the CS0644 check into
12135         GetClassBases().  Don't pass the interface types to the
12136         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12137         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12138
12139         * ecore.cs (TypeExpr.IsAttribute): New property.
12140         (TypeExpr.GetInterfaces): New method.
12141
12142         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12143         TypeExpr instead of a Type.
12144         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12145         (Interface.DefineType): Don't pass the interface types to the
12146         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12147         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12148
12149         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12150         instead of a `Type[]'.
12151         (TypeManager.RegisterBuilder): Likewise.
12152         (TypeManager.AddUserInterface): Likewise.
12153         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12154         `Type[]' and also return a `TypeExpr[]'.
12155         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12156
12157 2003-11-08  Martin Baulig  <martin@ximian.com>
12158
12159         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12160         Expression.     
12161
12162 2003-11-08  Martin Baulig  <martin@ximian.com>
12163
12164         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12165         TypeManager.ResolveExpressionTypes().
12166
12167         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12168         instead of an Expression.
12169         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12170         (TypeExpression): New public class; formerly known as `TypeExpr'.
12171
12172         * expression.cs (ComposedCast): Derive from TypeExpr.
12173
12174         * typemanager.cs (TypeManager.system_*_expr): These are now
12175         TypExpr's instead of Expression's.
12176         (TypeManager.ResolveExpressionTypes): New public static function;
12177         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12178         of them.        
12179
12180 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * expression.cs (New.DoResolve): Do not dereference value that
12183         might be a null return.
12184
12185         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12186         sure that the constant value has the right type.  Fixes an
12187         unreported bug, similar to 50425.
12188
12189         * const.cs (Const.LookupConstantValue): Call
12190         ImplicitStandardConversionExists before doing a conversion to
12191         avoid havng the TypeManager.ChangeType do conversions.
12192
12193         Reduced the number of casts used
12194
12195         (Const.ChangeType): New routine to enable reuse of the constant
12196         type changing code from statement.
12197
12198         * typemanager.cs (ChangeType): Move common initialization to
12199         static global variables.
12200
12201         Fixes #50425.
12202
12203         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12204         every value type to go through, even if it was void.  Fix that. 
12205
12206         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12207         character of the define, and the is_identifier_part_character for
12208         the rest of the string.
12209
12210 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12211
12212         * expression.cs (UnaryMutator.EmitCode): When I updated
12213         LocalVariableReference.DoResolve, I overdid it, and dropped an
12214         optimization done on local variable references.
12215
12216 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * ecore.cs: Convert the return from Ldlen into an int.
12219
12220 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12223         the accessibility, this is a special case for toplevel non-public
12224         classes (internal for instance).
12225
12226 2003-10-20  Nick Drochak <ndrochak@gol.com>
12227
12228         * ecore.cs: Fix typo and build.  Needed another right paren.
12229
12230 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12231
12232         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12233         `internal' case regular and protected, but not allowing protected
12234         to be evaluated later.  Bug 49840
12235
12236 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12237
12238         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12239         to kb.Nlast, and not the kb.nFirst to isolate the switch
12240         statement.
12241
12242         Extract the underlying type, so enumerations of long/ulong are
12243         treated like long/ulong.
12244
12245 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12246
12247         * expression.cs (New): Overload the meaning of RequestedType to
12248         track the possible creation of the NewDelegate type, since
12249         DoResolve is invoked more than once for new constructors on field
12250         initialization.
12251
12252         See bugs: #48800 and #37014
12253
12254         * cs-parser.jay (declare_local_constants): Take an arraylist
12255         instead of a single constant.
12256
12257         (local_constant_declaration): It should take a
12258         constant_declarators, not a constant_declarator.  Fixes 49487
12259
12260         * convert.cs: Fix error report.
12261
12262 2003-10-13 Jackson Harper <jackson@ximian.com>
12263
12264         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12265         bug #49611
12266
12267 2003-10-09  Martin Baulig  <martin@ximian.com>
12268
12269         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12270         to the .ctor.
12271         (MethodCore.DoDefineParameters): Removed the TypeContainer
12272         argument; use the DeclSpace which was passed to the .ctor instead.
12273         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12274         TypeContainer; we only need a DeclSpace here.
12275
12276 2003-10-09  Martin Baulig  <martin@ximian.com>
12277
12278         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12279         to the .ctor.
12280         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12281         EmitContext's .ctor.    
12282
12283 2003-10-09  Martin Baulig  <martin@ximian.com>
12284
12285         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12286         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12287         AsAccessible(), moved them as well.
12288
12289         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12290
12291 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12292
12293         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12294
12295 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12296
12297         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12298         generation for >=, as spotted by Paolo, bug 48679.  
12299         Patch from David Waite.
12300
12301         * cs-tokenizer.cs: Add handling for #pragma.
12302
12303         * cs-parser.jay: Allow for both yield and yield return in the
12304         syntax.  The anti-cobolization of C# fight will go on!
12305
12306         * class.cs (TypeBuilder.DefineType): Catch error condition here
12307         (Parent.DefineType erroring out and returning null).
12308
12309         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12310         coping with enumerations variables, we were mistakenly processing
12311         them as a regular value type instead of built-in types.  Fixes the
12312         bug #48063
12313
12314         * typemanager.cs (IsBuiltinOrEnum): New method.
12315
12316 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12317
12318         * cs-parser.jay: Upgrade: yield now needs the return clause.
12319
12320 2003-09-19  Martin Baulig  <martin@ximian.com>
12321
12322         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12323         `MemberCache parent' argument.  Normally, an interface doesn't
12324         have a parent type except System.Object, but we use this in gmcs
12325         for generic type parameters.
12326
12327 2003-09-18  Martin Baulig  <martin@ximian.com>
12328
12329         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12330         on `type.IsInterface'; don't check whether the type has a parent
12331         to determine whether it's an interface.
12332
12333 2003-09-15  Martin Baulig  <martin@ximian.com>
12334
12335         * class.cs (TypeContainer.DefineType): Added an error flag to
12336         avoid reporting duplicate CS0146's ("class definition is
12337         circular.").
12338
12339         * driver.cs (Driver.MainDriver): Abort if
12340         RootContext.ResolveTree() reported any errors.
12341
12342 2003-09-07  Martin Baulig  <martin@ximian.com>
12343
12344         * report.cs (Error, Warning): Added overloaded versions which take
12345         a `params object[] args' and call String.Format().
12346
12347 2003-09-07  Martin Baulig  <martin@ximian.com>
12348
12349         * decl.cs (DeclSpace..ctor): Don't call
12350         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12351         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12352         (DeclSpace.RecordDecl): New method.
12353
12354         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12355
12356 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12357
12358         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12359         value attributes to be applied to ParameterBuilders.
12360
12361         * class.cs (MethodCore.LabelParameters): Make static and more
12362         generic so that it can be used from other places - like interface
12363         methods, for instance.
12364
12365         * interface.cs (Interface.Emit): Call LabelParameters before
12366         emitting attributes on the InterfaceMethod.
12367
12368 2003-08-26  Martin Baulig  <martin@ximian.com>
12369
12370         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12371         resolving aliases; fixes #47927.
12372
12373 2003-08-26  Martin Baulig  <martin@ximian.com>
12374
12375         * statement.cs (Using.DoResolve): This is internally emitting a
12376         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12377         do not always return.  Fixes #47681.
12378
12379 2003-08-26  Martin Baulig  <martin@ximian.com>
12380
12381         * decl.cs (MemberCore): Moved WarningNotHiding(),
12382         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12383         into MemberBase.
12384         (AdditionResult): Make this nested in DeclSpace.
12385         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12386         argument; call NamespaceEntry.Define() unless we're nested in a
12387         class or struct.
12388
12389         * namespace.cs (Namespace.DefineName): New public function.  This
12390         is called from DeclSpace's .ctor to add 
12391         (Namespace.Lookup): Include DeclSpaces in the lookup.
12392
12393         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12394
12395         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12396
12397 2003-08-25  Martin Baulig  <martin@ximian.com>
12398
12399         * convert.cs (Convert.ExplicitReferenceConversion): When
12400         converting from an interface type to a class, unbox if the target
12401         type is a struct type.  Fixes #47822.
12402
12403 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12404
12405         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12406         #47854.
12407
12408 2003-08-22  Martin Baulig  <martin@ximian.com>
12409
12410         * class.cs (TypeManager.DefineType): When defining a nested type,
12411         call DefineType() on our parent; fixes #47801.
12412
12413 2003-08-22  Martin Baulig  <martin@ximian.com>
12414
12415         * class.cs (MethodData.Define): While checking if a method is an
12416         interface implementation, improve the test a bit more to fix #47654.
12417
12418 2003-08-22  Martin Baulig  <martin@ximian.com>
12419
12420         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12421         correctly; fixes #47722.
12422
12423 2003-08-22  Martin Baulig  <martin@ximian.com>
12424
12425         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12426         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12427
12428         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12429
12430 2003-08-22  Martin Baulig  <martin@ximian.com>
12431
12432         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12433         can only be assigned in static constructors.  Fixes #47161.
12434
12435 2003-08-22  Martin Baulig  <martin@ximian.com>
12436
12437         Rewrote and improved the flow analysis code.
12438
12439         * flowbranching.cs (FlowBranching): Make this class abstract.
12440         (FlowBranching.CreateBranching): New static function to create a
12441         new flow branching.
12442         (FlowBranchingBlock, FlowBranchingException): New classes.
12443         (FlowBranching.UsageVector.Type): New public readonly field.
12444         (FlowBranching.UsageVector.Breaks): Removed the setter.
12445         (FlowBranching.UsageVector.Returns): Removed the setter.
12446         (FlowBranching.UsageVector): Added Break(), Return(),
12447         NeverReachable() and Throw() methods to modify the reachability.
12448         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12449         done by FlowBranching.Merge().
12450         (FlowBranching.UsageVector.MergeChild): New method; merges the
12451         merge result into the current vector.
12452         (FlowBranching.Merge): New abstract method to merge a branching.
12453
12454 2003-08-12  Martin Baulig  <martin@ximian.com>
12455
12456         * expression.cs (Indirection.CacheTemporaries): Create the
12457         LocalTemporary with the pointer type, not its element type.
12458
12459 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12462         token was a keyword or not.
12463
12464         Add `error' options where an IDENTIFIER was expected;  Provide
12465         CheckToken and CheckIdentifierToken convenience error reporting
12466         functions. 
12467
12468         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12469
12470         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12471         NameSpaceEntry NameSpaceEntry.
12472
12473         (LookupInterfaceOrClass): Avoid creating a full qualified name
12474         from namespace and name: avoid doing lookups when we know the
12475         namespace is non-existant.   Use new Tree.LookupByNamespace which
12476         looks up DeclSpaces based on their namespace, name pair.
12477
12478         * driver.cs: Provide a new `parser verbose' to display the
12479         exception thrown during parsing.  This is turned off by default
12480         now, so the output of a failure from mcs is more graceful.
12481
12482         * namespace.cs: Track all the namespaces defined in a hashtable
12483         for quick lookup.
12484
12485         (IsNamespace): New method
12486
12487 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12488
12489         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12490         we know that we need to concatenate (full typename can never be
12491         null). 
12492
12493         * class.cs: ditto.
12494
12495         * statement.cs: Use a bitfield;  Do not initialize to null things
12496         which are done by the constructor by default.
12497
12498         * cs-parser.jay: bug fix, parameter was 4, not 3.
12499
12500         * expression.cs: Just use the property;
12501
12502         * statement.cs: No need for GetVariableInfo method.
12503
12504 2003-08-08  Martin Baulig  <martin@ximian.com>
12505
12506         * flowanalysis.cs (FlowReturns): This is now nested in the
12507         `FlowBranching' class.
12508         (MyBitVector): Moved this here from statement.cs.
12509         (FlowBranching.SiblingType): New enum type.
12510         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12511
12512 2003-08-07  Martin Baulig  <martin@ximian.com>
12513
12514         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12515         `FlowBranching' class and called `BranchingType'.
12516
12517 2003-08-07  Martin Baulig  <martin@ximian.com>
12518
12519         * flowanalysis.cs: Moved all the control flow analysis code into
12520         its own file.
12521
12522 2003-08-07  Martin Baulig  <martin@ximian.com>
12523
12524         * assign.cs (Assign.DoResolve): `target' must either be an
12525         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12526         #37319.
12527
12528 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * expression.cs (BinaryMethod): This kind of expression is created by the
12531         Binary class if it determines that the operator has to be handled
12532         by a method.
12533
12534         (BinaryDelegate): This kind of expression is created if we are
12535         dealing with a + or - operator on delegates.
12536
12537         (Binary): remove method, argumetns, and DelegateOperator: when
12538         dealing with methods, 
12539
12540         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12541
12542         * statement.cs (Block): use bitfields for the three extra booleans
12543         we had in use.   Remove unused topblock parameter.
12544
12545         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12546
12547         * assign.cs: Drop extra unneeded tests.
12548
12549 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12550
12551         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12552
12553         * statement.cs (Foreach): Use VariableStorage instead of
12554         LocalBuilders.   
12555
12556         * codegen.cs (VariableStorage): New class used by clients that
12557         require a variable stored: locals or fields for variables that
12558         need to live across yield.
12559
12560         Maybe provide a convenience api for EmitThis+EmitLoad?
12561
12562         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12563         these bad boys.
12564
12565 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12568         RemapParameterLValue): New methods that are used to turn a
12569         precomputed FieldInfo into an expression like this:
12570
12571                 instance.FieldInfo
12572
12573         The idea is to use this instead of making LocalVariableReference
12574         have more than one meaning.
12575
12576         * cs-parser.jay: Add error production to BASE.
12577
12578         * ecore.cs: Deal with TypeManager.GetField returning null, which
12579         is now a valid return value.
12580
12581         (FieldExprNoAddress): New expression for Fields whose address can
12582         not be taken.
12583
12584         * expression.cs (LocalVariableReference): During the resolve
12585         phases, create new expressions if we are in a remapping context.
12586         Remove code that dealt with remapping here.
12587
12588         (ParameterReference): same.
12589
12590         (ProxyInstance): New expression, like the `This' expression, but
12591         it is born fully resolved.  We know what we are doing, so remove
12592         the errors that are targeted to user-provided uses of `this'.
12593
12594         * statement.cs (Foreach): our variable is now stored as an
12595         Expression;  During resolution, follow the protocol, dont just
12596         assume it will return this.
12597
12598 2003-08-06  Martin Baulig  <martin@ximian.com>
12599
12600         * support.cs (SeekableStreamReader.cs): New public class.
12601
12602         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12603         SeekableStreamReader instead of the normal StreamReader.
12604
12605 2003-08-04  Martin Baulig  <martin@ximian.com>
12606
12607         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12608         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12609         deambiguate casts and delegate invocations.
12610         (parenthesized_expression): Use the new tokens to ensure this is
12611         not a cast of method invocation.
12612
12613         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12614         when reading a `)' and Deambiguate_CloseParens () was previously
12615         called.
12616
12617         * expression.cs (ParenthesizedExpression): New class.  This is
12618         just used for the CS0075 test.
12619         (Binary.DoResolve): Check for CS0075.   
12620
12621 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12622
12623         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12624         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12625         reference comparison.
12626
12627         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12628         examine the ReturnType for equality - this is necessary in the
12629         cases of implicit and explicit operators whose signature also
12630         includes the return type.
12631
12632 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12633
12634         * namespace.cs: Cache the result of the namespace computation,
12635         instead of computing it every time.
12636
12637 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * decl.cs: Use a global arraylist that we reuse over invocations
12640         to avoid excesive memory consumption.  Reduces memory usage on an
12641         mcs compile by one meg (45 average).
12642
12643         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12644         private, work around that.
12645
12646 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12647
12648         * literal.cs (IntLiteral): Define Zero and One static literals. 
12649
12650         * cs-parser.jay (integer_literal): use static literals to reduce
12651         memory usage for the most used literals (0, 1 and -1).  211kb
12652         reduced in memory usage.
12653
12654         Replace all calls to `new ArrayList' with `new
12655         ArrayList(4)' which is a good average number for most allocations,
12656         and also requires only 16 bytes of memory for its buffer by
12657         default. 
12658
12659         This reduced MCS memory usage in seven megabytes for the RSS after
12660         bootstrapping.
12661
12662 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12663
12664         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12665         handle params methods the correct way by forming only one
12666         applicable set with params and normal methods in them. Earlier we
12667         were looking at params methods only if we found no normal methods
12668         which was not the correct thing to do.
12669
12670         (Invocation.BetterFunction): Take separate arguments indicating
12671         when candidate and the best method are params methods in their
12672         expanded form.
12673
12674         This fixes bugs #43367 and #46199.
12675
12676         * attribute.cs: Documentation updates.
12677
12678         (CheckAttribute): Rename to CheckAttributeTarget.
12679         (GetValidPlaces): Rename to GetValidTargets.
12680
12681         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12682         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12683
12684         Fixes bug #44468.
12685
12686 2003-07-28  Martin Baulig  <martin@ximian.com>
12687
12688         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12689         name when looking up the base class of a nested class.  Fixes #46977.
12690
12691 2003-07-26  Martin Baulig  <martin@ximian.com>
12692
12693         * expression.cs (Indexers.Indexer): New nested struct; contains
12694         getter, setter and the indexer's type.
12695         (Indexers.Properties): This is now an ArrayList of
12696         Indexers.Indexer's.
12697         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12698         indexer doesn't have any getters.
12699
12700         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12701         for embedded property and indexer assignments.
12702
12703 2003-07-26  Martin Baulig  <martin@ximian.com>
12704
12705         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12706         preprocessor directive is not the first non-whitespace character
12707         on a line.
12708
12709 2003-07-26  Martin Baulig  <martin@ximian.com>
12710
12711         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12712         namespace parsing, follow the spec more closely.
12713
12714         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12715         NamespaceEntry.Lookup().
12716
12717 2003-07-25  Martin Baulig  <martin@ximian.com>
12718
12719         * MethodCore.cs (OverridesSomething): New public field; it's set
12720         from TypeContainer.DefineMembers if this method overrides
12721         something (which doesn't need to be a method).  Fix #39462.
12722
12723 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12724
12725         * typemanager.cs (GetMembers): Ensure that the list of members is
12726         reversed. This keeps things in sync.
12727
12728         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12729         find an AttributeUsage attribute.
12730
12731         * expression.cs (Invocation.OverloadResolve): Perform the check
12732         which disallows Invoke to be directly called on a Delegate.
12733
12734         (Error_InvokeOnDelegate): Report error cs1533.
12735
12736 2003-07-25  Martin Baulig  <martin@ximian.com>
12737
12738         * expression.cs (Indexers.GetIndexersForType): Only look in the
12739         interface hierarchy if the requested type is already an
12740         interface.  Fixes #46788 while keeping #46502 fixed.
12741
12742 2003-07-25  Martin Baulig  <martin@ximian.com>
12743
12744         * class.cs (TypeContainer.DefineMembers): Check whether all
12745         readonly fields have been assigned and report warning CS0649 if
12746         not.
12747
12748         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12749         a valuetype.
12750
12751 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12752
12753         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12754         returned from GetMethods to make things consistent with the
12755         assumptions MCS makes about ordering of methods.
12756
12757         This should comprehensively fix bug #45127 and it does :-)
12758
12759         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12760         ordering is actually reverse.
12761
12762         * Clean up some debug messages I left lying around.
12763
12764         * interface.cs (Populate*): Get rid of code which emits attributes
12765         since the stage in which we emit attributes is the 'Emit' stage,
12766         not the define stage.
12767
12768         (Emit): Move attribute emission for interface members here.
12769
12770 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12771
12772         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12773         closely: we eliminate methods in base types when we have an
12774         applicable method in a top-level type.
12775
12776         Please see section 14.5.5.1 for an exact description of what goes
12777         on. 
12778
12779         This fixes bug #45127 and a host of other related to corlib compilation.
12780
12781         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12782         array is the method corresponding to the top-level type (this is
12783         because of the changes made to icall.c) so we change this
12784         accordingly.
12785
12786         (MethodGroupExpr.Name): This too.
12787
12788         * typemanager.cs (GetElementType): New method which does the right
12789         thing when compiling corlib. 
12790
12791         * everywhere: Make use of the above in the relevant places.
12792
12793 2003-07-22  Martin Baulig  <martin@ximian.com>
12794
12795         * cs-parser.jay (invocation_expression): Moved
12796         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12797         `cast_expression', but create a InvocationOrCast which later
12798         resolves to either an Invocation or a Cast.
12799
12800         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12801         method; call this before EmitStatement() to make sure that this
12802         expression can be used as a statement.
12803
12804         * expression.cs (InvocationOrCast): New class; resolves to either
12805         an Invocation or a Cast.
12806
12807         * statement.cs (StatementExpression): Call ResolveStatement() on
12808         the ExpressionStatement before emitting it.
12809
12810 2003-07-21  Martin Baulig  <martin@ximian.com>
12811
12812         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12813         `ref' and `out' attributes match; fixes #46220.
12814         (MemberAccess.ResolveMemberAccess): You can't reference a type
12815         through an expression; fixes #33180.
12816         (Indexers.GetIndexersForType): Don't return the indexers from
12817         interfaces the class implements; fixes #46502.
12818
12819 2003-07-21  Martin Baulig  <martin@ximian.com>
12820
12821         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12822         CS0661 checks; fixes bug #30442.
12823
12824 2003-07-21  Martin Baulig  <martin@ximian.com>
12825
12826         * decl.cs (AdditionResult): Added `Error'.
12827
12828         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12829
12830         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12831         makes cs0031.cs actually work.
12832
12833 2003-07-20  Martin Baulig  <martin@ximian.com>
12834
12835         * namespace.cs: Fixed that bug which caused a crash when compiling
12836         the debugger's GUI.
12837
12838 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * typemanager.cs (LookupTypeReflection): Never expose types which
12841         are NotPublic, NestedPrivate, NestedAssembly, or
12842         NestedFamANDAssem.  We used to return these, and later do a check
12843         that would report a meaningful error, but the problem is that we
12844         would not get the real match, if there was a name override.
12845
12846 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12847
12848         * namespace.cs (Namespace, Name): Do not compute the namespace
12849         name dynamically, compute it in the constructor.  This reduced
12850         memory usage by 1697 KB.
12851
12852         * driver.cs: Use --pause to pause at the end.
12853
12854 2003-07-17  Peter Williams  <peter@newton.cx>
12855
12856         * Makefile: Change the name of the test target so that it doesn't
12857         conflict with the recursive test target.
12858
12859 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12862         AddressOf): Do not use EmitThis, that was wrong, use the actual
12863         this pointer.
12864
12865 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12866
12867         * class.cs (MethodData.Define): While checking if a method is an
12868         interface implementation, improve the test: If we are not public
12869         (use new test here: use the computed MethodAttributes directly,
12870         instead of the parsed modifier flags) check if the `implementing'
12871         method comes from an interface or not.
12872
12873         * pending.cs (VerifyPendingMethods): Slightly better error
12874         message.
12875
12876         * makefile: add test target that does the mcs bootstrap.
12877
12878 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12879
12880         * interface.cs (Define): Do nothing here since there are no
12881         members to populate etc. Move the attribute emission out of here
12882         since this was just totally the wrong place to put it. Attribute
12883         application happens during the 'Emit' phase, not in the 'Define'
12884         phase.
12885
12886         (Emit): Add this method and move the attribute emission here
12887
12888         * rootcontext.cs (EmitCode): Call the Emit method on interface
12889         types too.
12890
12891 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12892
12893         * expression.cs (OverloadResolve): Report error only if Location
12894         is not 'Null' which means that there was a probe going on.
12895
12896 2003-07-14  Martin Baulig  <martin@ximian.com>
12897
12898         * expression.cs (ConditionalLogicalOperator): New public class to
12899         implement user defined conditional logical operators.
12900         This is section 14.11.2 in the spec and bug #40505.
12901
12902 2003-07-14  Martin Baulig  <martin@ximian.com>
12903
12904         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12905
12906 2003-07-14  Martin Baulig  <martin@ximian.com>
12907
12908         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12909
12910         * ecore.cs (IVariable.VerifyFixed): New interface method.
12911
12912         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12913         operator, check whether the variable is actually fixed.  Fixes bug
12914         #36055.  Set a variable definitely assigned when taking its
12915         address as required by the spec.
12916
12917         * statement.cs (LocalInfo.IsFixed): New field.
12918         (LocalInfo.MakePinned): Set `IsFixed' to true.
12919
12920 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12921
12922         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12923         for .ctors, ensure that we only ask for members declared in the
12924         attribute type (BindingFlags.DeclaredOnly).
12925
12926         Fixes bug #43632.
12927
12928         * expression.cs (Error_WrongNumArguments): Report error 1501
12929         correctly the way CSC does.
12930
12931 2003-07-13  Martin Baulig  <martin@ximian.com>
12932
12933         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12934         lookup on the fully qualified name, to make things like "X.X" work
12935         where "X.X" is a fully qualified type name, but we also have a
12936         namespace "X" in the using list.  Fixes #41975.
12937
12938 2003-07-13  Martin Baulig  <martin@ximian.com>
12939
12940         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12941         function. If we're a CompoundAssign, we need to create an embedded
12942         CompoundAssign, not an embedded Assign.
12943         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12944         Fixes #45854.
12945
12946 2003-07-13  Martin Baulig  <martin@ximian.com>
12947
12948         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12949         work to fix bug #46088.
12950
12951 2003-07-13  Ravi Pratap <ravi@ximian.com>
12952
12953         * class.cs (Operator.Emit): Do not emit attributes here - it is
12954         taken care of by the Method class that we delegate too. This takes
12955         care of bug #45876.
12956
12957 2003-07-10  Martin Baulig  <martin@ximian.com>
12958
12959         * expression.cs (TypeOfVoid): New class.
12960         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12961
12962 2003-07-10  Martin Baulig  <martin@ximian.com>
12963
12964         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12965         bug #35957.
12966
12967 2003-07-10  Martin Baulig  <martin@ximian.com>
12968
12969         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12970         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12971
12972         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12973
12974         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12975
12976 2003-07-10  Martin Baulig  <martin@ximian.com>
12977
12978         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12979         of decimal.  Fixes #42850.
12980
12981         NOTE: I also fixed the created byte blob, but this doesn't work on
12982         the MS runtime and csc never produces any byte blobs for decimal
12983         arrays.
12984
12985 2003-07-10  Martin Baulig  <martin@ximian.com>
12986
12987         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12988         structs; fixes #32068.
12989         (Block.AddChildVariableNames): Fixed #44302.
12990
12991 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12992
12993         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12994
12995 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12996
12997         * attribute.cs: And this test is onger needed.
12998
12999 2003-07-08  Martin Baulig  <martin@ximian.com>
13000
13001         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13002         inaccessible types.  Fixes #36313.
13003
13004         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13005
13006         * namespace.cs (NamespaceEntry): Create implicit entries for all
13007         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13008         implicit entries for N1.N2 and N1.
13009
13010 2003-07-08  Martin Baulig  <martin@ximian.com>
13011
13012         Rewrote the handling of namespaces to fix a lot of the issues
13013         wrt. `using' aliases etc.
13014
13015         * namespace.cs (Namespace): Splitted this class into a
13016         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13017
13018         * typemanager.cs (TypeManager.IsNamespace): Removed.
13019         (TypeManager.ComputeNamespaces): Only compute namespaces from
13020         loaded assemblies here, not the namespaces from the assembly we're
13021         currently compiling.
13022
13023 2003-07-08  Martin Baulig  <martin@ximian.com>
13024
13025         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13026
13027 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13028
13029         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13030         already fixed it.  
13031
13032         I thought about the memory savings here, but LookupTypeReflection
13033         is used under already very constrained scenarios.  Compiling
13034         corlib or mcs only exposes one hit, so it would not really reduce
13035         any memory consumption.
13036
13037 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13038
13039         * typemanager.cs: fixes bug #45889 by only adding public types from
13040         other assemblies to the list of known types.
13041
13042 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13045         on the type we resolved.
13046
13047 2003-07-05  Martin Baulig  <martin@ximian.com>
13048
13049         * pending.cs (PendingImplementation.ParentImplements): Don't
13050         create the proxy if the parent is abstract.
13051
13052         * class.cs (TypeContainer.DefineIndexers): Process explicit
13053         interface implementations first.  Fixes #37714.
13054
13055 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13056
13057         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13058         defined recursively;  but since we modify the input parameters
13059         (left is set to `this' temporarily), we reset this value if the
13060         left_is_explicit is false, which gives the original semantics to
13061         the code.  
13062
13063         * literal.cs (NullPointer): new class used to represent a null
13064         literal in a pointer context.
13065
13066         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13067         type is a pointer, use a NullPointer object instead of a
13068         NullLiteral.   Closes 43687
13069
13070         (ExplicitConversion): Convert pointer values using
13071         the conv opcode to the proper type.
13072
13073         * ecore.cs (New): change ValueTypeVariable property into a method,
13074         that returns whether the valuetype is suitable for being used.
13075
13076         * expression.cs (Binary.DoNumericPromotions): Only return if we
13077         the int constant was a valid uint, and we can return both left and
13078         right as uints.  If not, we continue processing, to trigger the
13079         type conversion.  This fixes 39018.
13080
13081         * statement.cs (Block.EmitMeta): During constant resolution, set
13082         the CurrentBlock property on the emitcontext, so that we resolve
13083         constants propertly.
13084
13085 2003-07-02  Martin Baulig  <martin@ximian.com>
13086
13087         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13088         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13089
13090         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13091         than emitting it here.
13092
13093         * statement.cs: Fixed some more flow analysis bugs.
13094
13095 2003-07-02  Martin Baulig  <martin@ximian.com>
13096
13097         * class.cs (MethodData.Define): When implementing interface
13098         methods, set Final unless we're Virtual.
13099
13100         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13101         check work for interface methods.
13102
13103 2003-07-01  Martin Baulig  <martin@ximian.com>
13104
13105         * ecore.cs (EmitContext.This): Replaced this property with a
13106         GetThis() method which takes a Location argument.  This ensures
13107         that we get the correct error location for a CS0188.
13108
13109 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13112         ImplicitStandardConversion.
13113
13114         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13115
13116 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13117
13118         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13119         optimization.
13120
13121 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13122
13123         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13124         constructors.
13125
13126         (MethodData.Define): Turn off initlocals for unsafe methods.
13127
13128 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13129
13130         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13131         complete;  Fixes #37521.
13132
13133         * delegate.cs: Use Modifiers.TypeAttr to compute the
13134         TypeAttributes, instead of rolling our own.  This makes the flags
13135         correct for the delegates.
13136
13137 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13138
13139         * class.cs (Constructor.Define): Set the private flag for static
13140         constructors as well.
13141
13142         * cs-parser.jay (statement_expression): Set the return value to
13143         null, to avoid a crash when we catch an error.
13144
13145 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13146
13147         * cs-parser.jay: Applied patch from Jackson that adds support for
13148         extern and unsafe modifiers to destructor declarations.
13149
13150         * expression.cs: Report error 21 if the user is trying to index a
13151         System.Array.
13152
13153         * driver.cs: Add an error message, suggested by the bug report.
13154
13155         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13156         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13157
13158 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * namespace.cs: Add some information to reduce FAQs.
13161
13162 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13163
13164         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13165         underlying enumeration types.  Fixes #43915.
13166
13167         * expression.cs: Treat ushort/short as legal values to be used in
13168         bitwise operations.
13169
13170 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13171
13172         * delegate.cs: transfer custom attributes for paramenters from
13173         the delegate declaration to Invoke and BeginInvoke.
13174
13175 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13176
13177         * attribute.cs: handle custom marshalers and emit marshal info
13178         for fields, too.
13179
13180 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13181
13182         * makefile.gnu: Added anonymous.cs to the compiler sources.
13183
13184 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13185
13186         * iterators.cs: Change the name of the proxy class to include two
13187         underscores.
13188
13189         * cs-parser.jay: Update grammar to include anonymous methods.
13190
13191         * anonymous.cs: new file.
13192
13193 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13194
13195         * class.cs (Field.Define): Add missing test for pointers and
13196         safety. 
13197
13198 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13199
13200         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13201         we use the stobj opcode.
13202
13203         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13204         since it wasn't the correct fix. 
13205
13206         It still is puzzling that we are required to use stobj for IntPtr
13207         which seems to be a ValueType.
13208
13209 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13210
13211         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13212         during regular simple name resolution.   Now, the trick is that
13213         instead of returning for processing the simplename, we do a
13214         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13215         contextual lookup type).   If a match is found, return that, if
13216         not, return for further composition.
13217
13218         This fixes long-standing 30485.
13219
13220         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13221         using the address to initialize an object, do an Stobj instead of
13222         using the regular Stelem.
13223
13224         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13225         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13226         Because if we are a BaseIndexerAccess that value will be true.
13227         Fixes 43643.
13228
13229         * statement.cs (GotoCase.Resolve): Return after reporting an
13230         error, do not attempt to continue. 
13231
13232         * expression.cs (PointerArithmetic.Emit): If our operand is a
13233         long, convert our constants to match the operand before
13234         multiplying.  Convert to I type before adding.   Fixes 43670.
13235
13236 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13237
13238         * enum.cs (ImplicitConversionExists) : Rename to
13239         ImplicitEnumConversionExists to remove ambiguity. 
13240
13241         * ecore.cs (NullCast): New type of cast expression class which
13242         basically is very similar to EmptyCast with the difference being
13243         it still is a constant since it is used only to cast a null to
13244         something else
13245         (eg. (string) null)
13246
13247         * convert.cs (ImplicitReferenceConversion): When casting a null
13248         literal, we return a NullCast.
13249
13250         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13251         should be around anymore.
13252
13253         The renaming (reported was slightly wrong). Corrections:
13254
13255         ConvertImplicitStandard -> ImplicitConversionStandard
13256         ConvertExplicitStandard -> ExplicitConversionStandard
13257
13258         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13259         before passing them in !
13260
13261         * convert.cs (ImplicitConversionStandard): When comparing for
13262         equal expr and target types, ensure that expr is not a
13263         NullLiteral.
13264
13265         In general, we must not be checking (expr_type ==
13266         target_type) in the top level conversion methods
13267         (ImplicitConversion, ExplicitConversion etc). This checking is
13268         done in the methods that they delegate to.
13269
13270 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13271
13272         * convert.cs: Move Error_CannotConvertType,
13273         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13274         ImplicitNumericConversion, ImplicitConversionExists,
13275         ImplicitUserConversionExists, StandardConversionExists,
13276         FindMostEncompassedType, FindMostSpecificSource,
13277         FindMostSpecificTarget, ImplicitUserConversion,
13278         ExplicitUserConversion, GetConversionOperators,
13279         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13280         TryImplicitIntConversion, Error_CannotConvertImplicit,
13281         ConvertImplicitRequired, ConvertNumericExplicit,
13282         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13283         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13284         its own file.
13285
13286         Perform the following renames:
13287
13288         StandardConversionExists -> ImplicitStandardConversionExists
13289         ConvertImplicit -> ImplicitConversion
13290         ConvertImplicitStandard -> ImplicitStandardConversion
13291         TryImplicitIntConversion -> ImplicitIntConversion
13292         ConvertImplicitRequired -> ImplicitConversionRequired
13293         ConvertNumericExplicit -> ExplicitNumericConversion
13294         ConvertReferenceExplicit -> ExplicitReferenceConversion
13295         ConvertExplicit -> ExplicitConversion
13296         ConvertExplicitStandard -> ExplicitStandardConversion
13297
13298 2003-05-19  Martin Baulig  <martin@ximian.com>
13299
13300         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13301         (TypeInfo): Added support for structs having structs as fields.
13302
13303         * ecore.cs (FieldExpr): Implement IVariable.
13304         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13305         VariableInfo for the field.
13306
13307 2003-05-18  Martin Baulig  <martin@ximian.com>
13308
13309         * expression.cs (This.DoResolve): Report a CS0027 if we're
13310         emitting a field initializer.
13311
13312 2003-05-18  Martin Baulig  <martin@ximian.com>
13313
13314         * expression.cs (This.ResolveBase): New public function.
13315         (This.DoResolve): Check for CS0188.
13316
13317         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13318         This.Resolve().
13319
13320         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13321         `instance_expression' to null if we don't have any non-static
13322         methods.
13323
13324 2003-05-18  Martin Baulig  <martin@ximian.com>
13325
13326         Reworked the way how local variables and parameters are handled by
13327         the flow analysis code.
13328
13329         * statement.cs (TypeInfo, VariableMap): New public classes.
13330         (VariableInfo): New public class.  This is now responsible for
13331         checking whether a variable has been assigned.  It is used for
13332         parameters and local variables.
13333         (Block.EmitMeta): Take the InternalParameters as argument; compute
13334         the layout of the flow vectors here.
13335         (Block.LocalMap, Block.ParameterMap): New public properties.
13336         (FlowBranching): The .ctor doesn't get the InternalParameters
13337         anymore since Block.EmitMeta() now computes the layout of the flow
13338         vector.
13339         (MyStructInfo): This class is now known as `StructInfo' and nested
13340         in `TypeInfo'; we don't access this directly anymore.
13341
13342         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13343         property and removed IsAssigned(), IsFieldAssigned(),
13344         SetAssigned() and SetFieldAssigned(); we now call them on the
13345         VariableInfo so we don't need to duplicate this code everywhere.
13346
13347         * expression.cs (ParameterReference): Added `Block block' argument
13348         to the .ctor.
13349         (LocalVariableReference, ParameterReference, This): The new
13350         VariableInfo class is now responsible for all the definite
13351         assignment stuff.
13352
13353         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13354         IsParameterAssigned, SetParameterAssigned): Removed.
13355
13356 2003-05-18  Martin Baulig  <martin@ximian.com>
13357
13358         * typemanager.cs (InitCoreTypes): Try calling
13359         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13360         the 3-args-version.  Corlib now also needs our `void_type'.
13361         (GetMethod): Added overloaded version which takes an optional
13362         `bool report_errors' to allow lookups of optional methods.
13363
13364 2003-05-12  Martin Baulig  <martin@ximian.com>
13365
13366         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13367         only used for locals and not for parameters.
13368
13369 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13370
13371         * support.cs (InternalParameters.ParameterType): Return the
13372         ExternalType of the parameter.
13373
13374         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13375         they were unused.
13376
13377 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13378
13379         * class.cs (MethodData.Define): Do not set the `newslot' on
13380         interface members, if they are also flagged as "override".
13381
13382         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13383         better code for ++i and i++.  This only works for static fields
13384         and local variables.
13385
13386         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13387         want to pull the DeclSpace out of the builder_to_declspace instead
13388         of the TypeBuilder (like in TypeContainer.FindMembers).
13389
13390         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13391         instead of LookupTypeContainer.  Fixes the crash on .NET for
13392         looking up interface members.
13393
13394         * const.cs: Create our own emit context during the Definition
13395         stage, so that constants are evaluated in the proper context, when
13396         a recursive definition happens.
13397
13398 2003-05-11  Martin Baulig  <martin@ximian.com>
13399
13400         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13401         new block for a switch section.
13402         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13403         the adding/lookup in the switch block.  Fixes #39828.
13404
13405 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13406
13407         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13408         functionality: I needed to convert the data after I had performed
13409         the add/sub operation into the operands type size.
13410
13411         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13412         pass the type for the box operation, otherwise the resulting
13413         object would have been of type object.
13414
13415         (BoxedCast): Add constructor to specify the type to box as.
13416
13417 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13418
13419         * iterators.cs: I was reusing the `count' variable inadvertently,
13420         take steps to not allow this to happen.
13421
13422 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13423
13424         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13425         by creating an array at the point where the params starts and
13426         putting all those arguments there, then adjusting the size of the
13427         array.
13428
13429 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13430
13431         * expression.cs (New.AddressOf): Implement interface
13432         IMemoryLocation.  This is used when the `new' operator is used in
13433         the context of an invocation to a method on a value type.
13434
13435         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13436         example. 
13437
13438         * namespace.cs: Also check the using aliases here.
13439
13440         * driver.cs: Move the test for using validity after the types have
13441         been entered, so we do a single pass that also includes the using
13442         aliases. 
13443
13444         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13445         in the regular case.   CreateSiblingForFinally is doing extra
13446         error checking.
13447
13448         * attribute.cs (GetAttributeArgumentExpression): Store the result
13449         on an out value, and use the return value to indicate failure
13450         instead of using null (which is a valid return for Constant.GetValue).
13451
13452         * statement.cs: Perform the analysis flow for the increment
13453         portion after the statement, because this will be the real flow of
13454         execution.  Fixes #42385
13455
13456         * codegen.cs (EmitContext.EmitArgument,
13457         EmitContext.EmitStoreArgument): New helper functions when the
13458         RemapToProxy flag is set.
13459
13460         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13461         function.
13462
13463         Add support for remapping parameters. 
13464
13465         * iterators.cs: Propagate parameter values;  Store parameter
13466         values in the proxy classes.
13467
13468 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13469
13470         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13471         need a proxy reference;  I do not know what I was thinking
13472
13473         * cs-parser.jay (constructor_initializer): catch another error,
13474         and display nice message.
13475
13476         (field_declaration): catch void field declaration
13477         to flag a better error. 
13478
13479         * class.cs (MemberBase.CheckBase): Report an error instead of a
13480         warning if a new protected member is declared in a struct. 
13481         (Field.Define): catch the error of readonly/volatile.
13482
13483         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13484
13485         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13486         volatile variable is taken
13487
13488 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * statement.cs (Fixed.Resolve): Report an error if we are not in
13491         an unsafe context.
13492
13493 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13494
13495         * typemanager.cs: reuse the code that handles type clashes for
13496         delegates and enumerations.
13497
13498         * class.cs (Report28): Always report.
13499
13500         * expression.cs (EncodeAsAttribute): Allow nulls here.
13501
13502 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13503
13504         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13505         the functionality for testing whether an expression is valid for
13506         an attribute here.  Also handle the case of arrays of elements
13507         being stored. 
13508
13509         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13510         encoding a linear array into an array of objects that are suitable
13511         to be passed to an CustomAttributeBuilder.
13512
13513         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13514
13515         * ecore.cs: (FieldExpr): Handle field remapping here.
13516
13517         * iteratators.cs: Pass the instance variable (if the method is an
13518         instance method) to the constructors, so we can access the field
13519         variables on the class.
13520
13521         TODO: Test this with structs.  I think the THIS variable on
13522         structs might have to be a pointer, and not a refenrece
13523
13524 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13525
13526         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13527         local variables to fields in a proxy class.
13528
13529         * iterators.cs (PopulateProxy): Rename our internal fields to
13530         <XXX>.  
13531         Create a <THIS> field if we are an instance method, so we can
13532         reference our parent container variables.
13533         (MapVariable): Called back from the EmitContext code to enter a
13534         new variable to field mapping into the proxy class (we just create
13535         a FieldBuilder).
13536
13537         * expression.cs
13538         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13539         for using the remapped locals to fields.
13540
13541         I placed the code here, because that gives the same semantics to
13542         local variables, and only changes the Emit code.
13543
13544         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13545         statements inside iterators.
13546         (VariableInfo): Add a FieldBuilder for the cases when we are
13547         remapping local variables to fields in a proxy class
13548
13549         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13550         current_block != null.
13551
13552         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13553         not cope with strings, as it has been moved to the
13554         TableSwitchEmit.  Fixed bug in switch generation.
13555
13556         * expression.cs (New.DoResolve): Provide more context for the user
13557         when reporting an error.
13558
13559         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13560         pointers. 
13561
13562         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13563         check the permissions for it.  Note than in a type-resolution
13564         context the check was already present in DeclSpace.ResolveType,
13565         but was missing from the MemberAccess.
13566
13567         (ArrayCreation.CheckIndices): warn if the user has
13568         more nested levels of expressions, but there are no more
13569         dimensions specified.  Avoids crash on bug 41906.
13570
13571 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * statement.cs (Block): replace Implicit bool, for a generic
13574         flags.   
13575         New flag: `Unchecked'.  This is used during the EmitMeta phase
13576         (which is out-of-line with the regular Resolve/Emit process for a
13577         statement, as this is done ahead of time, but still gets a chance
13578         to call constant resolve).
13579
13580         (Block.Flags): new enum for adding a new flag.
13581
13582         (Block.EmitMeta): track the state of unchecked.
13583
13584         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13585         to enable constant resolution to work there as well.
13586
13587 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13588
13589         * typemanager.cs (ienumerable_type): Also look up
13590         System.Collections.IEnumerable. 
13591
13592 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13593
13594         TODO: Test more than one conditional per method.
13595
13596         * class.cs (Indexer.Define): Report the location where the user is
13597         referencing the unsupported feature.
13598
13599         (MethodData): Overload the use of `conditionals' to
13600         minimize the creation of needless ArrayLists.   This saves roughly
13601         212kb on my machine.
13602
13603         (Method): Implement the new IIteratorContainer interface.
13604         (Method.SetYields): Implement the method by setting the ModFlags
13605         to contain METHOD_YIELDS.
13606
13607         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13608         which just got set to null.
13609
13610         * iterators.cs: New file.
13611
13612         (Yield, YieldBreak): New statements.
13613
13614         * statement.cs (Return.Resolve): Flag an error if we are used in
13615         an iterator method.
13616
13617         * codegen.cs (InIterator): New flag set if the code is being
13618         compiled in an iterator method.
13619
13620         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13621         internal modifier, and we just use it to avoid adding extra
13622         fields, as this is seldom used.  
13623
13624         * cs-parser.jay: Add yield_statement (yield and yield break).
13625
13626         * driver.cs: New flag -v2 to turn on version 2 features. 
13627
13628         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13629         hashtable when v2 is enabled.
13630
13631 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13634         there is already a namespace defined with this name.
13635
13636         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13637         people upgraded their corlibs.
13638
13639         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13640         always use fully qualified types, no need to use the compiler
13641         front end.
13642
13643         (TypeManager.IsNamespace): Use binarysearch.
13644
13645         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13646         AddDelegate): I did not quite use the new IsValid API properly: I
13647         have to pass the short-name and the fullname.  I was passing only
13648         the basename instead of the fullname sometimes. 
13649
13650         (TypeContainer.DefineType): call NamespaceClash.
13651
13652         * interface.cs (Interface.DefineType): use NamespaceClash before
13653         defining the type.
13654
13655         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13656         defining the type.
13657
13658         * enum.cs: (Enum.DefineType): use NamespaceClash before
13659         defining the type.
13660
13661         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13662         speed increase.  First, use the negative_hits cache when we get a
13663         negative.  Second, add the type with its full original name
13664         instead of the new . and + encoded name (reflection uses + to
13665         separate type from a nested type).  Use LookupTypeReflection
13666         directly which bypasses the type->name hashtable (that we already
13667         know does not contain the type.
13668
13669         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13670         location/container type. 
13671
13672         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13673
13674 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13675
13676         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13677
13678         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13679         method is being referenced in the method group from a static
13680         context, and report error 120 if so.
13681
13682         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13683         Error118. 
13684
13685         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13686         is created, we create the A namespace).
13687
13688         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13689         Fixes #41591
13690
13691 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13692
13693         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13694         invocation to ModuleBuilder.GetType with the same values will
13695         return a new type instance, so we need to cache its return
13696         values. 
13697
13698         * expression.cs (Binary.ResolveOperator): Only allow the compare
13699         operators on enums if they are of the same type.
13700
13701         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13702         types of ValueType on their own case.  Before we were giving them
13703         the same treatment as objects.
13704
13705         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13706         fullname.  Short name is used to compare against container name.
13707         Fullname is used to check against defined namespace names.
13708
13709         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13710         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13711
13712         (Method.CheckBase): Call parent.
13713         (MemberBase.CheckBase): Check for protected members on sealed
13714         classes.
13715         (PropertyBase.CheckBase): Call parent.
13716         (Field.Define): Call parent.
13717
13718         * report.cs: Negative error codes are now mapped to 8000 - code,
13719         so that the display is render more nicely.
13720
13721         * typemanager.cs: Do not use try/catch, instead report a regular
13722         error. 
13723
13724         (GetPointerType, GetReferenceType): These methods provide
13725         mechanisms to obtain the T* and T& from a T.  We had the code
13726         previously scattered around the code base, and it also used
13727         TypeManager.LookupType that would go through plenty of caches.
13728         This one goes directly to the type source.
13729
13730         In some places we did the Type.GetType followed by
13731         ModuleBuilder.GetType, but not in others, so this unifies the
13732         processing as well.
13733
13734         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13735         statements now that we have namespace information.
13736
13737         * typemanager.cs (IsNamespace): New method, returns whether the
13738         string presented is a namespace or not.
13739
13740         (ComputeNamespaces): New public entry point, computes the list of
13741         available namespaces, using the GetNamespaces API call in Mono, or
13742         the slower version in MS.NET.   
13743
13744         Now before we start the semantic analysis phase, we have a
13745         complete list of namespaces including everything that the user has
13746         provided.
13747
13748         Deleted old code to cache namespaces in .nsc files.
13749
13750 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13751
13752         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13753         class/struct location definition Location for the implicit
13754         constructor location.
13755
13756         (Operator.Define): Use the location of the operator for the
13757         implicit Method definition.
13758
13759         (Constructor.Emit): use the constructor location for the implicit
13760         base initializer constructor.
13761
13762         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13763         and the Expression class now contains two new methods:
13764
13765         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13766         isolate type lookup from the rest of the resolution process.
13767
13768         Since we use Expressions to hold type definitions due to the way
13769         we parse the input we have historically overloaded Resolve to
13770         perform the Type lookups if a special flag is passed.  Now this is
13771         eliminated and two methods take their place. 
13772
13773         The differences in the two methods between xStep and xTerminal is
13774         that xStep is involved in our current lookup system that uses
13775         SimpleNames to compose a name, while xTerminal is used just to
13776         catch the case where the simplename lookup failed.
13777
13778 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13779
13780         * expression.cs (ResolveMemberAccess): Remove redundant code.
13781         TypeExpr expressions are always born fully resolved.
13782
13783         * interface.cs (PopulateMethod): Do not lookup the types twice.
13784         We were doing it once during SemanticAnalysis and once during
13785         PopulateMethod.
13786
13787         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13788         in local variable type definitions, were being returned as a
13789         SimpleName (we decomposed everything into a string), that is
13790         because primary_expression was being used instead of a type in the
13791         grammar (reduce/reduce conflicts).
13792
13793         The part that was wrong is that we converted the expression into a
13794         string (an oversimplification in one hand, compounded with primary
13795         expressions doing string concatenation).
13796
13797         So things like:
13798
13799         A.B.C [] x;
13800
13801         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13802         using clauses from working on this particular context.  And a type
13803         was being matched directly against "A.B.C[]".
13804
13805         We now use the correct approach, and allow for ComposedCast to be
13806         part of the unary expression.  So the "A.B.C []" become a composed
13807         cast of "A.B.C" (as a nested group of MemberAccess with a
13808         SimpleName at the end) plus the rank composition "[]". 
13809
13810         Also fixes 35567
13811
13812 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13813
13814         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13815         for the access level checking.
13816
13817         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13818         `TypeContainer container', because I kept getting confused when I
13819         was debugging this code.
13820
13821         * expression.cs (Indexers): Instead of tracking getters/setters,
13822         we now track them in parallel.  We create one arraylist less, but
13823         most importantly it is possible now for the LValue code to find a
13824         matching get for a set.
13825
13826         (IndexerAccess.DoResolveLValue): Update the code.
13827         GetIndexersForType has been modified already to extract all the
13828         indexers from a type.  The code assumed it did not.
13829
13830         Also make the code set the correct return type for the indexer.
13831         This was fixed a long time ago for properties, but was missing for
13832         indexers.  It used to be void_type.
13833
13834         (Binary.Emit): Test first for doubles instead of
13835         floats, as they are more common.
13836
13837         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13838         when dealing with floats and the <=, >= operators.  This fixes bug
13839         #39314 
13840
13841         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13842         to load the array value by emitting a load on the foreach variable
13843         type.  This was incorrect.  
13844
13845         We now emit the code to load an element using the the array
13846         variable type, and then we emit the conversion operator.
13847
13848         Fixed #40176
13849
13850 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13851
13852         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13853
13854 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13857         test for protection before we test for signatures. 
13858
13859         (MethodSignature.ToString): implement.
13860
13861         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13862         to the case where we reduced into a LongConstant.
13863
13864         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13865         depend on whether the information is acurrate, because the
13866         Microsoft runtime will always claim that the array type is public,
13867         regardless of the real state.
13868
13869         If the type is a pointer, another problem happens: the type is
13870         reported as non-public in Microsoft.  
13871
13872         In both cases we have to call CheckAccessLevel recursively with
13873         the underlying type as the argument to be tested.
13874
13875 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13876
13877         * assign.cs (Assign.Emit): If we are dealing with a compound
13878         assignment expression, we should use the code path that stores the
13879         intermediate result in a temporary value.  This fixes #40903.
13880
13881         *expression.cs (Indirection.ToString): Provide ToString method for
13882         debugging. 
13883
13884 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13885
13886         * class.cs: Null out fields holding references to Block objects so
13887         they can be garbage collected.
13888
13889         * expression.cs (OverloadResolve): Remove unused local.
13890
13891 2003-04-07  Martin Baulig  <martin@ximian.com>
13892
13893         * codegen.cs (EmitContext.CurrentFile): New public field.
13894         (EmitContext.Mark): Use the CurrentFile to check whether the
13895         location is in the correct file.
13896         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13897
13898 2003-04-07  Martin Baulig  <martin@ximian.com>
13899
13900         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13901
13902         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13903         location.  [FIXME: The location argument which gets passed to this
13904         method is sometimes wrong!]
13905
13906 2003-04-07  Nick Drochak <ndrochak@gol.com>
13907
13908         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13909
13910 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13911
13912         * expression.cs (Indirection.EmitAssign): We were using the
13913         temporary, but returning immediately instead of continuing the
13914         EmitAssing flow.
13915
13916 2003-04-06  Martin Baulig  <martin@ximian.com>
13917
13918         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13919         if it's a nested child, but also deriving from the outer class.
13920         See test 190.cs.
13921
13922         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13923         nested child, but also deriving from the outer class.  See
13924         test-190.cs.
13925         (FilterWithClosure): We may access private members of the outer
13926         class if we're a nested child and deriving from the outer class.
13927         (RealMemberLookup): Only set `closure_private_ok' if the
13928         `original_bf' contained BindingFlags.NonPublic.
13929
13930 2003-04-05  Martin Baulig  <martin@ximian.com>
13931
13932         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13933
13934 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13935
13936         * class.cs (Event.Define): Do not allow abstract events to have
13937         initializers. 
13938
13939 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13940
13941         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13942         block in event declarations.
13943
13944         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13945         value type, get its address.
13946
13947         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13948         leaving a class on the stack instead of a boolean value (int
13949         0/1).  Change the code so we compare against null, and then the
13950         result against zero.
13951
13952         * class.cs (TypeContainer.GetClassBases): We were checking for the
13953         parent class being sealed too late.
13954
13955         * expression.cs (Binary.Emit): For <= and >= when dealing with
13956         floating point values, use cgt.un and clt.un instead of cgt and
13957         clt alone.
13958
13959 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13960
13961         * statement.cs: Apply the same optimization as MS: skip the 
13962         GetEnumerator returning an IEnumerator, and use the one returning a 
13963         CharEnumerator instead. This allows us to avoid the try-finally block 
13964         and the boxing.
13965
13966 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13967
13968         * cs-parser.jay: Attributes cannot be applied to
13969                          namespaces. Fixes #40473
13970
13971 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13972
13973         * class.cs:
13974         (Add*): check if the name is valid using the full name for constants,
13975         fields, properties and events.
13976
13977 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13978
13979         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13980         char constants to be part of the enumeration.
13981
13982         * expression.cs (Conditional.DoResolve): Add support for operator
13983         true. Implements the missing functionality from 14.12
13984
13985         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13986         operator true/false as required by the spec.
13987
13988         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13989         implicit conversion to boolean.
13990
13991         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13992         also one where the type implements `operator true'. 
13993
13994         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13995         get an expression that will invoke operator true based on an
13996         expression.  
13997
13998         (GetConversionOperators): Removed the hack that called op_True
13999         here.  
14000
14001         (Expression.ResolveBoolean): Move this from Statement.
14002
14003 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14004
14005         * ecore.cs (FieldExpr): do not allow initialization of initonly
14006         fields on derived classes
14007
14008 2003-03-13  Martin Baulig  <martin@ximian.com>
14009
14010         * statement.cs (Block.Emit): Call ig.BeginScope() and
14011         ig.EndScope() when compiling with debugging info; call
14012         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14013
14014 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14015
14016         * expression.cs (Indexers): Do not construct immediately, allow
14017         for new members to be appended as we go.  Fixes 38143
14018
14019 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14020
14021         * expression.cs: save/restore context when resolving an unchecked
14022         expression.
14023
14024 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14025
14026         * cfold.cs: Catch division by zero in modulus operator during
14027         constant folding.
14028
14029 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14030
14031         * interface.cs (Interface.DefineMembers): Avoid defining members
14032         twice. 
14033
14034 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * driver.cs: handle the +/- options for -noconfig
14037
14038         * statement.cs (Unckeched.Resolve): Also track the state of
14039         unchecked in the Resolve phase.
14040
14041 2003-02-27  Martin Baulig  <martin@ximian.com>
14042
14043         * ecore.cs (Expression.MemberLookup): Don't create a
14044         MethodGroupExpr for something which is not a method.  Fixes #38291.
14045
14046 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * class.cs (MemberBase.CheckParameters): Also check that the type
14049         is unmanaged if it is a pointer.
14050
14051         * expression.cs (SizeOf.Resolve): Add location information.
14052
14053         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14054         a managed type is declared.
14055
14056         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14057         parameter modifiers as well.  Fixes bug 38606
14058
14059         * class.cs: Very sad.  Am backing out the speed up changes
14060         introduced by the ArrayList -> Array in the TypeContainer, as they
14061         were not actually that much faster, and introduced a bug (no error
14062         reports on duplicated methods).
14063
14064         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14065         source first, this will guarantee that we have a valid expression
14066         before calling in lower levels functions that will require a
14067         resolved object.  Then use this original_source in the
14068         target.ResolveLValue instead of the original source that was
14069         passed to us.
14070
14071         Another change.  Use target.Resolve instead of LValueResolve.
14072         Although we are resolving for LValues, we will let the Assign code
14073         take care of that (it will be called again from Resolve).  This
14074         basically allows code like this:
14075
14076         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14077         class Y { void A (X x) { x [0] += o; }
14078
14079         The problem was that the indexer was trying to resolve for
14080         set_Item (idx, object o) and never finding one.  The real set_Item
14081         was set_Item (idx, X).  By delaying the process we get the right
14082         semantics. 
14083
14084         Fixes bug 36505
14085
14086 2003-02-23  Martin Baulig  <martin@ximian.com>
14087
14088         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14089         while calling DoEmit ().
14090
14091         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14092         source files; if you use the #line directive inside a method, the
14093         compiler stops emitting line numbers for the debugger until it
14094         reaches the end of the method or another #line directive which
14095         restores the original file.
14096
14097 2003-02-23  Martin Baulig  <martin@ximian.com>
14098
14099         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14100
14101 2003-02-23  Martin Baulig  <martin@ximian.com>
14102
14103         * statement.cs (Block.AddChildVariableNames): We need to call this
14104         recursively, not just for our immediate children.
14105
14106 2003-02-23  Martin Baulig  <martin@ximian.com>
14107
14108         * class.cs (Event.Define): Always make the field private, like csc does.
14109
14110         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14111         actually work, fixes bug #37521.
14112
14113 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14114
14115         * delegate.cs: When creating the various temporary "Parameters"
14116         classes, make sure that we call the ComputeAndDefineParameterTypes
14117         on those new parameters (just like we do with the formal ones), to
14118         allow them to be resolved in the context of the DeclSpace.
14119
14120         This fixes the bug that Dick observed in Bugzilla #38530.
14121
14122 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14123
14124         * expression.cs (ResolveMemberAccess): When resolving a constant,
14125         do not attempt to pull a constant if the value was not able to
14126         generate a valid constant.
14127
14128         * const.cs (LookupConstantValue): Do not report more errors than required.
14129
14130 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14131
14132         * expression.cs: fixes bug #38328.
14133
14134 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14135
14136         * class.cs: Changed all the various members that can be part of a
14137         class from being an ArrayList to be an Array of the right type.
14138         During the DefineType type_list, interface_list, delegate_list and
14139         enum_list are turned into types, interfaces, delegates and enums
14140         arrays.  
14141
14142         And during the member population, indexer_list, event_list,
14143         constant_list, field_list, instance_constructor_list, method_list,
14144         operator_list and property_list are turned into their real arrays.
14145
14146         Although we could probably perform this operation earlier, for
14147         good error reporting we need to keep the lists and remove the
14148         lists for longer than required.
14149
14150         This optimization was triggered by Paolo profiling the compiler
14151         speed on the output of `gen-sample-program.pl' perl script. 
14152
14153         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14154         not crash in methods like MemberLookupFailed that use this field.  
14155
14156         This problem arises when the compiler fails to resolve a type
14157         during interface type definition for example.
14158
14159 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14162         inherit from System.Object, so we have to stop at null, not only
14163         when reaching System.Object.
14164
14165 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14168         DeclaredOnly because the parent indexer might have had a different
14169         name, but did not loop until the top of the hierarchy was reached.
14170
14171         The problem this one fixes is 35492: when a class implemented an
14172         indexer from an interface, we were getting the interface method
14173         (which was abstract) and we were flagging an error (can not invoke
14174         abstract method).
14175
14176         This also keeps bug 33089 functioning, and test-148 functioning.
14177
14178         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14179         out if a method is special is to see if it is declared in a
14180         property or event, or whether it is one of the predefined operator
14181         names.   This should fix correctly #36804.
14182
14183 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14184
14185         The goal here is to remove the dependency on EmptyCast.Peel ().
14186         Killing it completely.
14187
14188         The problem is that currently in a number of places where
14189         constants are expected, we have to "probe" for an EmptyCast, and
14190         Peel, which is not the correct thing to do, as this will be
14191         repetitive and will likely lead to errors. 
14192
14193         The idea is to remove any EmptyCasts that are used in casts that
14194         can be reduced to constants, so we only have to cope with
14195         constants. 
14196
14197         This bug hunt was triggered by Bug 37363 and the desire to remove
14198         the duplicate pattern where we were "peeling" emptycasts to check
14199         whether they were constants.  Now constants will always be
14200         constants.
14201
14202         * ecore.cs: Use an enumconstant here instead of wrapping with
14203         EmptyCast.  
14204
14205         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14206         throwing me off.  By handling this we can get rid of a few hacks.
14207
14208         * statement.cs (Switch): Removed Peel() code.
14209
14210 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * class.cs: Location information for error 508
14213
14214         * expression.cs (New.DoResolve): Add a guard against double
14215         resolution of an expression.  
14216
14217         The New DoResolve might be called twice when initializing field
14218         expressions (see EmitFieldInitializers, the call to
14219         GetInitializerExpression will perform a resolve on the expression,
14220         and later the assign will trigger another resolution
14221
14222         This leads to bugs (#37014)
14223
14224         * delegate.cs: The signature for EndInvoke should contain any ref
14225         or out parameters as well.  We were not doing this in the past. 
14226
14227         * class.cs (Field.Define): Do not overwrite the type definition
14228         inside the `volatile' group.  Turns out that volatile enumerations
14229         were changing the type here to perform a validity test, which
14230         broke conversions. 
14231
14232 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14233
14234         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14235         and structs, we do not want to load the instance variable
14236
14237         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14238         enum_type has to be handled like an object reference (implicit
14239         conversions exists from this to object), but the regular IsClass
14240         and IsValueType tests will never return true for this one.
14241
14242         Also we use TypeManager.IsValueType instead of type.IsValueType,
14243         just for consistency with the rest of the code (this is only
14244         needed if we ever use the construct exposed by test-180.cs inside
14245         corlib, which we dont today).
14246
14247 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14248
14249         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14250         just InternalCall.
14251
14252 2003-02-09  Martin Baulig  <martin@ximian.com>
14253
14254         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14255         (Namespace.DefineNamespaces): New static public method; this is
14256         called when we're compiling with debugging to add all namespaces
14257         to the symbol file.
14258
14259         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14260         pass it to the Namespace's .ctor.
14261
14262         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14263         and MethodBase arguments; pass the namespace ID to the symwriter;
14264         pass the MethodBase instead of the token to the symwriter.
14265         (SymbolWriter.DefineNamespace): New method to add a namespace to
14266         the symbol file.
14267
14268 2003-02-09  Martin Baulig  <martin@ximian.com>
14269
14270         * symbolwriter.cs: New file.  This is a wrapper around
14271         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14272         methods here in near future.
14273
14274 2003-02-09  Martin Baulig  <martin@ximian.com>
14275
14276         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14277         ILGenerator.MarkSequencePoint() which are actually used by the
14278         symbol writer.
14279
14280 2003-02-09  Martin Baulig  <martin@ximian.com>
14281
14282         * location.cs (SourceFile): New public sealed class.  This
14283         contains the name and an index which is used in the location's token.
14284         (Location): Reserve an appropriate number of bits in the token for
14285         the source file instead of walking over that list, this gives us a
14286         really huge performance improvement when compiling with debugging.
14287
14288         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14289         `SourceFile' argument instead of a string.
14290         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14291         but don't parse/tokenize here, we need to generate the list of all
14292         source files before we do that.
14293         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14294         the files.
14295
14296         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14297         instead of a string.
14298
14299         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14300         of a string.
14301
14302 2003-02-09  Martin Baulig  <martin@ximian.com>
14303
14304         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14305         filename on `#line default'.
14306
14307 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14308
14309         * statement.cs: don't clear the pinned var when the fixed statement
14310         returns from the method (fixes bug#37752).
14311
14312 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14313
14314         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14315         to IsValueType.
14316
14317 2003-02-07  Martin Baulig  <martin@ximian.com>
14318
14319         * driver.cs: Removed the `--debug-args' command line argument.
14320
14321         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14322         automatically by the AsssemblyBuilder.
14323         (CodeGen.InitializeSymbolWriter): We don't need to call any
14324         initialization function on the symbol writer anymore.  This method
14325         doesn't take any arguments.
14326
14327 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14328
14329         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14330         from referenced assemblies as well.
14331
14332 2003-02-02  Martin Baulig  <martin@ximian.com>
14333
14334         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14335
14336 2003-02-02  Martin Baulig  <martin@ximian.com>
14337
14338         * class.cs (Constructor.Emit): Open the symbol writer before
14339         emitting the constructor initializer.
14340         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14341         single-stepping through constructor initializers.
14342
14343 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14344
14345         * class.cs: Handle error 549: do not allow virtual methods in
14346         sealed classes. 
14347
14348 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14349
14350         * decl.cs: Check access levels when resolving types
14351
14352 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14353
14354         * statement.cs: Add parameters and locals set in catch blocks that might 
14355         return to set vector
14356
14357 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * class.cs (Operator): Set the SpecialName flags for operators.
14360
14361         * expression.cs (Invocation.DoResolve): Only block calls to
14362         accessors and operators on SpecialName methods.
14363
14364         (Cast.TryReduce): Handle conversions from char constants.
14365
14366
14367 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14368
14369         * statement.cs: small memory and time optimization in FlowBranching.
14370
14371 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14372
14373         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14374         problem that the last fix but in the other sid (Set).
14375
14376         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14377         access when there is no indexer in the hierarchy.
14378
14379 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14380
14381         * class.cs: Combine some if statements.
14382
14383 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14384
14385         * driver.cs: fixed bug #37187.
14386
14387 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14388
14389         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14390         any indexer, it's needed to build a list with all the indexers in the
14391         hierarchy (AllGetters), else we have problems. Fixes #35653.
14392
14393 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14394
14395         * class.cs (MethodData.Define): It is wrong for an interface
14396         implementation to be static in both cases: explicit and implicit.
14397         We were only handling this in one case.
14398
14399         Improve the if situation there to not have negations.
14400
14401         * class.cs (Field.Define): Turns out that we do not need to check
14402         the unsafe bit on field definition, only on usage.  Remove the test.
14403
14404 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14405
14406         * driver.cs: use assembly.Location instead of Codebase (the latest
14407         patch made mcs fail when using MS assemblies).
14408
14409 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14410
14411         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14412         get the path to *corlib.dll.
14413
14414 2003-01-21  Nick Drochak <ndrochak@gol.com>
14415
14416         * cs-tokenizer.cs:
14417         * pending.cs:
14418         * typemanager.cs: Remove compiler warnings
14419
14420 2003-01-20  Duncan Mak  <duncan@ximian.com>
14421
14422         * AssemblyInfo.cs: Bump the version number to 0.19.
14423
14424 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14425
14426         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14427
14428 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14429
14430         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14431
14432 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14433
14434         * cs-parser.jay: Small fix: we were not comparing the constructor
14435         name correctly.   Thanks to Zoltan for the initial pointer.
14436
14437 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14438
14439         * cs-tokenizer.cs: Set file name when specified with #line
14440
14441 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14442
14443         * cs-parser.jay: Only perform the constructor checks here if we
14444         are named like the class;  This will help provider a better
14445         error.  The constructor path is taken when a type definition is
14446         not found, but most likely the user forgot to add the type, so
14447         report that rather than the constructor error.
14448
14449 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14450
14451         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14452         allocations.
14453
14454 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14455
14456         * cs-parser.jay: Add cleanup call.
14457
14458 2003-01-13  Duncan Mak  <duncan@ximian.com>
14459
14460         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14461         consistent with other methods.
14462
14463 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14464
14465         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14466
14467 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14468
14469         * attribute.cs: only set GuidAttr to true when we have a
14470         GuidAttribute.
14471
14472 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14473
14474         * ecore.cs:
14475         * expression.cs:
14476         * typemanager.cs: fixes to allow mcs compile corlib with the new
14477         Type.IsSubclassOf fix.
14478
14479 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * expression.cs (LocalVariableReference.DoResolve): Classify a
14482         constant as a value, not as a variable.   Also, set the type for
14483         the variable.
14484
14485         * cs-parser.jay (fixed_statement): take a type instead of a
14486         pointer_type, so we can produce a better error message later.
14487
14488         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14489         as an error.  
14490
14491         (For.DoEmit): Make inifinite loops have a
14492         non-conditional branch back.
14493
14494         (Fixed.DoEmit): First populate the pinned variables, then emit the
14495         statement, then clear the variables.  Before I was emitting the
14496         code once for each fixed piece.
14497
14498
14499 2003-01-08  Martin Baulig  <martin@ximian.com>
14500
14501         * statement.cs (FlowBranching.MergeChild): A break in a
14502         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14503
14504 2003-01-08  Martin Baulig  <martin@ximian.com>
14505
14506         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14507         lives in the same number space than `param_map'.  Fixes #36154.
14508
14509 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14510
14511         * cs-parser.jay (constructor_declaration): Set the
14512         Constructor.ModFlags before probing for it.  This makes the
14513         compiler report 514, 515 and 132 (the code was there, but got
14514         broken). 
14515
14516         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14517         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14518         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14519
14520 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14521
14522         * enum.cs: create the enum static fields using the enum type.
14523
14524 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14525
14526         * class.cs: don't try to create the ParamBuilder for the return
14527         type if it's not needed (and handle it breaking for the ms runtime
14528         anyway).
14529
14530 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14531
14532         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14533
14534 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14535
14536         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14537         the command.   This showed up while compiling the JANET source
14538         code, which used \r as its only newline separator.
14539
14540 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * class.cs (Method.Define): If we are an operator (because it
14543         reuses our code), then set the SpecialName and HideBySig.  #36128
14544
14545 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14548         exception, report error 120 `object reference required'.
14549
14550         * driver.cs: Add --pause option, used during to measure the size
14551         of the process as it goes with --timestamp.
14552
14553         * expression.cs (Invocation.DoResolve): Do not allow methods with
14554         SpecialName to be invoked.
14555
14556 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14559         number before adding it.
14560
14561 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14562
14563         * ecore.cs (StandardImplicitConversion): When in an unsafe
14564         context, we allow conversion between void * to any other pointer
14565         type. This fixes bug #35973.
14566
14567 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14568
14569         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14570         is not thrown when extensionless outputs are used 
14571
14572 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14573
14574         * rootcontext.cs: fixed compilation of corlib.
14575
14576 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * attribute.cs (Attributes.Contains): Add new method.
14579
14580         * class.cs (MethodCore.LabelParameters): if the parameter is an
14581         `out' parameter, check that no attribute `[In]' has been passed.
14582
14583         * enum.cs: Handle the `value__' name in an enumeration.
14584
14585 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14586
14587         * decl.cs: Added special case to allow overrides on "protected
14588         internal" methods
14589
14590 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14591
14592         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14593         since it makes much more sense.
14594
14595         (Attributes.ctor): Don't require a Location parameter.
14596
14597         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14598
14599         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14600         since we already have that information per attribute.
14601
14602         * everywhere : make appropriate changes.
14603
14604         * class.cs (LabelParameters): Write the code which actually
14605         applies attributes to the return type. We can't do this on the MS
14606         .NET runtime so we flag a warning in the case an exception is
14607         thrown.
14608
14609 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * const.cs: Handle implicit null conversions here too.
14612
14613 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14614
14615         * class.cs (MethodCore.LabelParameters): Remove the extra
14616         Type [] parameter since it is completely unnecessary. Instead
14617         pass in the method's attributes so that we can extract
14618         the "return" attribute.
14619
14620 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14621
14622         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14623         of ignoring it and letting the compile continue.
14624
14625         * typemanager.cs (ChangeType): use an extra argument to return an
14626         error condition instead of throwing an exception.
14627
14628 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14629
14630         * expression.cs (Unary.TryReduce): mimic the code for the regular
14631         code path.  Perform an implicit cast in the cases where we can
14632         implicitly convert to one of the integral types, and then reduce
14633         based on that constant.   This fixes bug #35483.
14634
14635 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14636
14637         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14638
14639 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14640
14641         * namespace.cs: fixed bug #35489.
14642
14643 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14644
14645         * class.cs: Remove some dead code.
14646
14647         * cs-parser.jay: Estimate the number of methods needed
14648         (RootContext.MethodCount);
14649
14650         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14651         numbers instead of StringBuilders.
14652
14653         * support.cs (PtrHashtable): Add constructor with initial size;
14654         We can now reduce reallocations of the method table.
14655
14656 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14657
14658         * attribute.cs (ApplyAttributes): Keep track of the emitted
14659         attributes on a per-target basis. This fixes bug #35413.
14660
14661 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14662
14663         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14664         default to the Windows 1252 encoding.
14665
14666         (UnixParseOption): Support version, thanks to Alp for the missing
14667         pointer. 
14668
14669         * AssemblyInfo.cs: Add nice assembly information.
14670
14671         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14672         (bug 35169).
14673
14674         * cs-parser.jay: Allow a trailing comma before the close bracked
14675         in the attribute_section production.
14676
14677         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14678         address of the instance was being taken, I will take this out,
14679         because we take the address of the object immediately here.
14680
14681 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14682
14683         * typemanager.cs (AreMultipleAllowed): Take care of the most
14684         obvious case where attribute type is not in the current assembly -
14685         stupid me ;-)
14686
14687 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14688
14689         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14690         definitions, instead of doing that afterwards.  
14691
14692         Also we use a nice little hack, depending on the constructor, we
14693         know if we are a "composed" name or a simple name.  Hence, we
14694         avoid the IndexOf test, and we avoid 
14695
14696         * codegen.cs: Add code to assist in a bug reporter to track down
14697         the source of a compiler crash. 
14698
14699 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14700
14701         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14702         types have been emitted for a given element and flag an error
14703         if something which does not have AllowMultiple set is used more
14704         than once.
14705
14706         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14707         attribute types and their corresponding AllowMultiple properties
14708
14709         (AreMultipleAllowed): Check the property for a given type.
14710
14711         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14712         property in the case we have a TypeContainer.
14713
14714         (Attributes.AddAttribute): Detect duplicates and just skip on
14715         adding them. This trivial fix catches a pretty gross error in our
14716         attribute emission - global attributes were being emitted twice!
14717
14718         Bugzilla bug #33187 is now fixed.
14719
14720 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14721
14722         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14723         instead of pp_and).
14724
14725         * expression.cs (Binary.ResolveOperator): I can only use the
14726         Concat (string, string, string) and Concat (string, string,
14727         string, string) if the child is actually a concatenation of
14728         strings. 
14729
14730 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14731
14732         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14733         context where we need a 2-character lookahead.
14734
14735         * pending.cs (PendingImplementation): Rework so we can keep track
14736         of interface types all the time, and flag those which were
14737         implemented by parents as optional.
14738
14739 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * expression.cs (Binary.ResolveOperator): Use
14742         String.Concat(string,string,string) or
14743         String.Concat(string,string,string,string) when possible. 
14744
14745         * typemanager: More helper methods.
14746
14747
14748 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14749
14750         * pending.cs: remove the bogus return from GetMissingInterfaces()
14751         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14752
14753 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14754
14755         * namespace.cs: avoid duplicated 'using xxx' being added to
14756         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14757         when we get more than one 'using' statement for the same namespace.
14758         Report a CS0105 warning for it.
14759
14760 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14761
14762         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14763         of calling getChar/putback, uses internal knowledge of it.    
14764
14765         (xtoken): Reorder tokenizer so most common patterns are checked
14766         first.  This reduces the compilation time in another 5% (from 8.11s
14767         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14768
14769         The parsing time is 22% of the compilation in mcs, and from that
14770         64% is spent on the tokenization process.  
14771
14772         I tried using a binary search for keywords, but this is slower
14773         than the hashtable.  Another option would be to do a couple of
14774         things:
14775
14776                 * Not use a StringBuilder, instead use an array of chars,
14777                   with a set value.  Notice that this way we could catch
14778                   the 645 error without having to do it *afterwards*.
14779
14780                 * We could write a hand-parser to avoid the hashtable
14781                   compares altogether.
14782
14783         The identifier consumption process takes 37% of the tokenization
14784         time.  Another 15% is spent on is_number.  56% of the time spent
14785         on is_number is spent on Int64.Parse:
14786
14787                 * We could probably choose based on the string length to
14788                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14789                   computations. 
14790
14791         Another 3% is spend on wrapping `xtoken' in the `token' function.
14792
14793         Handle 0xa0 as whitespace (#34752)
14794
14795 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14796
14797         * typemanager.cs (IsCLRType): New routine to tell whether a type
14798         is one of the builtin types.  
14799
14800         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14801         typecode in more places instead of doing pointer comparissions.
14802         We could leverage some knowledge about the way the typecodes are
14803         laid out.
14804
14805         New code to cache namespaces in assemblies, it is currently not
14806         invoked, to be used soon.
14807
14808         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14809
14810         * expression.cs (Binary.ResolveOperator): specially handle
14811         strings, and do not perform user-defined operator overloading for
14812         built-in types.
14813
14814 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14815
14816         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14817         internalcall as it is a pretty simple operation;  Avoid whenever
14818         possible to call Char.IsLetter.
14819
14820         (consume_identifier): Cut by half the number of
14821         hashtable calls by merging the is_keyword and GetKeyword behavior.
14822
14823         Do not short-circuit, because if we do, we
14824         report errors (ie, #if false && true would produce an invalid
14825         directive error);
14826
14827
14828 2002-11-24  Martin Baulig  <martin@ximian.com>
14829
14830         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14831         check constant ranges and report a CS0221.  Fixes #33186.
14832
14833 2002-11-24  Martin Baulig  <martin@ximian.com>
14834
14835         * cs-parser.jay: Make this work for uninitialized variable
14836         declarations in the `for' initializer.  Fixes #32416.
14837
14838 2002-11-24  Martin Baulig  <martin@ximian.com>
14839
14840         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14841         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14842
14843 2002-11-24  Martin Baulig  <martin@ximian.com>
14844
14845         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14846         argument; if true, we also check for user-defined conversions.
14847         This is only needed if both arguments are of a user-defined type.
14848         Fixes #30443, added test-175.cs.
14849         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14850
14851         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14852
14853 2002-11-24  Martin Baulig  <martin@ximian.com>
14854
14855         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14856         function to get the store opcode.
14857         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14858         only emit the Ldelema if the store opcode is Stobj.  You must run
14859         both test-34 and test-167 to test this.  Fixes #34529.
14860
14861 2002-11-23  Martin Baulig  <martin@ximian.com>
14862
14863         * ecore.cs (Expression.MemberLookup): Added additional
14864         `qualifier_type' argument which is used when we're being called
14865         from MemberAccess.DoResolve() and null if we're called from a
14866         SimpleName lookup.
14867         (Expression.MemberLookupFailed): New method to report errors; this
14868         does the CS1540 check and reports the correct error message.
14869
14870         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14871         argument for the CS1540 check and redone the way how we're dealing
14872         with private members.  See the comment in the source code for details.
14873         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14874         `closure_start_type' to `closure_qualifier_type' and check whether
14875         it's not null.  It was not this filter being broken, it was just
14876         being called with the wrong arguments.
14877
14878         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14879         and pass it the correct `qualifier_type'; this also does the error
14880         handling for us.
14881
14882 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14883
14884         * expression.cs (Invocation.EmitParams): If the we are dealing
14885         with a non-built-in value type, load its address as well.
14886
14887         (ArrayCreation): Use a a pretty constant instead
14888         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14889         static initializers.  
14890
14891         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14892         because they are not really value types, just glorified integers. 
14893
14894         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14895
14896         * ecore.cs: Remove redundant code for enumerations, make them use
14897         the same code path as everything else, fixes the casting issue
14898         with enumerations in Windows.Forms.
14899
14900         * attribute.cs: Do only cast to string if it is a string, the
14901         validation happens later.
14902
14903         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14904         people upgrade their corlibs.
14905
14906         * ecore.cs: Oops, enumerations were not following the entire code path
14907
14908 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * typemanager.cs (FilterWithClosure): Commented out the test for
14911         1540 in typemanager.cs, as it has problems when accessing
14912         protected methods from a parent class (see test-174.cs). 
14913
14914         * attribute.cs (Attribute.ValidateGuid): new method.
14915         (Attribute.Resolve): Use above.
14916
14917 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14918
14919         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14920
14921         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14922         handling for enumerations, as we only needed the TypeContainer
14923         functionality to begin with (this is required for the fix below to
14924         work for enums that reference constants in a container class for
14925         example). 
14926
14927         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14928
14929         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14930         a valid TypeBuilder to perform lookups on.o
14931
14932         * class.cs (InheritableMemberSignatureCompare): Use true in the
14933         call to GetGetMethod and GetSetMethod, because we are comparing
14934         the signature, and we need to get the methods *even* if they are
14935         private. 
14936
14937         (PropertyBase.CheckBase): ditto.
14938
14939         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14940         GotoCase.Resolve): Use Peel on EmpytCasts.
14941
14942         * ecore.cs (EmptyCast): drop child, add Peel method.
14943
14944 2002-11-17  Martin Baulig  <martin@ximian.com>
14945
14946         * ecore.cs (EmptyCast.Child): New public property.
14947
14948         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14949         label resolved to an EmptyCast.  Fixes #34162.
14950         (GotoCase.Resolve): Likewise.
14951         (Block.EmitMeta): Likewise.
14952
14953 2002-11-17  Martin Baulig  <martin@ximian.com>
14954
14955         * expression.cs (Invocation.BetterConversion): Prefer int over
14956         uint; short over ushort; long over ulong for integer literals.
14957         Use ImplicitConversionExists instead of StandardConversionExists
14958         since we also need to check for user-defined implicit conversions.
14959         Fixes #34165.  Added test-173.cs.
14960
14961 2002-11-16  Martin Baulig  <martin@ximian.com>
14962
14963         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14964         with the `true' and `false' literals.  Fixes #33151.
14965
14966 2002-11-16  Martin Baulig  <martin@ximian.com>
14967
14968         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14969         October 22nd; don't do the cs1540 check for static members.
14970
14971         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14972         now using our own filter here and doing the cs1540 check again.
14973
14974 2002-11-16  Martin Baulig  <martin@ximian.com>
14975
14976         * support.cs (InternalParameters): Don't crash if we don't have
14977         any fixed parameters.  Fixes #33532.
14978
14979 2002-11-16  Martin Baulig  <martin@ximian.com>
14980
14981         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14982         when looking up static methods to make this work on Windows.
14983         Fixes #33773.
14984
14985 2002-11-16  Martin Baulig  <martin@ximian.com>
14986
14987         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14988         a setter rather than using PropertyInfo.CanWrite.
14989
14990 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14991
14992         * class.cs: Allow acces to block member by subclasses. Fixes build
14993         breaker.
14994
14995 2002-11-14  Martin Baulig  <martin@ximian.com>
14996
14997         * class.cs (Constructor.Emit): Added the extern/block check.
14998         Fixes bug #33678.
14999
15000 2002-11-14  Martin Baulig  <martin@ximian.com>
15001
15002         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15003         iteration while looking for indexers, this is needed because the
15004         indexer may have a different name in our base classes.  Fixed the
15005         error reporting (no indexers at all, not get accessor, no
15006         overloaded match).  Fixes bug #33089.
15007         (IndexerAccess.DoResolveLValue): Likewise.
15008
15009 2002-11-14  Martin Baulig  <martin@ximian.com>
15010
15011         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15012         indexers.  Fixes the first part of bug #33089.
15013         (MethodSignature.InheritableMemberSignatureCompare): Added support
15014         for properties.
15015
15016 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15017
15018         * attribute.cs (Attribute.Resolve): Catch the
15019         NullReferenceException and report it since it isn't supposed to
15020         happen. 
15021
15022 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15023
15024         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15025         LogicalOr and LogicalAnd that can benefit from recursively
15026         handling EmitBranchable.  The code now should be nice for Paolo.
15027
15028 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15029
15030         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15031         the Type lookups, as we perform quite a number of lookups on
15032         non-Types.  This can be removed once we can deterministically tell
15033         whether we have a type or a namespace in advance.
15034
15035         But this might require special hacks from our corlib.
15036
15037         * TODO: updated.
15038
15039         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15040         and double which avoids a conversion from an integer to a double.
15041
15042         * expression.cs: tiny optimization, avoid calling IsConstant,
15043         because it effectively performs the lookup twice.
15044
15045 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15046
15047         But a bogus return here to keep the semantics of the old code
15048         until the Mono runtime is fixed.
15049
15050         * pending.cs (GetMissingInterfaces): New method used to remove all
15051         the interfaces that are already implemented by our parent
15052         classes from the list of pending methods. 
15053
15054         * interface.cs: Add checks for calls after ResolveTypeExpr.
15055
15056 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15057
15058         * class.cs (Class.Emit): Report warning 67: event not used if the
15059         warning level is beyond 3.
15060
15061         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15062         being a NullLiteral.
15063
15064         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15065         specifiers. 
15066
15067         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15068         path that might fail if a type can not be resolved.
15069
15070         * expression.cs (Binary.Emit): Emit unsigned versions of the
15071         operators. 
15072
15073         * driver.cs: use error 5.
15074
15075 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15076
15077         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15078
15079 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * cs-parser.jay (switch_section): A beautiful patch from Martin
15082         Baulig that fixed 33094.
15083
15084 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15085
15086         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15087         Check whether the base is abstract and report an error if so.
15088
15089         * expression.cs (IndexerAccess.DoResolveLValue,
15090         IndexerAccess.DoResolve): ditto. 
15091
15092         (Invocation.DoResolve): ditto.
15093
15094         (Invocation.FullMethodDesc): Improve the report string.
15095
15096         * statement.cs (Block): Eliminate IsVariableDefined as it is
15097         basically just a wrapper for GetVariableInfo.
15098
15099         * ecore.cs (SimpleName): Use new 
15100
15101         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15102         type, as we return the actual parameter ref/unref state on a
15103         different call.
15104
15105 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15106
15107         * support.cs: Return proper flags REF/OUT fixing the previous
15108         commit.  
15109
15110         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15111         not used to mean `ref' but `ref or out' in ParameterReference
15112
15113         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15114         full type signature instead of calling TypeManger.CSharpName
15115         ourselves. 
15116
15117         * support.cs (InternalParameters.ParameterDesc): Do not compare
15118         directly to the modflags, because REF/OUT will actually be bitsets
15119         if set. 
15120
15121         * delegate.cs (VerifyMethod): Check also the modifiers.
15122
15123         * cs-tokenizer.cs: Fix bug where floating point values with an
15124         exponent where a sign was missing was ignored.
15125
15126         * driver.cs: Allow multiple assemblies to be specified in a single
15127         /r: argument
15128
15129 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15130
15131         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15132         because identifiers after a parenthesis would end up in this kind
15133         of production, and we needed to desamiguate it for having casts
15134         like:
15135
15136                 (UserDefinedType *) xxx
15137
15138 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15141         we should set on the Bindingflags.NonPublic, but not turn on
15142         private_ok.  private_ok controls whether a Private member is
15143         returned (this is chekced on the filter routine), while the
15144         BindingFlags.NonPublic just controls whether private/protected
15145         will be allowed.   This fixes the problem part of the problem of
15146         private properties being allowed to be used in derived classes.
15147
15148         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15149         so we can call the children DoResolveLValue method (this will
15150         properly signal errors on lvalue assignments to base properties)
15151
15152         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15153         getter are null, and we have a property info, we know that this
15154         happened because the lookup failed, so we report an error 122 for
15155         protection level violation.
15156
15157         We also silently return if setter and getter are null in the
15158         resolve functions, this condition only happens if we have flagged
15159         the error before.  This is the other half of the problem. 
15160
15161         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15162         not have accessibility information, that is why we were returning
15163         true in the filter function in typemanager.cs.
15164
15165         To properly report 122 (property is inaccessible because of its
15166         protection level) correctly, we report this error in ResolveAccess
15167         by failing if both the setter and the getter are lacking (ie, the
15168         lookup failed). 
15169
15170         DoResolve and DoLResolve have been modified to check for both
15171         setter/getter being null and returning silently, the reason being
15172         that I did not want to put the knowledge about this error in upper
15173         layers, like:
15174
15175         int old = Report.Errors;
15176         x = new PropertyExpr (...);
15177         if (old != Report.Errors)
15178                 return null;
15179         else
15180                 return x;
15181
15182         So the property expr is returned, but it is invalid, so the error
15183         will be flagged during the resolve process. 
15184
15185         * class.cs: Remove InheritablePropertySignatureCompare from the
15186         class, as we no longer depend on the property signature to compute
15187         whether it is possible to implement a method or not.
15188
15189         The reason is that calling PropertyInfo.GetGetMethod will return
15190         null (in .NET, in Mono it works, and we should change this), in
15191         cases where the Get Method does not exist in that particular
15192         class.
15193
15194         So this code:
15195
15196         class X { public virtual int A { get { return 1; } } }
15197         class Y : X { }
15198         class Z : Y { public override int A { get { return 2; } } }
15199
15200         Would fail in Z because the parent (Y) would not have the property
15201         defined.  So we avoid this completely now (because the alternative
15202         fix was ugly and slow), and we now depend exclusively on the
15203         method names.
15204
15205         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15206         reference method, instead of using the property.
15207
15208         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15209         routines are gone now.
15210
15211         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15212         names, they were incorrectly named.
15213
15214         * cs-tokenizer.cs: Return are more gentle token on failure. 
15215
15216         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15217         had an out-of-sync index variable, which caused it to remove from
15218         the list of pending methods the wrong method sometimes.
15219
15220 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15221
15222         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15223         CanWrite, because those refer to this particular instance of the
15224         property, and do not take into account the fact that we can
15225         override single members of a property.
15226
15227         Constructor requires an EmitContext.  The resolution process does
15228         not happen here, but we need to compute the accessors before,
15229         because the resolution does not always happen for properties.
15230
15231         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15232         subclass, before we did not update this flag, but we did update
15233         bindingflags. 
15234
15235         (GetAccessors): Drop this routine, as it did not work in the
15236         presence of partially overwritten set/get methods. 
15237
15238         Notice that this broke the cs1540 detection, but that will require
15239         more thinking. 
15240
15241 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15242
15243         * class.cs:
15244         * codegen.cs:
15245         * driver.cs: issue a warning instead of an error if we don't support
15246         debugging for the platform. Also ignore a couple of errors that may
15247         arise when trying to write the symbols. Undo my previous patch.
15248
15249 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15250
15251         * driver.cs: ignore /debug switch except for Unix platforms.
15252
15253 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15254
15255         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15256
15257 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * driver.cs: Do not make mcs-debug conditional, so we do not break
15260         builds that use it.
15261
15262         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15263         review this patch.  But basically after all the children variables
15264         have been merged, the value of "Breaks" was not being set to
15265         new_breaks for Switch blocks.  I think that it should be set after
15266         it has executed.  Currently I set this to the value of new_breaks,
15267         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15268         conservative, but I do not understand this code very well.
15269
15270         I did not break anything in the build, so that is good ;-)
15271
15272         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15273
15274 2002-10-20  Mark Crichton  <crichton@gimp.org>
15275
15276         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15277
15278 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15279
15280         * cfold.cs: Fixed compile blocker.
15281
15282 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15283
15284         * driver.cs: I was chekcing the key, not the file.
15285
15286 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15287
15288         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15289         message that we were generating - we just need to silently return
15290         a null.
15291
15292 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * class.cs (Event.Define): Change my previous commit, as this
15295         breaks the debugger.  This is a temporary hack, as it seems like
15296         the compiler is generating events incorrectly to begin with.
15297
15298         * expression.cs (Binary.ResolveOperator): Added support for 
15299         "U operator - (E x, E y)"
15300
15301         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15302         y)".
15303
15304         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15305         init-only variables, but this path did not take into account that
15306         there might be also instance readonly variables.  Correct this
15307         problem. 
15308
15309         This fixes bug 32253
15310
15311         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15312         delegates as well.
15313
15314         * driver.cs: Change the extension for modules to `netmodule'
15315
15316         * cs-parser.jay: Improved slightly the location tracking for
15317         the debugger symbols.
15318
15319         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15320         modifiers that were specified instead of the hardcoded value
15321         (FamAndAssem).  This was basically ignoring the static modifier,
15322         and others.  Fixes 32429.
15323
15324         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15325         fixed a bug in the process (32476)
15326
15327         * expression.cs (ArrayAccess.EmitAssign): Patch from
15328         hwang_rob@yahoo.ca that fixes bug 31834.3
15329
15330 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * driver.cs: Make the module extension .netmodule.
15333
15334 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15335
15336         * driver.cs: Report an error if the resource file is not found
15337         instead of crashing.
15338
15339         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15340         false, like Emit does.
15341
15342 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15343
15344         * typemanager.cs: Remove unused private member.  Also reported mcs
15345         bug to report this as a warning like csc.
15346
15347 2002-10-15  Martin Baulig  <martin@gnome.org>
15348
15349         * statement.cs (Statement.Emit): Made this a virtual method; emits
15350         the line number info and calls DoEmit().
15351         (Statement.DoEmit): New protected abstract method, formerly knows
15352         as Statement.Emit().
15353
15354         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15355
15356 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15357
15358         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15359         have fixed a remaining problem: not every AddXXXX was adding a
15360         fully qualified name.  
15361
15362         Now everyone registers a fully qualified name in the DeclSpace as
15363         being defined instead of the partial name.  
15364
15365         Downsides: we are slower than we need to be due to the excess
15366         copies and the names being registered this way.  
15367
15368         The reason for this is that we currently depend (on the corlib
15369         bootstrap for instance) that types are fully qualified, because
15370         we dump all the types in the namespace, and we should really have
15371         types inserted into the proper namespace, so we can only store the
15372         basenames in the defined_names array.
15373
15374 2002-10-10  Martin Baulig  <martin@gnome.org>
15375
15376         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15377         from bug #31834, see the bug report for a testcase which is
15378         miscompiled.
15379
15380 2002-10-10  Martin Baulig  <martin@gnome.org>
15381
15382         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15383         flow analysis code for this.
15384
15385         * statement.cs (Do, While, For): Tell the flow analysis code about
15386         infinite loops.
15387         (FlowBranching.UsageVector): Added support for infinite loops.
15388         (Block.Resolve): Moved the dead code elimination here and use flow
15389         analysis to do it.
15390
15391 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * class.cs (Field.Define): Catch cycles on struct type
15394         definitions. 
15395
15396         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15397         fields if the fields are static.  We only need to check instance
15398         fields. 
15399
15400         * expression.cs (As.DoResolve): Test for reference type.
15401
15402         * statement.cs (Using.ResolveExpression): Use
15403         ConvertImplicitRequired, not ConvertImplicit which reports an
15404         error on failture
15405         (Using.ResolveLocalVariableDecls): ditto.
15406
15407         * expression.cs (Binary.ResolveOperator): Report errors in a few
15408         places where we had to.
15409
15410         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15411
15412 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * expression.cs: Use StoreFromPtr instead of extracting the type
15415         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15416
15417         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15418         an enumeration value to a System.Enum, but System.Enum is not a
15419         value type, but an class type, so we need to box.
15420
15421         (Expression.ConvertExplicit): One codepath could return
15422         errors but not flag them.  Fix this.  Fixes #31853
15423
15424         * parameter.cs (Resolve): Do not allow void as a parameter type.
15425
15426 2002-10-06  Martin Baulig  <martin@gnome.org>
15427
15428         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15429         if it's a class type and not a struct.  Fixes #31815.
15430
15431 2002-10-06  Martin Baulig  <martin@gnome.org>
15432
15433         * statement.cs: Reworked the flow analysis code a bit to make it
15434         usable for dead code elimination.
15435
15436 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15437
15438         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15439
15440 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15441
15442         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15443         to fix the test 165, will investigate deeper.
15444
15445 2002-10-04  Martin Baulig  <martin@gnome.org>
15446
15447         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15448         finally blocks actually work.
15449         (Try.Resolve): We don't need to create a sibling for `finally' if
15450         there is no finally block.
15451
15452 2002-10-04  Martin Baulig  <martin@gnome.org>
15453
15454         * class.cs (Constructor.Define): The default accessibility for a
15455         non-default constructor is private, not public.
15456
15457 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * class.cs (Constructor): Make AllowedModifiers public, add
15460         EXTERN.
15461
15462         * cs-parser.jay: Perform the modifiers test here, as the
15463         constructor for the Constructor class usually receives a zero
15464         because of the way we create it (first we create, later we
15465         customize, and we were never checking the modifiers).
15466
15467         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15468         is a version of LookupTypeReflection that includes the type-name
15469         cache.  This can be used as a fast path for functions that know
15470         the fully qualified name and are only calling into *.GetType() to
15471         obtain a composed type.
15472
15473         This is also used by TypeManager.LookupType during its type
15474         composition.
15475
15476         (LookupType): We now also track the real type name, as sometimes
15477         we can get a quey for the real type name from things like
15478         ComposedCast.  This fixes bug 31422.
15479
15480         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15481         complete type fullname, it does not have to go through the type
15482         resolution system to obtain the composed version of the type (for
15483         obtaining arrays or pointers).
15484
15485         (Conditional.Emit): Use the EmitBoolExpression to
15486         generate nicer code, as requested by Paolo.
15487
15488         (ArrayCreation.CheckIndices): Use the patch from
15489         hwang_rob@yahoo.ca to validate the array initializers. 
15490
15491 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15492
15493         * class.cs (ConstructorInitializer.Emit): simplify code by using
15494         Invocation.EmitCall, and at the same time, fix the bugs in calling
15495         parent constructors that took variable arguments. 
15496
15497         * ecore.cs (Expression.ConvertNumericExplicit,
15498         Expression.ImplicitNumericConversion): Remove the code that
15499         manually wrapped decimal (InternalTypeConstructor call is now gone
15500         as well).
15501
15502         * expression.cs (Cast.TryReduce): Also handle decimal types when
15503         trying to perform a constant fold on the type.
15504
15505         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15506
15507         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15508         that only turned off an error report, and did nothing else. 
15509
15510 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15511
15512         * driver.cs: Handle and ignore /fullpaths
15513
15514 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * expression.cs (Binary.ResolveOperator): Catch the case where
15517         DoNumericPromotions returns true, 
15518
15519         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15520
15521 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15524         report error 70.
15525
15526 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15529         conversion exists, but it is also required that the conversion be
15530         performed.  This manifested in "(Type64Enum) 2".  
15531
15532         * class.cs (TypeManager.AddMethod): The fix is not to change
15533         AddEnum, because that one was using a fully qualified name (every
15534         DeclSpace derivative does), but to change the AddMethod routine
15535         that was using an un-namespaced name.  This now correctly reports
15536         the duplicated name.
15537
15538         Revert patch until I can properly fix it.  The issue
15539         is that we have a shared Type space across all namespaces
15540         currently, which is wrong.
15541
15542         Options include making the Namespace a DeclSpace, and merge
15543         current_namespace/current_container in the parser.
15544
15545 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * cs-parser.jay: Improve error reporting when we get a different
15548         kind of expression in local_variable_type and
15549         local_variable_pointer_type. 
15550
15551         Propagate this to avoid missleading errors being reported.
15552
15553         * ecore.cs (ImplicitReferenceConversion): treat
15554         TypeManager.value_type as a target just like object_type.   As
15555         code like this:
15556
15557         ValueType v = 1;
15558
15559         Is valid, and needs to result in the int 1 being boxed before it
15560         is assigned to the value type v.
15561
15562         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15563         to validate the enumeration name.
15564
15565         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15566         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15567         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15568
15569         * ecore.cs (TryImplicitIntConversion): When doing an
15570         implicit-enumeration-conversion, check if the type is 64-bits and
15571         perform a conversion before passing to EnumConstant.
15572
15573 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15574
15575         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15576         report ambiguous type references.  Unlike the MS version, we
15577         report what the ambiguity is.   Innovation at work ;-)
15578
15579         (DeclSpace.FindType): Require a location argument to
15580         display when we display an ambiguous error.
15581
15582         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15583
15584         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15585
15586         * expression.cs (EmitDynamicInitializers): Apply patch from
15587         hwang_rob@yahoo.ca that fixes the order in which we emit our
15588         initializers. 
15589
15590 2002-09-21  Martin Baulig  <martin@gnome.org>
15591
15592         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15593         delegate takes no arguments.
15594
15595 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15596
15597         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15598         from integers.
15599
15600         * expression.cs: Extract the underlying type.
15601
15602         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15603
15604         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15605
15606 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * class.cs (TypeContainer.DefineType): We can not use the nice
15609         PackingSize with the size set to 1 DefineType method, because it
15610         will not allow us to define the interfaces that the struct
15611         implements.
15612
15613         This completes the fixing of bug 27287
15614
15615         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15616         means also structs.  This fixes part of the problem. 
15617         (Expresion.ImplicitReferenceConversionExists): ditto.
15618
15619         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15620         error if there were no errors reported during the type lookup
15621         process, to avoid duplicates or redundant errors.  Without this
15622         you would get an ambiguous errors plus a type not found.  We have
15623         beaten the user enough with the first error.  
15624
15625         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15626         reference. 
15627
15628         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15629         during the resolution process, stop the lookup, this avoids
15630         repeated error reports (same error twice).
15631
15632         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15633
15634         * typemanager.cs (LookupType): Redo the type lookup code to match
15635         the needs of System.Reflection.  
15636
15637         The issue is that System.Reflection requires references to nested
15638         types to begin with a "+" sign instead of a dot.  So toplevel
15639         types look like: "NameSpace.TopLevelClass", and nested ones look
15640         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15641         levels. 
15642
15643 2002-09-19  Martin Baulig  <martin@gnome.org>
15644
15645         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15646         says that a method always returns or always throws an exception,
15647         don't report the CS0161.
15648
15649         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15650         set `Returns = new_returns'.
15651
15652 2002-09-19  Martin Baulig  <martin@gnome.org>
15653
15654         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15655         to an enum constant, check for a CS0176.
15656
15657 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15658
15659         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15660         for operators that must be in pairs and report errors.
15661
15662         * ecore.cs (SimpleName.DoResolveType): During the initial type
15663         resolution process, when we define types recursively, we must
15664         check first for types in our current scope before we perform
15665         lookups in the enclosing scopes.
15666
15667         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15668
15669         (Invocation.VerifyArgumentsCompat): Call
15670         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15671         I thought we were supposed to always call this, but there are a
15672         few places in the code where we dont do it.
15673
15674 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15675
15676         * driver.cs: Add support in -linkres and -resource to specify the
15677         name of the identifier.
15678
15679 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * ecore.cs (StandardConversionExists): Sync with the conversion
15682         code: allow anything-* to void* conversions.
15683
15684         (FindMostSpecificSource): Use an Expression argument
15685         instead of a Type, because we might be handed over a Literal which
15686         gets a few more implicit conversions that plain types do not.  So
15687         this information was being lost.
15688
15689         Also, we drop the temporary type-holder expression when not
15690         required.
15691
15692 2002-09-17  Martin Baulig  <martin@gnome.org>
15693
15694         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15695         this is an explicit interface implementation.
15696
15697 2002-09-17  Martin Baulig  <martin@gnome.org>
15698
15699         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15700         different `IndexerName' attributes.
15701
15702         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15703         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15704         virtual CommonResolve().
15705
15706 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15709         and convert that to the UnderlyingType.
15710
15711         * statement.cs (Foreach.Resolve): Indexers are just like variables
15712         or PropertyAccesses.
15713
15714         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15715         inside quoted strings, we were not doing this before.
15716
15717 2002-09-16  Martin Baulig  <martin@gnome.org>
15718
15719         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15720         resolve it.  This is needed for the definite assignment check of the
15721         instance expression, fixes bug #29846.
15722         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15723
15724 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15725
15726         * parameter.cs: Fix compile error.  Cannot reference static member
15727         from an instance object.  Is this an mcs bug?
15728
15729 2002-09-14  Martin Baulig  <martin@gnome.org>
15730
15731         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15732         multiple times.  Fixes bug #30295, added test-166.cs.
15733
15734 2002-09-14  Martin Baulig  <martin@gnome.org>
15735
15736         * statement.cs (Block.Emit): Don't emit unreachable code.
15737         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15738         `break' statements.
15739         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15740
15741 2002-09-14  Martin Baulig  <martin@gnome.org>
15742
15743         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15744         is set.
15745
15746 2002-09-14  Martin Baulig  <martin@gnome.org>
15747
15748         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15749         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15750         be false on the ms runtime.
15751
15752 2002-09-13  Martin Baulig  <martin@gnome.org>
15753
15754         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15755         the CS0038 error message.
15756
15757 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15758
15759         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15760         constant inside, return it.
15761
15762 2002-09-12  Martin Baulig  <martin@gnome.org>
15763
15764         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15765         implicit conversion can be done between enum types.
15766
15767         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15768         check whether an implicit conversion to the current enum's UnderlyingType
15769         exists and report an error if not.
15770
15771         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15772         without debugging support.
15773
15774         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15775         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15776
15777 2002-09-12  Martin Baulig  <martin@gnome.org>
15778
15779         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15780
15781         * ecore.cs (IMemberExpr.DeclaringType): New property.
15782         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15783         nonstatic member of an outer type (CS0038).
15784
15785 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15786
15787         * driver.cs: Activate the using-error detector at warning level
15788         4 (at least for MS-compatible APIs).
15789
15790         * namespace.cs (VerifyUsing): Small buglett fix.
15791
15792         * pending.cs (PendingImplementation): pass the container pointer. 
15793
15794         * interface.cs (GetMethods): Allow for recursive definition.  Long
15795         term, I would like to move every type to support recursive
15796         definitions, not the current ordering mechanism that we have right
15797         now.
15798
15799         The situation is this: Attributes are handled before interfaces,
15800         so we can apply attributes to interfaces.  But some attributes
15801         implement interfaces, we will now handle the simple cases
15802         (recursive definitions will just get an error).  
15803
15804         * parameter.cs: Only invalidate types at the end if we fail to
15805         lookup all types.  
15806
15807 2002-09-09  Martin Baulig  <martin@gnome.org>
15808
15809         * ecore.cs (PropertyExpr.Emit): Also check for
15810         TypeManager.system_int_array_get_length so this'll also work when
15811         compiling corlib.  Fixes #30003.
15812
15813 2002-09-09  Martin Baulig  <martin@gnome.org>
15814
15815         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15816         and throw an exception if we can't get the type's size.  Fixed #30040,
15817         added test-165.cs.
15818
15819 2002-09-09  Martin Baulig  <martin@gnome.org>
15820
15821         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15822
15823         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15824         context.  Fixes bug #30027.
15825
15826         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15827         virtual functions.  Fixes bug #30043, added test-164.cs.
15828
15829 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15830
15831         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15832
15833 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15834
15835         * driver.cs: Use an object to get the windows codepage since it's not a
15836         static property.
15837
15838 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * statement.cs (For.Emit): for infinite loops (test == null)
15841         return whether there is a break inside, not always "true".
15842
15843         * namespace.cs (UsingEntry): New struct to hold the name of the
15844         using definition, the location where it is defined, and whether it
15845         has been used in a successful type lookup.
15846
15847         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15848         strings.
15849
15850         * decl.cs: ditto.
15851
15852 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15853
15854         * attribute.cs : Fix incorrect code which relied on catching
15855         a NullReferenceException to detect a null being passed in
15856         where an object was expected.
15857
15858 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15859
15860         * statement.cs (Try): flag the catch variable as assigned
15861
15862         * expression.cs (Cast): Simplified by using ResolveType instead of
15863         manually resolving.
15864
15865         * statement.cs (Catch): Fix bug by using ResolveType.
15866
15867 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15868
15869         * expression.cs (BetterConversion): Special case for when we have
15870         a NullLiteral as the argument and we have to choose between string
15871         and object types - we choose string the way csc does.
15872
15873         * attribute.cs (Attribute.Resolve): Catch the
15874         NullReferenceException and report error #182 since the Mono
15875         runtime no more has the bug and having this exception raised means
15876         we tried to select a constructor which takes an object and is
15877         passed a null.
15878
15879 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15880
15881         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15882         message (1502, 1503) when we can't locate a method after overload
15883         resolution. This is much more informative and closes the bug
15884         Miguel reported.
15885
15886         * interface.cs (PopulateMethod): Return if there are no argument
15887         types. Fixes a NullReferenceException bug.
15888
15889         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15890         expressions too. Previously we were checking only in one place for
15891         positional arguments leaving out named arguments.
15892
15893         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15894         type to the enum type is not allowed. Remove code corresponding to
15895         that.
15896
15897         (ConvertNumericExplicit): Allow explicit conversions from
15898         the underlying type to enum type. This precisely follows the spec
15899         and closes a bug filed by Gonzalo.
15900
15901 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15902
15903         * compiler.csproj:
15904         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15905
15906 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15909         it was important that we stored the right value after the
15910         reduction in `converted'.
15911
15912 2002-09-04  Martin Baulig  <martin@gnome.org>
15913
15914         * location.cs (Location.SymbolDocument): Use full pathnames for the
15915         source files.
15916
15917 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15920         of the expression resolve mechanism, because that will catch the
15921         SimpleName error failures.
15922
15923         (Conditional): If we can not resolve the
15924         expression, return, do not crash.
15925
15926 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15927
15928         * cs-tokenizer.cs:
15929         (location): display token name instead of its number.
15930
15931 2002-08-28  Martin Baulig  <martin@gnome.org>
15932
15933         * expression.cs (Binary.ResolveOperator): Don't silently return
15934         but return an error if an operator cannot be applied between two
15935         enum types.
15936
15937 2002-08-28  Martin Baulig  <martin@gnome.org>
15938
15939         * class.cs (Constructor.Define): Set the permission attributes
15940         correctly instead of making all constructors public.
15941
15942 2002-08-28  Martin Baulig  <martin@gnome.org>
15943
15944         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15945         for private members before reporting a CS0103; if we find anything,
15946         it's a CS0122.
15947
15948 2002-08-28  Martin Baulig  <martin@gnome.org>
15949
15950         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15951         to check whether `closure_start_type == closure_invocation_type',
15952         we also need to check whether `m.DeclaringType == closure_invocation_type'
15953         before bypassing the permission checks.  We might be accessing
15954         protected/private members from the base class.
15955         (TypeManager.RealMemberLookup): Only set private_ok if private
15956         members were requested via BindingFlags.NonPublic.
15957
15958         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15959
15960         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15961         MethodGroupExpr.IsExplicitImpl if appropriate.
15962         (Invocation.DoResolve): Don't report the CS0120 for explicit
15963         interface implementations.
15964
15965 2002-08-27  Martin Baulig  <martin@gnome.org>
15966
15967         * expression.cs (Invocation.DoResolve): If this is a static
15968         method and we don't have an InstanceExpression, we must report
15969         a CS0120.
15970
15971 2002-08-25  Martin Baulig  <martin@gnome.org>
15972
15973         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15974         `==' between a valuetype and an object.
15975
15976 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15977
15978         * ecore.cs (TypeExpr): Provide a ToString method.
15979
15980 2002-08-24  Martin Baulig  <martin@gnome.org>
15981
15982         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15983         now called proggie.dbg and it's a binary file.
15984
15985 2002-08-23  Martin Baulig  <martin@gnome.org>
15986
15987         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15988
15989 2002-08-23  Martin Baulig  <martin@gnome.org>
15990
15991         * struct.cs (MyStructInfo.ctor): Make this work with empty
15992         structs; it's not allowed to use foreach() on null.
15993
15994 2002-08-23  Martin Baulig  <martin@gnome.org>
15995
15996         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15997         writer the full pathname of the generated assembly.
15998
15999 2002-08-23  Martin Baulig  <martin@gnome.org>
16000
16001         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16002         A `finally' block never returns or breaks; improved handling of
16003         unreachable code.
16004
16005 2002-08-23  Martin Baulig  <martin@gnome.org>
16006
16007         * statement.cs (Throw.Resolve): Allow `throw null'.
16008
16009 2002-08-23  Martin Baulig  <martin@gnome.org>
16010
16011         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16012         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16013         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16014         MemberLookup would return a wrong event if this is an explicit
16015         interface implementation and the class has an event with the same
16016         name.
16017
16018 2002-08-23  Martin Baulig  <martin@gnome.org>
16019
16020         * statement.cs (Block.AddChildVariableNames): New public method.
16021         (Block.AddChildVariableName): Likewise.
16022         (Block.IsVariableNameUsedInChildBlock): Likewise.
16023         (Block.AddVariable): Check whether a variable name has already
16024         been used in a child block.
16025
16026         * cs-parser.jay (declare_local_variables): Mark all variable names
16027         from the current block as being used in a child block in the
16028         implicit block.
16029
16030 2002-08-23  Martin Baulig  <martin@gnome.org>
16031
16032         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16033         find the symbol writer.
16034
16035         * driver.cs: csc also allows the arguments to /define being
16036         separated by commas, not only by semicolons.
16037
16038 2002-08-23  Martin Baulig  <martin@gnome.org>
16039
16040         * interface.cs (Interface.GetMembers): Added static check for events.
16041
16042 2002-08-15  Martin Baulig  <martin@gnome.org>
16043
16044         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16045         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16046
16047         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16048         why the MethodData.EmitDestructor() change was necessary.
16049
16050 2002-08-20  Martin Baulig  <martin@gnome.org>
16051
16052         * class.cs (TypeContainer.FindMembers): Added static check for events.
16053
16054         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16055
16056         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16057         use Type.GetEvents(), not Type.FindMembers().
16058
16059 2002-08-20  Martin Baulig  <martin@gnome.org>
16060
16061         * decl.cs (MemberCache): Added a special method cache which will
16062         be used for method-only searched.  This ensures that a method
16063         search will return a MethodInfo with the correct ReflectedType for
16064         inherited methods.      
16065
16066 2002-08-20  Martin Baulig  <martin@gnome.org>
16067
16068         * decl.cs (DeclSpace.FindMembers): Made this public.
16069
16070 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16071
16072         * delegate.cs: fixed build on windows.
16073         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16074
16075 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16076
16077         * ecore.cs (StandardConversionExists): Return a false
16078         if we are trying to convert the void type to anything else
16079         since that is not allowed.
16080
16081         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16082         we flag error 70 in the event an event is trying to be accessed
16083         directly from outside the declaring type.
16084
16085 2002-08-20  Martin Baulig  <martin@gnome.org>
16086
16087         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16088         MemberCache from typemanager.cs to decl.cs.
16089
16090 2002-08-19  Martin Baulig  <martin@gnome.org>
16091
16092         * class.cs (TypeContainer): Implement IMemberContainer.
16093         (TypeContainer.DefineMembers): Create the MemberCache.
16094         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16095         return public members if BindingFlags.Public was given, check
16096         whether members are static.
16097
16098 2002-08-16  Martin Baulig  <martin@gnome.org>
16099
16100         * decl.cs (DeclSpace.Define): Splitted this in Define and
16101         DefineMembers.  DefineMembers is called first and initializes the
16102         MemberCache.
16103
16104         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16105         DefineMembers() on all our DeclSpaces.
16106
16107         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16108         but call DefineMembers() on all nested interfaces.  We call their
16109         Define() in our new Define() function.
16110
16111         * interface.cs (Interface): Implement IMemberContainer.
16112         (Interface.Define): Moved all code except the attribute stuf to
16113         DefineMembers().
16114         (Interface.DefineMembers): Initialize the member cache.
16115
16116         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16117         need this anymore since we can use MemberCache.FindMembers directly.
16118
16119 2002-08-19  Martin Baulig  <martin@gnome.org>
16120
16121         * typemanager.cs (MemberCache): When creating the cache for an
16122         interface type, add all inherited members.
16123         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16124         to `out bool used_cache' and documented it.
16125         (TypeManager.MemberLookup): If we already used the cache in the first
16126         iteration, we don't need to do the interfaces check.
16127
16128 2002-08-19  Martin Baulig  <martin@gnome.org>
16129
16130         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16131         here from IMemberFinder and don't implement this interface anymore.
16132         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16133
16134         * typemanager.cs (IMemberFinder): This interface is now only used by
16135         classes which actually support the member cache.
16136         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16137         since we only put DeclSpaces into this Hashtable.
16138         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16139         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16140
16141 2002-08-16  Martin Baulig  <martin@gnome.org>
16142
16143         * typemanager.cs (ICachingMemberFinder): Removed.
16144         (IMemberFinder.MemberCache): New property.
16145         (TypeManager.FindMembers): Merged this with RealFindMembers().
16146         This function will never be called from TypeManager.MemberLookup()
16147         so we can't use the cache here, just the IMemberFinder.
16148         (TypeManager.MemberLookup_FindMembers): Check whether the
16149         IMemberFinder has a MemberCache and call the cache's FindMembers
16150         function.
16151         (MemberCache): Rewrote larger parts of this yet another time and
16152         cleaned it up a bit.
16153
16154 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16155
16156         * driver.cs (LoadArgs): Support quoting.
16157
16158         (Usage): Show the CSC-like command line arguments.
16159
16160         Improved a few error messages.
16161
16162 2002-08-15  Martin Baulig  <martin@gnome.org>
16163
16164         * typemanager.cs (IMemberContainer.Type): New property.
16165         (IMemberContainer.IsInterface): New property.
16166
16167         The following changes are conditional to BROKEN_RUNTIME, which is
16168         defined at the top of the file.
16169
16170         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16171         class'es members, but add all members from TypeHandle.ObjectType
16172         if we're an interface.
16173         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16174         is the current type.
16175         (MemberCache.CacheEntry.Container): Removed this field.
16176         (TypeHandle.GetMembers): Include inherited members.
16177
16178 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16179
16180         * typemanager.cs: fixed compilation and added a comment on a field that
16181         is never used.
16182
16183 2002-08-15  Martin Baulig  <martin@gnome.org>
16184
16185         * class.cs (ConstructorInitializer.Resolve): In the
16186         Expression.MemberLookup call, use the queried_type as
16187         invocation_type.
16188
16189         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16190         declared' attribute, it's always true.
16191         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16192         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16193         temporary wrapper for FindMembers which tells MemberLookup whether
16194         members from the base classes are included in the return value.
16195         This will go away soon.
16196         (TypeManager.MemberLookup): Use this temporary hack here; once the
16197         new MemberCache is completed, we don't need to do the DeclaredOnly
16198         looping here anymore since the MemberCache will take care of this.
16199         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16200         (MemberCache): When creating the MemberCache for a class, get
16201         members from the current class and all its base classes.
16202         (MemberCache.CacheEntry.Container): New field.  This is a
16203         temporary hack until the Mono runtime is fixed to distinguish
16204         between ReflectedType and DeclaringType.  It allows us to use MCS
16205         with both the MS runtime and the unfixed Mono runtime without
16206         problems and without accecting performance.
16207         (MemberCache.SearchMembers): The DeclaredOnly looping from
16208         TypeManager.MemberLookup is now done here.      
16209
16210 2002-08-14  Martin Baulig  <martin@gnome.org>
16211
16212         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16213         Type.GetFields on dynamic types but get the fields from the
16214         corresponding TypeContainer.
16215         (MyStructInfo.GetStructInfo): Added check for enum types.
16216
16217         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16218         (MemberList.SyncRoot): Implemented.
16219         (TypeManager.FilterWithClosure): No need to check permissions if
16220         closure_start_type == closure_invocation_type, don't crash if
16221         closure_invocation_type is null.
16222
16223 2002-08-13  Martin Baulig  <martin@gnome.org>
16224
16225         Rewrote TypeContainer.FindMembers to use a member cache.  This
16226         gives us a speed increase of about 35% for the self-hosting MCS
16227         build and of about 15-20% for the class libs (both on GNU/Linux).
16228
16229         * report.cs (Timer): New class to get enhanced profiling.  This
16230         whole class is "TIMER" conditional since it remarkably slows down
16231         compilation speed.
16232
16233         * class.cs (MemberList): New class.  This is an IList wrapper
16234         which we're now using instead of passing MemberInfo[]'s around to
16235         avoid copying this array unnecessarily.
16236         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16237         (ICachingMemberFinder, IMemberContainer): New interface.
16238         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16239         has already been checked, otherwise use it for the name comparision.
16240         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16241         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16242         if possible.  Returns a MemberList, not a MemberInfo [].
16243         (TypeHandle): New class, implements IMemberContainer.  We create
16244         one instance of this class per type, it contains a MemberCache
16245         which is used to do the member lookups.
16246         (MemberCache): New class.  Each instance of this class contains
16247         all members of a type and a name-based hash table.
16248         (MemberCache.FindMembers): This is our new member lookup
16249         function.  First, it looks up all members of the requested name in
16250         the hash table.  Then, it walks this list and sorts out all
16251         applicable members and returns them.
16252
16253 2002-08-13  Martin Baulig  <martin@gnome.org>
16254
16255         In addition to a nice code cleanup, this gives us a performance
16256         increase of about 1.4% on GNU/Linux - not much, but it's already
16257         half a second for the self-hosting MCS compilation.
16258
16259         * typemanager.cs (IMemberFinder): New interface.  It is used by
16260         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16261         Enum, Delegate or Interface.
16262         (TypeManager.finder_to_member_finder): New PtrHashtable.
16263         (TypeManager.finder_to_container): Removed.
16264         (TypeManager.finder_to_delegate): Removed.
16265         (TypeManager.finder_to_interface): Removed.
16266         (TypeManager.finder_to_enum): Removed.
16267
16268         * interface.cs (Interface): Implement IMemberFinder.
16269
16270         * delegate.cs (Delegate): Implement IMemberFinder.
16271
16272         * enum.cs (Enum): Implement IMemberFinder.
16273
16274         * class.cs (TypeContainer): Implement IMemberFinder.
16275
16276 2002-08-12  Martin Baulig  <martin@gnome.org>
16277
16278         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16279
16280 2002-08-12  Martin Baulig  <martin@gnome.org>
16281
16282         * ecore.cs (ITypeExpression): New interface for expressions which
16283         resolve to a type.
16284         (TypeExpression): Renamed to TypeLookupExpression.
16285         (Expression.DoResolve): If we're doing a types-only lookup, the
16286         expression must implement the ITypeExpression interface and we
16287         call DoResolveType() on it.
16288         (SimpleName): Implement the new ITypeExpression interface.
16289         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16290         hack, the situation that we're only looking up types can't happen
16291         anymore when this method is called.  Moved the type lookup code to
16292         DoResolveType() and call it.
16293         (SimpleName.DoResolveType): This ITypeExpression interface method
16294         is now doing the types-only lookup.
16295         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16296         (ResolveFlags): Added MaskExprClass.
16297
16298         * expression.cs (MemberAccess): Implement the ITypeExpression
16299         interface.
16300         (MemberAccess.DoResolve): Added support for a types-only lookup
16301         when we're called via ITypeExpression.DoResolveType().
16302         (ComposedCast): Implement the ITypeExpression interface.
16303
16304         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16305         Expression.Resolve() with ResolveFlags.Type instead.
16306
16307 2002-08-12  Martin Baulig  <martin@gnome.org>
16308
16309         * interface.cs (Interface.Define): Apply attributes.
16310
16311         * attribute.cs (Attribute.ApplyAttributes): Added support for
16312         interface attributes.
16313
16314 2002-08-11  Martin Baulig  <martin@gnome.org>
16315
16316         * statement.cs (Block.Emit): Only check the "this" variable if we
16317         do not always throw an exception.
16318
16319         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16320         whether the property has a set accessor.
16321
16322 2002-08-11  Martin Baulig  <martin@gnome.org>
16323
16324         Added control flow analysis support for structs.
16325
16326         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16327         with control flow analysis turned off.
16328         (IVariable): New interface.
16329         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16330         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16331         (FieldExpr.DoResolve): Resolve the instance expression with flow
16332         analysis turned off and do the definite assignment check after the
16333         resolving when we know what the expression will resolve to.
16334
16335         * expression.cs (LocalVariableReference, ParameterReference):
16336         Implement the new IVariable interface, only call the flow analysis
16337         code if ec.DoFlowAnalysis is true.
16338         (This): Added constructor which takes a Block argument.  Implement
16339         the new IVariable interface.
16340         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16341         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16342         This does the definite assignment checks for struct members.
16343
16344         * class.cs (Constructor.Emit): If this is a non-static `struct'
16345         constructor which doesn't have any initializer, call
16346         Block.AddThisVariable() to tell the flow analysis code that all
16347         struct elements must be initialized before control returns from
16348         the constructor.
16349
16350         * statement.cs (MyStructInfo): New public class.
16351         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16352         argument to this indexer.  If non-zero, check an individual struct
16353         member, not the whole struct.
16354         (FlowBranching.CheckOutParameters): Check struct members.
16355         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16356         overloaded versions of these methods which take an additional
16357         `int field_idx' argument to check struct members.
16358         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16359         overloaded versions of these methods which take an additional
16360         `string field_name' argument to check struct member.s
16361         (VariableInfo): Implement the IVariable interface.
16362         (VariableInfo.StructInfo): New public property.  Returns the
16363         MyStructInfo instance of the variable if it's a struct or null.
16364         (Block.AddThisVariable): New public method.  This is called from
16365         Constructor.Emit() for non-static `struct' constructor which do
16366         not have any initializer.  It creates a special variable for the
16367         "this" instance variable which will be checked by the flow
16368         analysis code to ensure that all of the struct's fields are
16369         initialized before control returns from the constructor.
16370         (UsageVector): Added support for struct members.  If a
16371         variable/parameter is a struct with N members, we reserve a slot
16372         in the usage vector for each member.  A struct is considered fully
16373         initialized if either the struct itself (slot 0) or all its
16374         members are initialized.
16375
16376 2002-08-08  Martin Baulig  <martin@gnome.org>
16377
16378         * driver.cs (Driver.MainDriver): Only report an error CS5001
16379         if there were no compilation errors.
16380
16381         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16382         `UnsafeContext' property to determine whether the parent is in
16383         unsafe context rather than checking the parent's ModFlags:
16384         classes nested in an unsafe class are unsafe as well.
16385
16386 2002-08-08  Martin Baulig  <martin@gnome.org>
16387
16388         * statement.cs (UsageVector.MergeChildren): Distinguish between
16389         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16390         we return.  Added test17() and test18() to test-154.cs.
16391
16392 2002-08-08  Martin Baulig  <martin@gnome.org>
16393
16394         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16395         Family access, make sure the invoking type isn't a subclass of the
16396         queried type (that'd be a CS1540).
16397
16398         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16399         this method which takes an additional `Type invocation_type'.
16400
16401         * expression.cs (BaseAccess.DoResolve): Use the base type as
16402         invocation and query type.
16403         (MemberAccess.DoResolve): If the lookup failed and we're about to
16404         report a CS0122, try a lookup with the ec.ContainerType - if this
16405         succeeds, we must report a CS1540.
16406
16407 2002-08-08  Martin Baulig  <martin@gnome.org>
16408
16409         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16410         (MethodGroupExpr): Implement the IMemberExpr interface.
16411
16412         * expression (MemberAccess.ResolveMemberAccess): No need to have
16413         any special code for MethodGroupExprs anymore, they're now
16414         IMemberExprs.   
16415
16416 2002-08-08  Martin Baulig  <martin@gnome.org>
16417
16418         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16419         Family, FamANDAssem and FamORAssem permissions.
16420         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16421
16422 2002-08-08  Martin Baulig  <martin@gnome.org>
16423
16424         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16425         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16426         or loop block.
16427
16428 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16429
16430         * driver.cs: implemented /resource option to embed managed resources.
16431
16432 2002-08-07  Martin Baulig  <martin@gnome.org>
16433
16434         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16435         (FieldBase.HasFieldInitializer): New public property.
16436         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16437         returns the field initializer and makes sure it is only resolved once.
16438         (TypeContainer.EmitFieldInitializers): Call
16439         FieldBase.GetInitializerExpression to get the initializer, this ensures
16440         that it isn't resolved multiple times.
16441
16442         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16443         the resolving process (SimpleName/MemberLookup) that we're currently
16444         emitting a field initializer (which must not access any instance members,
16445         this is an error CS0236).
16446
16447         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16448         argument, if the `IsFieldInitializer' flag is set, we must report and
16449         error CS0236 and not an error CS0120.   
16450
16451 2002-08-07  Martin Baulig  <martin@gnome.org>
16452
16453         * ecore.cs (IMemberExpr): New public interface.
16454         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16455         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16456         if the expression is an IMemberExpr.
16457
16458         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16459         to be null, implicitly default to `this' if we're non-static in
16460         this case.  Simplified the code a lot by using the new IMemberExpr
16461         interface.  Also fixed bug #28176 here.
16462
16463 2002-08-06  Martin Baulig  <martin@gnome.org>
16464
16465         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16466         ParameterReferences during semantic analysis so that we can do a
16467         type-only search when resolving Cast, TypeOf and SizeOf.
16468         (block): Pass the `current_local_parameters' to the Block's
16469         constructor.
16470
16471         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16472         argument to the constructor.
16473         (ConstructorInitializer.Resolve): Create a temporary implicit
16474         block with the parameters.
16475
16476         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16477         references here if we aren't doing a type-only search.
16478
16479         * statement.cs (Block): Added constructor which takes a
16480         `Parameters parameters' argument.
16481         (Block.Parameters): New public property.
16482
16483         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16484         to `Parameters' and made it public readonly.
16485
16486 2002-08-06  Martin Baulig  <martin@gnome.org>
16487
16488         * ecore.cs (Expression.Warning): Made this public as well.
16489
16490         * report.cs (Report.Debug): Print the contents of collections.
16491
16492 2002-08-06  Martin Baulig  <martin@gnome.org>
16493
16494         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16495         used to tell Resolve() which kinds of expressions it may return.
16496         (Expression.Resolve): Added overloaded version of this method which
16497         takes a `ResolveFlags flags' argument.  This can be used to tell
16498         Resolve() which kinds of expressions it may return.  Reports a
16499         CS0118 on error.
16500         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16501         ResolveFlags.SimpleName.
16502         (Expression.Error118): Added overloaded version of this method which
16503         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16504         which kinds of expressions are allowed.
16505
16506         * expression.cs (Argument.ResolveMethodGroup): New public method.
16507         Resolves an argument, but allows a MethodGroup to be returned.
16508         This is used when invoking a delegate.
16509
16510         * TODO: Updated a bit.
16511
16512 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16513
16514         Fixed compilation with csc.
16515
16516         * ecore.cs: Expression.Error made public. Is this correct? Should
16517         Warning be made public too?
16518
16519         * expression.cs: use ea.Location instead of ea.loc.
16520         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16521
16522 2002-08-06  Martin Baulig  <martin@gnome.org>
16523
16524         * ecore.cs (Expression.loc): Moved the location here instead of
16525         duplicating it in all derived classes.
16526         (Expression.Location): New public property.
16527         (Expression.Error, Expression.Warning): Made them non-static and
16528         removed the location argument.
16529         (Expression.Warning): Added overloaded version which takes an
16530         `int level' argument.
16531         (Expression.Error118): Make this non-static and removed the
16532         expression and location arguments.
16533         (TypeExpr): Added location argument to the constructor.
16534
16535         * expression.cs (StaticCallExpr): Added location argument to
16536         the constructor.
16537         (Indirection, PointerArithmetic): Likewise.
16538         (CheckedExpr, UnCheckedExpr): Likewise.
16539         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16540         (StringPtr): Likewise.
16541
16542
16543 2002-08-05  Martin Baulig  <martin@gnome.org>
16544
16545         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16546
16547         * assign.cs (Assign.DoResolve): Check whether the source
16548         expression is a value or variable.
16549
16550         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16551         while resolving the corresponding blocks.
16552
16553         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16554         an error, don't silently return null.
16555
16556         * statement.cs (Block.AddVariable): Do the error reporting here
16557         and distinguish between CS0128 and CS0136.
16558         (Block.DoResolve): Report all unused labels (warning CS0164).
16559         (LabeledStatement): Pass the location to the constructor.
16560         (LabeledStatement.HasBeenReferenced): New property.
16561         (LabeledStatement.Resolve): Set it to true here.
16562
16563         * statement.cs (Return.Emit): Return success even after reporting
16564         a type mismatch error (CS0126 or CS0127), this is what csc does and
16565         it avoids confusing the users with any consecutive errors.
16566
16567 2002-08-05  Martin Baulig  <martin@gnome.org>
16568
16569         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16570
16571         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16572
16573         * expression.cs (MemberAccess.DoResolve): Silently return if an
16574         error has already been reported.
16575
16576         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16577         error has already been reported.
16578
16579 2002-08-05  Martin Baulig  <martin@gnome.org>
16580
16581         * statement.cs (UsageVector): Only initialize the `parameters'
16582         vector if we actually have any "out" parameters.
16583
16584 2002-08-05  Martin Baulig  <martin@gnome.org>
16585
16586         * expression.cs (Binary.ResolveOperator): When combining delegates,
16587         they must have the same type.
16588
16589 2002-08-05  Martin Baulig  <martin@gnome.org>
16590
16591         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16592         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16593         work with the ms runtime and we also don't need it: if we're a
16594         PropertyBuilder and not in the `indexer_arguments' hash, then we
16595         are a property and not an indexer.
16596
16597         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16598         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16599         since the latter one doesn't work with the ms runtime.
16600
16601 2002-08-03  Martin Baulig  <martin@gnome.org>
16602
16603         Fixed bugs #27998 and #22735.
16604
16605         * class.cs (Method.IsOperator): New public field.
16606         (Method.CheckBase): Report CS0111 if there's already a method
16607         with the same parameters in the current class.  Report CS0508 when
16608         attempting to change the return type of an inherited method.
16609         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16610         and it's not marked abstract or extern.
16611         (PropertyBase): New abstract base class for Property and Indexer.
16612         (PropertyBase.CheckBase): Moved here from Property and made it work
16613         for indexers.
16614         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16615         the same so we can reuse it there.
16616         (Property, Indexer): Derive from PropertyBase.
16617         (MethodSignature.inheritable_property_signature_filter): New delegate
16618         to find properties and indexers.
16619
16620         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16621         argument and improved error reporting.
16622
16623         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16624         EmptyReadOnlyParameters and made it a property.
16625
16626         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16627         version of this method which takes a `PropertyInfo indexer'.
16628         (TypeManager.RegisterIndexer): New method.
16629
16630         * class.cs: Added myself as author of this file :-)
16631
16632 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16633
16634         * class.cs: fixed compilation on windoze.
16635
16636 2002-08-03  Martin Baulig  <martin@gnome.org>
16637
16638         * interface.cs (Interface.GetInterfaceBases): Check whether all
16639         base interfaces are at least as accessible than the current one.
16640
16641         * class.cs (TypeContainer.GetClassBases): Check whether base types
16642         are at least as accessible than the current type.
16643         (TypeContainer.AsAccessible): Implemented and made non-static.
16644         (MemberBase.CheckParameters): Report errors if the accessibility
16645         checks fail.
16646
16647         * delegate.cs (Delegate.Delegate): The default visibility is
16648         internal for top-level types and private for nested types.
16649         (Delegate.Define): Report errors if the accessibility checks fail.
16650
16651         * enum.cs (Enum.Enum): The default visibility is internal for
16652         top-level types and private for nested types.
16653         (Enum.DefineType): Compute the correct visibility.
16654
16655         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16656         function which takes a `bool is_toplevel' instead of a TypeContainer.
16657
16658         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16659         builtin type.
16660
16661 2002-08-02  Martin Baulig  <martin@gnome.org>
16662
16663         * expression.cs (LocalVariableReferenc): Added constructor which
16664         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16665         (LocalVariableReference.IsReadOnly): New property.
16666         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16667         variable is readonly, use our own readonly flag to do this; you can
16668         use the new constructor to get a writable reference to a read-only
16669         variable.
16670
16671         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16672         reference to the local variable.
16673
16674 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16675
16676         * rootcontext.cs (ResolveCore): Also include System.Exception
16677
16678         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16679         we reach an EmptyStatement.
16680
16681         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16682         is also fine.
16683
16684         * expression.cs (Binary.ResolveOperator): Check error result in
16685         two places.
16686
16687         use brtrue/brfalse directly and avoid compares to null.
16688
16689 2002-08-02  Martin Baulig  <martin@gnome.org>
16690
16691         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16692         Fixes bug #28407, added test-155.cs.
16693
16694 2002-08-01  Martin Baulig  <martin@gnome.org>
16695
16696         * class.cs (Event.EmitDefaultMethod): Make this work with static
16697         events.  Fixes #28311, added verify-3.cs.
16698
16699 2002-08-01  Martin Baulig  <martin@gnome.org>
16700
16701         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16702         `is_disposable' fields.
16703         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16704         `hm.is_disposable' if we're using the collection pattern.
16705         (Foreach.EmitCollectionForeach): Use the correct type for the
16706         enumerator's local variable, only emit the try/finally block if
16707         necessary (fixes #27713).
16708
16709 2002-08-01  Martin Baulig  <martin@gnome.org>
16710
16711         * ecore.cs (Expression.report118): Renamed to Error118 and made
16712         it public static.
16713
16714         * statement.cs (Throw.Resolve): Check whether the expression is of
16715         the correct type (CS0118) and whether the type derives from
16716         System.Exception (CS0155).
16717         (Catch.Resolve): New method.  Do the type lookup here and check
16718         whether it derives from System.Exception (CS0155).
16719         (Catch.CatchType, Catch.IsGeneral): New public properties.
16720
16721         * typemanager.cs (TypeManager.exception_type): Added.
16722
16723 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * driver.cs: Updated About function.
16726
16727 2002-07-31  Martin Baulig  <martin@gnome.org>
16728
16729         Implemented Control Flow Analysis.
16730
16731         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16732         (EmitContext.CurrentBranching): Added.
16733         (EmitContext.StartFlowBranching): Added.
16734         (EmitContext.EndFlowBranching): Added.
16735         (EmitContext.KillFlowBranching): Added.
16736         (EmitContext.IsVariableAssigned): Added.
16737         (EmitContext.SetVariableAssigned): Added.
16738         (EmitContext.IsParameterAssigned): Added.
16739         (EmitContext.SetParameterAssigned): Added.
16740         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16741         Added control flow analysis stuff here.
16742
16743         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16744         resolve the expression as lvalue.
16745         (LocalVariableReference.DoResolve): Check whether the variable has
16746         already been assigned.
16747         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16748         the parameter as assigned here.
16749         (ParameterReference.DoResolve): Check whether the parameter has already
16750         been assigned.
16751         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16752         expression as lvalue.
16753
16754         * statement.cs (FlowBranching): New class for the flow analysis code.
16755         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16756         (LabeledStatement.IsDefined): New public property.
16757         (LabeledStatement.AddUsageVector): New public method to tell flow
16758         analyis that the label may be reached via a forward jump.
16759         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16760         flow analysis.
16761         (VariableInfo.Number): New public field.  This is used by flow analysis
16762         to number all locals of a block.
16763         (Block.CountVariables): New public property.  This is the number of
16764         local variables in this block (including the locals from all parent
16765         blocks).
16766         (Block.EmitMeta): Number all the variables.
16767
16768         * statement.cs: Added flow analysis support to all classes.
16769
16770 2002-07-31  Martin Baulig  <martin@gnome.org>
16771
16772         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16773         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16774         then use this argument.
16775
16776         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16777
16778         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16779         use this to specify /define options.
16780
16781 2002-07-29  Martin Baulig  <martin@gnome.org>
16782
16783         * statement.cs (Fixed): Moved all code that does variable lookups
16784         and resolvings from Emit to Resolve.
16785
16786         * statement.cs (For): Moved all code that does variable lookups
16787         and resolvings from Emit to Resolve.
16788
16789         * statement.cs (Using): Moved all code that does variable lookups
16790         and resolvings from Emit to Resolve.
16791
16792 2002-07-29  Martin Baulig  <martin@gnome.org>
16793
16794         * attribute.cs (Attribute.Resolve): Explicitly catch a
16795         System.NullReferenceException when creating the
16796         CustromAttributeBuilder and report a different warning message.
16797
16798 2002-07-29  Martin Baulig  <martin@gnome.org>
16799
16800         * support.cs (ParameterData.ParameterName): Added method to
16801         get the name of a parameter.
16802
16803         * typemanager.cs (TypeManager.IsValueType): New public method.
16804
16805 2002-07-29  Martin Baulig  <martin@gnome.org>
16806
16807         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16808         is a flag which specifies that it's either ref or out.
16809         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16810         the out parameter to `out Parameter.Modifier mod', also set the
16811         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16812
16813         * support.cs (InternalParameters.ParameterModifier): Distinguish
16814         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16815         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16816
16817         * expression.cs (Argument.GetParameterModifier): Distinguish
16818         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16819         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16820
16821 2002-07-29  Martin Baulig  <martin@gnome.org>
16822
16823         * expression.cs (ParameterReference.ParameterReference): Added
16824         `Location loc' argument to the constructor.
16825
16826         * cs-parser.jay: Pass location to ParameterReference.
16827
16828 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16829
16830         * statement.cs (Try): Initialize the location.
16831
16832         * cs-parser.jay: pass location to Try.
16833
16834         * expression.cs (Unary.Reduce): Change the prototype to return
16835         whether a constant fold could be performed or not.  The result is
16836         returned in an out parameters.  In the case of Indirection and
16837         AddressOf, we want to perform the full tests.
16838
16839 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16840
16841         * statement.cs (Statement.Emit): Flag dead code.
16842
16843 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16844
16845         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16846
16847 2002-07-27  Martin Baulig  <martin@gnome.org>
16848
16849         * class.cs (MethodData.Define): Put back call to
16850         TypeManager.AddMethod(), accidentally commented this out.
16851
16852         * report.cs (Debug): New public method to print debugging information,
16853         this is `[Conditional ("DEBUG")]'.
16854
16855 2002-07-26  Martin Baulig  <martin@gnome.org>
16856
16857         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16858         (switch_statement): Push the current_block to the switch_stack and
16859         pop it again when we're done with the switch.
16860         (switch_section): The new block is a child of the current_block.
16861         Fixes bug #24007, added test-152.cs.
16862
16863 2002-07-27  Martin Baulig  <martin@gnome.org>
16864
16865         * expression.cs (Invocation.EmitArguments): When calling a varargs
16866         function with only its fixed arguments, we need to pass an empty
16867         array.
16868
16869 2002-07-27  Martin Baulig  <martin@gnome.org>
16870
16871         Mono 0.13 has been released.
16872
16873 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * driver.cs: Rename --resource to --linkres, because that is what
16876         we do currently, we dont support --resource yet.
16877
16878         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16879
16880 2002-07-25  Martin Baulig  <martin@gnome.org>
16881
16882         * class.cs (MethodData): New public class.  This is a `method builder'
16883         class for a method or one accessor of a Property/Indexer/Event.
16884         (MethodData.GetMethodFlags): Moved here from MemberBase.
16885         (MethodData.ApplyAttributes): Likewise.
16886         (MethodData.ApplyObsoleteAttribute): Likewise.
16887         (MethodData.ApplyConditionalAttribute): Likewise.
16888         (MethodData.ApplyDllImportAttribute): Likewise.
16889         (MethodData.CheckAbstractAndExternal): Likewise.
16890         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16891         (MethodData.Emit): Formerly known as Method.Emit().
16892         (MemberBase): Moved everything which was specific to a single
16893         accessor/method to MethodData.
16894         (Method): Create a new MethodData and call Define() and Emit() on it.
16895         (Property, Indexer, Event): Create a new MethodData objects for each
16896         accessor and call Define() and Emit() on them.
16897
16898 2002-07-25  Martin Baulig  <martin@gnome.org>
16899
16900         Made MethodCore derive from MemberBase to reuse the code from there.
16901         MemberBase now also checks for attributes.
16902
16903         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16904         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16905         as virtual.
16906         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16907         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16908         (MemberBase.ApplyAttributes): New virtual method; applies the
16909         attributes to a method or accessor.
16910         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16911         (MemberBase.ApplyConditionalAttribute): Likewise.
16912         (MemberBase.ApplyDllImportAttribute): Likewise.
16913         (MemberBase.CheckAbstractAndExternal): Likewise.
16914         (MethodCore.ParameterTypes): This is now a property instead of a
16915         method, it's initialized from DoDefineParameters().
16916         (MethodCore.ParameterInfo): Removed the set accessor.
16917         (MethodCore.DoDefineParameters): New protected virtual method to
16918         initialize ParameterTypes and ParameterInfo.
16919         (Method.GetReturnType): We can now simply return the MemberType.
16920         (Method.GetMethodFlags): Override the MemberBase version and add
16921         the conditional flags.
16922         (Method.CheckBase): Moved some code from Define() here, call
16923         DoDefineParameters() here.
16924         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16925         here to avoid some larger code duplication.
16926         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16927         ensure that abstract and external accessors don't declare a body.
16928
16929         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16930         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16931         lookup in the attribute's parent classes, so we need to abort as soon
16932         as we found the first match.
16933         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16934         the attribute has no arguments.
16935
16936         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16937         of a Method.
16938
16939 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16940
16941         * cs-parser.jay: reverted previous patch.
16942
16943 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16944
16945         * cs-parser.jay: fixed bug #22119.
16946
16947 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16948
16949         * attribute.cs: fixed compilation. The error was:
16950         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16951         be assigned to before control leaves the current method."
16952         [FIXME:  Filed as bug #28186: MCS must report this error.]
16953
16954 2002-07-25  Martin Baulig  <martin@gnome.org>
16955
16956         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16957         method to pull the condition name ouf of a Conditional attribute.
16958         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16959         the obsolete message and error flag out of an Obsolete attribute.
16960
16961         * class.cs (Method.GetMethodFlags): New public method to get the
16962         TypeManager.MethodFlags for this method.
16963         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16964         private methods.
16965         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16966         if we're overriding a virtual function, set the new private variable
16967         `parent_method'; call the new TypeManager.AddMethod().
16968
16969         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16970         the MethodBuilder and the Method in a PtrHashtable.
16971         (TypeManager.builder_to_method): Added for this purpose.
16972         (TypeManager.MethodFlags): Added IsObsoleteError.
16973         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16974         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16975         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16976         the message from the attribute.
16977
16978 2002-07-24  Martin Baulig  <martin@gnome.org>
16979
16980         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16981         preprocessor directives, ensure that the argument to #define/#undef is
16982         exactly one identifier and that it's actually an identifier.
16983
16984         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16985         did not work ....
16986
16987 2002-07-24  Martin Baulig  <martin@gnome.org>
16988
16989         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16990         initialize it to TypeManager.object_type in the constructor.
16991         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16992         of the `hm.get_current' method if we're using the collection pattern.
16993         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16994         for the explicit conversion to make it work when we're using the collection
16995         pattern and the `Current' property has a different return type than `object'.
16996         Fixes #27713.
16997
16998 2002-07-24  Martin Baulig  <martin@gnome.org>
16999
17000         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17001         does not match, but don't report any errors.  This method is called in
17002         order for all methods in a MethodGroupExpr until a matching method is
17003         found, so we don't want to bail out if the first method doesn't match.
17004         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17005         matches, report the 123.  Fixes #28070.
17006
17007 2002-07-24  Martin Baulig  <martin@gnome.org>
17008
17009         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17010         TypeManager.TypeToCoreType() to the top of the method so the
17011         following equality checks will work.  Fixes #28107.
17012
17013 2002-07-24  Martin Baulig  <martin@gnome.org>
17014
17015         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17016         operand is of type uint, and the other operand is of type sbyte,
17017         short or int, the operands are converted to type long." -
17018         Actually do what this comment already told us.  Fixes bug #28106,
17019         added test-150.cs.
17020
17021 2002-07-24  Martin Baulig  <martin@gnome.org>
17022
17023         * class.cs (MethodBase): New abstract class.  This is now a base
17024         class for Property, Indexer and Event to avoid some code duplication
17025         in their Define() and DefineMethods() methods.
17026         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17027         generic methods for Define() and DefineMethods().
17028         (FieldBase): Derive from MemberBase, not MemberCore.
17029         (Property): Derive from MemberBase, not MemberCore.
17030         (Property.DefineMethod): Moved all the code from this method to the
17031         new MethodBase.DefineAccessor(), just call it with appropriate
17032         argumetnts.
17033         (Property.Define): Call the new Property.DoDefine(), this does some
17034         sanity checks and we don't need to duplicate the code everywhere.
17035         (Event): Derive from MemberBase, not MemberCore.
17036         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17037         accessors, this will also make them work with interface events.
17038         (Indexer): Derive from MemberBase, not MemberCore.
17039         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17040         (Indexer.Define): Use the new MethodBase functions.
17041
17042         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17043         argument to the constructor.
17044         (Interface.FindMembers): Added support for interface events.
17045         (Interface.PopluateEvent): Implemented.
17046
17047         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17048
17049 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17050
17051         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17052         but this is required to check for a method name being the same as
17053         the containing class.  
17054
17055         Handle this now.
17056
17057 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17058
17059         * interface.cs: initialize variable.
17060
17061 2002-07-23  Martin Baulig  <martin@gnome.org>
17062
17063         Implemented the IndexerName attribute in interfaces.
17064
17065         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17066         name if this is an explicit interface implementation.
17067         (Indexer.InterfaceIndexerName): New public variable.  If we're
17068         implementing an interface indexer, this is the IndexerName in that
17069         interface.  Otherwise, it's the IndexerName.
17070         (Indexer.DefineMethod): If we're implementing interface indexer,
17071         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17072         and Pending.ImplementIndexer methods.
17073         (Indexer.Define): Also define the PropertyBuilder if we're
17074         implementing an interface indexer and this is neither an explicit
17075         interface implementation nor do the IndexerName match the one in
17076         the interface.
17077
17078         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17079         If a method is defined here, then we always need to create a proxy
17080         for it.  This is used when implementing interface indexers.
17081         (Pending.IsInterfaceIndexer): New public method.
17082         (Pending.ImplementIndexer): New public method.
17083         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17084         This is used when implementing interface indexers to define a proxy
17085         if necessary.
17086         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17087         define a proxy if necessary.
17088
17089         * interface.cs (Interface.IndexerName): New public variable.
17090         (Interface.PopulateIndexer): Set the IndexerName.
17091         (Interface.DefineIndexers): New private method.  Populate all the
17092         indexers and make sure their IndexerNames match.
17093
17094         * typemanager.cs (IndexerPropertyName): Added support for interface
17095         indexers.
17096
17097 2002-07-22  Martin Baulig  <martin@gnome.org>
17098
17099         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17100         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17101         ret if HasReturnLabel.
17102         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17103         variables.
17104
17105         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17106         and set the ec.LoopBeginTryCatchLevel.
17107         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17108         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17109         the current ec.TryCatchLevel, the branch goes out of an exception
17110         block.  In this case, we need to use Leave and not Br.
17111
17112 2002-07-22  Martin Baulig  <martin@gnome.org>
17113
17114         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17115         block unless the block does not always return or it is contained in
17116         another try { ... } catch { ... } block.  Fixes bug #26506.
17117         Added verify-1.cs to the test suite.
17118
17119 2002-07-22  Martin Baulig  <martin@gnome.org>
17120
17121         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17122         then we do not always return.  Fixes bug #24985.
17123
17124 2002-07-22  Martin Baulig  <martin@gnome.org>
17125
17126         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17127         lookup on a per-class level; ie. walk up the class hierarchy until we
17128         found at least one applicable method, then choose the best among them.
17129         Fixes bug #24463 and test-29.cs.
17130
17131 2002-07-22  Martin Baulig  <martin@gnome.org>
17132
17133         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17134         return types of the methods.  The return type is not part of the
17135         signature and we must not check it to make the `new' modifier work.
17136         Fixes bug #27999, also added test-147.cs.
17137         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17138
17139         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17140         on the method's return type.
17141
17142 2002-07-21  Martin Baulig  <martin@gnome.org>
17143
17144         * assign.cs: Make this work if the rightmost source is a constant and
17145         we need to do an implicit type conversion.  Also adding a few more tests
17146         to test-38.cs which should have caught this.
17147
17148         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17149         target in the makefile for this.  The makefile.gnu is primarily intended
17150         for end-users who don't want to debug the compiler.
17151
17152 2002-07-21  Martin Baulig  <martin@gnome.org>
17153
17154         * assign.cs: Improved the Assign class so it can now handle embedded
17155         assignments (X = Y = Z = something).  As a side-effect this'll now also
17156         consume less local variables.  test-38.cs now passes with MCS, added
17157         a few new test cases to that test.
17158
17159 2002-07-20  Martin Baulig  <martin@gnome.org>
17160
17161         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17162         instructions.  Fixes bug #27977, also added test-146.cs.
17163
17164 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17165
17166         * cs-tokenizer.cs: fixed getHex ().
17167
17168 2002-07-19  Martin Baulig  <martin@gnome.org>
17169
17170         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17171         not Type.GetType() to lookup the array type.  This is needed when
17172         we're constructing an array of a user-defined type.
17173         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17174         single-dimensional arrays, but also for single-dimensial arrays of
17175         type decimal.
17176
17177 2002-07-19  Martin Baulig  <martin@gnome.org>
17178
17179         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17180         this function is called, it's not allowed to share LocalBuilders
17181         among ILGenerators.
17182
17183 2002-07-19  Martin Baulig  <martin@gnome.org>
17184
17185         * expression.cs (Argument.Resolve): Report an error 118 when trying
17186         to pass a type as argument.
17187
17188 2002-07-18  Martin Baulig  <martin@gnome.org>
17189
17190         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17191         Conv_R_Un for the signed `long' type.
17192
17193 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17194
17195         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17196         `expr' for the temporary result, as that will fail if we do
17197         multiple resolves on the same expression.
17198
17199 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17200
17201         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17202         ec.TypeContainer for looking up aliases. 
17203
17204         * class.cs (TypeContainer): Remove LookupAlias from here.
17205
17206         * decl.cs (DeclSpace); Move here.
17207
17208 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17209
17210         * class.cs (FindMembers): Only call filter if the constructor
17211         bulider is not null.
17212
17213         Also handle delegates in `NestedTypes' now.  Now we will perform
17214         type lookups using the standard resolution process.  This also
17215         fixes a bug.
17216
17217         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17218         This uses Expressions (the limited kind that can be parsed by the
17219         tree) instead of strings.
17220
17221         * expression.cs (ComposedCast.ToString): Implement, used to flag
17222         errors since now we have to render expressions.
17223
17224         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17225         FormArrayType. 
17226
17227         * ecore.cs (SimpleName.ToString): ditto.
17228
17229         * cs-parser.jay: Instead of using strings to assemble types, use
17230         Expressions to assemble the type (using SimpleName, ComposedCast,
17231         MemberAccess).  This should fix the type lookups in declarations,
17232         because we were using a different code path for this.
17233
17234         * statement.cs (Block.Resolve): Continue processing statements
17235         even when there is an error.
17236
17237 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * class.cs (Event.Define): Also remove the `remove' method from
17240         the list of pending items.
17241
17242         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17243         generate more compact code. 
17244
17245 2002-07-17  Martin Baulig  <martin@gnome.org>
17246
17247         * const.cs (Const.LookupConstantValue): Add support for constant
17248         `unchecked' and `checked' expressions.
17249         Also adding test case test-140.cs for this.
17250
17251 2002-07-17  Martin Baulig  <martin@gnome.org>
17252
17253         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17254         check whether mi.ReturnType implements the IEnumerator interface; the
17255         `==' and the IsAssignableFrom() will fail in this situation.
17256
17257 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17258
17259         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17260         here too.
17261
17262 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17263
17264         * expression.cs: fixed bug #27811.
17265
17266 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17267
17268         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17269         Molaro: when we are a ref, the value already contains a pointer
17270         value, do not take the address of it.
17271
17272 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17273         * removed mb-parser.jay and mb-tokenizer.cs
17274
17275 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17276
17277         * expression.cs: check against the building corlib void type.
17278
17279 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17280
17281         * ecore.cs: fix for valuetype static readonly fields: when 
17282         initializing them, we need their address, not the address of a copy.
17283
17284 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17285
17286         * typemanager.cs: register also enum_type in corlib.
17287
17288 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17289
17290         * class.cs: allow calling this (but not base) initializers in structs.
17291
17292 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17293
17294         * ecore.cs: make sure we compare against the building base types
17295         in GetTypeSize ().
17296
17297 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17298
17299         * typemanager.cs: fix TypeToCoreType() to handle void and object
17300         (corlib gets no more typerefs after this change).
17301
17302 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17303
17304         * expression.cs (ArrayCreation.EmitArrayArguments): use
17305         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17306
17307         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17308         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17309         array indexes, the runtime actually forbids them.
17310
17311         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17312         for array arguments here.
17313
17314         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17315         instead of the default for ValueTypes.
17316
17317         (New.DoEmit): Use IsValueType instead of
17318         IsSubclassOf (value_type)
17319         (New.DoResolve): ditto.
17320         (Invocation.EmitCall): ditto.
17321
17322         * assign.cs (Assign): ditto.
17323
17324         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17325         Statements *are* currently doing part of their resolution during
17326         Emit.  
17327
17328         Expressions do always resolve during resolve, but statements are
17329         only required to propagate resolution to their children.
17330
17331 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17332
17333         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17334
17335         (LoadAssembly): Do not add the dll if it is already specified
17336
17337         (MainDriver): Add the System directory to the link path at the end,
17338         after all the other -L arguments. 
17339
17340         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17341         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17342         ldelem.u1) and using the opposite for sbytes.
17343
17344         This fixes Digger, and we can finally run it.
17345
17346         * driver.cs (UnixParseOption): Move the option parsing here.  
17347         (CSCParseOption): Implement CSC-like parsing of options.
17348
17349         We now support both modes of operation, the old Unix way, and the
17350         new CSC-like way.  This should help those who wanted to make cross
17351         platform makefiles.
17352
17353         The only thing broken is that /r:, /reference: and /lib: are not
17354         implemented, because I want to make those have the same semantics
17355         as the CSC compiler has, and kill once and for all the confussion
17356         around this.   Will be doing this tomorrow.
17357
17358         * statement.cs (Unsafe.Resolve): The state is checked during
17359         resolve, not emit, so we have to set the flags for IsUnsfe here.
17360
17361 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17362
17363         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17364         not catch the Error_ObjectRefRequired in SimpleName (as it is
17365         possible to have a class/instance variable name that later gets
17366         deambiguated), we have to check this here.      
17367
17368 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17369
17370         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17371         make static and put into Expression.
17372
17373         (Event.Define): Register the private field of the event with the 
17374         TypeManager so that GetFieldFromEvent can get at it.
17375
17376         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17377         keep track of the private field associated with an event which
17378         has no accessors.
17379
17380         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17381         private field.
17382
17383         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17384
17385 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * expression.cs (Binary.EmitBranchable): this routine emits the
17388         Binary expression in a branchable context.  This basically means:
17389         we need to branch somewhere, not just get the value on the stack.
17390
17391         This works together with Statement.EmitBoolExpression.
17392
17393         * statement.cs (Statement.EmitBoolExpression): Use
17394         EmitBranchable. 
17395
17396 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * statement.cs (For): Reduce the number of jumps in loops.
17399
17400         (For): Implement loop inversion for the For statement.
17401
17402         (Break): We can be breaking out of a Try/Catch controlled section
17403         (foreach might have an implicit try/catch clause), so we need to
17404         use Leave instead of Br.
17405
17406         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17407         now).  If the instace expression supports IMemoryLocation, we use
17408         the AddressOf method from the IMemoryLocation to extract the
17409         address instead of emitting the instance.
17410
17411         This showed up with `This', as we were emitting the instance
17412         always (Emit) instead of the Address of This.  Particularly
17413         interesting when This is a value type, as we dont want the Emit
17414         effect (which was to load the object).
17415
17416 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17417
17418         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17419
17420         * statement.cs (Checked): Set the CheckedState during the resolve
17421         process too, as the ConvCast operations track the checked state on
17422         the resolve process, and not emit.
17423
17424         * cs-parser.jay (namespace_member_declaration): Flag that we have
17425         found a declaration when we do.  This is used to flag error 1529
17426
17427         * driver.cs: Report ok when we display the help only.
17428
17429 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17430
17431         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17432
17433 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17434
17435         * cs-tokenizer.cs (define): We also have to track locally the
17436         defines.  AllDefines is just used for the Conditional Attribute,
17437         but we also need the local defines for the current source code. 
17438
17439 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17440
17441         * statement.cs (While, For, Do): These loops can exit through a
17442         Break statement, use this information to tell whether the
17443         statement is the last piece of code.
17444
17445         (Break): Flag that we break.
17446
17447         * codegen.cs (EmitContexts): New `Breaks' state variable.
17448
17449 2002-07-03  Martin Baulig  <martin@gnome.org>
17450
17451         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17452         modifiers in method declarations in structs.  Otherwise, you won't
17453         be able to override things like Object.Equals().
17454
17455 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17456
17457         * class.cs (Method, Property, Indexer): Do not allow the public
17458         modifier to be used in explicit interface implementations.
17459
17460         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17461         override modifiers in method declarations in structs
17462
17463 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17464
17465         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17466         integer or real overflow, report an error
17467
17468 2002-07-02  Martin Baulig  <martin@gnome.org>
17469
17470         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17471         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17472         to tell the runtime about our newly created System.Object and
17473         System.ValueType types.
17474
17475 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17476
17477         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17478         struct instead of Ldarg/Starg.
17479
17480 2002-07-02  Martin Baulig  <martin@gnome.org>
17481
17482         * expression.cs (Indirection.Indirection): Call
17483         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17484
17485 2002-07-02  Martin Baulig  <martin@gnome.org>
17486
17487         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17488         ValueType, call TypeManager.TypeToCoreType() on it.
17489         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17490         the OpCodes.Newarr argument.
17491
17492 2002-07-02  Martin Baulig  <martin@gnome.org>
17493
17494         * expression.cs (Invocation.EmitCall): When compiling corlib,
17495         replace all calls to the system's System.Array type to calls to
17496         the newly created one.
17497
17498         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17499         System.Array methods.
17500         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17501         from the system's System.Array type which must be replaced.
17502
17503 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17504
17505         * typemanager.cs: load unverifiable_code_ctor so we can build
17506         corlib using the correct type. Avoid using GetTypeCode() with
17507         TypeBuilders.
17508         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17509         TypeManager.object_type to allow building corlib.
17510
17511 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17512
17513         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17514
17515 2002-07-01  Martin Baulig  <martin@gnome.org>
17516
17517         * class.cs: Make the last change actually work, we need to check
17518         whether `ifaces != null' to avoid a crash.
17519
17520 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17521
17522         * class.cs: when we build structs without fields that implement
17523         interfaces, we need to add the interfaces separately, since there is
17524         no API to both set the size and add the interfaces at type creation
17525         time.
17526
17527 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17528
17529         * expression.cs: the dimension arguments to the array constructors
17530         need to be converted if they are a long.
17531
17532 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17533
17534         * class.cs: don't emit ldarg.0 if there is no parent constructor
17535         (fixes showstopper for corlib).
17536
17537 2002-06-29  Martin Baulig  <martin@gnome.org>
17538
17539         MCS now compiles corlib on GNU/Linux :-)
17540
17541         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17542         ie. check for MethodImplOptions.InternalCall.
17543
17544         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17545         and TypeManager.attribute_type are null, so we must explicitly check
17546         whether parent is not null to find out whether it's an attribute type.
17547         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17548         and SetBuilder, not only if the property is neither abstract nor external.
17549         This is necessary to set the MethodImplOptions on the accessor methods.
17550         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17551         SetBuilder, see Property.Emit().
17552
17553         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17554         populate "System.Object", "System.ValueType" and "System.Attribute" since
17555         they've already been populated from BootCorlib_PopulateCoreTypes().
17556
17557 2002-06-29  Martin Baulig  <martin@gnome.org>
17558
17559         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17560         is the NullLiteral, we also need to make sure that target_type is not
17561         an enum type.   
17562
17563 2002-06-29  Martin Baulig  <martin@gnome.org>
17564
17565         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17566         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17567         before calling BootstrapCorlib_ResolveDelegate ().
17568
17569 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17570
17571         * statement.cs: fixed build-breaker. All tests passed ok.
17572
17573 2002-06-27  Martin Baulig  <martin@gnome.org>
17574
17575         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17576         for System.Decimal when compiling corlib.
17577
17578 2002-06-27  Martin Baulig  <martin@gnome.org>
17579
17580         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17581         switch blocks which contain nothing but a default clause.
17582
17583 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17584
17585        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17586
17587 2002-06-27  Martin Baulig  <martin@gnome.org>
17588
17589         * ecore.cs (PropertyExpr.PropertyExpr): Call
17590         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17591
17592         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17593         is already a TypeBuilder.
17594
17595 2002-06-27  Martin Baulig  <martin@gnome.org>
17596
17597         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17598         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17599         the "from an array-type to System.Array" case.  This makes it work
17600         when compiling corlib.
17601
17602 2002-06-27  Martin Baulig  <martin@gnome.org>
17603
17604         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17605         non-static PropertyExpr, set its InstanceExpression.  This makes
17606         the `ICollection.Count' property work in System/Array.cs.
17607
17608 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17609
17610         * driver.cs: Made error handling more consistent.  Errors now
17611         tracked by Report class, so many methods which used to return int
17612         now return void.  Main() now prints success/failure and 
17613         errors/warnings message.
17614
17615         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17616         the magic number return values (123 and 124).  Now, if the
17617         expected error occurs, the compiler exits with success (exit value
17618         0).  If the compilation completes without seeing that particular
17619         error, the compiler exits with failure (exit value 1).  The
17620         makefile in mcs/errors has been changed to handle the new behaviour.
17621
17622         * report.cs: Made 'expected error' number a property and renamed
17623         it from 'Probe' to 'ExpectedError'.
17624
17625         * genericparser.cs: Removed error handling support, since it is
17626         now all done by Report class.
17627
17628         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17629         class, so parse() no longer returns an int.
17630
17631         * namespace.cs: Use Report.Error instead of GenericParser.error
17632
17633 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17634
17635         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17636         TypeContainer.AddOperator): At the front of the list put the
17637         explicit implementations, so they get resolved/defined first. 
17638
17639 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17640
17641         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17642         interface type is implemented by this TypeContainer.  Used during
17643         explicit interface implementation.
17644
17645         (Property.Define, Indexer.Define, Method.Define): Validate that
17646         the given interface in the explicit implementation is one of the
17647         base classes for the containing type.
17648
17649         Also if we are explicitly implementing an interface, but there is
17650         no match in the pending implementation table, report an error.
17651
17652         (Property.Define): Only define the property if we are
17653         not explicitly implementing a property from an interface.  Use the
17654         correct name also for those properties (the same CSC uses,
17655         although that is really not needed).
17656
17657         (Property.Emit): Do not emit attributes for explicitly implemented
17658         properties, as there is no TypeBuilder.
17659
17660         (Indexer.Emit): ditto.
17661
17662         Hiding then means that we do not really *implement* a pending
17663         implementation, which makes code fail.
17664
17665 2002-06-22  Martin Baulig  <martin@gnome.org>
17666
17667         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17668         the return value of Object.GetType().  [FIXME: we need to do this whenever
17669         we get a type back from the reflection library].
17670
17671 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17672
17673         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17674
17675 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17676
17677         * attribute.cs: Return null if we can not look up the type.
17678
17679         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17680         the interface types found.
17681
17682         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17683         interface types found.
17684
17685         * typemanager.cs (GetInterfaces): Make this routine returns alll
17686         the interfaces and work around the lame differences between
17687         System.Type and System.Reflection.Emit.TypeBuilder in the results
17688         result for GetInterfaces.
17689
17690         (ExpandInterfaces): Given an array of interface types, expand and
17691         eliminate repeated ocurrences of an interface.  This expands in
17692         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17693         be IA, IB, IC.
17694
17695 2002-06-21  Martin Baulig  <martin@gnome.org>
17696
17697         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17698         on System.Enum.
17699
17700 2002-06-21  Martin Baulig  <martin@gnome.org>
17701
17702         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17703         and called with one of the core types, return the corresponding typebuilder for
17704         that type.
17705
17706         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17707         element type.
17708
17709 2002-06-21  Martin Baulig  <martin@gnome.org>
17710
17711         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17712         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17713         (Expression.ConvertReferenceExplicit): Likewise.
17714
17715         * expression.cs (ElementAccess.DoResolve): Likewise.
17716         (ElementAccess.DoResolveLValue): Likewise.
17717
17718 2002-06-10  Martin Baulig  <martin@gnome.org>
17719
17720         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17721         add the "value" parameter to the parameter list.
17722
17723         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17724         to our caller.
17725
17726 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17727
17728         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17729         the argument to an int, uint, long or ulong, per the spec.  Also
17730         catch negative constants in array creation.
17731
17732 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17733
17734         * class.cs: do not allow the same interface to appear twice in
17735         the definition list.
17736
17737 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17738
17739         * ecore.cs: don't use ldlen with System.Array.
17740
17741 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17742
17743         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17744
17745 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17746
17747         * modifiers.cs: produce correct field attributes for protected
17748         internal. Easy fix so miguel can work on ther harder stuff:-)
17749
17750 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17751
17752         * pending.cs: New file.  Move the code from class.cs here.
17753         Support clearning the pending flag for all methods (when not doing
17754         explicit interface implementation).
17755
17756 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17757
17758         * rootcontext.cs: added a couple more types needed to bootstrap.
17759
17760 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17761
17762         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17763         constructor in the type, instead of any constructor in the type
17764         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17765         a bug in the Mono runtime when applying the params attribute). 
17766
17767 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17768         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17769
17770 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17771
17772         * expression.cs (Unary.ResolveOperator): Use TypeManager
17773         to resolve the type.
17774
17775 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17776
17777         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17778         attached.
17779
17780         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17781         with each member too.
17782
17783         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17784         field builders too - this takes care of the enum member case.
17785
17786 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17787
17788         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17789         address-of operator on both value types and pointers.
17790
17791 2002-06-10  Martin Baulig  <martin@gnome.org>
17792
17793         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17794         PropertyBuilder to the `property_builders' list.
17795
17796         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17797         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17798         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17799         find any indexers which are inherited from an interface.
17800
17801 2002-06-09  Martin Baulig  <martin@gnome.org>
17802
17803         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17804         the same type as the constant if necessary.  There's also a test-130.cs
17805         for this.
17806
17807         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17808
17809         * typemanager.cs (TypeManager.ChangeType): Previously known as
17810         Enum.ChangeEnumType().
17811
17812 2002-06-09  Martin Baulig  <martin@gnome.org>
17813
17814         * expression.cs (Cast.TryReduce): Added support for consts.
17815
17816 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17817
17818         * class.cs (Accessor): Hold attributes information so we can pass
17819         it along.
17820
17821         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17822         Modify to pass in attributes attached to the methods.
17823
17824         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17825
17826         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17827         to handle the Accessor kind :-)
17828
17829         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17830
17831 2002-06-08  Martin Baulig  <martin@gnome.org>
17832
17833         * expression.cs (Unary.TryReduceNegative): Added support for
17834         ULongConstants.
17835
17836 2002-06-08  Martin Baulig  <martin@gnome.org>
17837
17838         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17839         name can't be found in the `defined_names' - the caller will do a
17840         MemberLookup in this case and thus find methods in System.Enum
17841         such as Enum.IsDefined().
17842
17843 2002-06-08  Martin Baulig  <martin@gnome.org>
17844
17845         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17846         Convert.ChangeType() which works with TypeBuilder created types.
17847         (Enum.LookupEnumValue, Enum.Define): Use it here.
17848
17849         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17850         `TypeBuilder.BaseType != null' check.
17851         (TypeContainer.FindMembers): Only lookup parent members if we
17852         actually have a parent.
17853         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17854         (ConstructorInitializer.Resolve): Likewise.
17855
17856         * interface.cs (Interface.FindMembers): Added
17857         `TypeBuilder.BaseType != null' check.
17858
17859         * rootcontext.cs (RootContext.ResolveCore): Added
17860         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17861         classes_second_stage.
17862
17863         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17864         debug_type and trace_type when compiling with --nostdlib.       
17865
17866 2002-06-07  Martin Baulig  <martin@gnome.org>
17867
17868         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17869         (AddField): Set it to true when adding a non-static field.
17870         (DefineType): Use `have_nonstatic_fields' to find out whether we
17871         have non-static fields, not `Fields != null'.
17872
17873 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17874
17875         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17876         dereferencing a null on the static-field code path)
17877
17878 2002-05-30  Martin Baulig  <martin@gnome.org>
17879
17880         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17881         to take command line arguments.  Use reflection to call the new
17882         custom `Initialize' function on the symbol writer and pass it the
17883         command line arguments.
17884
17885         * driver.cs (--debug-args): New command line argument to pass command
17886         line arguments to the symbol writer.
17887
17888 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17891         the target type for indexers and properties.  Thanks to Joe for
17892         catching this.
17893
17894 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17895
17896         * typemanager.cs (MethodFlags): returns the method flags
17897         (Obsolete/ShouldIgnore) that control warning emission and whether
17898         the invocation should be made, or ignored. 
17899
17900         * expression.cs (Invocation.Emit): Remove previous hack, we should
17901         not do this on matching a base type, we should do this based on an attribute
17902
17903         Only emit calls to System.Diagnostics.Debug and
17904         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17905         on the command line.
17906
17907         * rootcontext.cs: Global settings for tracing and debugging.
17908
17909         * cs-tokenizer.cs (define): New utility function to track
17910         defines.   Set the global settings for TRACE and DEBUG if found.
17911
17912 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17913
17914         * interface.cs (Populate*): Pass in the TypeContainer as well as
17915         the DeclSpace as parameters so that we can create EmitContexts and
17916         then use that to apply attributes etc.
17917
17918         (PopulateMethod, PopulateEvent, PopulateProperty)
17919         (PopulateIndexer): Apply attributes everywhere.
17920
17921         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17922         etc.
17923
17924         (ApplyAttributes): Update accordingly.
17925
17926         We now apply interface attributes for all members too.
17927
17928 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * class.cs (Indexer.Define); Correctly check if we are explicit
17931         implementation (instead of checking the Name for a ".", we
17932         directly look up if the InterfaceType was specified).
17933
17934         Delay the creation of the PropertyBuilder.
17935
17936         Only create the PropertyBuilder if we are not an explicit
17937         interface implementation.   This means that explicit interface
17938         implementation members do not participate in regular function
17939         lookups, and hence fixes another major ambiguity problem in
17940         overload resolution (that was the visible effect).
17941
17942         (DefineMethod): Return whether we are doing an interface
17943         implementation. 
17944
17945         * typemanager.cs: Temporary hack until we get attributes in
17946         interfaces (Ravi is working on that) and we get IndexerName
17947         support in interfaces.
17948
17949         * interface.cs: Register the indexers as properties.
17950
17951         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17952         warning, I have verified that this is a bug in the .NET runtime
17953         (JavaScript suffers of the same problem).
17954
17955         * typemanager.cs (MemberLookup): When looking up members for
17956         interfaces, the parent of an interface is the implicit
17957         System.Object (so we succeed in searches of Object methods in an
17958         interface method invocation.  Example:  IEnumerable x;  x.ToString
17959         ()) 
17960
17961 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * class.cs (Event): Events should also register if they do
17964         implement the methods that an interface requires.
17965
17966         * typemanager.cs (MemberLookup); use the new GetInterfaces
17967         method. 
17968
17969         (GetInterfaces): The code used to lookup interfaces for a type is
17970         used in more than one place, factor it here. 
17971
17972         * driver.cs: Track the errors at the bottom of the file, we kept
17973         on going.
17974
17975         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17976         instance if the method we are calling is static!
17977
17978 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17979
17980         * attribute.cs (ApplyAttributes): Make this function filter out
17981         the IndexerName attribute (as that attribute in reality is never
17982         applied) and return the string constant for the IndexerName
17983         attribute. 
17984
17985         * class.cs (TypeContainer.Emit): Validate that all the indexers
17986         have the same IndexerName attribute, and if so, set the
17987         DefaultName attribute on the class. 
17988
17989         * typemanager.cs: The return value might contain other stuff (not
17990         only methods).  For instance, consider a method with an "Item"
17991         property and an Item method.
17992
17993         * class.cs: If there is a problem with the parameter types,
17994         return. 
17995
17996 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17997
17998         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17999         looks at user defined conversion after making a call to 
18000         StandardConversionExists - we need this for overload resolution.
18001
18002         * expression.cs : Update accordingly the various method calls.
18003
18004         This fixes 2 bugs filed against implicit user defined conversions 
18005
18006 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18007
18008         * statement.cs: Track the result of the assignment.
18009
18010 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18011
18012         * expression.cs (MemberAccess): Improved error reporting for
18013         inaccessible members.
18014
18015 2002-05-22  Martin Baulig  <martin@gnome.org>
18016
18017         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18018         itself with debugging support.
18019
18020 2002-05-22  Martin Baulig  <martin@gnome.org>
18021
18022         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18023         Removed, this isn't needed anymore.
18024
18025 2002-05-20  Martin Baulig  <martin@gnome.org>
18026
18027         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18028         be underlying type for an enum.
18029
18030 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18033         that splits out the loading of just the core types.
18034
18035         * rootcontext.cs (ResolveCore): Split the struct resolution in
18036         two, so we can load the enumeration underlying types before any
18037         enums are used.
18038
18039         * expression.cs (Is): Bandaid until we fix properly Switch (see
18040         bug #24985 for details).
18041
18042         * typemanager.cs (ImplementsInterface): The hashtable will contain
18043         a null if there are no interfaces implemented.
18044
18045 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * cs-parser.jay (indexer_declarator): It is fine to have array
18048         parameters
18049
18050 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18051
18052         * typemanager.cs: (RegisterBuilder): New function used to register
18053         TypeBuilders that implement interfaces.  Since
18054         TypeBuilder.GetInterfaces (as usual) does not work with lame
18055         Reflection.Emit. 
18056         (AddUserType): register interfaces.
18057
18058         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18059         dealing with TypeBuilder.  Also, arrays are showing up as
18060         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18061         methods can not be invoked on them!
18062
18063         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18064         (ImplicitReferenceConversionExists): Split out from
18065         StandardConversionExists. 
18066
18067         * expression.cs (As): We were only implementing one of the three
18068         cases for the as operator.  We now implement them all.
18069         (Is): Implement the various other cases for Is as well.
18070
18071         * typemanager.cs (CACHE): New define used to control if we want or
18072         not the FindMembers cache.  Seems to have a negative impact on
18073         performance currently
18074
18075         (MemberLookup): Nested types have full acess to
18076         enclosing type members
18077
18078         Remove code that coped with instance/static returns for events, we
18079         now catch this in RealFindMembers.
18080
18081         (RealFindMembers): only perform static lookup if the instance
18082         lookup did not return a type or an event.  
18083
18084 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18085
18086         * assign.cs (CompoundAssign): We pass more semantic information
18087         now to Compound Assignments than we did before: now we have all
18088         the information at hand, and now we resolve the target *before* we
18089         do the expression expansion, which allows the "CacheValue" method
18090         to have the effect we intended (before, a [x] += 1 would generate
18091         two differen ArrayAccess expressions from the ElementAccess,
18092         during the resolution process).
18093
18094         (CompoundAssign.DoResolve): Resolve target and original_source here.
18095
18096 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18097
18098         * expression.cs (ArrayAccess): dropped debugging information. 
18099
18100         * typemanager.cs: Small bug fix: I was always returning i_members,
18101         instead of one of i_members or s_members (depending on which had
18102         the content).
18103
18104         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18105         method is invoked before any code generation takes place, and it
18106         is a mechanism to inform that the expression will be invoked more
18107         than once, and that the method should use temporary values to
18108         avoid having side effects
18109
18110         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18111
18112         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18113         implementation.
18114
18115         * expression.cs (Indirection, ArrayAccess): Add support for
18116         CacheTemporaries in these two bad boys. 
18117
18118         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18119         ldobj or ldind_ref.  
18120         (StoreFromPtr): Handle stobj as well.
18121
18122         * expression.cs (UnaryMutator): Share more code.
18123
18124         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18125         down: I was not tracking the Filter function as well, which
18126         was affecting the results of the cache.
18127
18128 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18129
18130         * attribute.cs: Remove the hack to handle the CharSet property on
18131         StructLayouts. 
18132
18133 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18134
18135         * attribute.cs (DoResolve): More uglyness, we now only try to
18136         resolve the attribute partially, to extract the CharSet
18137         information (only if we are a StructLayout attribute).  Otherwise 
18138
18139         (GetExtraTypeInfo): Add some code to conditionally kill in the
18140         future this.   I am more and more convinced that the .NET
18141         framework has special code to handle the attribute setting on
18142         certain elements.
18143
18144         * expression.cs (IsParamsMethodApplicable): Revert my previous
18145         foreach change here, it was wrong.
18146
18147 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18148
18149         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18150         (pp_expr): do not abort on unknown input, just return.
18151         (eval): abort if there are pending chars.
18152
18153         * attribute.cs (Attribute.Resolve): Positional parameters are
18154         optional.  Deal with that case.
18155
18156         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18157         the Ansi/Unicode/Auto information for the type.
18158
18159         (TypeContainer.DefineType): instantiate the EmitContext here, as
18160         we will be using it during the type definition (to resolve
18161         attributes) and during the emit phase.
18162
18163         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18164         to pull type information out of the attributes
18165
18166         (Attribute.Resolve): track the constructor builder, and allow for
18167         multiple invocations (structs and classes will use this).
18168
18169         * ecore.cs (MemberLookupFinal): new version with all the
18170         parameters customizable.
18171
18172         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18173         constructors.  Return if the result value is null (as the error
18174         would have been flagged already by MemberLookupFinal)
18175
18176         Do not allow instances of abstract classes or interfaces to be
18177         created.
18178
18179         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18180         We have to compare the assembly property here when dealing with
18181         FamANDAssem and Assembly access modifiers, because we might be
18182         creating an assembly from *modules* (that means that we are not
18183         getting TypeBuilders for types defined in other modules that are
18184         part of this assembly).
18185
18186         (Method.Emit): If the method is marked abstract and has a body,
18187         emit an error. 
18188
18189         (TypeContainer.DefineMembers): If both the defined member and the
18190         parent name match are methods, then do not emit any warnings: let
18191         the Method.Define routine take care of flagging warnings.  But if
18192         there is a mismatch (method overrides something else, or method is
18193         overriwritten by something, then emit warning).
18194
18195         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18196         set to null, this means `do not check for the return type on the
18197         signature'. 
18198
18199         (Method.Define): set the return type for the method signature to
18200         null, so that we get methods with the same name and parameters and
18201         different return types.  This is used to flag warning 114 (you are
18202         hiding a method, and you probably want to use the new/override
18203         keywords instead).
18204
18205         * typemanager.cs (MemberLookup): Implemented proper access
18206         control, closing a long standing set of bug reports.  The problem
18207         was that the Framework only has two bits: Public and NonPublic,
18208         and NonPublic includes private and protected methods, but we need
18209         to enforce the FamANDAssem, FamOrAssem and Family. 
18210
18211 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18212
18213         * statement.cs (GotoCase): Return true: Ammounts to giving up
18214         knowledge on whether we return or not, and letting the other case
18215         be responsible for it.
18216
18217 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * driver.cs: Do not load directories for each file processed, only
18220         do it if there is a pattern.
18221
18222         * ecore.cs: Report readonly assigns here as well, as we might have
18223         been resolved only by MemberAccess.
18224
18225         (SimpleName.SimpleNameResolve): Also be useful for LValue
18226         resolution.   We need this to propagate assign to local readonly variables
18227
18228         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18229         do not want to reuse potential criteria memory.
18230
18231         * class.cs (MyEventBuilder): Set reflected_type;
18232
18233         * ecore.cs (Constantify): Added support for constifying bools.
18234
18235         (RootContext.LookupType): Added a cache for values looked up in
18236         the declaration space.
18237
18238         * typemanager.cs (FindMembers): Now is a front-end to
18239         RealFindMembers, and provides a two-level hashtable-based cache to
18240         the request.  
18241
18242         15% performance improvement: from 22.5 to 19.2 seconds.
18243
18244         * expression.cs (IsParamsMethodApplicable): use foreach.
18245         (Invocation.DoResolve): ditto.
18246         (New.DoResolve): ditto.
18247         (ArrayCreation.DoResolve): ditto.
18248
18249         * ecore.cs (FindMostEncompassingType): use foreach.
18250
18251         * delegate.cs (NewDelegate.DoResolve): Use foreach
18252
18253         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18254         (RemoveMethods): use foreach.
18255
18256         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18257         nested foreach statements instead of for, and also break out of
18258         the inner loop once a match is found.
18259
18260         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18261
18262 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18265         we actually unwrap the expression to allow for extra information
18266         to be extracted. 
18267
18268         * expression.cs: Use Shr_Un on unsigned operations. 
18269
18270 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18271
18272         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18273         applicable operators was not being considered correctly. This closes
18274         the bug Miguel reported.
18275
18276 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18277
18278         * attribute.cs: check that the type derives from System.Attribute
18279         and report the correct error in that case (moved the duplicate code to
18280         its own method, too).
18281
18282 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18283
18284         * attribute.cs: lookup attribute type name as the spec says: first the
18285         bare attribute name and then name + "Attribute" (nant compiles with
18286         mcs after this fix).
18287
18288 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18289
18290         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18291         Because of the way we parse things, we should try to see if a
18292         UIntConstant can fit in an integer.
18293
18294 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18295
18296         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18297         when we are in an explicit context.
18298
18299         (ConvertReferenceExplicit): When converting from Iface type S to Class
18300         T make sure the rules are implemented as an OR.
18301
18302         * parameter.cs (ParameterType): Make it a property for now although the
18303         purpose really isn't anything immediate.
18304
18305         * expression.cs (Is*Applicable): Do better checking on the parameter type
18306         of a ref/out parameter. The ones from the system assemblies are already 
18307         marked with the correct type so we don't need to do any correction.
18308
18309         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18310         the object type is standard too so include that.
18311
18312 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18313
18314         * ecore.cs (StandardConversionExists): Augment with missing code:
18315         deal with IntConstant, LongConstants and Enumerations.
18316
18317         * assign.cs: Report the error, instead of failing silently
18318
18319         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18320         typecontainer that they are declared, because the
18321         typecontainer/namespace will have the list of using clauses that
18322         need to be applied.
18323
18324         Assembly Attributes were escaping the normal registration
18325         mechanism. 
18326
18327         (EmitCode): Apply attributes within an EmitContext that represents
18328         the container they were declared on.
18329
18330         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18331
18332 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18333
18334         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18335         Revamp completely - make much cleaner as we now operate only
18336         on a set of Types.
18337
18338         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18339         to implement the logic detailed in the spec more correctly.
18340
18341         (UserDefinedConversion): Update accordingly.
18342
18343 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * statement.cs: Return flow analysis information up.
18346
18347         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18348         and the default.
18349
18350         (token): Do not consume an extra character before calling
18351         decimal_digits.
18352
18353 2002-05-06  Piers Haken <piersh@friskit.com>
18354
18355         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18356
18357 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18360         EmitContext during the instance constructor initializer
18361         resolution, to stop access to instance variables.
18362
18363         This is mandated by the spec, last paragraph of the `constructor
18364         initializers' section. 
18365
18366 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18367
18368         * cs-parser.jay, class.cs (Accessor): new class used to represent
18369         an accessor (get or set).  In the past we used `null' to represent
18370         a missing accessor.  But this is ambiguous because there was no
18371         way to tell in abstract indexers/properties if one of them was
18372         specified.
18373
18374         Now there is a way of addressing that.
18375
18376         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18377         instead of FindMembers.
18378
18379         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18380         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18381
18382         * attribute.cs: Treat indexers and properties as the same in terms
18383         of applying attributes
18384
18385         * ecore.cs (FindMostEncompassedType): Use statically initialized
18386         EmptyExpressions()s like we do elsewhere to avoid creating useless
18387         objects (and we take this out of the tight loop).
18388
18389         (GetConversionOperators): Move the code to extract the actual
18390         operators to a separate routine to clean things up.
18391
18392 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18393
18394         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18395         events are always registered FieldBuilders.
18396
18397         * class.cs (FieldBase): New class shared by Fields 
18398
18399         * delegate.cs: If we are a toplevel delegate, use our full name.
18400         If we are a nested delegate, then only use our tail name.
18401
18402 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18403
18404         * expression.cs (IsApplicable): Ensure that we add the "&" to
18405         ref/out types before comparing it with the type of the argument.
18406
18407         (IsParamsMethodApplicable): Ditto.
18408
18409         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18410         silly me ;-)
18411
18412         * delegate.cs : Handle the case when we have more than one applicable
18413         method. Flag an error only when we finish checking all.
18414
18415 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18416
18417         * expression.cs: Add support for boolean static initializers.
18418
18419 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18420
18421         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18422
18423         * parameter.cs (ComputeParameterTypes,
18424         ComputeAndDefineParameterTypes): Better error handling: now we
18425         clear the `types' cache if we fail during any of the type lookups.
18426         We also return the status code correctly to our caller
18427
18428         * delegate.cs: If we fail to define a delegate, abort the extra
18429         steps. 
18430
18431         * expression.cs (Binary.ResolveOperator): for
18432         operator==(object,object) and operator !=(object, object) we also
18433         have to verify that there is an implicit conversion from one to
18434         the other.
18435
18436         (ArrayAccess.DoResolve): Array Access can operate on
18437         non-variables. 
18438
18439 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18440
18441         * assign.cs (CompoundAssign): A new class used as a "flag" that
18442         the assignment actually is happening as part of a compound
18443         assignment operator.
18444
18445         During compound assignment, a few new rules exist to enable things
18446         like:
18447
18448         byte b |= 1 + 2
18449
18450         From the spec:
18451
18452         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18453         to the type of x) if y is implicitly convertible to the type of x,
18454         and the operator is a builtin operator and the return type of the
18455         operator is explicitly convertible to the type of x. 
18456
18457         * rootcontext.cs: Reset warning level to 2.  4 catches various
18458         "interesting" features in mcs, we must clean this up at some
18459         point, but currently am trying to kill other bugs ;-)
18460
18461         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18462         in container classes as well.  
18463
18464         * expression.cs (Binary.ResolveOperator): Handle string case
18465         before anything else (as operator overloading does emit an error
18466         before doing anything else).
18467
18468         This code could go away when we move to a table driven model, but
18469         i could not come up with a good plan last night.
18470
18471 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18472
18473         * typemanager.cs (CSharpName): reimplementation using regex.
18474         * class.cs: added null check for fields in Emit
18475         * rootcontext.cs: set warninglevel to 4
18476
18477 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18478
18479         * typemanager.cs (CSharpName): reimplemented with Lupus
18480         suggestion.
18481
18482 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * statement.cs (If): correclty implement Resolve, because we were
18485         not catching sem errors in there.  The same process is needed
18486         everywhere else. 
18487         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18488
18489
18490         (Statement.Warning_DeadCodeFound): Factorize code.
18491         (While): Report dead code here too.
18492
18493         (Statement): Added Resolve virtual method to allow
18494         for resolution split from the emit code.
18495
18496 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18497
18498         * statement.cs (EmitBoolExpression): No longer try to resolve the
18499         expression here.    
18500         (MakeBoolean): New utility function that resolve, implicitly
18501         converts to boolean and tags the expression. 
18502
18503
18504         (If, Do): Implement dead code elimination.
18505         (While): Implement loop inversion
18506
18507         (Do, While, For, If): Resolve the expression prior to calling our
18508         code generation.
18509
18510 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18511
18512         * class.cs:
18513           - added method Report28 (warning: program has more than one entry point)
18514           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18515           - modified method Method.Define, the part at the end of the method
18516
18517         * rootcontext.cs: added static public Location EntryPointLocation;
18518           
18519         * ../errors/cs0028.cs : Add test case for the above warning.              
18520
18521         * typemanager.cs:
18522           - modified method CSharpName to allow arrays of primitive type to
18523             be printed nicely (e.g. instead of System.Int32[][] it now prints
18524             int[][])
18525           - added method CSharpSignature: returns the signature of a method
18526             in string format to be used in reporting errors, warnings, etc.
18527
18528         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18529         with String.Empty.
18530
18531 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18532
18533         * delegate.cs (Define): Fix extremely silly bug where I was
18534         setting the type of the 'object' parameter of the BeginInvoke
18535         method to System.IAsyncResult instead of System.Object ;-)
18536
18537 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18538
18539         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18540         here. 
18541
18542         (Constructor.Emit): return if we fail to initialize the
18543         constructor.  Another door closed!  
18544
18545         * expression.cs (New.DoResolve): Improve error message (from -6 to
18546         1501).  Use DeclaredOnly lookup to find the exact constructor.
18547
18548         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18549         loop.  This is useful.
18550
18551         * cs-parser.jay: Adjust the default parameters so that destructors
18552         have the proper signature.
18553
18554 2002-04-26  Martin Baulig  <martin@gnome.org>
18555
18556         * driver.cs (LoadAssembly): If `assembly' contains any characters
18557         which are only valid in path names and not in assembly names
18558         (currently slash, backslash and point), use Assembly.LoadFrom ()
18559         instead of Assembly.Load () on the `assembly' (before iteration
18560         over the link_paths).
18561
18562 2002-04-26  Martin Baulig  <martin@gnome.org>
18563
18564         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18565
18566 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18567
18568         * class.cs (Property): use the new typemanager.MemberLookup
18569
18570         (TypeContainer.MemberLookup): Implement using the
18571         TypeManager.MemberLookup now. 
18572
18573         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18574         and return MemberInfos, so that these can be used without an
18575         EmitContext (what we had before).
18576
18577 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * expression.cs: Fix the case where the argument to params if the
18580         type of the params.  I omitted handling this before.   Fixed
18581
18582 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * driver.cs: Call BootCorlib_PopulateCoreType
18585
18586         * class.cs (Property.CheckBase): Check for properties only, not
18587         for all members. 
18588
18589         * interface.cs: Temporary hack: try/catch around the
18590         CustomAttributeBuilder, because I am getting an exception that I
18591         do not understand.
18592
18593         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18594         types whose definitions are required to be there (attributes are
18595         defined before standard types).
18596
18597         Compute definitions as we boot the various types, as they are used
18598         immediately (value_type class will need object_type, but if we do
18599         not initialize object_type, we will pass a null, which will let
18600         the runtime pick the System.Object from the existing corlib, which
18601         is not what we want).
18602
18603 2002-04-22  Patrik Torstensson <totte@labs2.com>
18604
18605         * cs-tokenizer.cs: fixed a number of trim() issues.
18606
18607 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18608
18609         * expression.cs (Argument.Type): Ensure that we return the correct
18610         type when we have out or ref parameters [in which case we 
18611         append a "&"].
18612
18613 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * class.cs (Property, Indexer): Allow extern modifier in there. 
18616
18617         * typemanager.cs (InitBaseTypes): Initializes object_type and
18618         value_type, since those will be used early on during the bootstrap
18619         process to compile corlib.
18620
18621         (InitCoreTypes): Move code from here to InitBaseTypes.
18622
18623 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18626         single-dimension arrays as using the ldlen opcode.  
18627
18628         Daniel Lewis discovered this optimization.  
18629
18630         * typemanager.cs: Add signature for System.Array::get_Length
18631
18632 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18633
18634         * statement.cs: report the error when the foreach does not apply to an
18635         array nor a collection.
18636
18637 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * expression.cs: Add implicit conversions to the operator ~.
18640
18641         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18642
18643         * typemanager.cs: Locate the decimal constructor.
18644
18645 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18646
18647         * attribute.cs: use the new property of TypeOf.
18648         * expression.cs: added 'get' property around typearg.
18649
18650         These changes fix a build breaker reported by NickD. Is this the
18651         correct way to fix?  If not, please, revert my changes and make it
18652         work :-).
18653
18654 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * attribute.cs: Add support for typeof in attribute invocations.
18657         I am not sure that this is right though.
18658
18659 2002-04-14  Duncan Mak  <duncan@ximian.com>
18660
18661         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18662         Binary.Operator.Division case.
18663
18664 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18665
18666         * class.cs (DefineType): Ensure that we do a proper check on
18667         attribute types and also register it with the TypeManager.
18668
18669         (TypeContainer.Targets): The default for attribute types is
18670         AttributeTargets.All.
18671
18672         * attribute.cs (ApplyAttributes): Registering the attribute type
18673         is done elsewhere, not when we discover we have a Usage attribute.
18674
18675 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18676
18677         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18678         and get rid of is_delegate parameter.
18679
18680         * everywhere : update.
18681
18682 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18683
18684         * cs-parser.jay (compilation_unit): Revamp completely to use
18685         some new ideas that I got from Rhys' grammar to solve the problems
18686         with assembly level attributes.
18687
18688         (outer_declaration): New grammar production.
18689
18690         (attribute_sections): Add.
18691
18692         (opt_attributes): Base on attribute_sections
18693
18694         (namespace_declaration): Allow opt_attributes to tackle the case
18695         when we have assembly level attributes - we are clever in this
18696         regard now ;-)
18697
18698         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18699         attributes in the non-global context.
18700
18701         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18702         instead of SetGlobalAttributes.
18703
18704         * class.cs, rootcontext.cs : Ensure we define and generate 
18705         attribute types before anything else.
18706
18707         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18708         and flag the new error -20 for the case when the attribute type
18709         does not have valid targets specified. csc does not catch this.
18710
18711         * ../errors/errors.txt : update for error # -20
18712
18713 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18714
18715         * support.cs (InternalParameters.ParameterModifier): Do some null
18716         checking and return sane values.
18717
18718         * class.cs (Method.Define): If we are a PInvoke method, ensure
18719         that we are static and extern. Report error # 601
18720
18721         * ../errors/cs0601.cs : Add test case for the above error.
18722
18723 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18724
18725         * rootcontext.cs (attribute_types): We need to keep type of
18726         all attribute types separately and emit code for them first.
18727
18728         (RegisterAttribute) : Implement.
18729
18730         * class.cs (DefineType): Check if the current Type is a custom
18731         attribute type and register it accordingly.
18732
18733         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18734         adding the first attribute twice and rename to
18735
18736         (SetGlobalAttributes): this.
18737
18738         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18739         lookups.
18740
18741         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18742         if we are processing global arguments. Hmm, I am unsure of this.
18743
18744 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18745
18746         * expression.cs: added static array of strings to avoid calling
18747         Enum.ToString () for Operator in Binary. Significant recover of
18748         performance.
18749
18750 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * class.cs (FindMembers): Allow the Builders of the various
18753         members to be null.  If they are skip them.  This only happens
18754         during the PInvoke declaration.
18755
18756 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18757
18758         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18759         failure, so we do not keep going afterwards.
18760
18761         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18762         wanted to pass `false' as the `is_delegate' argument.  If this is
18763         the case, why not use delegate_type == null to mean `is_delegate =
18764         false' and anything else as is_delegate = true.
18765
18766 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18767
18768         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18769         code for the section, not the beginning of the tests.
18770
18771 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18774
18775         * expression.cs (Binary): same.  Warn about errors where we have
18776         Enum/Enum in operator + as well.
18777
18778 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18779
18780         * statement.cs:
18781                 - added support for switch(bool)
18782                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18783                 - add TableSwitchEmit() to handle table-based switch statements
18784
18785 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18786
18787         * expression.cs (Invocation.OverloadResolve): Factor out code which
18788         does parameter compatibility checking with arguments so that we can 
18789         re-use the code even from Delegate.VerifyApplicability
18790
18791         (VerifyArgumentsCompat): Move above code here.
18792
18793         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18794         and instead make a call to the above method.
18795
18796 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18797
18798         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18799         We use it to keep track of classes which are attribute types.
18800
18801 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18802
18803         * delegate.cs (Delegate.Define): Correctly define the types in the
18804         presence of fixed and array parameters.
18805
18806         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18807         doing FindMembers.
18808
18809         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18810         include NonPublic after the first iteration.
18811
18812         * class.cs (Indexer.CheckBase): Only check if both parents are
18813         non-null. 
18814
18815         * cs-parser.jay (accessor_body): If empty, set to null.
18816
18817         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18818         same code path here to resolve constants names that we did have in
18819         MemberAccess.DoResolve.  There is too much code duplicated here.
18820
18821 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18822
18823         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18824
18825         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18826         to MakeUnionSet.
18827
18828         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18829         tokens, numbers and strings.
18830
18831         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18832         parenthesis.
18833
18834         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18835         asyncronous parameters and the regular parameters.  
18836
18837         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18838         specify the target directory.
18839
18840         * expression.cs: (This.DoResolve): Simplify
18841         (As.Emit): Optimize, do not generate IsInst if the expression is
18842         always of the given type.
18843
18844         (Is.DoResolve): Bug fix, we were reporting both always/never for
18845         the is expression.
18846
18847         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18848         creating too many unnecessary arrays.
18849
18850 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18851
18852         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18853         fields instead of rolling our own initializer.   Takes care of all
18854         implicit conversions, and drops unnecessary static checks/argument.
18855
18856 2002-03-31  Dick Porter  <dick@ximian.com>
18857
18858         * driver.cs: use the GetDirectories() return values properly, and
18859         use "/" as path separator.
18860
18861 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18862
18863         * expression.cs (Unary): Optimize - - expr into expr.
18864         (Binary): Optimize a + (-b) into a -b.
18865
18866         * codegen.cs (CodeGen): Made all methods static.
18867
18868 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * rootcontext.cs: 
18871
18872         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18873         TypeBuilder property.
18874
18875         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18876         instead. 
18877
18878         * tree.cs: Removed the various RecordXXXX, and replaced with a
18879         single RecordDecl.  Removed all the accessor methods, and just
18880         left a single access point Type 
18881
18882         * enum.cs: Rename DefineEnum to DefineType.
18883
18884         * decl.cs: New abstract method `DefineType' used to unify the
18885         Defines for Enumerations, Interfaces, TypeContainers and
18886         Delegates.
18887
18888         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18889         LookupBaseClasses method that used to live in class.cs and
18890         interface.cs here, and renamed to FindType.
18891
18892         * delegate.cs: Implement DefineType.  Take advantage of the
18893         refactored pattern for locating the parent builder without taking
18894         the parent_builder argument (which we know does not work if we are
18895         nested, and triggering a toplevel definition).
18896
18897 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18900         accessibility of a member has changed during override and report
18901         an error if so.
18902
18903         * class.cs (Method.Define, Property.Define): Only complain on
18904         overrides if the method is private, any other accessibility is
18905         fine (and since we just checked the permission is the same, we are
18906         good to go).
18907
18908         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18909         and elif are processed always.  The other pre-processing
18910         directives are only processed if we are "taking" the path
18911
18912 2002-03-29  Martin Baulig  <martin@gnome.org>
18913
18914         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18915         current location is not Null.
18916
18917         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18918         a separate method so we can profile it.
18919
18920         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18921         `span.Seconds' are just seconds, but no minutes or hours.
18922         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18923
18924 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18925
18926         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18927         Remove the gratuitous set of Final:
18928
18929                                 // If an interface implementation, then we can set Final.
18930                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18931                                     implementing.DeclaringType.IsInterface)
18932                                         flags |= MethodAttributes.Final;
18933
18934         I do not know what I was smoking when I used that.
18935
18936
18937         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18938         step into fixing the name resolution issues for delegates and
18939         unifying the toplevel name resolution.
18940
18941 2002-03-28  Martin Baulig  <martin@gnome.org>
18942
18943         * class.cs (Method.Emit): If we have a symbol writer, call its
18944         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18945         tell it about the current method.
18946
18947         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18948         writer that we're going to emit the first byte of IL code for a new
18949         statement (a new source line).
18950         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18951         EmitContext.Mark() before emitting any code.
18952
18953         * location.cs (SymbolDocument): Return null when we're Null.
18954
18955         * statement.cs (Statement): Moved the `Location loc' variable here.
18956         (Statement.EmitBoolExpression): If we have a symbol writer, call
18957         ec.Mark() before emitting any code to tell it that we're at the
18958         beginning of a new statement.
18959         (StatementExpression): Added `Location' argument to the constructor.
18960         (Block): Added public readonly variable `StartLocation' and public
18961         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18962         (Block): Added constructor which takes a start and end location.
18963         (Block.SetEndLocation): New method. This sets the end location.
18964         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18965         local variables we create.
18966         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18967         each statement and do also mark the begin and end of the block.
18968
18969         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18970         tell it the current lexer.Location, use Location.Null for the end of the
18971         block.
18972         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18973         current block, set its end location using SetEndLocation().
18974         (statement_expression): StatementExpression constructor now takes the
18975         lexer.Location as additional argument.
18976         (for_statement, declare_local_variables): Likewise.
18977         (declare_local_variables): When creating a new implicit block, use the
18978         new Block constructor and pass it the lexer.Location.
18979
18980 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18981
18982         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18983         members also on the parent interfaces recursively.
18984
18985 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * report.cs: Use new formats, since Gonzalo finished the missing
18988         bits. 
18989
18990         * expression.cs (Binary.ResolveOperator): added missing operator|
18991         operator& and operator^ for bool/bool.
18992
18993         * cs-parser.jay: CheckDef now takes a Location argument that is
18994         used to report errors more precisly (instead of reporting the end
18995         of a definition, we try to track something which is a lot closer
18996         to the source of the problem).
18997
18998         * cs-tokenizer.cs: Track global token use, so we can properly flag
18999         the use of #define/#undef after the first token has been seen.
19000
19001         Also, rename the reportXXXX to Error_DescriptiveName
19002
19003         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19004         TypeContainer, so that Enum and Interface can use this too.
19005
19006         * class.cs (TypeContainer.LookupInterfaceOrClass,
19007         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19008         `builder' argument.  Typically this was used to pass the parent
19009         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19010         the definition).  
19011
19012         The problem is that a nested class could trigger the definition of
19013         a toplevel class, and the builder would be obviously wrong in that
19014         case. 
19015
19016         So we drop this argument, and we compute dynamically the
19017         TypeBuilder/ModuleBuilder (the correct information was available
19018         to us anyways from DeclSpace.Parent)
19019
19020         * interface.cs (Interface.DefineInterface): Drop builder
19021         parameter cleanup like class.cs
19022
19023         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19024         like class.cs
19025
19026         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19027         values. 
19028
19029         (Try.Emit): Propagate the returns value from the statement.
19030
19031         (Return.Emit): Even if we are leavning 
19032
19033         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19034
19035         * modifiers.cs: Fix the computation of MethodAttributes flags.
19036
19037 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19038
19039         * driver.cs: allow compilation of files that start with '/'.
19040         Add a default case when checking the argument of --target.
19041
19042 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * interface.cs: Implement the same search algorithm for types in
19045         the interface code.
19046
19047         * delegate.cs: Do not allow multiple definition.
19048
19049         * Recovered ChangeLog that got accidentally amputated
19050
19051         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19052
19053         * rootcontext.cs: Load manually enum to allow core classes to
19054         contain enumerations.
19055
19056         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19057         Update to new static methods in TypeManager.
19058
19059         * typemanager.cs (GetMethod, GetConstructor): Use our
19060         implementation of FindMembers to find the members, since during
19061         corlib compilation, the types are TypeBuilders and GetMethod and
19062         GetConstructor do not work.
19063
19064         Make all methods in TypeManager static.
19065
19066         (InitCodeHelpers): Split the functionality from
19067         the InitCodeTypes function.
19068
19069         * driver.cs: Call InitCodeHelpers after we have populated the
19070         types. 
19071
19072         * cs-parser.jay (delegate_declaration): we did not used to compute
19073         the delegate name correctly for void delegates.
19074
19075 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * rootcontext.cs (RootContext): Init the interface_resolve_order
19078         and type_container_resolve_order always.
19079
19080         (ResolveCore, BootstrapCorlib_ResolveClass,
19081         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19082         compiler when compiling with --nostdlib
19083
19084         * class.cs (TypeContainer.DefineType): Check that our parent is
19085         not null.  This test is most important when we are bootstraping
19086         the core types.
19087
19088         * codegen.cs: Split out the symbol writing code.
19089
19090 2002-03-25  Martin Baulig  <martin@gnome.org>
19091
19092         * driver.cs (-g): Made -g an alias for --debug.
19093
19094 2002-03-24  Martin Baulig  <martin@gnome.org>
19095
19096         * codegen.cs (SymbolWriter): New public variable. Returns the
19097         current symbol writer.
19098         (CodeGen): Added `bool want_debugging_support' argument to the
19099          constructor. If true, tell the ModuleBuild that we want debugging
19100         support and ask it for the ISymbolWriter.
19101         (Save): If we have a symbol writer, call it's Close() method after
19102         saving the assembly.
19103
19104         * driver.c (--debug): New command line argument to create a
19105         debugger information file.
19106
19107         * location.cs (SymbolDocument): New public property. Returns an
19108         ISymbolDocumentWriter object for the current source file or null
19109         if we don't have a symbol writer.
19110
19111 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19112
19113         * driver.cs (LoadAssembly): Correctly return when all the paths
19114         have been tried and not before.
19115
19116         * statement.cs (Switch.Emit): return the actual coverage for this
19117         statement (returns/not-returns)
19118
19119         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19120         switch of the statement if we are the last switch section.  That
19121         kills two problems: try/catch problems (we used to emit an empty
19122         nop at the end) and switch statements where all branches would
19123         return. 
19124
19125 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19126
19127         * driver.cs: Add default assemblies (the equivalent to the
19128         Microsoft CSC.RSP file)
19129
19130         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19131         also update tokens_seen and set it to false.
19132
19133         * driver.cs: Implement --recurse for Mike.
19134
19135         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19136         correctly splitting out the paths.
19137
19138 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * interface.cs (Interface.PopulateProperty): Instead of using
19141         `parent' as the declaration space for the set parameters, use
19142         `this' 
19143
19144         * support.cs (InternalParameters): InternalParameters constructor
19145         takes a DeclSpace instead of a TypeContainer.
19146
19147         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19148         types are being initialized, load the address of it before calling
19149         the function.  
19150
19151         (New): Provide a mechanism to disable the generation of local
19152         value type temporaries when the caller will be providing us with
19153         an address to store it.
19154
19155         (ArrayCreation.EmitDynamicInitializers): Use it.
19156
19157 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19158
19159         * expression.cs (Invocation.EmitArguments): Only probe for array
19160         property if there is more than one argument.  Sorry about that.
19161
19162         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19163         empty param arrays.
19164
19165         * class.cs (Method.LabelParameters): Fix incorrect code path that
19166         prevented the `ParamArrayAttribute' from being applied to the
19167         params attribute.
19168
19169 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * support.cs (ReflectionParameters): Correctly compute whether the
19172         last argument is a params array.  Fixes the problem with
19173         string.Split ('a')
19174
19175         * typemanager.cs: Make the assemblies array always be non-null
19176         (empty, but non-null)
19177
19178         * tree.cs (RecordDecl): New function that abstracts the recording
19179         of names.  This reports error 101, and provides a pointer to the
19180         previous declaration.  Fixes a crash in the compiler.
19181
19182         * cs-parser.jay (constructor_declaration): Update to new grammar,
19183         and provide a constructor_body that can be empty.
19184
19185 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19186
19187         * driver.cs: Add support for --resources.
19188
19189         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19190         Make all types for the various array helper methods be integer.
19191
19192         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19193         CheckState to ConvCast.
19194
19195         (ConvCast): Now it takes a `checked' state argument, to avoid
19196         depending on the emit context for the conversion, and just using
19197         the resolve time setting.
19198
19199         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19200         instead of Invocation.EmitArguments.  We do not emit the original
19201         arguments, instead we emit those which have been converted to
19202         unsigned int expressions.
19203
19204         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19205
19206         * codegen.cs: ditto.
19207
19208         * expression.cs (LocalVariableReference): Drop the use of the
19209         Store function that depended on the variable index.
19210
19211         * statement.cs (VariableInfo): Drop the `Idx' property from this
19212         class, as this is not taking into account the indexes for
19213         temporaries tat we generate during the execution, getting the
19214         indexes wrong.
19215
19216         * class.cs: First emit class initializers, then call the parent
19217         constructor. 
19218
19219         * expression.cs (Binary): Fix opcode emision.
19220         (UnaryMutator.EmitCode): Support checked code generation
19221
19222         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19223         matches for events for both the Static and Instance scans,
19224         pointing to the same element.   Fix that.
19225
19226 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19227
19228         * rootcontext.cs (ResolveTree): Always set the
19229         interface_resolve_order, because nested interfaces will be calling
19230         into us.
19231
19232         * class.cs (GetInterfaceOrClass): Track the same resolution
19233         process used by TypeManager.LookupType.  This fixes the nested
19234         type lookups in class declarations (separate path from
19235         LookupType). 
19236
19237         (TypeContainer.DefineType): Also define nested interfaces.
19238         (TypeContainer.RegisterOrder): New public function used to
19239         register the order in which child interfaces need to be closed.
19240
19241         Nested interfaces need to be closed after their parents have been
19242         created. 
19243
19244         * interface.cs (InterfaceAttr): Put all the logic for computing
19245         the interface attribute here. 
19246
19247         (DefineInterface): Register our interface order with the
19248         RootContext or with the TypeContainer depending on the case.
19249
19250 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19251
19252         * cs-parser.jay: rework foreach statement to work with the new
19253         changes to the policy on SimpleNames.
19254
19255         * report.cs: support Stacktrace on warnings as well.
19256
19257         * makefile: drop --unsafe and /unsafe from the compile.
19258
19259 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19260
19261         * ecore.cs (StandardConversionExists): Modify to take an Expression
19262         as the first parameter. Ensure we do null -> reference type conversion
19263         checking.
19264
19265         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19266         temporary Expression objects.
19267
19268 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19269
19270         * interface.cs: workaround bug in method overloading resolution
19271         (there is already a bugzilla bug for it).
19272
19273 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19274
19275         We could also solve this problem by having a separate path for
19276         performing type lookups, instead of DoResolve, we could have a
19277         ResolveType entry point, and only participating pieces of the
19278         production (simplename, deref, array) would implement this. 
19279
19280         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19281         signal SimpleName to only resolve type names and not attempt to
19282         resolve anything else.
19283
19284         * expression.cs (Cast): Set the flag.
19285
19286         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19287
19288         * class.cs: Only report 108 if there is no `new' modifier.
19289
19290         * cs-parser.jay: rework foreach statement to work with the new
19291         changes to the policy on SimpleNames.
19292
19293         * report.cs: support Stacktrace on warnings as well.
19294
19295         * makefile: drop --unsafe and /unsafe from the compile.
19296
19297 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19298
19299         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19300         lookups here, instead of doing that at parse time.  This means
19301         that our grammar will not introduce `LocalVariableReferences' as
19302         expressions at this point.  That solves the problem of code like
19303         this:
19304
19305         class X {
19306            static void Main ()
19307            { int X = 1;
19308             { X x = null }}}
19309
19310         This is only half the fix.  The full fix requires parameters to
19311         also be handled in this way.
19312
19313         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19314         makes the use more obvious of the DeclSpace.  The
19315         ec.TypeContainer.TypeBuilder is now only used to pull the
19316         TypeBuilder for it.
19317
19318         My theory is that I can get rid of the TypeBuilder completely from
19319         the EmitContext, and have typecasts where it is used (from
19320         DeclSpace to where it matters).  
19321
19322         The only pending problem is that the code that implements Aliases
19323         is on TypeContainer, and probably should go in DeclSpace.
19324
19325         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19326         lookups here, instead of doing that at parse time.  This means
19327         that our grammar will not introduce `LocalVariableReferences' as
19328         expressions at this point.  That solves the problem of code like
19329         this:
19330
19331         class X {
19332            static void Main ()
19333            { int X = 1;
19334             { X x = null }}}
19335
19336         This is only half the fix.  The full fix requires parameters to
19337         also be handled in this way.
19338
19339         * class.cs (Property.DefineMethod): When implementing an interface
19340         method, set newslot, when implementing an abstract method, do not
19341         set the flag (before we tried never setting it, or always setting
19342         it, which is the difference).
19343         (Indexer.DefineMethod): same.
19344         (Method.DefineMethod): same.
19345
19346         * ecore.cs: Only set the status used flag if we get back a Field.
19347
19348         * attribute.cs: Temporary hack, so Paolo can keep working.
19349
19350 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19351
19352         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19353         the unmanaged type in the case we have a MarshalAs attribute.
19354
19355         (Resolve): Handle the case when we are parsing the special MarshalAs
19356         attribute [we need to store the unmanaged type to use later]
19357
19358         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19359         MarshalAs Attribute.
19360
19361         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19362         on parameters and accordingly set the marshalling info.
19363
19364 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * class.cs: Optimizing slightly by removing redundant code after
19367         we switched to the `NoTypes' return value.
19368         (Property.DefineMethod): use NoTypes here too.
19369
19370         This fixes the bug I introduced in my last batch of changes.
19371
19372 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19373
19374         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19375
19376         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19377         Enums since those are types too. 
19378
19379         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19380
19381         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19382         thanks to a call during the lookup process.
19383
19384 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19385
19386         * statement.cs (Foreach): Lots of work to accomodate a particular
19387         kind of foreach statement that I had not kept in mind.  It is
19388         possible to have foreachs on classes that provide a GetEnumerator
19389         method that return objects that implement the "pattern" for using
19390         a foreach, there is no need to support GetEnumerator
19391         specifically. 
19392
19393         This is needed to compile nant.
19394
19395         * decl.cs: Only report 114 if the member is not `Finalize' and if
19396         the warning level is at least 2.
19397
19398         * class.cs: Moved the compare function from Method to
19399         MethodSignature. 
19400
19401         (MethodSignature.InheritableMemberSignatureCompare): Add new
19402         filter function that is used to extract inheritable methods from a
19403         class. 
19404
19405         (Method.Define): Use the new `inheritable_method_signature_filter'
19406         delegate
19407
19408         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19409         command. 
19410
19411 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19412
19413         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19414
19415         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19416
19417         * expression.cs: Pass location information to
19418         ConvertImplicitStandard. 
19419
19420         * class.cs: Added debugging code to track return values from
19421         interfaces. 
19422
19423 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19424
19425         * expression.cs (Is.DoResolve): If either side of the `is' is an
19426         interface, do not flag the warning.
19427
19428         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19429         for interfaces
19430
19431         * report.cs: Allow for --fatal to be used with --probe.
19432
19433         * typemanager.cs (NoTypes): Move the definition for the empty Type
19434         array here. 
19435
19436         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19437         properties. 
19438         (TypeContainer.DefineProxy): New function used to proxy to parent
19439         implementations when implementing interfaces.
19440         (TypeContainer.ParentImplements): used to lookup if our parent
19441         implements a public function that is required by an interface.
19442         (TypeContainer.VerifyPendingMethods): Hook this up.
19443
19444         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19445         `modules' and `assemblies' arraylists into arrays.  We only grow
19446         these are the very early start up of the program, so this improves
19447         the speedof LookupType (nicely measured).
19448
19449         * expression.cs (MakeByteBlob): Replaced unsafe code with
19450         BitConverter, as suggested by Paolo.
19451
19452         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19453         folding of string concatenation, but if either side is a string,
19454         and the other is not, then return null, and let the runtime use
19455         the concatenation on the string plus the object (using
19456         `Object.ToString'). 
19457
19458 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19459
19460         Constant Folding has been implemented now.
19461
19462         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19463         the error instead on types that are not supported in one's
19464         complement. 
19465
19466         * constant.cs (Constant and all children): New set of functions to
19467         perform implict and explicit conversions.
19468
19469         * ecore.cs (EnumConstant): Implement the new functions to perform
19470         conversion by proxying to the child expression.
19471
19472         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19473         own separate setting that can not be turned off from the command
19474         line using --unchecked or --checked and is only controlled using
19475         the checked/unchecked statements and expressions.  This setting is
19476         used by the constant folder to flag errors.
19477
19478         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19479         ConstantCheckState as well.   
19480
19481         During Resolve, they also have to flag the state, because the
19482         constant folder runs completely in the Resolve phase.
19483
19484         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19485         well.
19486
19487 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19488
19489         * cfold.cs: New file, this file contains the constant folder.
19490
19491         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19492         argument to track whether we are using the resulting address to
19493         load or store a value and provide better error messages. 
19494
19495         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19496         new AddressOf arguments.
19497
19498         * statement.cs (Foreach.EmitCollectionForeach): Update
19499
19500         * expression.cs (Argument.Emit): Call AddressOf with proper
19501         arguments to track usage.
19502
19503         (New.DoEmit): Call AddressOf with new arguments.
19504
19505         (Unary.Emit): Adjust AddressOf call.
19506
19507 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19508
19509         * cs-parser.jay (member_access): Change the case for pre-defined types
19510         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19511         this suggestion.
19512
19513         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19514         a method body.
19515
19516         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19517         essentially like methods and apply attributes like MethodImplOptions to them too.
19518
19519         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19520         not being null.
19521
19522         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19523         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19524         is the DeclSpace.
19525
19526         * Update code everywhere accordingly.
19527
19528         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19529
19530         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19531
19532 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19533
19534         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19535         try performing lookups against those instead of jumping straight into using
19536         the 'using' clauses.
19537
19538         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19539
19540         (LookupType): Perform lookups in implicit parents too.
19541
19542         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19543         sequence as RootContext.LookupType. 
19544
19545         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19546         the various cases of namespace lookups into this method.
19547
19548 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19549
19550         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19551         in positional arguments)
19552
19553         * class.cs (Operator): Update the AllowedModifiers to contain
19554         extern. 
19555
19556         * cs-parser.jay: Update operator declaration to allow for the
19557         operator body to be empty.
19558
19559         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19560         values. 
19561
19562 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * class.cs (Method.Emit): Label parameters.
19565
19566         * driver.cs: Return 1 or 0 as the program exit code.
19567
19568 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19569
19570         * expression.cs: Special case the `null' object when trying to
19571         auto-compute the type, as anything can be explicitly converted to
19572         that. 
19573
19574         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19575         spotting this Paolo.
19576
19577         (Expression.ImplicitNumericConversion): Perform comparissions of
19578         the type using the underlying type in the case of an enumeration
19579         rather than using the enumeration type for the compare.
19580
19581         Cope with the underlying == type case, which is not possible to
19582         catch before. 
19583
19584         (Expression.ConvertNumericExplicit): Perform comparissions of
19585         the type using the underlying type in the case of an enumeration
19586         rather than using the enumeration type for the compare.
19587
19588         * driver.cs: If the user does not supply an extension, assume .exe
19589
19590         * cs-parser.jay (if_statement): Rewrote so that we can track the
19591         location for the if statement.
19592
19593         * expression.cs (Binary.ConstantFold): Only concat strings when
19594         the operation is "+", not everything ;-)
19595
19596         * statement.cs (Statement.EmitBoolExpression): Take a location
19597         argument. 
19598         (If, While, Do): Track location.
19599
19600         * expression.cs (Binary.ResolveOperator): In the object + string
19601         case, I was missing a call to ConvertImplicit
19602
19603 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19604
19605         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19606         Location arguments. Ensure we use RootContext.LookupType to do our work
19607         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19608
19609         * interface.cs (PopulateMethod): Handle the type of the parameter being
19610         null gracefully.
19611
19612         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19613         have a params method with no fixed arguments and a call is made with no
19614         arguments.
19615
19616 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19617
19618         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19619         the verbatim-string-literal
19620
19621         * support.cs (InternalParameters.ParameterModifier): handle null
19622         fixed parameters.
19623         (InternalParameters.ParameterType): ditto.
19624
19625         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19626         duplicating the name of the variable parameter.
19627         (GetParameterByName): Fix bug where we were not looking up array
19628         paramters if they were the only present (thanks Paolo!).
19629         (GetParameterInfo): We only have an empty set of types if both
19630         fixed and array are set to null.
19631         (GetParameterInfo-idx): Handle FixedParameter == null
19632
19633         * cs-parser.jay: Handle the case where there is no catch
19634         statements (missing null test).
19635
19636 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19637
19638         * driver.cs (MainDriver): Be conservative on our command line
19639         handling.
19640
19641         Catch DirectoryNotFoundException when calling GetFiles.
19642
19643         (SplitPathAndPattern): Used to split the input specification into
19644         a path and a pattern that we can feed to Directory.GetFiles.
19645
19646 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19647
19648         * statement.cs (Fixed): Implement the last case of the Fixed
19649         statement (string handling).
19650
19651         * expression.cs (StringPtr): New class used to return a char * to
19652         a string;  Used by the Fixed statement.
19653
19654         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19655
19656         * expression.cs (Binary.ResolveOperator): Remove redundant
19657         MemberLookup pn parent type.
19658         Optimize union call, we do not need a union if the types are the same.
19659         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19660         type.
19661
19662         Specialize the use of MemberLookup everywhere, instead of using
19663         the default settings. 
19664
19665         (StackAlloc): Implement stackalloc keyword.
19666
19667         * cs-parser.jay: Add rule to parse stackalloc.
19668
19669         * driver.cs: Handle /h, /help, /?
19670
19671         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19672         before we supported unsafe code.
19673
19674         * makefile: add --unsafe to the self compilation of mcs.
19675
19676 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19677
19678         * expression.cs (PointerArithmetic): New class that is used to
19679         perform pointer arithmetic.
19680         (Binary.Resolve): Handle pointer arithmetic
19681         Handle pointer comparission.
19682         (ArrayPtr): Utility expression class that is used to take the
19683         address of an array.
19684
19685         (ElementAccess): Implement array access for pointers
19686
19687         * statement.cs (Fixed): Implement fixed statement for arrays, we
19688         are missing one more case before we are done.
19689
19690         * expression.cs (Indirection): Implement EmitAssign and set the
19691         ExprClass to Variable.  This allows pointer dereferences to be
19692         treated as variables, and to have values assigned to them.
19693
19694         * ecore.cs (Expression.StoreFromPtr): New utility function to
19695         store values dereferencing.
19696
19697 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19698
19699         * expression.cs (Binary.ResolveOperator): Ensure that we are
19700         not trying to operate on a void type - this fixes the reported
19701         bug.
19702
19703         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19704         the parent implementation is sealed.
19705
19706         * ../errors/cs0239.cs : Add.
19707
19708         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19709
19710         * typemanager.cs (unverifiable_code_type): Corresponds to 
19711         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19712         which have unsafe code in them.
19713
19714         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19715         unsafe context.
19716
19717 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19718
19719         * cs-tokenizer.cs: Add support for @"litreal strings"
19720
19721         Make tokenizer accept pre-processor directives
19722         on any column (remove the old C-like limitation). 
19723
19724         * rootcontext.cs (EmitCode): Emit any global attributes.
19725         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19726
19727         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19728
19729         * cs-parser.jay: Add support for global attributes.  
19730
19731 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * expression.cs (Indirection): New helper class.  Unary will
19734         create Indirection classes to be able to implement the
19735         IMemoryLocation interface on it.
19736
19737 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19738
19739         * cs-parser.jay (fixed_statement): reference the right statement.
19740
19741         * statement.cs (Fixed.Emit): Finish implementing the fixed
19742         statement for the &x case.
19743
19744 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19745
19746         * class.cs (Property.Define, Method.Define): Remove newslot when
19747         `implementing'.  
19748
19749         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19750         wrong.  NewSlot should only be used if the `new' keyword is present.
19751
19752         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19753         locating our system dir.  Sorry about this.
19754
19755 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19756
19757         * driver.cs (GetSystemDir): Compute correctly the location of our
19758         system assemblies.  I was using the compiler directory instead of
19759         the library directory.
19760
19761 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19762
19763         * expression.cs (BetterFunction): Put back in what Miguel commented out
19764         since it is the correct fix. The problem is elsewhere ;-)
19765
19766         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19767         parameters of the parms method are themselves compatible or not !
19768
19769         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19770         to check that a class implements an interface before saying that an implicit
19771         conversion was allowed. Use ImplementsInterface to do the checking.
19772
19773 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19774
19775         * class.cs (Method.Define): Track whether we are an explicit
19776         implementation or not.  And only call DefineMethodOverride if we
19777         are an explicit implementation.
19778
19779         (Property.DefineMethod): Ditto.
19780
19781 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19782
19783         * expression.cs (BetterFunction): Catch hideous bug which was
19784          preventing us from detecting ambiguous calls due to implicit casts i.e
19785         cs0121.
19786
19787 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19788
19789         * support.cs (Pair): Remove un-needed method.  I figured why I was
19790         getting the error in cs-parser.jay, the variable in a foreach loop
19791         is readonly, and the compiler does not really treat this as a variable.
19792
19793         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19794         instead of EQUALS in grammar.  
19795
19796         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19797
19798         * expression.cs (Unary.DoResolve): Check whether the argument is
19799         managed or not.
19800
19801 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19802
19803         * support.cs: Api for Pair to set a value.  Despite the fact that
19804         the variables are public the MS C# compiler refuses to compile
19805         code that accesses the field if the variable is part of a foreach
19806         statement. 
19807
19808         * statement.cs (Fixed): Begin implementation of the fixed
19809         statement.
19810
19811         (Block.AddVariable): Return the VariableInfo on success and null
19812         on failure instead of true/false. 
19813
19814         * cs-parser.jay (foreach): Catch errors on variables already
19815         defined (we were ignoring this value before) and properly unwind
19816         the block hierarchy
19817
19818         (fixed_statement): grammar for the fixed statement.
19819
19820 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19821
19822         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19823         pointer types to be incretemented.
19824
19825         (SizeOf): Implement.
19826
19827         * cs-parser.jay (pointer_member_access): Implement
19828         expr->IDENTIFIER production.
19829
19830         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19831         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19832         on safe contexts.
19833
19834         (Unary): Implement indirection.
19835
19836         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19837         use in non-unsafe context).
19838
19839         (SimpleName.DoResolve): Check for pointers in field access on safe
19840         contexts. 
19841
19842         (Expression.LoadFromPtr): Factor the load-indirect code in this
19843         function.  This was duplicated in UnboxCast and ParameterReference
19844
19845 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19846
19847         * expression.cs (ComposedCast): report an error if a pointer cast
19848         is used in a safe region.
19849
19850         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19851         pointer type casts in unsafe context.
19852
19853         * codegen.cs (EmitContext): Set up IsUnsafe.
19854
19855         * cs-parser.jay (non_expression_type): Add productions for pointer
19856         casts. 
19857
19858         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19859         code.  We should not use force into static mode if the method is
19860         not virtual.  Fixes bug in MIS
19861
19862         * statement.cs (Do.Emit, While.Emit, For.Emit,
19863         Statement.EmitBoolExpression): Add support to Do and While to
19864         propagate infinite loop as `I do return' semantics.
19865
19866         Improve the For case to also test for boolean constants.
19867
19868         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19869         to the list of attributes we can add.
19870
19871         Remove `EmitContext' argument.
19872
19873         * class.cs (Method.Define): Apply parameter attributes.
19874         (Constructor.Define): Apply parameter attributes.
19875         (MethodCore.LabelParameters): Move here the core of labeling
19876         parameters. 
19877
19878         * support.cs (ReflectionParameters.ParameterModifier,
19879         InternalParameters.ParameterModifier): Use IsByRef on the type and
19880         only return the OUT bit for these parameters instead of in/out/ref
19881         flags.
19882
19883         This is because I miss-understood things.  The ParameterInfo.IsIn
19884         and IsOut represent whether the parameter has the [In] and [Out]
19885         attributes set.  
19886
19887 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * ecore.cs (FieldExpr.Emit): Release temporaries.
19890
19891         * assign.cs (LocalTemporary.Release): new function.
19892
19893         * codegen.cs (EmitContext.GetTemporaryStorage,
19894         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19895         temporary storage.  Now we can "put back" localbuilders when we
19896         are done with them
19897
19898 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19899
19900         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19901         need to make a copy of the variable to generate verifiable code.
19902
19903 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * driver.cs: Compute dynamically the system directory.
19906
19907         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19908         Slower, but more generally useful.  Used by the abstract
19909         registering implementation. 
19910
19911         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19912         the rules for the special rule on Type/instances.  First check if
19913         we have the same name, and if so, try that special static path
19914         rather than the instance path.
19915
19916 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19917
19918         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19919         for, while and if.
19920
19921         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19922         Enum, ValueType, Delegate or Array for non-corlib compiles.
19923
19924         * cs-tokenizer.cs: Catch long identifiers (645)
19925
19926         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19927         piece of code.
19928
19929         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19930         fix, we were returning too early, so we were not registering
19931         pending methods from abstract classes.
19932
19933         Do not register pending methods if the class is abstract.
19934
19935         * expression.cs (Conditional.DoResolve): Report circular implicit
19936         conversions when we neecd to compute it for conditional
19937         expressions. 
19938
19939         (Is.DoResolve): If the expression is always of the provided type,
19940         flag warning 183.  If the expression can not ever be of the
19941         provided type flag warning 184.
19942
19943         * class.cs: Catch 169 as well.
19944
19945         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19946         read. 
19947
19948 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19949
19950         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19951
19952 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19953
19954         * interface.cs: (PopulateMethod): Check for pointers being defined
19955         only if the unsafe context is active.
19956         (PopulateProperty): ditto.
19957         (PopulateIndexer): ditto.
19958
19959         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19960         specified.  If pointers are present, make sure that they are
19961         present in an unsafe context.
19962         (Constructor, Constructor.Define): ditto.
19963         (Field, Field.Define): ditto.
19964         (Property, Property.Define): ditto.
19965         (Event, Event.Define): ditto.
19966
19967         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19968         hashtable if there are classes or structs defined.
19969
19970         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19971         code, as the constant resolution moved.
19972
19973         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19974         the metadata, so we can flag error 133. 
19975
19976         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19977         pointer is being declared in an unsafe context.
19978
19979 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * modifiers.cs (Modifiers.Check): Require a Location argument.
19982         Report error 227 for Unsafe use.
19983
19984         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19985
19986         * statement.cs (For.Emit): If the test is null, then report that
19987         we do `return', as we wont reach anything afterwards.
19988
19989         (Switch.SwitchGoverningType): Track the expression that matched
19990         the conversion.
19991
19992         * driver.cs: Allow negative numbers as an error code to flag.
19993
19994         * cs-parser.jay: Handle 1551.
19995
19996         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19997
19998 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * cs-parser.jay: Report 1518 (type declaration can only contain
20001         class, struct, interface, enum or delegate)
20002
20003         (switch_label): Report 1523 (keywords `case' or `default' must
20004         preced code)
20005
20006         (opt_switch_sections): Report 1522 (empty switch)
20007
20008         * driver.cs: Report 1515 (response file specified multiple times)
20009         Report 1516 (Source file specified multiple times).
20010
20011         * expression.cs (Argument.Resolve): Signal 1510
20012
20013         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20014         access not allowed in static code)
20015
20016 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20017
20018         * typemanager.cs (IsPointerType): Utility method which we are going
20019         to need a lot.
20020
20021         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20022         the object type, so we take care of that.
20023
20024         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20025
20026         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20027         added to non-params parameters :-)
20028
20029         * typemanager.cs (CSharpName): Include 'void' type too. 
20030
20031         (void_ptr_type): Include in the set of core types.
20032
20033         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20034         duplicating code.
20035
20036         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20037         an unsafe context.
20038
20039         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20040         completely forgotten about it.
20041
20042 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20043
20044         * cs-parser.jay (pointer_type): Add. This begins our implementation
20045         of parsing rules for unsafe code.
20046
20047         (unsafe_statement): Implement.
20048
20049         (embedded_statement): Modify to include the above.
20050
20051         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20052
20053         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20054         if the current context is an unsafe one.
20055
20056         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20057         are handled differently, we need separate rules for them.
20058
20059         (local_variable_declaration): Update to use local_variable_pointer_type
20060         to allow variable declarations of unmanaged pointer types.
20061
20062         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20063         in unsafe contexts.
20064
20065         * ../errors/cs0214.cs : Add.
20066
20067 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20068
20069         * makefile: remove 'response' file when cleaning.
20070
20071 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * cs-parser.jay: Report 1524.
20074
20075 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20076
20077         * typemanager.cs (RegisterMethod): drop checking if we have
20078         registered this from here
20079
20080 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * class.cs (Method.EmitDestructor): Implement calling our base
20083         destructor. 
20084
20085         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20086         value of InFinally.
20087
20088         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20089         this routine and will wrap the call in a try/catch block.  Deal
20090         with the case.
20091
20092 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * ecore.cs (Expression.MemberLookup): instead of taking a
20095         parameter `same_type' that was used to tell whether we could
20096         access private members we compute our containing type from the
20097         EmitContext.
20098
20099         (FieldExpr): Added partial support for volatile fields.  This does
20100         not work for volatile fields exposed from assemblies, as I can not
20101         figure out how to extract the modreq from it.
20102
20103         Updated all the source files to use this.
20104
20105         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20106         because it is referenced by MemberLookup very often. 
20107
20108 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20109
20110         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20111         TypeBuilder.GetCustomAttributes to retrieve what we need.
20112
20113         Get rid of redundant default_member_attr_type as this is the same as
20114         default_member_type which already exists.
20115
20116         * interface.cs, attribute.cs : Update accordingly.
20117
20118 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20119
20120         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20121         work for TYpeBuilders though.  Ravi, can you please fix this?
20122
20123         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20124
20125         * expression.cs (Argument.Emit): Handle the case of ref objects
20126         being passed to ref functions;  
20127
20128         (ParameterReference.EmitLoad): Loads the content of the pointer
20129         without dereferencing.
20130
20131 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20134
20135 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20136
20137         * class.cs (Indexer.DefineMethod): Incorporate the interface
20138         type in the name of the method if we are doing explicit interface
20139         implementation.
20140
20141         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20142
20143         (BetterConversion): Fix extremely trivial bug where we were referring to
20144         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20145         again !
20146
20147         * ../errors/bug16.cs : Add although we have fixed it.
20148
20149 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * expression.cs (BaseIndexer): Begin implementation.
20152
20153         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20154
20155         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20156         production directly to remove a shift/reduce, and implement
20157         explicit interface implementation.
20158
20159         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20160         after a floating point suffix.
20161
20162         * expression.cs (DoNumericPromotions): Improved the conversion for
20163         uint/uint.  If we have a constant, we avoid doing a typecast to a
20164         larger type.
20165
20166         * class.cs (Indexer): Implement explicit interface implementation
20167         for indexers.
20168
20169 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20170
20171         * class.cs: make the default instance constructor public and hidebysig.
20172
20173 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20174
20175         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20176         so we can call it from elsewhere.
20177
20178         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20179         we emit it internally if the class has a defined indexer; otherwise the user
20180         emits it by decorating the class definition with the DefaultMemberAttribute.
20181
20182         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20183         attribute is not used on a type which defines an indexer.
20184
20185         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20186         character when we skip whitespace.
20187
20188         * ../errors/cs0646.cs : Add.
20189
20190 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20191
20192         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20193         again. 
20194
20195         * makefile: Add practical target `mcs3.exe' which builds the third
20196         generation compiler. 
20197
20198         * expression.cs (New): Fix structures constructor calling.
20199
20200         * class.cs (Property, Method, Indexer): Emit Final flag on the
20201         method if we are an interface implementation and we are not
20202         abstract. 
20203
20204         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20205         whether this property is referencing a `base' method.
20206
20207         * expression.cs (Invocation.EmitCall): take an extra argument:
20208         is_base, this is used to determine whether the `call' or
20209         `callvirt' opcode should be used.
20210
20211
20212         * delegate.cs: update EmitCall.
20213
20214         * class.cs (Method.Define): Set NewSlot for the cases where we are
20215         not implementing an interface method.
20216
20217         (Property.Define): ditto.
20218
20219 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20220
20221         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20222         'r'.  Allows mcs to parse itself fully.
20223
20224 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20225
20226         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20227         of the number of initializers that require the InitializeArray method.
20228
20229         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20230         update the above field where necessary.
20231
20232         (MakeByteBlob): Update accordingly.
20233
20234         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20235         greater than 2.
20236
20237         (EmitDynamicInitializers): Update in accordance with the new optimization.
20238
20239         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20240         same OpCode applies.
20241
20242         * cs-parser.jay : Fix some glaring errors I introduced.
20243
20244 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20245
20246         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20247         so that we can check for name clashes there too.
20248
20249         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20250         for interface indexers.
20251
20252         * interfaces.cs (Define): Emit the default member attribute.
20253
20254         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20255         variable was being referred to while setting the value ;-)
20256
20257 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20260         byte-by-byte information when we know the data is zero.
20261
20262         Make the block always a multiple of 4, because
20263         DefineInitializedData has a bug.
20264
20265         * assign.cs: Fix, we should assign from the temporary, not from
20266         the source. 
20267
20268         * expression.cs (MakeByteBlob): Fix my incorrect code.
20269
20270 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20271
20272         * typemanager.cs (EnumToUnderlying): This function is used to get
20273         the underlying type from an enumeration, because it does not
20274         always work. 
20275
20276         * constant.cs: Use the I4_S form for values between -128 and 127.
20277
20278         * statement.cs (Block.LookupLabel): Looks up a label.
20279         (Block): Drop support for labeled blocks.
20280
20281         (LabeledStatement): New kind of statement that represents a label
20282         only.
20283
20284         (Goto): Finally implement this bad boy.
20285
20286         * cs-parser.jay: Update to reflect new mechanism to implement
20287         labels.
20288
20289 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * codegen.cs (EmitContext.This): a codegen property that keeps the
20292         a single instance of this instead of creating many different this
20293         instances. 
20294
20295         * delegate.cs (Delegate.DoResolve): Update to use the property;
20296
20297         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20298
20299         * expression.cs (BaseAccess.DoResolve): Ditto.
20300
20301 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20302
20303         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20304         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20305
20306         (InitCoreTypes): Update accordingly.
20307
20308         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20309         so we can quickly store the state.
20310
20311         (ApplyAttributes): Set the correct implementation flags
20312         for InternalCall methods.
20313
20314 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20315
20316         * expression.cs (EmitCall): if a method is not virtual, then do
20317         not use callvirt on it.
20318
20319         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20320         user defined stuff) requires the use of stobj, which takes an
20321         address on the stack instead of an array and an index.  So emit
20322         the Ldelema operation for it.
20323
20324         (EmitStoreOpcode): Use stobj for valuetypes.
20325
20326         (UnaryMutator.EmitCode): Use the right 1 value depending on
20327         whether we are dealing with int64/uint64, float or doubles.
20328
20329         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20330         constructors that I implemented last night.
20331
20332         (Constructor.IsDefault): Fix to work properly for static
20333         constructors.
20334
20335         * cs-parser.jay (CheckDef): report method signature errors.
20336         Update error number 103 to be 132.
20337
20338         * decl.cs: New AdditionResult enumeration value: MethodExists.
20339         Although we do this check for methods later on in the semantic
20340         analysis, catching repeated default constructors is so easy that
20341         we catch these here. 
20342
20343         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20344         promotions code.
20345
20346         (ParameterReference.EmitAssign, Emit): handle
20347         bools as bytes.
20348
20349         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20350         (ArrayAccess.EmitStoreOpcode): ditto.
20351
20352         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20353
20354         * expression.cs (MakeByteBlob): Complete all the missing types
20355         (uint, short, ushort, byte, sbyte)
20356
20357         * class.cs: Only init instance field initializers on instance
20358         constructors. 
20359
20360         Rename `constructors' to instance_constructors. 
20361
20362         (TypeContainer.AddConstructor): Only add constructors to the list
20363         if it is not static.
20364
20365         Make sure that we handle default_static_constructor independently
20366         everywhere where we handle instance_constructors
20367
20368 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20369
20370         * class.cs: Do not lookup or create a base initializer for a
20371         static constructor.
20372
20373         (ConstructorInitializer.Resolve): use the proper type to lookup
20374         for constructors.
20375
20376         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20377
20378         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20379         in DeclSpace. 
20380
20381         * decl.cs: CloseType is now an virtual method, the default
20382         implementation just closes this type.
20383
20384 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20385
20386         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20387         to PreserveSig by default. Also emit HideBySig on such methods.
20388
20389         Basically, set the defaults to standard values.
20390
20391         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20392         argument, if candidate is better, it can't be worse than the best !
20393
20394         (Invocation): Re-write bits to differentiate between methods being
20395         applicable in their expanded form and their normal form - for params
20396         methods of course.
20397
20398         Get rid of use_standard everywhere as only standard conversions are allowed
20399         in overload resolution. 
20400
20401         More spec conformance.
20402
20403 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20404
20405         * driver.cs: Add --timestamp, to see where the compiler spends
20406         most of its time.
20407
20408         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20409         `this' in static code.
20410
20411         (SimpleName.DoResolve): Implement in terms of a helper function
20412         that allows static-references to be passed upstream to
20413         MemberAccess.
20414
20415         (Expression.ResolveWithSimpleName): Resolve specially simple
20416         names when called by MemberAccess to implement the special
20417         semantics. 
20418
20419         (Expression.ImplicitReferenceConversion): Handle conversions from
20420         Null to reference types before others, as Null's type is
20421         System.Object. 
20422
20423         * expression.cs (Invocation.EmitCall): Handle the special case of
20424         calling methods declared on a reference type from a ValueType
20425         (Base classes System.Object and System.Enum)
20426
20427         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20428         the left hand side is a TypeExpr, not on every enumeration. 
20429
20430         (Binary.Resolve): If types are reference types, then do a cast to
20431         object on operators != and == of both arguments.
20432
20433         * typemanager.cs (FindMembers): Extract instance and static
20434         members if requested.
20435
20436         * interface.cs (PopulateProperty): Use void_type instead of null
20437         as the return type for the setter method.
20438
20439         (PopulateIndexer): ditto.
20440
20441 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20442
20443         * support.cs (ReflectionParameters): Fix minor bug where we
20444         were examining the wrong parameter for the ParamArray attribute.
20445
20446         Cope with requests for the type of the parameter at position
20447         greater than the params parameter's. We now return the element
20448         type of the params array as that makes more sense.
20449
20450         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20451         accordingly as we no longer have to extract the element type
20452         ourselves.
20453
20454         (Invocation.OverloadResolve): Update.
20455
20456 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20459         against IEnumerator, test whether the return value is a descendant
20460         of the IEnumerator interface.
20461
20462         * class.cs (Indexer.Define): Use an auxiliary method to implement
20463         the other bits of the method definition.  Begin support for
20464         explicit interface implementation.
20465
20466         (Property.DefineMethod): Use TypeManager.void_type instead of null
20467         for an empty return value.
20468
20469 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20470
20471         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20472         dealing with a FieldExpr which is composed of a FieldBuilder, in
20473         the code path we did extract the constant, but we should have
20474         obtained the underlying value to be able to cast it (otherwise we
20475         end up in an infinite loop, this is what Ravi was running into).
20476
20477         (ArrayCreation.UpdateIndices): Arrays might be empty.
20478
20479         (MemberAccess.ResolveMemberAccess): Add support for section
20480         14.5.4.1 that deals with the special case of E.I when E is a type
20481         and something else, that I can be a reference to a static member.
20482
20483         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20484         handle a particular array type to create byte blobs, it is just
20485         something we dont generate byteblobs for.
20486
20487         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20488         arguments. 
20489
20490         * location.cs (Push): remove the key from the hashtable that we
20491         are about to add.   This happens for empty files.
20492
20493         * driver.cs: Dispose files after we have parsed them.
20494
20495         (tokenize): new function that only runs the tokenizer on its
20496         input, for speed testing.
20497
20498 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20499
20500         * class.cs (Event.Define): Define the private field only if there
20501         are no accessors defined.
20502
20503         * expression.cs (ResolveMemberAccess): If there is no associated
20504         field with the event, that means we have an event defined with its
20505         own accessors and we should flag error cs0070 since transforming
20506         ourselves into a field is not valid in that case.
20507
20508         * ecore.cs (SimpleName.DoResolve): Same as above.
20509
20510         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20511         and charset to sane values.
20512
20513 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20514
20515         * assign.cs (DoResolve): Perform check on events only if they 
20516         are being accessed outside the declaring type.
20517
20518         * cs-parser.jay (event_declarations): Update rules to correctly
20519         set the type of the implicit parameter etc.
20520
20521         (add_accessor, remove_accessor): Set current local parameters.
20522
20523         * expression.cs (Binary): For delegate addition and subtraction,
20524         cast the return value from the method into the appropriate delegate
20525         type.
20526
20527 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20528
20529         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20530         of these as the workaround is unnecessary.
20531
20532         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20533         delegate data - none of that is needed at all.
20534
20535         Re-write bits to extract the instance expression and the delegate method
20536         correctly.
20537
20538         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20539         on delegates too.
20540
20541         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20542         of attaching attributes instead of duplicating code everywhere.
20543
20544         * everywhere : Update code to do attribute emission using the above method.
20545
20546 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20547
20548         * expression.cs (IsParamsMethodApplicable): if there are not
20549         parameters, return immediately.
20550
20551         * ecore.cs: The 0 literal can be implicity converted to an enum
20552         type. 
20553
20554         (SimpleName.DoResolve): First lookup the type, then lookup the
20555         members. 
20556
20557         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20558         want to get its address.  If the InstanceExpression is not
20559         addressable, store the result in a temporary variable, then get
20560         the address of it.
20561
20562         * codegen.cs: Only display 219 errors on warning level or above. 
20563
20564         * expression.cs (ArrayAccess): Make it implement the
20565         IMemoryLocation interface.
20566
20567         (Binary.DoResolve): handle the operator == (object a, object b)
20568         and operator != (object a, object b) without incurring into a
20569         BoxedCast (because 5 != o should never be performed).
20570
20571         Handle binary enumerator operators.
20572
20573         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20574         value type, otherwise use Ldelem_ref.
20575
20576         Use precomputed names;
20577
20578         (AddressOf): Implement address of
20579
20580         * cs-parser.jay (labeled_statement): Fix recursive block
20581         addition by reworking the production.
20582
20583         * expression.cs (New.DoEmit): New has a special case:
20584                 
20585                  If we are dealing with a ValueType, we have a few
20586                  situations to deal with:
20587                 
20588                     * The target of New is a ValueType variable, that is
20589                       easy, we just pass this as the variable reference
20590                 
20591                     * The target of New is being passed as an argument,
20592                       to a boxing operation or a function that takes a
20593                       ValueType.
20594                 
20595                       In this case, we need to create a temporary variable
20596                       that is the argument of New.
20597
20598
20599 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20600
20601         * rootcontext.cs (LookupType): Check that current_type is not null before
20602         going about looking at nested types.
20603
20604         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20605         not implement the IAssignMethod interface any more.
20606
20607         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20608         where we tranform them into FieldExprs if they are being resolved from within
20609         the declaring type.
20610
20611         * ecore.cs (SimpleName.DoResolve): Do the same here.
20612
20613         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20614
20615         * ../errors/bug10.cs : Add.
20616
20617         * ../errors/cs0070.cs : Add.
20618
20619         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20620
20621         * assign.cs : Get rid of EventIsLocal everywhere.
20622
20623 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20624
20625         * ecore.cs (ConvertIntLiteral): finished the implementation.
20626
20627         * statement.cs (SwitchLabel): Convert the value we are using as a
20628         key before looking up the table.
20629
20630 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20631
20632         * codegen.cs (EmitTopBlock): Require a Location argument now.
20633
20634         * cs-parser.jay (constructor_declarator): We need to setup
20635         current_local_parameters before we parse the
20636         opt_constructor_initializer, to allow the variables to be bound
20637         to the constructor arguments.
20638
20639         * rootcontext.cs (LookupType): First lookup nested classes in our
20640         class and our parents before we go looking outside our class.
20641
20642         * expression.cs (ConstantFold): Extract/debox the values at the
20643         beginnning. 
20644
20645         * rootcontext.cs (EmitCode): Resolve the constants first before we
20646         resolve the types.  This is not really needed, but it helps debugging.
20647
20648         * statement.cs: report location.
20649
20650         * cs-parser.jay: pass location to throw statement.
20651
20652         * driver.cs: Small bug fix.
20653
20654         * report.cs: Updated format to be 4-zero filled digits.
20655
20656 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20657
20658         * expression.cs (CheckIndices): Fix minor bug where the wrong
20659         variable was being referred to ;-)
20660
20661         (DoEmit): Do not call EmitStaticInitializers when the 
20662         underlying type is System.Object.
20663
20664 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20665
20666         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20667         and do the usual workaround for SRE.
20668
20669         * class.cs (MyEventBuilder.EventType): New member to get at the type
20670         of the event, quickly.
20671
20672         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20673
20674         * assign.cs (Assign.DoResolve): Handle the case when the target
20675         is an EventExpr and perform the necessary checks.
20676
20677         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20678         interface.
20679
20680         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20681
20682         (EventExpr): Set the type in the constructor itself since we 
20683         are meant to be born fully resolved.
20684
20685         (EventExpr.Define): Revert code I wrote earlier.
20686                 
20687         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20688         instance expression is null. The instance expression is a This in that case
20689         or a null, depending on whether it is a static method or not.
20690
20691         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20692         refers to more than one method.
20693
20694         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20695         and accordingly flag errors.
20696
20697 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20698
20699         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20700
20701 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20702
20703         * location.cs (ToString): Provide useful rutine.
20704
20705 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20706
20707         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20708         objects, return the actual integral boxed.
20709
20710         * statement.cs (SwitchLabel): define an ILLabel for each
20711         SwitchLabel. 
20712
20713         (Switch.CheckSwitch): If the value is a Literal, extract
20714         the underlying literal.
20715
20716         Also in the unused hashtable we had, add the SwitchLabel so we can
20717         quickly look this value up.
20718
20719         * constant.cs: Implement a bunch of new constants.  Rewrite
20720         Literal based on this.  Made changes everywhere to adapt to this.
20721
20722         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20723         dereferencing array only once, and also copes with enumrations.
20724
20725         bytes are two bytes wide, not one.
20726
20727         (Cast): Perform constant conversions.
20728
20729         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20730         wrappers to the literals here.
20731
20732         * expression.cs (DoNumericPromotions): long literals can converted
20733         to ulong implicity (this is taken care of elsewhere, but I was
20734         missing this spot).
20735
20736         * ecore.cs (Expression.Literalize): Make the return type Literal,
20737         to improve type checking.
20738
20739         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20740
20741 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20742
20743         * literal.cs: Revert code from ravi that checked the bounds.  The
20744         bounds are sane by the definition of the type itself. 
20745
20746         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20747         need to actually look up in our parent hierarchy for interfaces
20748         implemented. 
20749
20750         * const.cs: Use the underlying type for enumerations
20751
20752         * delegate.cs: Compute the basename for the delegate creation,
20753         that should fix the delegate test case, and restore the correct
20754         Type Lookup semantics in rootcontext
20755
20756         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20757         referencing a nested type with the Reflection API is using the "+"
20758         sign. 
20759
20760         * cs-parser.jay: Do not require EOF token at the end.
20761
20762 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20763
20764         * rootcontext.cs (LookupType): Concatenate type names with
20765         a '.' instead of a '+' The test suite passes again.
20766
20767         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20768         field of the enumeration.
20769
20770         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20771         the case when the member is an EventExpr.
20772
20773         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20774         static has an associated instance expression.
20775
20776         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20777
20778         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20779
20780         * class.cs (Event.Define): Register event and perform appropriate checks
20781         for error #111.
20782
20783         We define the Add and Remove methods even if the use provides none because
20784         in that case, we provide default implementations ourselves.
20785
20786         Define a private field of the type of the event. This is done by the CSC compiler
20787         and we should be doing it too ;-)
20788
20789         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20790         More methods we use in code we generate.
20791
20792         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20793         is important.
20794
20795         (InitCoreTypes): Update accordingly for the above.
20796
20797         * class.cs (Event.Emit): Generate code for default accessors that we provide
20798
20799         (EmitDefaultMethod): Do the job in the above.
20800
20801         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20802         appropriate place.
20803
20804 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20805
20806         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20807         builders even if we were missing one.
20808
20809         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20810         pass the Basename as our class name instead of the Name.  The
20811         basename will be correctly composed for us.
20812
20813         * parameter.cs (Paramters): Now takes a Location argument.
20814
20815         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20816         make all the code call directly LookupType in RootContext and take
20817         this chance to pass the Location information everywhere.
20818
20819         * Everywhere: pass Location information.
20820
20821 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20822
20823         * class.cs (Constructor.Define): Updated way of detecting the
20824         length of the parameters.
20825
20826         (TypeContainer.DefineType): Use basename as the type name for
20827         nested types.
20828
20829         (TypeContainer.Define): Do not recursively define types here, as
20830         definition is taken care in order by the RootContext.
20831
20832         * tree.cs: Keep track of namespaces in a per-file basis.
20833
20834         * parameter.cs (Parameter.ComputeSignature): Update to use
20835         DeclSpace. 
20836
20837         (Parameters.GetSignature): ditto.
20838
20839         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20840         instead of a TypeContainer.
20841
20842         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20843         resolve names.  Because we need to be resolve in our context, not
20844         our parents.
20845
20846         * driver.cs: Implement response files.
20847
20848         * class.cs (TypeContainer.DefineType): If we are defined, do not
20849         redefine ourselves.
20850
20851         (Event.Emit): Emit the code for add/remove handlers.
20852         (Event.Define): Save the MethodBuilders for add/remove.
20853
20854         * typemanager.cs: Use pair here too.
20855
20856         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20857         DictionaryEntry requires the first argument to be non-null.  
20858
20859         (enum_declaration): Compute full name for registering the
20860         enumeration.
20861
20862         (delegate_declaration): Instead of using
20863         formal_parameter_list, use opt_formal_parameter_list as the list
20864         can be empty.
20865
20866         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20867         (EventParsing): New property that controls whether `add' and
20868         `remove' are returned as tokens or identifiers (for events);
20869
20870 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20871
20872         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20873         use MyEventBuilder only and let it wrap the real builder for us.
20874
20875         (MyEventBuilder): Revamp constructor etc.
20876
20877         Implement all operations that we perform on EventBuilder in precisely the same
20878         way here too.
20879
20880         (FindMembers): Update to use the EventBuilder member.
20881
20882         (Event.Emit): Update accordingly.
20883
20884 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20885
20886         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20887         by calling the appropriate methods.
20888
20889         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20890         useful.
20891
20892         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20893
20894 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20895
20896         * delegate.cs (Delegate.Populate): Check that the return type
20897         and various parameters types are indeed accessible.
20898
20899         * class.cs (Constructor.Define): Same here.
20900
20901         (Field.Define): Ditto.
20902
20903         (Event.Define): Ditto.
20904
20905         (Operator.Define): Check that the underlying Method defined itself
20906         correctly - so it's MethodBuilder should not be null.
20907
20908         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20909         expression happens to be null.
20910
20911         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20912         members but as of now we don't seem to be able to do anything really useful with it.
20913
20914         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20915         not the EventBuilder.
20916
20917 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20918
20919         * cs-tokenizer.cs: Add support for defines.
20920         Add support for #if, #elif, #else, #endif
20921
20922         (eval_var): evaluates a variable.
20923         (eval): stubbed for evaluating functions.
20924
20925         * cs-parser.jay: Pass the defines information
20926
20927         * driver.cs: Add --define command line option.
20928
20929         * decl.cs: Move MemberCore here.
20930
20931         Make it the base class for DeclSpace.  This allows us to catch and
20932         report 108 and 109 for everything now.
20933
20934         * class.cs (TypeContainer.Define): Extract all the members
20935         before populating and emit the warning 108 (new keyword required
20936         to override) instead of having each member implement this.
20937
20938         (MemberCore.Define): New abstract method, we will be using this in
20939         the warning reporting engine in Populate.
20940
20941         (Operator.Define): Adjust to new MemberCore protocol. 
20942
20943         * const.cs (Const): This does not derive from Expression, it is a
20944         temporary object we use to create fields, it is a MemberCore. 
20945
20946         * class.cs (Method.Define): Allow the entry point to be in a
20947         specific class.
20948
20949         * driver.cs: Rewrite the argument handler to clean it up a bit.
20950
20951         * rootcontext.cs: Made it just an auxiliary namespace feature by
20952         making everything static.
20953
20954         * driver.cs: Adapt code to use RootContext type name instead of
20955         instance variable.
20956
20957         * delegate.cs: Remove RootContext argument.
20958
20959         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20960         argument. 
20961
20962         * class.cs (Event.Define): The lookup can fail.
20963
20964         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20965
20966         * expression.cs: Resolve the this instance before invoking the code.
20967
20968 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20969
20970         * cs-parser.jay: Add a production in element_access that allows
20971         the thing to become a "type" reference.  This way we can parse
20972         things like "(string [])" as a type.
20973
20974         Note that this still does not handle the more complex rules of
20975         casts. 
20976
20977
20978         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20979
20980         * ecore.cs: (CopyNewMethods): new utility function used to
20981         assemble the list of methods from running FindMembers.
20982
20983         (MemberLookup): Rework FindMembers so that 
20984
20985 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * class.cs (TypeContainer): Remove Delegates who fail to be
20988         defined.
20989
20990         * delegate.cs (Populate): Verify that we dont get null return
20991         values.   TODO: Check for AsAccessible.
20992
20993         * cs-parser.jay: Use basename to emit error 574 (destructor should
20994         have the same name as container class), not the full name.
20995
20996         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20997         possible representation.  
20998
20999         Also implements integer type suffixes U and L.
21000
21001 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21002
21003         * expression.cs (ArrayCreation.DoResolve): We need to do the
21004         argument resolution *always*.
21005
21006         * decl.cs: Make this hold the namespace.  Hold the root context as
21007         well.
21008         (LookupType): Move here.
21009
21010         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21011
21012         * location.cs (Row, Name): Fixed the code, it was always returning
21013         references to the first file.
21014
21015         * interface.cs: Register properties defined through interfaces.
21016
21017         * driver.cs: Add support for globbing on the command line
21018
21019         * class.cs (Field): Make it derive from MemberCore as well.
21020         (Event): ditto.
21021
21022 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21023
21024         * class.cs (Event::Define): Check that the type of the event is a delegate
21025         type else flag error #66.
21026
21027         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21028         same.
21029
21030         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21031         values of EntryPoint, CharSet etc etc.
21032
21033         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21034
21035         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21036         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21037         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21038         which needs this to do its work.
21039
21040         * ../errors/cs0066.cs : Add.
21041
21042 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21045         helper functions.
21046
21047         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21048         clears out the parameters field.
21049         (MemberSignatureCompare): Cleanup
21050
21051         (MemberCore): New base class used to share code between MethodCore
21052         and Property.
21053
21054         (RegisterRequiredImplementations) BindingFlags.Public requires
21055         either BindingFlags.Instace or Static.  Use instance here.
21056
21057         (Property): Refactored code to cope better with the full spec.
21058
21059         * parameter.cs (GetParameterInfo): Return an empty array instead
21060         of null on error.
21061
21062         * class.cs (Property): Abstract or extern properties have no bodies.
21063
21064         * parameter.cs (GetParameterInfo): return a zero-sized array.
21065
21066         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21067         method modifier validation to the typecontainer so we can reuse
21068         this on properties.
21069
21070         (MethodCore.ParameterTypes): return an empty sized array of types.
21071
21072         (Property.Define): Test property modifier validity.
21073
21074         Add tests for sealed/override too.
21075
21076         (Method.Emit): abstract or extern methods have no bodies.
21077
21078 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21079
21080         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21081         thing.
21082
21083         (Method::Define, ::Emit): Modify accordingly.
21084
21085         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21086
21087         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21088
21089         * makefile: Pass in /unsafe.
21090
21091 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21092
21093         * class.cs (MakeKey): Kill routine.
21094
21095         * class.cs (TypeContainer.Define): Correctly define explicit
21096         method implementations (they require the full interface name plus
21097         the method name).
21098
21099         * typemanager.cs: Deply the PtrHashtable here and stop using the
21100         lame keys.  Things work so much better.
21101
21102         This of course broke everyone who depended on `RegisterMethod' to
21103         do the `test for existance' test.  This has to be done elsewhere.
21104
21105         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21106         the object stupid Equals method (because, that like fails all over
21107         the place).  We still do not use it.
21108
21109         * class.cs (TypeContainer.SetRequiredInterface,
21110         TypeContainer.RequireMethods): Killed these two routines and moved
21111         all the functionality to RegisterRequiredImplementations.
21112
21113         (TypeContainer.RegisterRequiredImplementations): This routine now
21114         registers all the implementations required in an array for the
21115         interfaces and abstract methods.  We use an array of structures
21116         which can be computed ahead of time to reduce memory usage and we
21117         also assume that lookups are cheap as most classes will not
21118         implement too many interfaces.
21119
21120         We also avoid creating too many MethodSignatures.
21121
21122         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21123         clear the "pending" bit if we find that there are problems with
21124         the declaration.
21125
21126         (TypeContainer.VerifyPendingMethods): Update to report errors of
21127         methods that look like implementations but are not.
21128
21129         (TypeContainer.Define): Add support for explicit interface method
21130         implementation. 
21131
21132 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * typemanager.cs: Keep track of the parameters here instead of
21135         being a feature of the TypeContainer.
21136
21137         * class.cs: Drop the registration of parameters here, as
21138         InterfaceMethods are also interface declarations.
21139
21140         * delegate.cs: Register methods with the TypeManager not only with
21141         the TypeContainer.  This code was buggy.
21142
21143         * interface.cs: Full registation here.
21144
21145 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21146
21147         * expression.cs: Remove reducer for binary expressions, it can not
21148         be done this way.
21149
21150         * const.cs: Put here the code that used to go into constant.cs
21151
21152         * constant.cs: Put here the code for constants, this is a new base
21153         class for Literals.
21154
21155         * literal.cs: Make Literal derive from Constant.
21156
21157 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21158
21159         * statement.cs (Return.Emit): Report error 157 if the user
21160         attempts to return from a finally block.
21161
21162         (Return.Emit): Instead of emitting a return, jump to the end of
21163         the function.
21164
21165         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21166         LocalBuilder to store the result of the function.  ReturnLabel is
21167         the target where we jump.
21168
21169
21170 2001-12-09  Radek Doulik  <rodo@ximian.com>
21171
21172         * cs-parser.jay: remember alias in current namespace
21173
21174         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21175         namespaces
21176
21177         * class.cs (LookupAlias): lookup alias in my_namespace
21178
21179         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21180         aliases hashtable
21181         (LookupAlias): lookup alias in this and if needed in parent
21182         namespaces
21183
21184 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21185
21186         * support.cs: 
21187
21188         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21189         making things static.  I need this to avoid passing the
21190         TypeContainer when calling ParameterType.
21191
21192         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21193         that did string manipulation to compute the type and then call
21194         GetType.  Use Parameter.ParameterType instead.
21195
21196         * cs-tokenizer.cs: Consume the suffix for floating values.
21197
21198         * expression.cs (ParameterReference): figure out whether this is a
21199         reference parameter or not.  Kill an extra variable by computing
21200         the arg_idx during emission.
21201
21202         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21203         function that returns whether a parameter is an out/ref value or not.
21204
21205         (Parameter.ParameterType): The type of the parameter (base,
21206         without ref/out applied).
21207
21208         (Parameter.Resolve): Perform resolution here.
21209         (Parameter.ExternalType): The full type (with ref/out applied).
21210
21211         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21212         support for expressions on the using statement.
21213
21214 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21215
21216         * statement.cs (Using.EmitLocalVariableDecls): Split the
21217         localvariable handling of the using statement.
21218
21219         (Block.EmitMeta): Keep track of variable count across blocks.  We
21220         were reusing slots on separate branches of blocks.
21221
21222         (Try.Emit): Emit the general code block, we were not emitting it. 
21223
21224         Check the type of the declaration to be an IDisposable or
21225         something that can be implicity converted to it. 
21226
21227         Emit conversions if required.
21228
21229         * ecore.cs (EmptyExpression): New utility class.
21230         (Expression.ImplicitConversionExists): New utility function.
21231
21232 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21233
21234         * statement.cs (Using): Implement.
21235
21236         * expression.cs (LocalVariableReference): Support read only variables.
21237
21238         * statement.cs: Remove the explicit emit for the Leave opcode.
21239         (VariableInfo): Add a readonly field.
21240
21241 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * ecore.cs (ConvCast): new class used to encapsulate the various
21244         explicit integer conversions that works in both checked and
21245         unchecked contexts.
21246
21247         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21248         properly generate the overflow opcodes.
21249
21250 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * statement.cs: The correct type for the EmptyExpression is the
21253         element_type, not the variable type.  Ravi pointed this out.
21254
21255 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21256
21257         * class.cs (Method::Define): Handle PInvoke methods specially
21258         by using DefinePInvokeMethod instead of the usual one.
21259
21260         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21261         above to do the task of extracting information and defining the method.
21262
21263 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21264
21265         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21266         of the condition for string type.
21267
21268         (Emit): Move that here. 
21269
21270         (ArrayCreation::CheckIndices): Keep string literals in their expression
21271         form.
21272
21273         (EmitDynamicInitializers): Handle strings appropriately.
21274
21275 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21276
21277         * codegen.cs (EmitContext): Replace multiple variables with a
21278         single pointer to the current Switch statement.
21279
21280         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21281         EmitContext.
21282
21283 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21284
21285         * statement.cs 
21286
21287         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21288         default'.
21289
21290         (Foreach.Emit): Foreach on arrays was not setting
21291         up the loop variables (for break/continue).
21292
21293         (GotoCase): Semi-implented.
21294
21295 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21296
21297         * attribute.cs (CheckAttribute): Handle system attributes by using
21298         Attribute.GetAttributes to examine information we need.
21299
21300         (GetValidPlaces): Same here.
21301
21302         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21303
21304         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21305
21306         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21307
21308         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21309
21310         (Method::Emit): Handle the case when we are a PInvoke method.
21311
21312 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * expression.cs: Use ResolveWithSimpleName on compound names.
21315
21316 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21317
21318         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21319         before trying to reduce it.
21320
21321         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21322
21323         * constant.cs (LookupConstantValue): Implement.
21324
21325         (EmitConstant): Use the above in emitting the constant.
21326
21327         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21328         that are user-defined by doing a LookupConstantValue on them.
21329
21330         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21331         too, like above.
21332
21333 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21334
21335         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21336
21337         (BaseAccess.DoResolve): Implement.
21338
21339         (MemberAccess.DoResolve): Split this routine into a
21340         ResolveMemberAccess routine that can be used independently
21341
21342 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21343
21344         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21345         As that share bits of the implementation.  Is returns a boolean,
21346         while As returns the Type that is being probed.
21347
21348 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21349
21350         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21351         instead of a Literal - much easier.
21352
21353         (EnumInTransit): Remove - utterly useless :-)
21354
21355         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21356
21357         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21358
21359         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21360         chain when we have no associated expression.
21361
21362 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21363
21364         * constant.cs (Define): Use Location while reporting the errror.
21365
21366         Also emit a warning when 'new' is used and there is no inherited
21367         member to hide.
21368
21369         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21370         populated.
21371
21372         (LookupEnumValue): Implement to lookup an enum member's value and define it
21373         if necessary.
21374
21375         (Populate): Re-write accordingly to use the above routine.
21376
21377 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21378
21379         * expression.cs (This): Fix prototype for DoResolveLValue to
21380         override the base class DoResolveLValue.
21381
21382         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21383         declarations) 
21384
21385         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21386         (we need to load the address of the field here).  This fixes
21387         test-22. 
21388
21389         (FieldExpr.DoResolveLValue): Call the DoResolve
21390         function to initialize the Instance expression.
21391
21392         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21393         correctly the GetEnumerator operation on a value type.
21394
21395         * cs-parser.jay: Add more simple parsing error catches.
21396
21397         * statement.cs (Switch): Add support for string switches.
21398         Handle null specially.
21399
21400         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21401
21402 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21403
21404         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21405
21406         (declare_local_constant): New helper function.
21407
21408         * statement.cs (AddConstant): Keep a separate record of constants
21409
21410         (IsConstant): Implement to determine if a variable is a constant.
21411
21412         (GetConstantExpression): Implement.
21413
21414         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21415
21416         * statement.cs (IsVariableDefined): Re-write.
21417
21418 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21419
21420         * class.cs (TypeContainer::FindMembers): Look for constants
21421         in the case when we are looking for MemberTypes.Field
21422
21423         * expression.cs (MemberAccess::DoResolve): Check that in the
21424         case we are a FieldExpr and a Literal, we are not being accessed
21425         by an instance reference.
21426
21427         * cs-parser.jay (local_constant_declaration): Implement.
21428
21429         (declaration_statement): Implement for constant declarations.
21430
21431 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21432
21433         * statement.cs (Switch): Catch double defaults.
21434
21435         (Switch): More work on the switch() statement
21436         implementation.  It works for integral values now, need to finish
21437         string support.
21438
21439
21440 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21441
21442         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21443         integer literals into other integer literals.  To be used by
21444         switch. 
21445
21446 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21447
21448         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21449         some memory.
21450
21451         (EmitDynamicInitializers): Cope with the above since we extract data
21452         directly from ArrayData now.
21453
21454         (ExpectInitializers): Keep track of whether initializers are mandatory
21455         or not.
21456
21457         (Bounds): Make it a hashtable to prevent the same dimension being 
21458         recorded for every element in that dimension.
21459
21460         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21461         from being found.
21462
21463         Also fix bug which was causing the indices to be emitted in the reverse
21464         order.
21465
21466 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21469         unfinished.  They do not work, because the underlying code is
21470         sloppy.
21471
21472 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * cs-parser.jay: Remove bogus fixme.
21475
21476         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21477         on Switch statement.
21478
21479 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21480
21481         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21482         the same. 
21483
21484         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21485         parameter. Apparently, any expression is allowed. 
21486
21487         (ValidateInitializers): Update accordingly.
21488
21489         (CheckIndices): Fix some tricky bugs thanks to recursion.
21490
21491         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21492         I was being completely brain-dead.
21493
21494         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21495         and re-write acordingly.
21496
21497         (DelegateInvocation): Re-write accordingly.
21498
21499         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21500
21501         (MakeByteBlob): Handle types more correctly.
21502
21503         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21504         initialization from expressions but it is incomplete because I am a complete
21505         Dodo :-|
21506
21507 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21508
21509         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21510         on If.  Basically, we have to return `true' (ie, we do return to
21511         our caller) only if both branches of the if return.
21512
21513         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21514         short-circuit operators, handle them as short circuit operators. 
21515
21516         (Cast.DoResolve): Resolve type.
21517         (Cast.Cast): Take an expression as the target type.
21518
21519         * cs-parser.jay (cast_expression): Remove old hack that only
21520         allowed a limited set of types to be handled.  Now we take a
21521         unary_expression and we resolve to a type during semantic
21522         analysis.
21523
21524         Use the grammar productions from Rhys to handle casts (this is
21525         not complete like Rhys syntax yet, we fail to handle that corner
21526         case that C# has regarding (-x), but we will get there.
21527
21528 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21529
21530         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21531         field which is an array type.
21532
21533         * cs-parser.jay (declare_local_variables): Support array initialization too.
21534
21535         * typemanager.cs (MakeKey): Implement.
21536
21537         (everywhere): Use the above appropriately.
21538
21539         * cs-parser.jay (for_statement): Update for array initialization while
21540         declaring variables.
21541
21542         * ecore.cs : The error message was correct, it's the variable's names that
21543         were misleading ;-) Make the code more readable.
21544
21545         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21546         the correct type etc.
21547
21548         (ConvertExplicit): Handle Enum types by examining the underlying type.
21549
21550 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21551
21552         * parameter.cs (GetCallingConvention): Always return
21553         CallingConventions.Standard for now.
21554
21555 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21556
21557         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21558         and `r' after calling DoNumericPromotions.
21559
21560         * ecore.cs: Fix error message (the types were in the wrong order).
21561
21562         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21563         BindingFlags.Instance as well 
21564
21565         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21566         implicit int literal conversion in an empty cast so that we
21567         propagate the right type upstream.
21568
21569         (UnboxCast): new class used to unbox value types.
21570         (Expression.ConvertExplicit): Add explicit type conversions done
21571         by unboxing.
21572
21573         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21574         the target type before applying the implicit LongLiterals to ULong
21575         literal cast.
21576
21577 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21578
21579         * cs-parser.jay (for_statement): Reworked the way For works: now
21580         we declare manually any variables that are introduced in
21581         for_initializer to solve the problem of having out-of-band code
21582         emition (that is what got for broken).
21583
21584         (declaration_statement): Perform the actual variable declaration
21585         that used to be done in local_variable_declaration here.
21586
21587         (local_variable_declaration): Do not declare anything, just pass
21588         the information on a DictionaryEntry
21589
21590 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21591
21592         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21593         re-write of the logic to now make it recursive.
21594
21595         (UpdateIndices): Re-write accordingly.
21596
21597         Store element data in a separate ArrayData list in the above methods.
21598
21599         (MakeByteBlob): Implement to dump the array data into a byte array.
21600
21601 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21602
21603         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21604         into CheckIndices.
21605
21606         * constant.cs (Define): Implement.
21607
21608         (EmitConstant): Re-write fully.
21609
21610         Pass in location info.
21611
21612         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21613         respectively.
21614
21615         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21616         DictionaryEntry since we need location info too.
21617
21618         (constant_declaration): Update accordingly.
21619
21620         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21621         code into another method : UpdateIndices.
21622
21623 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21624
21625         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21626         some type checking etc.
21627
21628 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21629
21630         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21631         bits to provide dimension info if the user skips doing that.
21632
21633         Update second constructor to store the rank correctly.
21634
21635 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21636
21637         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21638         and try to implement.
21639
21640         * ../errors/cs0150.cs : Add.
21641
21642         * ../errors/cs0178.cs : Add.
21643
21644 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21645
21646         * statement.cs: Implement foreach on multi-dimensional arrays. 
21647
21648         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21649         name of the params argument.
21650
21651         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21652         initializing the array.
21653
21654         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21655         we can use this elsewhere.
21656
21657         * statement.cs: Finish implementation of foreach for single
21658         dimension arrays.
21659
21660         * cs-parser.jay: Use an out-of-band stack to pass information
21661         around, I wonder why I need this.
21662
21663         foreach_block: Make the new foreach_block the current_block.
21664
21665         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21666         function used to return a static Parameters structure.  Used for
21667         empty parameters, as those are created very frequently.
21668
21669         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21670
21671 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21672
21673         * interface.cs : Default modifier is private, not public. The
21674         make verify test passes again.
21675
21676 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21677
21678         * support.cs (ReflectionParameters): Fix logic to determine
21679         whether the last parameter is a params one. Test 9 passes again.
21680
21681         * delegate.cs (Populate): Register the builders we define with
21682         RegisterParameterForBuilder. Test 19 passes again.
21683
21684         * cs-parser.jay (property_declaration): Reference $6 instead
21685         of $$ to get at the location.
21686
21687         (indexer_declaration): Similar stuff.
21688
21689         (attribute): Ditto.
21690
21691         * class.cs (Property): Register parameters for the Get and Set methods
21692         if they exist. Test 23 passes again.
21693
21694         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21695         call to EmitArguments as we are sure there aren't any params arguments. 
21696         Test 32 passes again.
21697
21698         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21699         IndexOutOfRangeException. 
21700
21701         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21702         Test 33 now passes again.
21703
21704 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21705
21706         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21707         broke a bunch of things.  Will have to come up with a better way
21708         of tracking locations.
21709
21710         * statement.cs: Implemented foreach for single dimension arrays.
21711
21712 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21713
21714         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21715         an error.  This removes the lookup from the critical path.
21716
21717         * cs-parser.jay: Removed use of temporary_loc, which is completely
21718         broken. 
21719
21720 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21721
21722         * support.cs (ReflectionParameters.ParameterModifier): Report
21723         whether the argument is a PARAMS argument or not.
21724
21725         * class.cs: Set the attribute `ParamArrayAttribute' on the
21726         parameter argument.
21727
21728         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21729         and cons_param_array_attribute (ConstructorInfo for
21730         ParamArrayAttribute)., 
21731
21732         * codegen.cs: Emit the return using the `Return' statement, that
21733         way we can report the error correctly for missing return values. 
21734
21735         * class.cs (Method.Emit): Clean up.
21736
21737         * expression.cs (Argument.Resolve): Take another argument: the
21738         location where this argument is used.  Notice that this is not
21739         part of the "Argument" class as to reduce the size of the
21740         structure (we know the approximate location anyways).
21741
21742         Test if the argument is a variable-reference, if not, then
21743         complain with a 206.
21744
21745         (Argument.Emit): Emit addresses of variables.
21746
21747         (Argument.FullDesc): Simplify.
21748
21749         (Invocation.DoResolve): Update for Argument.Resolve.
21750
21751         (ElementAccess.DoResolve): ditto.
21752
21753         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21754         method should be virtual, as this method is always virtual.
21755
21756         (NewDelegate.DoResolve): Update for Argument.Resolve.
21757
21758         * class.cs (ConstructorInitializer.DoResolve): ditto.
21759
21760         * attribute.cs (Attribute.Resolve): ditto.
21761
21762 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21765
21766         * expression.cs (ParameterReference): Drop IStackStorage and implement
21767         IAssignMethod instead. 
21768
21769         (LocalVariableReference): ditto.
21770
21771         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21772         IAssignMethod instead. 
21773
21774 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21775
21776         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21777         enumerations that are used in heavily used structures derive from
21778         byte in a laughable and pathetic attempt to reduce memory usage.
21779         This is the kind of pre-optimzations that you should not do at
21780         home without adult supervision.
21781
21782         * expression.cs (UnaryMutator): New class, used to handle ++ and
21783         -- separatedly from the other unary operators.  Cleans up the
21784         code, and kills the ExpressionStatement dependency in Unary.
21785
21786         (Unary): Removed `method' and `Arguments' from this class, making
21787         it smaller, and moving it all to SimpleCall, so I can reuse this
21788         code in other locations and avoid creating a lot of transient data
21789         strucutres when not required.
21790
21791         * cs-parser.jay: Adjust for new changes.
21792
21793 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21794
21795         * enum.cs (Enum.Populate): If there is a failure during
21796         definition, return
21797
21798         * cs-parser.jay (opt_enum_base): we used to catch type errors
21799         here, but this is really incorrect.  The type error should be
21800         catched during semantic analysis.
21801
21802 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21803
21804         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21805         current_local_parameters as expected since I, in my stupidity, had forgotten
21806         to do this :-)
21807
21808         * attribute.cs (GetValidPlaces): Fix stupid bug.
21809
21810         * class.cs (Method::Emit): Perform check on applicability of attributes.
21811
21812         (Constructor::Emit): Ditto.
21813
21814         (Field::Emit): Ditto.
21815
21816         (Field.Location): Store location information.
21817
21818         (Property, Event, Indexer, Operator): Ditto.
21819
21820         * cs-parser.jay (field_declaration): Pass in location for each field.
21821
21822         * ../errors/cs0592.cs : Add.
21823
21824 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21825
21826         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21827
21828         (InitCoreTypes): Update accordingly.
21829
21830         (RegisterAttrType, LookupAttr): Implement.
21831
21832         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21833         info about the same.
21834
21835         (Resolve): Update to populate the above as necessary.
21836
21837         (Error592): Helper.
21838
21839         (GetValidPlaces): Helper to the above.
21840
21841         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21842
21843         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21844
21845 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21846
21847         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21848
21849         * ../errors/cs0617.cs : Add.
21850
21851 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21852
21853         * enum.cs (Emit): Rename to Populate to be more consistent with what
21854         we expect it to do and when exactly it is called.
21855
21856         * class.cs, rootcontext.cs : Update accordingly.
21857
21858         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21859         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21860
21861         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21862
21863         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21864         of a fieldinfo using the above, when dealing with a FieldBuilder.
21865
21866 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21867
21868         * ../errors/cs0031.cs : Add.
21869
21870         * ../errors/cs1008.cs : Add.
21871
21872         * ../errrors/cs0543.cs : Add.
21873
21874         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21875         enum type.
21876
21877         (FindMembers): Implement.
21878
21879         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21880         enums and delegates too.
21881
21882         (enum_types): Rename to builder_to_enum.
21883
21884         (delegate_types): Rename to builder_to_delegate.
21885
21886         * delegate.cs (FindMembers): Implement.
21887
21888 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21889
21890         * typemanager.cs (IsEnumType): Implement.
21891
21892         * enum.cs (Emit): Re-write parts to account for the underlying type
21893         better and perform checking etc.
21894
21895         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21896         of the underlying type.
21897
21898         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21899         value
21900
21901         * enum.cs (error31): Helper to report error #31.
21902
21903         * cs-parser.jay (enum_declaration): Store location of each member too.
21904
21905         * enum.cs (member_to_location): New hashtable. 
21906
21907         (AddEnumMember): Update location hashtable.
21908
21909         (Emit): Use the location of each member while reporting errors.
21910
21911 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21912
21913         * cs-parser.jay: A for_initializer if is a
21914         local_variable_declaration really ammount to have an implicit
21915         block with the variable declaration and no initializer for for.
21916
21917         * statement.cs (For.Emit): Cope with null initializers.
21918
21919         This fixes the infinite loop on for initializers.
21920
21921 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21922
21923         * enum.cs: More cleanup.
21924
21925         * ecore.cs: Remove dead code.
21926
21927         * class.cs (Property.Emit): More simplification.
21928         (Event.Emit): ditto.
21929
21930         Reworked to have less levels of indentation.
21931
21932 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21933
21934         * class.cs (Property): Emit attributes.
21935
21936         (Field): Ditto.
21937
21938         (Event): Ditto.
21939
21940         (Indexer): Ditto.
21941
21942         (Operator): Ditto.
21943
21944         * enum.cs (Emit): Ditto.
21945
21946         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21947         Enums too.
21948
21949         * class.cs (Field, Event, etc.): Move attribute generation into the
21950         Emit method everywhere.
21951
21952         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21953         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21954         as we had no way of defining nested enums !
21955
21956         * rootcontext.cs : Adjust code accordingly.
21957
21958         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21959
21960 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21961
21962         * expression.cs (EvalConstantExpression): Move into ecore.cs
21963
21964         * enum.cs (Enum): Rename some members and make them public and readonly
21965         according to our convention.
21966
21967         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21968         nothing else.
21969
21970         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21971
21972         (Enum::Emit): Write a simple version for now which doesn't try to compute
21973         expressions. I shall modify this to be more robust in just a while.
21974
21975         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21976
21977         (TypeContainer::CloseType): Create the Enum types too.
21978
21979         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21980
21981         * expression.cs (EvalConstantExpression): Get rid of completely.
21982
21983         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21984         user-defined values and other cases.
21985
21986         (IsValidEnumLiteral): Helper function.
21987
21988         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21989         out there in the case we had a literal FieldExpr.
21990
21991         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21992
21993         (Literalize): Revamp a bit to take two arguments.
21994
21995         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21996
21997 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21998
21999         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22000
22001         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22002
22003         (Resolve): Use the above to ensure we have proper initializers.
22004
22005 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22006
22007         * expression.cs (Expression::EvalConstantExpression): New method to 
22008         evaluate constant expressions.
22009
22010         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22011
22012 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22015         in an array.
22016
22017         (Binary.ResolveOperator): Handle operator != (object a, object b)
22018         and operator == (object a, object b);
22019
22020         (Binary.DoNumericPromotions): Indicate whether the numeric
22021         promotion was possible.
22022
22023         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22024         Implement.  
22025
22026         Made the ArrayAccess implement interface IAssignMethod instead of
22027         IStackStore as the order in which arguments are passed reflects
22028         this.
22029
22030         * assign.cs: Instead of using expr.ExprClass to select the way of
22031         assinging, probe for the IStackStore/IAssignMethod interfaces.
22032
22033         * typemanager.cs: Load InitializeArray definition.
22034
22035         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22036         static data that can be used to initialize arrays. 
22037
22038 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22039
22040         * expression.cs: Handle operator== and operator!= for booleans.
22041
22042         (Conditioal.Reduce): Implement reducer for the ?: operator.
22043
22044         (Conditional.Resolve): Implement dead code elimination.
22045
22046         (Binary.Resolve): Catch string literals and return a new
22047         concatenated string.
22048
22049         (Unary.Reduce): Implement reduction of unary expressions.
22050
22051         * ecore.cs: Split out the expression core handling here.
22052
22053         (Expression.Reduce): New method used to perform constant folding
22054         and CSE.  This is needed to support constant-expressions. 
22055
22056         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22057         targets, and optimize for !x.
22058
22059 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22060
22061         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22062         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22063         set custom atttributes.
22064
22065         * literal.cs (Literal::GetValue): New abstract method to return the actual
22066         value of the literal, cast as an object.
22067
22068         (*Literal): Implement GetValue method.
22069
22070         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22071         expressions to the arraylist but objects of type Argument.
22072
22073         * class.cs (TypeContainer::Emit): Emit our attributes too.
22074
22075         (Method::Emit, Constructor::Emit): Ditto.
22076
22077         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22078         to be ignoring earlier.
22079
22080 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22081
22082         * attribute.cs (AttributeSection::Define): Implement to do the business
22083         of constructing a CustomAttributeBuilder.
22084
22085         (Attribute): New trivial class. Increases readability of code.  
22086
22087         * cs-parser.jay : Update accordingly.
22088
22089         (positional_argument_list, named_argument_list, named_argument): New rules
22090
22091         (attribute_arguments): Use the above so that we are more correct.
22092
22093 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22094
22095         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22096         to perform all checks for a method with a params parameter.
22097
22098         (Invocation::OverloadResolve): Update to use the above method and therefore
22099         cope correctly with params method invocations.
22100
22101         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22102         params too.
22103
22104         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22105         constructors in our parent too because we can't afford to miss out on 
22106         protected ones ;-)
22107
22108         * attribute.cs (AttributeSection): New name for the class Attribute
22109
22110         Other trivial changes to improve readability.
22111
22112         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22113         use the new class names.
22114
22115 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22116
22117         * class.cs (Method::Define): Complete definition for params types too
22118
22119         (Indexer::Define): Ditto.
22120
22121         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22122         Cope everywhere with a request for info about the array parameter.
22123
22124 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22125
22126         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22127
22128         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22129         local_variable_type to extract the string corresponding to the type.
22130
22131         (local_variable_type): Fixup the action to use the new helper method.
22132
22133         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22134         go.
22135
22136         * expression.cs : Clean out code which uses the above.
22137
22138 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22139
22140         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22141         and bale out if necessary by returning a false.
22142
22143         (RegisterProperty): Ditto.
22144
22145         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22146         and print out appropriate error messages.
22147
22148         * interface.cs (everywhere): Ditto.
22149
22150         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22151         location to constructor.
22152
22153         * class.cs (Property, Event, Indexer): Update accordingly.
22154
22155         * ../errors/cs111.cs : Added.
22156
22157         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22158         of a method, as laid down by the spec.
22159
22160         (Invocation::OverloadResolve): Use the above method.
22161
22162 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22163
22164         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22165         now take a TypeContainer and a Parameters object.
22166
22167         (ParameterData): Modify return type of ParameterModifier method to be 
22168         Parameter.Modifier and not a string.
22169
22170         (ReflectionParameters, InternalParameters): Update accordingly.
22171
22172         * expression.cs (Argument::GetParameterModifier): Same here.
22173
22174         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22175         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22176         symbol in it at all so maybe this is only for now.
22177
22178 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22179
22180         * support.cs (InternalParameters): Constructor now takes an extra argument 
22181         which is the actual Parameters class.
22182
22183         (ParameterDesc): Update to provide info on ref/out modifiers.
22184
22185         * class.cs (everywhere): Update call to InternalParameters to pass in
22186         the second argument too.
22187
22188         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22189         to return the modifier info [ref/out etc]
22190
22191         (InternalParameters, ReflectionParameters): Implement the above.
22192
22193         * expression.cs (Argument::ParameterModifier): Similar function to return
22194         info about the argument's modifiers.
22195
22196         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22197         too.
22198
22199         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22200         a new SetFormalParameters object which we pass to InternalParameters.
22201
22202 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22203
22204         * expression.cs (NewArray): Merge into the ArrayCreation class.
22205
22206 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22207
22208         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22209         NewUserdefinedArray into one as there wasn't much of a use in having
22210         two separate ones.
22211
22212         * expression.cs (Argument): Change field's name to ArgType from Type.
22213
22214         (Type): New readonly property which returns the proper type, taking into 
22215         account ref/out modifiers.
22216
22217         (everywhere): Adjust code accordingly for the above.
22218
22219         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22220         whether we are emitting for a ref or out parameter.
22221
22222         * expression.cs (Argument::Emit): Use the above field to set the state.
22223
22224         (LocalVariableReference::Emit): Update to honour the flag and emit the
22225         right stuff.
22226
22227         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22228
22229         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22230
22231         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22232
22233         (ReflectionParameters, InternalParameters): Implement the above method.
22234
22235         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22236         reporting errors.
22237
22238         (Invocation::FullMethodDesc): Ditto. 
22239
22240 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22241
22242         * cs-parser.jay: Add extra production for the second form of array
22243         creation. 
22244
22245         * expression.cs (ArrayCreation): Update to reflect the above
22246         change. 
22247
22248         * Small changes to prepare for Array initialization.
22249
22250 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22251
22252         * typemanager.cs (ImplementsInterface): interface might be null;
22253         Deal with this problem;
22254
22255         Also, we do store negative hits on the cache (null values), so use
22256         this instead of calling t.GetInterfaces on the type everytime.
22257
22258 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22259
22260         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22261
22262         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22263         split functionality out into different classes.
22264
22265         (New::FormArrayType): Move into NewBuiltinArray.
22266
22267         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22268         quite useless.
22269
22270         (NewBuiltinArray): New class to handle creation of built-in arrays.
22271
22272         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22273         account creation of one-dimensional arrays.
22274
22275         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22276
22277         (NewUserdefinedArray::DoResolve): Implement.
22278
22279         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22280
22281         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22282         we maintain inside the TypeManager. This is necessary to perform lookups on the
22283         module builder.
22284
22285         (LookupType): Update to perform GetType on the module builders too.     
22286
22287         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22288
22289         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22290
22291 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22292
22293         * expression.cs (New::DoResolve): Implement guts of array creation.
22294
22295         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22296
22297 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22298
22299         * expression.cs: Fix bug I introduced lsat night that broke
22300         Delegates. 
22301
22302         (Expression.Resolve): Report a 246 error (can not resolve name)
22303         if we find a SimpleName in the stream.
22304
22305         (Expression.ResolveLValue): Ditto.
22306
22307         (Expression.ResolveWithSimpleName): This function is a variant of
22308         ResolveName, this one allows SimpleNames to be returned without a
22309         warning.  The only consumer of SimpleNames is MemberAccess
22310
22311 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22312
22313         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22314         might arrive here.  I have my doubts that this is correct.
22315
22316         * statement.cs (Lock): Implement lock statement.
22317
22318         * cs-parser.jay: Small fixes to support `lock' and `using'
22319
22320         * cs-tokenizer.cs: Remove extra space
22321
22322         * driver.cs: New flag --checked, allows to turn on integer math
22323         checking. 
22324
22325         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22326         Threading.Monitor.Exit 
22327
22328 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22329
22330         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22331         Expression Class to be IndexerAccess.
22332
22333         Notice that Indexer::DoResolve sets the eclass to Value.
22334
22335 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22336
22337         * class.cs (TypeContainer::Emit): Emit code for indexers.
22338
22339         * assign.cs (IAssignMethod): New interface implemented by Indexers
22340         and Properties for handling assignment.
22341
22342         (Assign::Emit): Simplify and reuse code. 
22343
22344         * expression.cs (IndexerAccess, PropertyExpr): Implement
22345         IAssignMethod, clean up old code. 
22346
22347 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22348
22349         * typemanager.cs (ImplementsInterface): New method to determine if a type
22350         implements a given interface. Provides a nice cache too.
22351
22352         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22353         method.
22354
22355         (ConvertReferenceExplicit): Ditto.
22356
22357         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22358         various methods, with correct names etc.
22359
22360         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22361         Operator.UnaryNegation.
22362
22363         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22364         we have a unary plus or minus operator.
22365
22366         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22367         UnaryMinus.
22368
22369         * everywhere : update accordingly.
22370
22371         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22372         respectively.
22373
22374         * class.cs (Method::Define): For the case where we are implementing a method
22375         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22376         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22377
22378 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22379
22380         * interface.cs (FindMembers): Implement to work around S.R.E
22381         lameness.
22382
22383         * typemanager.cs (IsInterfaceType): Implement.
22384
22385         (FindMembers): Update to handle interface types too.
22386
22387         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22388         use IsAssignableFrom as that is not correct - it doesn't work.
22389
22390         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22391         and accordingly override EmitStatement.
22392
22393         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22394         using the correct logic :-)
22395
22396 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22397
22398         * ../errors/cs-11.cs : Add to demonstrate error -11 
22399
22400 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22401
22402         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22403         then pass this as a hint to ResolveLValue.
22404
22405         * expression.cs (FieldExpr): Add Location information
22406
22407         (FieldExpr::LValueResolve): Report assignment to readonly
22408         variable. 
22409
22410         (Expression::ExprClassFromMemberInfo): Pass location information.
22411
22412         (Expression::ResolveLValue): Add new method that resolves an
22413         LValue. 
22414
22415         (Expression::DoResolveLValue): Default invocation calls
22416         DoResolve. 
22417
22418         (Indexers): New class used to keep track of indexers in a given
22419         Type. 
22420
22421         (IStackStore): Renamed from LValue, as it did not really describe
22422         what this did.  Also ResolveLValue is gone from this interface and
22423         now is part of Expression.
22424
22425         (ElementAccess): Depending on the element access type
22426
22427         * typemanager.cs: Add `indexer_name_type' as a Core type
22428         (System.Runtime.CompilerServices.IndexerNameAttribute)
22429
22430         * statement.cs (Goto): Take a location.
22431
22432 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22433
22434         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22435         if two delegates are compatible.
22436
22437         (NewDelegate::DoResolve): Update to take care of the case when
22438         we instantiate a delegate from another delegate.
22439
22440         * typemanager.cs (FindMembers): Don't even try to look up members
22441         of Delegate types for now.
22442
22443 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22444
22445         * delegate.cs (NewDelegate): New class to take care of delegate
22446         instantiation.
22447
22448         * expression.cs (New): Split the delegate related code out into 
22449         the NewDelegate class.
22450
22451         * delegate.cs (DelegateInvocation): New class to handle delegate 
22452         invocation.
22453
22454         * expression.cs (Invocation): Split out delegate related code into
22455         the DelegateInvocation class.
22456
22457 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22458
22459         * expression.cs (New::DoResolve): Implement delegate creation fully
22460         and according to the spec.
22461
22462         (New::DoEmit): Update to handle delegates differently.
22463
22464         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22465         because of which we were printing out arguments in reverse order !
22466
22467         * delegate.cs (VerifyMethod): Implement to check if the given method
22468         matches the delegate.
22469
22470         (FullDelegateDesc): Implement.
22471
22472         (VerifyApplicability): Implement.
22473
22474         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22475         delegate invocations too.
22476
22477         (Invocation::Emit): Ditto.
22478
22479         * ../errors/cs1593.cs : Added.
22480
22481         * ../errors/cs1594.cs : Added.
22482
22483         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22484
22485 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22486
22487         * typemanager.cs (intptr_type): Core type for System.IntPtr
22488
22489         (InitCoreTypes): Update for the same.
22490
22491         (iasyncresult_type, asynccallback_type): Ditto.
22492
22493         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22494         correct.
22495
22496         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22497         too.
22498
22499         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22500         the builders for the 4 members of a delegate type :-)
22501
22502         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22503         type.
22504
22505         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22506
22507         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22508
22509 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22510
22511         * statement.cs (Break::Emit): Implement.   
22512         (Continue::Emit): Implement.
22513
22514         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22515         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22516         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22517         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22518         end loop
22519
22520         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22521         properties that track the label for the current loop (begin of the
22522         loop and end of the loop).
22523
22524 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22525
22526         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22527         use of emitting anything at all.
22528
22529         * class.cs, rootcontext.cs : Get rid of calls to the same.
22530
22531         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22532
22533         (Populate): Define the constructor correctly and set the implementation
22534         attributes.
22535
22536         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22537         have been defined.
22538
22539         (AddDelegateType): Implement.
22540
22541         (IsDelegateType): Implement helper method.
22542
22543         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22544
22545         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22546         and accordingly handle it.
22547
22548         * delegate.cs (Populate): Take TypeContainer argument.
22549         Implement bits to define the Invoke method. However, I still haven't figured out
22550         how to take care of the native int bit :-(
22551
22552         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22553         Qualify the name of the delegate, not its return type !
22554
22555         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22556         conversion.
22557
22558         (StandardConversionExists): Checking for array types turns out to be recursive.
22559
22560         (ConvertReferenceExplicit): Implement array conversion.
22561
22562         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22563
22564 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22565
22566         * cs-parser.jay (delegate_declaration): Store the fully qualified
22567         name as it is a type declaration.
22568
22569         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22570         readonly.
22571
22572         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22573         as TypeContainer::DefineType.
22574
22575         (Populate): Method in which all the definition of the various methods (Invoke)
22576         etc is done.
22577
22578         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22579         see.
22580
22581         (CloseDelegate): Finally creates the delegate.
22582
22583         * class.cs (TypeContainer::DefineType): Update to define delegates.
22584         (Populate, Emit and CloseType): Do the same thing here too.
22585
22586         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22587         delegates in all these operations.
22588
22589 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22590
22591         * expression.cs: LocalTemporary: a new expression used to
22592         reference a temporary that has been created.
22593
22594         * assign.cs: Handle PropertyAccess back here, so that we can
22595         provide the proper semantic access to properties.
22596
22597         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22598         a few more explicit conversions. 
22599
22600         * modifiers.cs: `NEW' modifier maps to HideBySig.
22601
22602         * expression.cs (PropertyExpr): Make this into an
22603         ExpressionStatement, and support the EmitStatement code path. 
22604
22605         Perform get/set error checking, clean up the interface.
22606
22607         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22608         them into toplevel access objects.
22609
22610 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22611
22612         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22613         SRE.
22614
22615         * typemanager.cs: Keep track here of our PropertyBuilders again to
22616         work around lameness in SRE.
22617
22618 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22619
22620         * expression.cs (LValue::LValueResolve): New method in the
22621         interface, used to perform a second resolution pass for LValues. 
22622
22623         (This::DoResolve): Catch the use of this in static methods.
22624
22625         (This::LValueResolve): Implement.
22626
22627         (This::Store): Remove warning, assigning to `this' in structures
22628         is 
22629
22630         (Invocation::Emit): Deal with invocation of
22631         methods on value types.  We need to pass the address to structure
22632         methods rather than the object itself.  (The equivalent code to
22633         emit "this" for structures leaves the entire structure on the
22634         stack instead of a pointer to it). 
22635
22636         (ParameterReference::DoResolve): Compute the real index for the
22637         argument based on whether the method takes or not a `this' pointer
22638         (ie, the method is static).
22639
22640         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22641         value types returned from functions when we need to invoke a
22642         method on the sturcture.
22643
22644
22645 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22646
22647         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22648         defining the type in the Modulebuilder or Typebuilder. This is to take
22649         care of nested types which need to be defined on the TypeBuilder using
22650         DefineNestedMethod.
22651
22652         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22653         methods in RootContext, only ported to be part of TypeContainer.
22654
22655         (TypeContainer::GetInterfaceOrClass): Ditto.
22656
22657         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22658
22659         * interface.cs (Interface::DefineInterface): New method. Does exactly
22660         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22661         too.
22662
22663         (Interface::GetInterfaces): Move from RootContext here and port.
22664
22665         (Interface::GetInterfaceByName): Same here.
22666
22667         * rootcontext.cs (ResolveTree): Re-write.
22668
22669         (PopulateTypes): Re-write.
22670
22671         * class.cs (TypeContainer::Populate): Populate nested types too.
22672         (TypeContainer::Emit): Emit nested members too.
22673
22674         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22675         instead just use the name argument passed in as it is already fully
22676         qualified.
22677
22678         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22679         to TypeContainer mapping to see if a type is user-defined.
22680
22681         * class.cs (TypeContainer::CloseType): Implement. 
22682
22683         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22684         the default constructor.
22685
22686         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22687         twice.
22688
22689         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22690
22691         * interface.cs (CloseType): Create the type here.
22692
22693         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22694         the hierarchy.
22695
22696         Remove all the methods which are now in TypeContainer.
22697
22698 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22699
22700         * delegate.cs (Define): Re-write bits to define the delegate
22701         correctly.
22702
22703 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22704
22705         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22706
22707         * expression.cs (ImplicitReferenceConversion): handle null as well
22708         as a source to convert to any reference type.
22709
22710         * statement.cs (Return): Perform any implicit conversions to
22711         expected return type.  
22712
22713         Validate use of return statement.  
22714
22715         * codegen.cs (EmitContext): Pass the expected return type here.
22716
22717         * class.cs (Method, Constructor, Property): Pass expected return
22718         type to EmitContext.
22719
22720 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22721
22722         * expression.cs: Make DoResolve take an EmitContext instead of a
22723         TypeContainer.
22724
22725         Replaced `l' and `location' for `loc', for consistency.
22726
22727         (Error, Warning): Remove unneeded Tc argument.
22728
22729         * assign.cs, literal.cs, constant.cs: Update to new calling
22730         convention. 
22731
22732         * codegen.cs: EmitContext now contains a flag indicating whether
22733         code is being generated in a static method or not.
22734
22735         * cs-parser.jay: DecomposeQI, new function that replaces the old
22736         QualifiedIdentifier.  Now we always decompose the assembled
22737         strings from qualified_identifier productions into a group of
22738         memberaccesses.
22739
22740 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22741
22742         * rootcontext.cs: Deal with field-less struct types correctly now
22743         by passing the size option to Define Type.
22744
22745         * class.cs: Removed hack that created one static field. 
22746
22747 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22748
22749         * statement.cs: Moved most of the code generation here. 
22750
22751 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22752
22753         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22754         seem very right.
22755
22756         (ElementAccess): Remove useless bits for now - keep checks as the spec
22757         says.
22758
22759 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22760
22761         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22762         and start performing checks according to the spec.
22763
22764 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22765
22766         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22767         rank_specifiers instead.
22768
22769         (rank_specifiers): Change the order in which the rank specifiers are stored
22770
22771         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22772
22773         * expression.cs (ElementAccess): Implement the LValue interface too.
22774
22775 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22776
22777         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22778         except that user defined conversions are not included.
22779
22780         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22781         perform the conversion of the return type, if necessary.
22782
22783         (New::DoResolve): Check whether we are creating an array or an object
22784         and accordingly do the needful.
22785
22786         (New::Emit): Same here.
22787
22788         (New::DoResolve): Implement guts of array creation.
22789
22790         (New::FormLookupType): Helper function.
22791
22792 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22793
22794         * codegen.cs: Removed most of the code generation here, and move the
22795         corresponding code generation bits to the statement classes. 
22796
22797         Added support for try/catch/finalize and throw.
22798
22799         * cs-parser.jay: Added support for try/catch/finalize.
22800
22801         * class.cs: Catch static methods having the flags override,
22802         virtual or abstract.
22803
22804         * expression.cs (UserCast): This user cast was not really doing
22805         what it was supposed to do.  Which is to be born in fully resolved
22806         state.  Parts of the resolution were being performed at Emit time! 
22807
22808         Fixed this code.
22809
22810 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * expression.cs: Implicity convert the result from UserCast.
22813
22814 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22815
22816         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22817         prevented it from working correctly. 
22818
22819         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22820         merely ConvertImplicit.
22821
22822 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22823
22824         * typemanager.cs: Make the LookupTypeContainer function static,
22825         and not per-instance.  
22826
22827         * class.cs: Make static FindMembers (the one that takes a Type
22828         argument). 
22829
22830         * codegen.cs: Add EmitForeach here.
22831
22832         * cs-parser.jay: Make foreach a toplevel object instead of the
22833         inline expansion, as we need to perform semantic analysis on it. 
22834
22835 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22836
22837         * expression.cs (Expression::ImplicitUserConversion): Rename to
22838         UserDefinedConversion.
22839
22840         (Expression::UserDefinedConversion): Take an extra argument specifying 
22841         whether we look for explicit user conversions too.
22842
22843         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22844
22845         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22846
22847         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22848         with the appropriate arguments.
22849
22850         * cs-parser.jay (cast_expression): Record location too.
22851
22852         * expression.cs (Cast): Record location info.
22853
22854         (Expression::ConvertExplicit): Take location argument.
22855
22856         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22857         to determine if we are doing explicit conversions.
22858
22859         (UserCast::Emit): Update accordingly.
22860
22861         (Expression::ConvertExplicit): Report an error if everything fails.
22862
22863         * ../errors/cs0030.cs : Add.
22864
22865 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22866
22867         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22868         virtual and newslot bits. 
22869
22870         * class.cs (TypeContainer::RegisterRequiredImplementations):
22871         Record methods we need.
22872
22873         (TypeContainer::MakeKey): Helper function to make keys for
22874         MethodBases, since the Methodbase key is useless.
22875
22876         (TypeContainer::Populate): Call RegisterRequiredImplementations
22877         before defining the methods.   
22878
22879         Create a mapping for method_builders_to_methods ahead of time
22880         instead of inside a tight loop.
22881
22882         (::RequireMethods):  Accept an object as the data to set into the
22883         hashtable so we can report interface vs abstract method mismatch.
22884
22885 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22886
22887         * report.cs: Make all of it static.
22888
22889         * rootcontext.cs: Drop object_type and value_type computations, as
22890         we have those in the TypeManager anyways.
22891
22892         Drop report instance variable too, now it is a global.
22893
22894         * driver.cs: Use try/catch on command line handling.
22895
22896         Add --probe option to debug the error reporting system with a test
22897         suite. 
22898
22899         * report.cs: Add support for exiting program when a probe
22900         condition is reached.
22901
22902 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22903
22904         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22905         we do a forcible conversion regardless of type, to check if 
22906         ForceConversion returns a null.
22907
22908         (Binary::error19): Use location to report error.
22909
22910         (Unary::error23): Use location here too.
22911
22912         * ../errors/cs0019.cs : Check in.
22913
22914         * ../errors/cs0023.cs : Check in.
22915
22916         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22917         case of a non-null MethodInfo object with a length of 0 !
22918
22919         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22920         an applicable member - according to the spec :-)
22921         Also fix logic to find members in base types.
22922
22923         (Unary::ResolveOperator): Same here.
22924
22925         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22926         as I was getting thoroughly confused between this and error19 :-)
22927
22928         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22929         (::FindMostEncompassedType): Implement.
22930         (::FindMostEncompassingType): Implement.
22931         (::StandardConversionExists): Implement.
22932
22933         (UserImplicitCast): Re-vamp. We now need info about most specific
22934         source and target types so that we can do the necessary conversions.
22935
22936         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22937         mathematical union with no duplicates.
22938
22939 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22940
22941         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22942         in order from base classes to child classes, so that we can in
22943         child classes look up in our parent for method names and
22944         attributes (required for handling abstract, virtual, new, override
22945         constructs: we need to instrospect our base class, and if we dont
22946         populate the classes in order, the introspection might be
22947         incorrect.  For example, a method could query its parent before
22948         the parent has any methods and would determine that the parent has
22949         no abstract methods (while it could have had them)).
22950
22951         (RootContext::CreateType): Record the order in which we define the
22952         classes.
22953
22954 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22955
22956         * class.cs (TypeContainer::Populate): Also method definitions can
22957         fail now, keep track of this.
22958
22959         (TypeContainer::FindMembers): Implement support for
22960         DeclaredOnly/noDeclaredOnly flag.
22961
22962         (Constructor::Emit) Return the ConstructorBuilder.
22963
22964         (Method::Emit) Return the MethodBuilder. 
22965         Check for abstract or virtual methods to be public.
22966
22967         * rootcontext.cs (RootContext::CreateType): Register all the
22968         abstract methods required for the class to be complete and the
22969         interface methods that must be implemented. 
22970
22971         * cs-parser.jay: Report error 501 (method requires body if it is
22972         not marked abstract or extern).
22973
22974         * expression.cs (TypeOf::Emit): Implement.
22975
22976         * typemanager.cs: runtime_handle_type, new global type.
22977
22978         * class.cs (Property::Emit): Generate code for properties.
22979
22980 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22981
22982         * expression.cs (Unary::ResolveOperator): Find operators on base type
22983         too - we now conform exactly to the spec.
22984
22985         (Binary::ResolveOperator): Same here.
22986
22987         * class.cs (Operator::Define): Fix minor quirk in the tests.
22988
22989         * ../errors/cs0215.cs : Added.
22990
22991         * ../errors/cs0556.cs : Added.
22992
22993         * ../errors/cs0555.cs : Added.
22994
22995 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22996
22997         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22998         single integer which is really efficient
22999
23000 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23001
23002         *  expression.cs (Expression::ImplicitUserConversion): Use location
23003         even in the case when we are examining True operators.
23004  
23005         * class.cs (Operator::Define): Perform extensive checks to conform
23006         with the rules for operator overloading in the spec.
23007
23008         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23009         some of the other conversions mentioned in the spec.
23010
23011         * typemanager.cs (array_type): New static member for the System.Array built-in
23012         type.
23013
23014         (cloneable_interface): For System.ICloneable interface.
23015
23016         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23017         we start resolving the tree and populating types.
23018
23019         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23020  
23021 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23022
23023         * expression.cs (Expression::ExprClassFromMemberInfo,
23024         Expression::Literalize): Create literal expressions from
23025         FieldInfos which are literals.
23026
23027         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23028         type casts, because they were wrong.  The test suite in tests
23029         caught these ones.
23030
23031         (ImplicitNumericConversion): ushort to ulong requires a widening
23032         cast. 
23033
23034         Int32 constant to long requires widening cast as well.
23035
23036         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23037         for integers because the type on the stack is not i4.
23038
23039 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23040
23041         * expression.cs (report118): require location argument. 
23042
23043         * parameter.cs: Do not dereference potential null value.
23044
23045         * class.cs: Catch methods that lack the `new' keyword when
23046         overriding a name.  Report warnings when `new' is used without
23047         anything being there to override.
23048
23049         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23050
23051         * class.cs: Only add constructor to hashtable if it is non-null
23052         (as now constructors can fail on define).
23053
23054         (TypeManager, Class, Struct): Take location arguments.
23055
23056         Catch field instance initialization in structs as errors.
23057
23058         accepting_filter: a new filter for FindMembers that is static so
23059         that we dont create an instance per invocation.
23060
23061         (Constructor::Define): Catch errors where a struct constructor is
23062         parameterless 
23063
23064         * cs-parser.jay: Pass location information for various new
23065         constructs. 
23066
23067         * delegate.cs (Delegate): take a location argument.
23068
23069         * driver.cs: Do not call EmitCode if there were problesm in the
23070         Definition of the types, as many Builders wont be there. 
23071
23072         * decl.cs (Decl::Decl): Require a location argument.
23073
23074         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23075         into integers, and find the most appropiate integer for it.
23076
23077         * literal.cs: Implement ULongLiteral.
23078
23079         * rootcontext.cs: Provide better information about the location of
23080         failure when CreateType fails.
23081
23082 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23083
23084         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23085         as well.
23086
23087         * expression.cs (Binary::CheckShiftArguments): Add missing type
23088         computation.
23089         (Binary::ResolveOperator): Add type to the logical and and logical
23090         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23091         before.
23092
23093         (Binary::DoNumericPromotions): In the case where either argument
23094         is ulong (and most signed types combined with ulong cause an
23095         error) perform implicit integer constant conversions as well.
23096
23097 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23098
23099         * expression.cs (UserImplicitCast): Method should always be
23100         non-null. 
23101         (Invocation::BetterConversion): Simplified test for IntLiteral.
23102
23103         (Expression::ImplicitNumericConversion): Split this routine out.
23104         Put the code that performs implicit constant integer conversions
23105         here. 
23106
23107         (Expression::Resolve): Become a wrapper around DoResolve so we can
23108         check eclass and type being set after resolve.
23109
23110         (Invocation::Badness): Remove this dead function
23111
23112         (Binary::ResolveOperator): Do not compute the expensive argumnets
23113         unless we have a union for it.
23114
23115         (Probe::Emit): Is needs to do an isinst and then
23116         compare against null.
23117
23118         (::CanConvert): Added Location argument.  If the Location argument
23119         is null (Location.Null), then we do not report errors.  This is
23120         used by the `probe' mechanism of the Explicit conversion.  We do
23121         not want to generate an error for something that the user
23122         explicitly requested to be casted.  But the pipeline for an
23123         explicit cast first tests for potential implicit casts.
23124
23125         So for now, if the Location is null, it means `Probe only' to
23126         avoid adding another argument.   Might have to revise this
23127         strategy later.
23128
23129         (ClassCast): New class used to type cast objects into arbitrary
23130         classes (used in Explicit Reference Conversions).
23131
23132         Implement `as' as well.
23133
23134         Reverted all the patches from Ravi below: they were broken:
23135
23136                 * The use of `level' as a mechanism to stop recursive
23137                   invocations is wrong.  That was there just to catch the
23138                   bug with a strack trace but not as a way of addressing
23139                   the problem.
23140
23141                   To fix the problem we have to *understand* what is going
23142                   on and the interactions and come up with a plan, not
23143                   just get things going.
23144
23145                 * The use of the type conversion cache that I proposed
23146                   last night had an open topic: How does this work across
23147                   protection domains.  A user defined conversion might not
23148                   be public in the location where we are applying the
23149                   conversion, a different conversion might be selected
23150                   (ie, private A->B (better) but public B->A (worse),
23151                   inside A, A->B applies, but outside it, B->A will
23152                   apply).
23153
23154                 * On top of that (ie, even if the above is solved),
23155                   conversions in a cache need to be abstract.  Ie, `To
23156                   convert from an Int to a Short use an OpcodeCast', not
23157                   `To convert from an Int to a Short use the OpcodeCast on
23158                   the variable 5' (which is what this patch was doing).
23159
23160 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23161
23162         * expression.cs (Invocation::ConversionExists): Re-write to use
23163         the conversion cache
23164
23165         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23166         cache all conversions done, not just user-defined ones.
23167
23168         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23169         to determine if a conversion exists instead of acutually trying to 
23170         perform the conversion. It's faster too.
23171
23172         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23173         and only then attempt the implicit conversion.
23174
23175 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23176
23177         * expression.cs (ConvertImplicit): Use a cache for conversions
23178         already found. Check level of recursion and bail out if necessary.
23179
23180 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23183         Export standard methods that we expect for string operations.
23184
23185         * statement.cs (Block::UsageWarning): Track usage of variables and
23186         report the errors for not used variables.
23187
23188         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23189         operator. 
23190
23191 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23192
23193         * codegen.cs: remove unnneded code 
23194
23195         * expression.cs: Removed BuiltinTypeAccess class
23196
23197         Fix the order in which implicit conversions are
23198         done.  
23199
23200         The previous fixed dropped support for boxed conversions (adding a
23201         test to the test suite now)
23202
23203         (UserImplicitCast::CanConvert): Remove test for source being null,
23204         that code is broken.  We should not feed a null to begin with, if
23205         we do, then we should track the bug where the problem originates
23206         and not try to cover it up here.
23207
23208         Return a resolved expression of type UserImplicitCast on success
23209         rather than true/false.  Ravi: this is what I was talking about,
23210         the pattern is to use a static method as a "constructor" for
23211         objects. 
23212
23213         Also, do not create arguments until the very last minute,
23214         otherwise we always create the arguments even for lookups that
23215         will never be performed. 
23216
23217         (UserImplicitCast::Resolve): Eliminate, objects of type
23218         UserImplicitCast are born in a fully resolved state. 
23219
23220         * typemanager.cs (InitCoreTypes): Init also value_type
23221         (System.ValueType). 
23222
23223         * expression.cs (Cast::Resolve): First resolve the child expression.
23224
23225         (LValue): Add new method AddressOf to be used by
23226         the `&' operator.  
23227
23228         Change the argument of Store to take an EmitContext instead of an
23229         ILGenerator, because things like FieldExpr need to be able to call
23230         their children expression to generate the instance code. 
23231
23232         (Expression::Error, Expression::Warning): Sugar functions for
23233         reporting errors.
23234
23235         (Expression::MemberLookup): Accept a TypeContainer instead of a
23236         Report as the first argument.
23237
23238         (Expression::ResolvePrimary): Killed.  I still want to improve
23239         this as currently the code is just not right.
23240
23241         (Expression::ResolveMemberAccess): Simplify, but it is still
23242         wrong. 
23243
23244         (Unary::Resolve): Catch errors in AddressOf operators.
23245
23246         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23247         index to a byte for the short-version, or the compiler will choose
23248         the wrong Emit call, which generates the wrong data.
23249
23250         (ParameterReference::Emit, ::Store): same.
23251
23252         (FieldExpr::AddressOf): Implement.
23253
23254         * typemanager.cs: TypeManager: made public variable instead of
23255         property.
23256
23257         * driver.cs: document --fatal.
23258
23259         * report.cs (ErrorMessage, WarningMessage): new names for the old
23260         Error and Warning classes.
23261
23262         * cs-parser.jay (member_access): Turn built-in access to types
23263         into a normal simplename
23264
23265 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23266
23267         * expression.cs (Invocation::BetterConversion): Fix to cope
23268         with q being null, since this was introducing a bug.
23269
23270         * expression.cs (ConvertImplicit): Do built-in conversions first.
23271
23272 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23273
23274         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23275
23276 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23277
23278         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23279         I had introduced long ago (what's new ?).
23280
23281         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23282         the work of all the checking. 
23283         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23284         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23285
23286         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23287         that is the right way. 
23288
23289         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23290         overloading resolution. Use everywhere instead of cutting and pasting code.
23291
23292         (Binary::ResolveOperator): Use MakeUnionSet.
23293
23294         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23295         we have to convert to bool types. Not complete yet.
23296
23297 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23298
23299         * typemanager.cs (TypeManager::CSharpName): support ushort.
23300
23301         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23302         to provide an expression that performsn an implicit constant int
23303         conversion (section 6.1.6).
23304         (Expression::ConvertImplicitRequired): Reworked to include
23305         implicit constant expression conversions.
23306
23307         (Expression::ConvertNumericExplicit): Finished.
23308
23309         (Invocation::Emit): If InstanceExpression is null, then it means
23310         that we perform a call on this.
23311
23312 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23313
23314         * expression.cs (Unary::Emit): Remove some dead code.
23315         (Probe): Implement Resolve and Emit for `is'.
23316         (Expression::ConvertImplicitRequired): Attempt to do constant
23317         expression conversions here.  Maybe should be moved to
23318         ConvertImplicit, but I am not sure.
23319         (Expression::ImplicitLongConstantConversionPossible,
23320         Expression::ImplicitIntConstantConversionPossible): New functions
23321         that tell whether is it possible to apply an implicit constant
23322         expression conversion.
23323
23324         (ConvertNumericExplicit): Started work on explicit numeric
23325         conversions.
23326
23327         * cs-parser.jay: Update operator constants.
23328
23329         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23330         (Parameters::GetSignature): Hook up VerifyArgs here.
23331         (Parameters::VerifyArgs): Verifies that no two arguments have the
23332         same name. 
23333
23334         * class.cs (Operator): Update the operator names to reflect the
23335         ones that the spec expects (as we are just stringizing the
23336         operator names).
23337
23338         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23339         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23340         previous usage did only work for our methods.
23341         (Expression::ConvertImplicit): Handle decimal implicit numeric
23342         conversions as well.
23343         (Expression::InternalTypeConstructor): Used to invoke constructors
23344         on internal types for default promotions.
23345
23346         (Unary::Emit): Implement special handling for the pre/post
23347         increment/decrement for overloaded operators, as they need to have
23348         the same semantics as the other operators.
23349
23350         (Binary::ResolveOperator): ditto.
23351         (Invocation::ConversionExists): ditto.
23352         (UserImplicitCast::Resolve): ditto.
23353
23354 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23355
23356         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23357         operator, return after emitting body. Regression tests pass again !
23358
23359         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23360         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23361         (Invocation::OverloadResolve): Ditto.
23362         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23363
23364         * everywhere : update calls to the above methods accordingly.
23365
23366 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23367
23368         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23369
23370         * expression.cs (ExpressionStatement): New base class used for
23371         expressions that can appear in statements, so that we can provide
23372         an alternate path to generate expression that do not leave a value
23373         on the stack.
23374
23375         (Expression::Emit, and all the derivatives): We no longer return
23376         whether a value is left on the stack or not.  Every expression
23377         after being emitted leaves a single value on the stack.
23378
23379         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23380         facilties of ExpressionStatement if possible.
23381
23382         * cs-parser.jay: Update statement_expression.
23383
23384 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23385
23386         * driver.cs: Change the wording of message
23387
23388 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23389
23390         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23391         the type of the expression to the return type of the method if
23392         we have an overloaded operator match ! The regression tests pass again !
23393         (Unary::ResolveOperator): Ditto.
23394
23395         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23396         to find "op_Implicit", not "implicit" ;-)
23397         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23398         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23399
23400         * everywhere : Correct calls to the above accordingly.
23401
23402         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23403         (ConvertImplicit): Do user-defined conversion if it exists.
23404
23405 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23406
23407         * assign.cs: track location.
23408         (Resolve): Use implicit conversions on assignment.
23409
23410         * literal.cs: Oops.  Not good, Emit of short access values should
23411         pass (Bytes) or the wrong argument will be selected.
23412
23413         * expression.cs (Unary::Emit): Emit code for -expr.
23414
23415         (Unary::ResolveOperator): Handle `Substract' for non-constants
23416         (substract from zero from the non-constants).
23417         Deal with Doubles as well. 
23418
23419         (Expression::ConvertImplicitRequired): New routine that reports an
23420         error if no implicit conversion exists. 
23421
23422         (Invocation::OverloadResolve): Store the converted implicit
23423         expressions if we make them
23424
23425 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23426
23427         * class.cs (ConstructorInitializer): Take a Location argument.
23428         (ConstructorBaseInitializer): Same here.
23429         (ConstructorThisInitializer): Same here.
23430
23431         * cs-parser.jay : Update all calls accordingly.
23432
23433         * expression.cs (Unary, Binary, New): Take location argument.
23434         Update accordingly everywhere.
23435
23436         * cs-parser.jay : Update all calls to the above to take a location
23437         argument.
23438
23439         * class.cs : Ditto.
23440
23441 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23442
23443         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23444         (Invocation::BetterConversion): Same here
23445         (Invocation::ConversionExists): Ditto.
23446
23447         (Invocation::ConversionExists): Implement.
23448
23449 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23450
23451         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23452         Also take an additional TypeContainer argument.
23453
23454         * All over : Pass in TypeContainer as argument to OverloadResolve.
23455
23456         * typemanager.cs (CSharpName): Update to check for the string type and return
23457         that too.
23458
23459         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23460         a given method.
23461
23462 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23463
23464         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23465         (Invocation::BetterFunction): Implement.
23466         (Invocation::BetterConversion): Implement.
23467         (Invocation::ConversionExists): Skeleton, no implementation yet.
23468
23469         Okay, things work fine !
23470
23471 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23472
23473         * typemanager.cs: declare and load enum_type, delegate_type and
23474         void_type. 
23475
23476         * expression.cs (Expression::Emit): Now emit returns a value that
23477         tells whether a value is left on the stack or not.  This strategy
23478         might be reveted tomorrow with a mechanism that would address
23479         multiple assignments.
23480         (Expression::report118): Utility routine to report mismatches on
23481         the ExprClass.
23482
23483         (Unary::Report23): Report impossible type/operator combination
23484         utility function.
23485
23486         (Unary::IsIncrementableNumber): Whether the type can be
23487         incremented or decremented with add.
23488         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23489         complemented. 
23490         (Unary::ResolveOperator): Implement ++, !, ~,
23491
23492         (Invocation::Emit): Deal with new Emit convetion.
23493
23494         * All Expression derivatives: Updated their Emit method to return
23495         whether they leave values on the stack or not.
23496
23497         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23498         stack for expressions that are statements. 
23499
23500 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23501
23502         * expression.cs (LValue): New interface.  Must be implemented by
23503         LValue objects.
23504         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23505         LValue interface.
23506
23507         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23508         interface for generating code, simplifies the code.
23509
23510 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23511
23512         * expression.cs (everywhere): Comment out return statements in ::Resolve
23513         methods to avoid the warnings.
23514
23515 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23516
23517         * driver.cs (parse): Report error 2001 if we can not open the
23518         source file.
23519
23520         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23521         not resolve it.
23522
23523         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23524         object. 
23525
23526         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23527         otherwise nested blocks end up with the same index.
23528
23529         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23530
23531         * expression.cs:  Instead of having FIXMEs in the Resolve
23532         functions, throw exceptions so it is obvious that we are facing a
23533         bug. 
23534
23535         * cs-parser.jay (invocation_expression): Pass Location information.
23536
23537         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23538         Use a basename for those routines because .NET does not like paths
23539         on them. 
23540
23541         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23542         already defined.
23543
23544 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23545
23546         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23547         are loading the correct data types (throws an exception if not).
23548         (TypeManager::InitCoreTypes): Use CoreLookupType
23549
23550         * expression.cs (Unary::ResolveOperator): return the child
23551         expression for expressions which are just +expr.
23552         (Unary::ResolveOperator): Return negative literals for -LITERAL
23553         expressions (otherwise they are Unary {Literal}).
23554         (Invocation::Badness): Take into account `Implicit constant
23555         expression conversions'.
23556
23557         * literal.cs (LongLiteral): Implement long literal class.
23558         (IntLiteral): export the `Value' of the intliteral. 
23559
23560 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23561
23562         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23563
23564         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23565         instead of 'Operator'
23566
23567         * expression.cs (Binary::ResolveOperator): Update accordingly.
23568         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23569         and 'Minus'
23570
23571         * cs-parser.jay (unary_expression): Update to use the new names.
23572
23573         * gen-treedump.cs (GetUnary): Same here.
23574
23575         * expression.cs (Unary::Resolve): Implement.
23576         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23577         operators are found instead of making noise ;-)
23578         (Unary::ResolveOperator): New method to do precisely the same thing which
23579         Binary::ResolveOperator does for Binary expressions.
23580         (Unary.method, .Arguments): Add.
23581         (Unary::OperName): Implement.   
23582         (Unary::ForceConversion): Copy and Paste !
23583
23584         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23585         a unary operator.
23586
23587         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23588         for the inbuilt operators. Only overloading works for now ;-)
23589
23590 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23591
23592         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23593         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23594
23595         * expression.cs (This::Emit): Implement. 
23596         (This::Resolve): Implement.
23597         (TypeOf:Resolve): Implement.
23598         (Expression::ResolveSimpleName): Add an implicit this to instance
23599         field references. 
23600         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23601         Bind instance variable to Field expressions.
23602         (FieldExpr::Instance): New field used to track the expression that
23603         represents the object instance.
23604         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23605         binding 
23606         (FieldExpr::Emit): Implement.
23607
23608         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23609         the last instruction contains a return opcode to avoid generating
23610         the last `ret' instruction (this generates correct code, and it is
23611         nice to pass the peverify output).
23612
23613         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23614         initializer for static and instance variables.
23615         (Constructor::Emit): Allow initializer to be null in the case of
23616         static constructors.  Only emit initializer for instance
23617         constructors. 
23618
23619         (TypeContainer::FindMembers): Return a null array if there are no
23620         matches.
23621
23622         Also fix the code for the MemberTypes.Method branch, as it was not
23623         scanning that for operators (or tried to access null variables before).
23624
23625         * assign.cs (Assign::Emit): Handle instance and static fields. 
23626
23627         * TODO: Updated.
23628
23629         * driver.cs: Stop compilation if there are parse errors.
23630
23631         * cs-parser.jay (constructor_declaration): Provide default base
23632         initializer for non-static constructors.
23633         (constructor_declarator): Do not provide a default base
23634         initializers if none was specified.
23635         Catch the fact that constructors should not have parameters.
23636
23637         * class.cs: Do not emit parent class initializers for static
23638         constructors, that should be flagged as an error.
23639
23640 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23641
23642         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23643         Move back code into TypeContainer::Populate.
23644
23645 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23646
23647         * class.cs (TypeContainer::AddConstructor): Fix the check to
23648         compare against Name, not Basename. 
23649         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23650
23651         * cs-parser.jay : Update accordingly.
23652
23653         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23654         for methods, don't forget to look into the operators too.
23655         (RegisterMethodBuilder): Helper method to take care of this for
23656         methods, constructors and operators.
23657         (Operator::Define): Completely revamp.
23658         (Operator.OperatorMethod, MethodName): New fields.
23659         (TypeContainer::Populate): Move the registering of builders into
23660         RegisterMethodBuilder.
23661         (Operator::Emit): Re-write.
23662
23663         * expression.cs (Binary::Emit): Comment out code path to emit method
23664         invocation stuff for the case when we have a user defined operator. I am
23665         just not able to get it right !
23666
23667 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23668
23669         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23670         argument. 
23671
23672         (Expression::MemberLookup): Provide a version that allows to
23673         specify the MemberTypes and BindingFlags. 
23674
23675         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23676         so it was not fetching variable information from outer blocks.
23677
23678         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23679         Beforefieldinit as it was buggy.
23680
23681         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23682         that Ravi put here.  
23683
23684         * class.cs (Constructor::Emit): Only emit if block is not null.
23685         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23686         deal with this by semantically definining it as if the user had
23687         done it.
23688
23689         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23690         constructors as we now "emit" them at a higher level.
23691
23692         (TypeContainer::DefineDefaultConstructor): Used to define the
23693         default constructors if none was provided.
23694
23695         (ConstructorInitializer): Add methods Resolve and Emit. 
23696
23697         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23698
23699 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23700
23701         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23702         the default constructor builder with our hashtable for methodbuilders
23703         to methodcores.
23704
23705         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23706         and argument_count is 0 in which case we have a match.
23707         (Binary::ResolveOperator): More null checking and miscellaneous coding
23708         style cleanup.
23709
23710 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23711
23712         * rootcontext.cs (IsNameSpace): Compare against null.
23713
23714         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23715
23716         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23717         and Unary::Operator.
23718
23719         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23720         accordingly.
23721
23722         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23723         we have overloaded operators.
23724         (Binary::ResolveOperator): Implement the part which does the operator overload
23725         resolution.
23726
23727         * class.cs (Operator::Emit): Implement.
23728         (TypeContainer::Emit): Emit the operators we have too.
23729
23730         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23731         the case when we have a user-defined operator.
23732
23733 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23734
23735         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23736
23737 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23738
23739         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23740         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23741         (Constructor::Emit): Implement.
23742         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23743         if we have no work to do. 
23744         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23745         Emit method.
23746
23747         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23748         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23749
23750         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23751         of parent.parent.
23752
23753 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23754
23755         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23756         in the source.
23757         (Tree::RecordNamespace): Method to do what the name says ;-)
23758         (Tree::Namespaces): Property to get at the namespaces hashtable.
23759
23760         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23761         keep track.
23762
23763         * rootcontext.cs (IsNamespace): Fixed it :-)
23764
23765 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * class.cs (TypeContainer::FindMembers): Add support for
23768         constructors. 
23769         (MethodCore): New class that encapsulates both the shared aspects
23770         of a Constructor and a Method.  
23771         (Method, Constructor): Factored pieces into MethodCore.
23772
23773         * driver.cs: Added --fatal which makes errors throw exceptions.
23774         Load System assembly as well as part of the standard library.
23775
23776         * report.cs: Allow throwing exceptions on errors for debugging.
23777
23778         * modifiers.cs: Do not use `parent', instead use the real type
23779         container to evaluate permission settings.
23780
23781         * class.cs: Put Ravi's patch back in.  He is right, and we will
23782         have to cope with the
23783
23784 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23785
23786         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23787         FamORAssem, not FamANDAssem.
23788
23789 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23790
23791         * driver.cs: Added --parse option that only parses its input files
23792         and terminates.
23793
23794         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23795         incorrect.  IsTopLevel is not used to tell whether an object is
23796         root_types or not (that can be achieved by testing this ==
23797         root_types).  But to see if this is a top-level *class* (not
23798         necessarly our "toplevel" container). 
23799
23800 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23801
23802         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23803         parent instead of a direct call to GetType.
23804
23805 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23806
23807         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23808         Modifiers.TypeAttr. This should just be a call to that method.
23809
23810         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23811         object so that we can determine if we are top-level or not.
23812
23813         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23814         TypeContainer too.
23815
23816         * enum.cs (Enum::Define): Ditto.
23817
23818         * modifiers.cs (FieldAttr): Re-write.
23819
23820         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23821         (TypeContainer::HaveStaticConstructor): New property to provide access
23822         to precisely that info.
23823
23824         * modifiers.cs (MethodAttr): Re-write.
23825         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23826
23827         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23828         of top-level types as claimed.
23829
23830 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23831
23832         * expression.cs (MemberLookup): Fruitless attempt to lookup
23833         constructors.  Maybe I need to emit default constructors?  That
23834         might be it (currently .NET emits this for me automatically).
23835         (Invocation::OverloadResolve): Cope with Arguments == null.
23836         (Invocation::EmitArguments): new function, shared by the new
23837         constructor and us.
23838         (Invocation::Emit): Handle static and instance methods.  Emit
23839         proper call instruction for virtual or non-virtual invocations.
23840         (New::Emit): Implement.
23841         (New::Resolve): Implement.
23842         (MemberAccess:Resolve): Implement.
23843         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23844         to track instances.
23845         (FieldExpr::Resolve): Set type.
23846
23847         * support.cs: Handle empty arguments.
23848                 
23849         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23850         SimpleLookup): Auxiliary routines to help parse a qualifier
23851         identifier.  
23852
23853         Update qualifier_identifier rule.
23854
23855         * codegen.cs: Removed debugging messages.
23856
23857         * class.cs: Make this a global thing, this acts just as a "key" to
23858         objects that we might have around.
23859
23860         (Populate): Only initialize method_builders_to_methods once.
23861
23862         * expression.cs (PropertyExpr): Initialize type from the
23863         PropertyType. 
23864
23865         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23866         Resolve pattern.  Attempt to implicitly convert value to boolean.
23867         Emit code.
23868
23869         * expression.cs: Set the type for the int32/int32 argument case.
23870         (Binary::ResolveOperator): Set the return type to boolean for
23871         comparission operators
23872
23873         * typemanager.cs: Remove debugging print code.
23874
23875         (Invocation::Resolve): resolve type.
23876
23877         * class.cs: Allocate a MemberInfo of the correct size, as the code
23878         elsewhere depends on the test to reflect the correct contents.
23879
23880         (Method::) Keep track of parameters, due to System.Reflection holes
23881
23882         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23883         mapping here.
23884
23885         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23886         of the exact size and return that.
23887
23888         (Class::LookupMethodByBuilder): New function that maps
23889         MethodBuilders to its methods.  Required to locate the information
23890         on methods because System.Reflection bit us again.
23891
23892         * support.cs: New file, contains an interface ParameterData and
23893         two implementations: ReflectionParameters and InternalParameters
23894         used to access Parameter information.  We will need to grow this
23895         as required.
23896
23897         * expression.cs (Invocation::GetParameterData): implement a cache
23898         and a wrapper around the ParameterData creation for methods. 
23899         (Invocation::OverloadResolve): Use new code.
23900
23901 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23902
23903         * class.cs (TypeContainer::EmitField): Remove and move into 
23904         (Field::Define): here and modify accordingly.
23905         (Field.FieldBuilder): New member.
23906         (TypeContainer::Populate): Update accordingly.
23907         (TypeContainer::FindMembers): Implement.
23908
23909 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23910
23911         * statement.cs: (VariableInfo::VariableType): New field to be
23912         initialized with the full type once it is resolved. 
23913
23914 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23915
23916         * parameter.cs (GetParameterInfo): Use a type cache to compute
23917         things only once, and to reuse this information
23918
23919         * expression.cs (LocalVariableReference::Emit): Implement.
23920         (OpcodeCast::Emit): fix.
23921
23922         (ParameterReference::Resolve): Implement.
23923         (ParameterReference::Emit): Implement.
23924
23925         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23926         that are expressions need to stay as Expressions.
23927
23928         * typemanager.cs (CSharpName): Returns the C# name of a type if
23929         possible. 
23930
23931         * expression.cs (Expression::ConvertImplicit): New function that
23932         implements implicit type conversions.
23933
23934         (Expression::ImplicitReferenceConversion): Implements implicit
23935         reference conversions.
23936
23937         (EmptyCast): New type for transparent casts.
23938
23939         (OpcodeCast): New type for casts of types that are performed with
23940         a sequence of bytecodes.
23941
23942         (BoxedCast): New type used for casting value types into reference
23943         types.  Emits a box opcode.
23944
23945         (Binary::DoNumericPromotions): Implements numeric promotions of
23946         and computation of the Binary::Type.
23947
23948         (Binary::EmitBranchable): Optimization.
23949
23950         (Binary::Emit): Implement code emission for expressions.
23951
23952         * typemanager.cs (TypeManager): Added two new core types: sbyte
23953         and byte.
23954
23955 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23956
23957         * class.cs (TypeContainer::FindMembers): Method which does exactly
23958         what Type.FindMembers does, only we don't have to use reflection. No
23959         implementation yet.
23960
23961         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23962         typecontainer objects as we need to get at them.
23963         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23964
23965         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23966         typecontainer object.
23967
23968         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23969         of just a Report object.
23970
23971 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23972
23973         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23974         "remove_"
23975         (TypeContainer::Populate): Now define the delegates of the type too.
23976         (TypeContainer.Delegates): Property to access the list of delegates defined
23977         in the type.
23978
23979         * delegates.cs (Delegate::Define): Implement partially.
23980
23981         * modifiers.cs (TypeAttr): Handle more flags.
23982
23983 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23984
23985         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23986         and not <=
23987         (Operator::Define): Re-write logic to get types by using the LookupType method
23988         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23989         (Indexer::Define): Ditto.
23990         (Event::Define): Ditto.
23991         (Property::Define): Ditto.
23992
23993 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23994
23995         * class.cs (TypeContainer::Populate): Now define operators too. 
23996         (TypeContainer.Operators): New property to access the list of operators
23997         in a type.
23998         (Operator.OperatorMethodBuilder): New member to hold the method builder
23999         for the operator we are defining.
24000         (Operator::Define): Implement.
24001
24002 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24003
24004         * class.cs (Event::Define): Make the prefixes of the accessor methods
24005         addOn_ and removeOn_ 
24006
24007         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24008         of the location being passed in too. Ideally, this should go later since all
24009         error reporting should be done through the Report object.
24010
24011         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24012         (Populate): Iterate thru the indexers we have and define them too.
24013         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24014         for the get and set accessors.
24015         (Indexer::Define): Implement.
24016
24017 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24018
24019         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24020         my previous implementation, did not work.
24021
24022         * typemanager.cs: Add a couple of missing types (the longs).
24023
24024         * literal.cs: Use TypeManager.bool_type instead of getting it.
24025
24026         * expression.cs (EventExpr): New kind of expressions.
24027         (Expressio::ExprClassFromMemberInfo): finish
24028
24029 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24030
24031         * assign.cs: Emit stores to static fields differently.
24032
24033 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24034
24035         * Merge in changes and adjust code to tackle conflicts. Backed out my
24036         code in Assign::Resolve ;-) 
24037
24038 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24039
24040         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24041         instead Report.Error and also pass in the location.
24042         (CSharpParser::Lexer): New readonly property to return the reference
24043         to the Tokenizer object.
24044         (declare_local_variables): Use Report.Error with location instead of plain 
24045         old error.
24046         (CheckDef): Ditto.
24047
24048         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24049         (Operator.CheckBinaryOperator): Ditto.
24050
24051         * cs-parser.jay (operator_declarator): Update accordingly.
24052
24053         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24054         (CheckBinaryOperator): Same here.
24055
24056         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24057         on the name without any prefixes of namespace names etc. This is because we
24058         already might have something already fully qualified like 
24059         'System.Console.WriteLine'
24060
24061         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24062
24063 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24064
24065         * cs-tokenizer.cs (location): Return a string which also contains
24066         the file name.
24067
24068         * expression.cs (ElementAccess): New class for expressions of the
24069         type 'element access.'
24070         (BaseAccess): New class for expressions of the type 'base access.'
24071         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24072         respectively.
24073
24074         * cs-parser.jay (element_access): Implement action.
24075         (base_access): Implement actions.
24076         (checked_expression, unchecked_expression): Implement.
24077
24078         * cs-parser.jay (local_variable_type): Correct and implement.
24079         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24080
24081         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24082
24083         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24084         name and the specifiers.
24085
24086         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24087
24088         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24089         making them all public ;-)
24090
24091         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24092         class anyways.
24093
24094 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24095
24096         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24097         PropertyExprs.
24098         (FieldExpr, PropertyExprs): New resolved expressions.
24099         (SimpleName::MemberStaticCheck): Perform static checks for access
24100         to non-static fields on static methods. Maybe this should be
24101         generalized for MemberAccesses. 
24102         (SimpleName::ResolveSimpleName): More work on simple name
24103         resolution. 
24104
24105         * cs-parser.jay (primary_expression/qualified_identifier): track
24106         the parameter index.
24107
24108         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24109         (EmitContext::EmitBoolExpression): Chain to expression generation
24110         instead of temporary hack.
24111         (::EmitStatementExpression): Put generic expression code generation.
24112
24113         * assign.cs (Assign::Emit): Implement variable assignments to
24114         local variables, parameters and fields.
24115
24116 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24117
24118         * statement.cs (Block::GetVariableInfo): New method, returns the
24119         VariableInfo for a variable name in a block.
24120         (Block::GetVariableType): Implement in terms of GetVariableInfo
24121
24122         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24123         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24124
24125 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24126
24127         * cs-parser.jay (operator_declaration): Continue on my quest : update
24128         to take attributes argument.
24129         (event_declaration): Ditto.
24130         (enum_declaration): Ditto.
24131         (indexer_declaration): Ditto.
24132
24133         * class.cs (Operator::Operator): Update constructor accordingly.
24134         (Event::Event): Ditto.
24135
24136         * delegate.cs (Delegate::Delegate): Same here.
24137
24138         * enum.cs (Enum::Enum): Same here.
24139
24140 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24141
24142         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24143
24144         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24145
24146         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24147         being passed around as an arraylist.
24148         (Attributes::AddAttribute): Method to add attribute sections.
24149
24150         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24151         (struct_declaration): Update accordingly.
24152         (constant_declaration): Update.
24153         (field_declaration): Update.
24154         (method_header): Update.
24155         (fixed_parameter): Update.
24156         (parameter_array): Ditto.
24157         (property_declaration): Ditto.
24158         (destructor_declaration): Ditto.
24159
24160         * class.cs (Struct::Struct): Update constructors accordingly.
24161         (Class::Class): Ditto.
24162         (Field::Field): Ditto.
24163         (Method::Method): Ditto.
24164         (Property::Property): Ditto.
24165         (TypeContainer::OptAttribute): update property's return type.
24166
24167         * interface.cs (Interface.opt_attributes): New member.
24168         (Interface::Interface): Update to take the extra Attributes argument.
24169
24170         * parameter.cs (Parameter::Parameter): Ditto.
24171
24172         * constant.cs (Constant::Constant): Ditto.
24173
24174         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24175         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24176         the attributes as a parameter.
24177         (InterfaceProperty): Update constructor call.
24178         (InterfaceEvent): Ditto.
24179         (InterfaceMethod): Ditto.
24180         (InterfaceIndexer): Ditto.
24181
24182         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24183         pass the attributes too.
24184         (interface_event_declaration): Ditto.
24185         (interface_property_declaration): Ditto.
24186         (interface_method_declaration): Ditto.
24187         (interface_declaration): Ditto.
24188
24189 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24190
24191         * class.cs (Method::Define): Track the "static Main" definition to
24192         create an entry point. 
24193
24194         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24195         EntryPoint if we find it. 
24196
24197         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24198         (EmitContext::ig): Make this variable public.
24199
24200         * driver.cs: Make the default output file be the first file name
24201         with the .exe extension.  
24202
24203         Detect empty compilations
24204
24205         Handle various kinds of output targets.  Handle --target and
24206         rename -t to --dumper.
24207
24208         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24209         methods inherited from Expression return now an Expression.  This
24210         will is used during the tree rewriting as we resolve them during
24211         semantic analysis.
24212
24213         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24214         the spec.  Missing entirely is the information about
24215         accessability of elements of it.
24216
24217         (Expression::ExprClassFromMemberInfo): New constructor for
24218         Expressions that creates a fully initialized Expression based on
24219         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24220         a Type.
24221
24222         (Invocation::Resolve): Begin implementing resolution of invocations.
24223
24224         * literal.cs (StringLiteral):  Implement Emit.
24225
24226 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24227
24228         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24229         member.
24230
24231 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24232
24233         * cs-parser.jay (attribute_arguments): Implement actions.
24234         (attribute): Fix bug in production. Implement action.
24235         (attribute_list): Implement.
24236         (attribute_target): Implement.
24237         (attribute_target_specifier, opt_target_specifier): Implement
24238         (CheckAttributeTarget): New method to check if the attribute target
24239         is valid.
24240         (attribute_section): Implement.
24241         (opt_attributes): Implement.
24242
24243         * attribute.cs : New file to handle attributes.
24244         (Attribute): Class to hold attribute info.
24245
24246         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24247         (attribute_section): Modify production to use 2 different rules to 
24248         achieve the same thing. 1 s/r conflict down !
24249         Clean out commented, useless, non-reducing dimension_separator rules.
24250
24251         * class.cs (TypeContainer.attributes): New member to hold list
24252         of attributes for a type.
24253         (Struct::Struct): Modify to take one more argument, the attribute list.
24254         (Class::Class): Ditto.
24255         (Field::Field): Ditto.
24256         (Method::Method): Ditto.
24257         (Property::Property): Ditto.
24258
24259         * cs-parser.jay (struct_declaration): Update constructor call to
24260         pass in the attributes too.
24261         (class_declaration): Ditto.
24262         (constant_declaration): Ditto.
24263         (field_declaration): Ditto.
24264         (method_header): Ditto.
24265         (fixed_parameter): Ditto.
24266         (parameter_array): Ditto.
24267         (property_declaration): Ditto.
24268
24269         * constant.cs (Constant::Constant): Update constructor similarly.
24270         Use System.Collections.
24271
24272         * parameter.cs (Parameter::Parameter): Update as above.
24273
24274 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24275
24276         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24277         (TypeContainer.delegates): New member to hold list of delegates.
24278
24279         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24280         this time as I seem to be on crack ;-)
24281
24282 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24283
24284         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24285         tell whether an identifier represents a namespace.
24286
24287         * expression.cs (NamespaceExpr): A namespace expression, used only
24288         temporarly during expression resolution.
24289         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24290         utility functions to resolve names on expressions.
24291
24292 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * codegen.cs: Add hook for StatementExpressions. 
24295
24296         * class.cs: Fix inverted test for static flag in methods.
24297
24298 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24299
24300         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24301         to make it coincide with MS' number.
24302         (Operator::CheckBinaryOperator): Ditto.
24303
24304         * ../errors/errors.txt : Remove error numbers added earlier.
24305
24306         * ../errors/cs1019.cs : Test case for error # 1019
24307
24308         * ../errros/cs1020.cs : Test case for error # 1020
24309
24310         * cs-parser.jay : Clean out commented cruft.
24311         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24312         used anywhere - non-reducing rule.
24313         (namespace_declarations): Non-reducing rule - comment out.
24314
24315         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24316         with TypeContainer::AddEnum.
24317
24318         * delegate.cs : New file for delegate handling classes.
24319         (Delegate): Class for declaring delegates.
24320
24321         * makefile : Update.
24322
24323         * cs-parser.jay (delegate_declaration): Implement.
24324
24325 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24326
24327         * class.cs (Event::Define): Implement.
24328         (Event.EventBuilder): New member.
24329
24330         * class.cs (TypeContainer::Populate): Update to define all enums and events
24331         we have.
24332         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24333         readonly fields for all these cases ?
24334
24335 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24336
24337         * class.cs (Property): Revamp to use the convention of making fields readonly.
24338         Accordingly modify code elsewhere.
24339
24340         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24341         the Define method of the Property class.
24342
24343         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24344         trivial bug.
24345         (TypeContainer::Populate): Update to define all the properties we have. Also
24346         define all enumerations.
24347
24348         * enum.cs (Define): Implement.
24349
24350 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24351
24352         * cs-parser.jay (overloadable_operator): The semantic value is an
24353         enum of the Operator class.
24354         (operator_declarator): Implement actions.
24355         (operator_declaration): Implement.
24356
24357         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24358         validity of definitions.
24359         (Operator::CheckBinaryOperator): Static method to check for binary operators
24360         (TypeContainer::AddOperator): New method to add an operator to a type.
24361
24362         * cs-parser.jay (indexer_declaration): Added line to actually call the
24363         AddIndexer method so it gets added ;-)
24364
24365         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24366         already taken care of by the MS compiler ?  
24367
24368 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24369
24370         * class.cs (Operator): New class for operator declarations.
24371         (Operator::OpType): Enum for the various operators.
24372
24373 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24374
24375         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24376         ostensibly handle this in semantic analysis.
24377
24378         * cs-parser.jay (general_catch_clause): Comment out
24379         (specific_catch_clauses, specific_catch_clause): Ditto.
24380         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24381         (catch_args, opt_catch_args): New productions.
24382         (catch_clause): Rewrite to use the new productions above
24383         (catch_clauses): Modify accordingly.
24384         (opt_catch_clauses): New production to use in try_statement
24385         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24386         and re-write the code in the actions to extract the specific and
24387         general catch clauses by being a little smart ;-)
24388
24389         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24390         Hooray, try and catch statements parse fine !
24391
24392 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24393
24394         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24395         string from the hashtable of variables.
24396
24397         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24398         I end up making that mistake ;-)
24399         (catch_clauses): Fixed gross error which made Key and Value of the 
24400         DictionaryEntry the same : $1 !!
24401
24402 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24403
24404         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24405
24406         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24407         when the add and remove accessors are specified. 
24408
24409 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24410
24411         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24412         information about indexer_declarator.
24413         (indexer_declarator): Implement actions.
24414         (parsing_indexer): New local boolean used to keep track of whether
24415         we are parsing indexers or properties. This is necessary because 
24416         implicit_parameters come into picture even for the get accessor in the 
24417         case of an indexer.
24418         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24419
24420         * class.cs (Indexer): New class for indexer declarations.
24421         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24422         (TypeContainer::indexers): New member to hold list of indexers for the
24423         type.
24424
24425 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24426
24427         * cs-parser.jay (add_accessor_declaration): Implement action.
24428         (remove_accessor_declaration): Implement action.
24429         (event_accessors_declaration): Implement
24430         (variable_declarators): swap statements for first rule - trivial.
24431
24432         * class.cs (Event): New class to hold information about event
24433         declarations.
24434         (TypeContainer::AddEvent): New method to add an event to a type
24435         (TypeContainer::events): New member to hold list of events.
24436
24437         * cs-parser.jay (event_declaration): Implement actions.
24438
24439 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24440
24441         * cs-parser.jay (dim_separators): Implement. Make it a string
24442         concatenating all the commas together, just as they appear.
24443         (opt_dim_separators): Modify accordingly
24444         (rank_specifiers): Update accordingly. Basically do the same
24445         thing - instead, collect the brackets here.
24446         (opt_rank_sepcifiers): Modify accordingly.
24447         (array_type): Modify to actually return the complete type string
24448         instead of ignoring the rank_specifiers.
24449         (expression_list): Implement to collect the expressions
24450         (variable_initializer): Implement. We make it a list of expressions
24451         essentially so that we can handle the array_initializer case neatly too.
24452         (variable_initializer_list): Implement.
24453         (array_initializer): Make it a list of variable_initializers
24454         (opt_array_initializer): Modify accordingly.
24455
24456         * expression.cs (New::NType): Add enumeration to help us
24457         keep track of whether we have an object/delegate creation
24458         or an array creation.
24459         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24460         members to hold data about array creation.
24461         (New:New): Modify to update NewType
24462         (New:New): New Overloaded contructor for the array creation
24463         case.
24464
24465         * cs-parser.jay (array_creation_expression): Implement to call
24466         the overloaded New constructor.
24467
24468 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24469
24470         * class.cs (TypeContainer::Constructors): Return member
24471         constructors instead of returning null.
24472
24473 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24474
24475         * typemanager.cs (InitCoreTypes): Initialize the various core
24476         types after we have populated the type manager with the user
24477         defined types (this distinction will be important later while
24478         compiling corlib.dll)
24479
24480         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24481         on Expression Classification.  Now all expressions have a method
24482         `Resolve' and a method `Emit'.
24483
24484         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24485         generation from working.     Also add some temporary debugging
24486         code. 
24487
24488 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24489
24490         * codegen.cs: Lots of code generation pieces.  This is only the
24491         beginning, will continue tomorrow with more touches of polish.  We
24492         handle the fundamentals of if, while, do, for, return.  Others are
24493         trickier and I need to start working on invocations soon.
24494
24495         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24496         s.InitStatement. 
24497
24498         * codegen.cs (EmitContext): New struct, used during code
24499         emission to keep a context.   Most of the code generation will be
24500         here. 
24501
24502         * cs-parser.jay: Add embedded blocks to the list of statements of
24503         this block.  So code generation proceeds in a top down fashion.
24504
24505 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24506
24507         * statement.cs: Add support for multiple child blocks.
24508
24509 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24510
24511         * codegen.cs (EmitCode): New function, will emit the code for a
24512         Block of code given a TypeContainer and its ILGenerator. 
24513
24514         * statement.cs (Block): Standard public readonly optimization.
24515         (Block::Block constructors): Link children. 
24516         (Block::Child): Child Linker.
24517         (Block::EmitVariables): Emits IL variable declarations.
24518
24519         * class.cs: Drop support for MethodGroups here, delay until
24520         Semantic Analysis.
24521         (Method::): Applied the same simplification that I did before, and
24522         move from Properties to public readonly fields.
24523         (Method::ParameterTypes): Returns the parameter types for the
24524         function, and implements a cache that will be useful later when I
24525         do error checking and the semantic analysis on the methods is
24526         performed.
24527         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24528         and made a method, optional argument tells whether this is a class
24529         or a structure to apply the `has-this' bit.
24530         (Method::GetCallingConvention): Implement, returns the calling
24531         convention. 
24532         (Method::Define): Defines the type, a second pass is performed
24533         later to populate the methods.
24534
24535         (Constructor::ParameterTypes): implement a cache similar to the
24536         one on Method::ParameterTypes, useful later when we do semantic
24537         analysis. 
24538
24539         (TypeContainer::EmitMethod):  New method.  Emits methods.
24540
24541         * expression.cs: Removed MethodGroup class from here.
24542
24543         * parameter.cs (Parameters::GetCallingConvention): new method.
24544
24545 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24546
24547         * class.cs (TypeContainer::Populate): Drop RootContext from the
24548         argument. 
24549
24550         (Constructor::CallingConvention): Returns the calling convention.
24551         (Constructor::ParameterTypes): Returns the constructor parameter
24552         types. 
24553
24554         (TypeContainer::AddConstructor): Keep track of default constructor
24555         and the default static constructor.
24556
24557         (Constructor::) Another class that starts using `public readonly'
24558         instead of properties. 
24559
24560         (Constructor::IsDefault): Whether this is a default constructor. 
24561
24562         (Field::) use readonly public fields instead of properties also.
24563
24564         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24565         track of static constructors;  If none is used, turn on
24566         BeforeFieldInit in the TypeAttributes. 
24567
24568         * cs-parser.jay (opt_argument_list): now the return can be null
24569         for the cases where there are no arguments. 
24570
24571         (constructor_declarator): If there is no implicit `base' or
24572         `this', then invoke the default parent constructor. 
24573
24574         * modifiers.cs (MethodAttr): New static function maps a set of
24575         modifiers flags into a MethodAttributes enum
24576         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24577         MethodAttr, TypeAttr to represent the various mappings where the
24578         modifiers are used.
24579         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24580
24581 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24582
24583         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24584         method arguments.
24585
24586         * interface.cs (PopulateIndexer): Implemented the code generator
24587         for interface indexers.
24588
24589 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24590
24591         * interface.cs (InterfaceMemberBase): Now we track the new status
24592         here.  
24593
24594         (PopulateProperty): Implement property population.  Woohoo!  Got
24595         Methods and Properties going today. 
24596
24597         Removed all the properties for interfaces, and replaced them with
24598         `public readonly' fields. 
24599
24600 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24601
24602         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24603         initialize their hashtables/arraylists only when they are needed
24604         instead of doing this always.
24605
24606         * parameter.cs: Handle refs and out parameters.
24607
24608         * cs-parser.jay: Use an ArrayList to construct the arguments
24609         instead of the ParameterCollection, and then cast that to a
24610         Parameter[] array.
24611
24612         * parameter.cs: Drop the use of ParameterCollection and use
24613         instead arrays of Parameters.
24614
24615         (GetParameterInfo): Use the Type, not the Name when resolving
24616         types. 
24617
24618 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24619
24620         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24621         and instead use public readonly fields.
24622
24623         * class.cs: Put back walking code for type containers.
24624
24625 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24626
24627         * class.cs (MakeConstant): Code to define constants.
24628
24629         * rootcontext.cs (LookupType): New function.  Used to locate types 
24630
24631
24632 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24633
24634         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24635         this System.Reflection code is.  Kudos to Microsoft
24636
24637         * typemanager.cs: Implement a type cache and avoid loading all
24638         types at boot time.  Wrap in LookupType the internals.  This made
24639         the compiler so much faster.  Wow.  I rule!
24640
24641         * driver.cs: Make sure we always load mscorlib first (for
24642         debugging purposes, nothing really important).
24643
24644         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24645         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24646
24647         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24648         on namespaces that have been imported using the `using' keyword.
24649
24650         * class.cs (TypeContainer::TypeAttr): Virtualize.
24651         (Class::TypeAttr): Return attributes suitable for this bad boy.
24652         (Struct::TypeAttr): ditto.
24653         Handle nested classes.
24654         (TypeContainer::) Remove all the type visiting code, it is now
24655         replaced with the rootcontext.cs code
24656
24657         * rootcontext.cs (GetClassBases): Added support for structs. 
24658
24659 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24660
24661         * interface.cs, statement.cs, class.cs, parameter.cs,
24662         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24663         Drop use of TypeRefs, and use strings instead.
24664
24665 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24666
24667         * rootcontext.cs: 
24668
24669         * class.cs (Struct::Struct): set the SEALED flags after
24670         checking the modifiers.
24671         (TypeContainer::TypeAttr): new property, returns the
24672         TypeAttributes for a class.  
24673
24674         * cs-parser.jay (type_list): Oops, list production was creating a
24675         new list of base types.
24676
24677         * rootcontext.cs (StdLib): New property.
24678         (GetInterfaceTypeByName): returns an interface by type name, and
24679         encapsulates error handling here.
24680         (GetInterfaces): simplified.
24681         (ResolveTree): Encapsulated all the tree resolution here.
24682         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24683         types. 
24684
24685         * driver.cs: Add support for --nostdlib, to avoid loading the
24686         default assemblies.
24687         (Main): Do not put tree resolution here. 
24688
24689         * rootcontext.cs: Beginning of the class resolution.
24690
24691 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * rootcontext.cs: Provide better error reporting. 
24694
24695         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24696
24697         * rootcontext.cs (CreateInterface): Handle the case where there
24698         are no parent interfaces.
24699
24700         (CloseTypes): Routine to flush types at the end.
24701         (CreateInterface): Track types.
24702         (GetInterfaces): Returns an array of Types from the list of
24703         defined interfaces.
24704
24705         * typemanager.c (AddUserType): Mechanism to track user types (puts
24706         the type on the global type hash, and allows us to close it at the
24707         end). 
24708
24709 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24710
24711         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24712         RecordInterface instead.
24713
24714         * cs-parser.jay: Updated to reflect changes above.
24715
24716         * decl.cs (Definition): Keep track of the TypeBuilder type that
24717         represents this type here.  Not sure we will use it in the long
24718         run, but wont hurt for now.
24719
24720         * driver.cs: Smaller changes to accomodate the new code.
24721
24722         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24723         when done. 
24724
24725         * rootcontext.cs (CreateInterface):  New method, used to create
24726         the System.TypeBuilder type for interfaces.
24727         (ResolveInterfaces): new entry point to resolve the interface
24728         hierarchy. 
24729         (CodeGen): Property, used to keep track of the code generator.
24730
24731 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24732
24733         * cs-parser.jay: Add a second production for delegate_declaration
24734         with `VOID'.
24735
24736         (enum_body): Put an opt_comma here instead of putting it on
24737         enum_body or enum_member_declarations so we can handle trailing
24738         commas on enumeration members.  Gets rid of a shift/reduce.
24739
24740         (type_list): Need a COMMA in the middle.
24741
24742         (indexer_declaration): Tell tokenizer to recognize get/set
24743
24744         * Remove old targets.
24745
24746         * Re-add the parser target.
24747
24748 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24749
24750         * cs-parser.jay: Add precendence rules for a number of operators
24751         ot reduce the number of shift/reduce conflicts in the grammar.
24752
24753 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24754
24755         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24756         and put it here.
24757
24758         Get rid of old crufty code.
24759
24760         * rootcontext.cs: Use this to keep track of the parsed
24761         representation and the defined types available to the program. 
24762
24763         * gen-treedump.cs: adjust for new convention.
24764
24765         * type.cs: Split out the type manager, and the assembly builder
24766         from here. 
24767
24768         * typemanager.cs: the type manager will live here now.
24769
24770         * cil-codegen.cs: And the code generator here. 
24771
24772 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24773
24774         * makefile: Fixed up for easy making.
24775
24776 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24777
24778         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24779         the 
24780
24781         (unary_expression): Expand pre_increment_expression and
24782         post_decrement_expression to reduce a shift/reduce.
24783
24784 2001-07-11  Simon Cozens
24785
24786         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24787
24788         Improve allow_keyword_as_indent name.
24789
24790 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24791
24792         * Adjustments for Beta2. 
24793
24794 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24795
24796         * decl.cs: Added `Define' abstract method.
24797         (InTransit): new property, used to catch recursive definitions. 
24798
24799         * interface.cs: Implement `Define'. 
24800
24801         * modifiers.cs: Map Modifiers.constants to
24802         System.Reflection.TypeAttribute flags.
24803
24804         * class.cs: Keep track of types and user-defined types.
24805         (BuilderInit): New method for creating an assembly
24806         (ResolveType): New function to launch the resolution process, only
24807         used by interfaces for now.
24808
24809         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24810         that are inserted into the name space. 
24811
24812 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24813
24814         * ARGH.  I have screwed up my tree so many times due to the use of
24815         rsync rather than using CVS.  Going to fix this at once. 
24816
24817         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24818         load types.
24819
24820 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24821
24822         * Experiment successful: Use System.Type rather that our own
24823         version of Type.  
24824
24825 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24826
24827         * cs-parser.jay: Removed nsAliases from here.
24828
24829         Use new namespaces, handle `using XXX;' 
24830
24831         * namespace.cs: Reimplemented namespace handling, use a recursive
24832         definition of the class.  Now we can keep track of using clauses
24833         and catch invalid using clauses.
24834
24835 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24836
24837         * gen-treedump.cs: Adapted for all the renaming.
24838
24839         * expression.cs (Expression): this class now has a Type property
24840         which returns an expression Type.
24841
24842         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24843         `Type', as this has a different meaning now in the base
24844
24845 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24846
24847         * interface.cs, class.cs: Removed from all the sources the
24848         references to signature computation, as we can not do method
24849         signature computation during the parsing time, as we are not
24850         trying to solve at that point distinguishing:
24851
24852         class X {
24853                 void a (Blah x) {}
24854                 void a (NS.Blah x) {}
24855         }
24856
24857         Which depending on the context might be valid or not, as we do not
24858         know if Blah is the same thing as NS.Blah at that point.
24859
24860         * Redid everything so the code uses TypeRefs now instead of
24861         Types.  TypeRefs are just temporary type placeholders, that need
24862         to be resolved.  They initially have a pointer to a string and the
24863         current scope in which they are used.  This is used later by the
24864         compiler to resolve the reference to an actual Type. 
24865
24866         * DeclSpace is no longer a CIR.Type, and neither are
24867         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24868         are all DeclSpaces, but no Types. 
24869
24870         * type.cs (TypeRefManager): This implements the TypeRef manager,
24871         which keeps track of all the types that need to be resolved after
24872         the parsing has finished. 
24873
24874 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24875
24876         * ARGH.  We are going to have to store `foreach' as a class rather
24877         than resolving it, as we need to verify error 1579 after name
24878         resolution.   *OR* we could keep a flag that says `This request to
24879         IEnumerator comes from a foreach statement' which we can then use
24880         to generate the error.
24881
24882 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24883
24884         * class.cs (TypeContainer.AddMethod): we now add methods to the
24885         MethodGroup instead of the method hashtable.  
24886
24887         * expression.cs: Add MethodGroup abstraction, which gets us one
24888         step closer to the specification in the way we handle method
24889         declarations.  
24890
24891         * cs-parser.jay (primary_expression): qualified_identifier now
24892         tried to match up an identifier to a local variable reference or
24893         to a parameter reference.
24894
24895         current_local_parameters is now a parser global variable that
24896         points to the current parameters for the block, used during name
24897         lookup.
24898
24899         (property_declaration): Now creates an implicit `value' argument to
24900         the set accessor.
24901
24902 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24903
24904         * parameter.cs: Do not use `param' arguments as part of the
24905         signature, per the spec.
24906
24907 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24908
24909         * decl.cs: Base class for classes, structs and interfaces.  This
24910         is the "Declaration Space" 
24911
24912         * cs-parser.jay: Use CheckDef for checking declaration errors
24913         instead of having one on each function.
24914
24915         * class.cs: Factor out some code for handling error handling in
24916         accordance to the "Declarations" section in the "Basic Concepts"
24917         chapter in the ECMA C# spec.
24918
24919         * interface.cs: Make all interface member classes derive from
24920         InterfaceMemberBase.
24921
24922 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24923
24924         * Many things: all interfaces are parsed and generated in
24925         gen-treedump.  Support for member variables, constructors,
24926         destructors, properties, constants is there.
24927
24928         Beginning of the IL backend, but very little done, just there for
24929         testing purposes. 
24930
24931 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24932
24933         * cs-parser.jay: Fix labeled statement.
24934
24935         * cs-tokenizer.cs (escape): Escape " and ' always.
24936         ref_line, ref_name: keep track of the line/filename as instructed
24937         by #line by the compiler.
24938         Parse #line.
24939
24940 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24941
24942         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24943         to match the values in System.CodeDOM.
24944
24945         Divid renamed to Divide.
24946
24947         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24948         statements. 
24949         (Statements.set): remove.
24950
24951         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24952         statements. 
24953
24954         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24955         falseStatements always have valid values. 
24956
24957         * cs-parser.jay: Use System.CodeDOM now.
24958