2007-01-01 Miguel de Icaza <miguel@novell.com>
[mono.git] / mcs / mcs / ChangeLog
1 2007-01-01  Miguel de Icaza  <miguel@novell.com>
2
3         * Everywhere that called Error_ValueCannotBeConverted: pass a new
4         EmitContext.
5
6         Exceptions: Null.ConvertImplicitly,
7         Constant.ImplicitConversionRequired as there are too many call
8         sites for passing the ec. 
9
10         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
11         EmitContext, if the value is null, then we do not try to provide
12         the extra information from the error (If a userdefined conversion
13         exists, as UserDefinedConversion requires a non null-EmitContext).
14
15         Fixes: #80347
16
17 2006-12-30  Raja R Harinath  <rharinath@novell.com>
18
19         * flowanalysis.cs (MyBitVector): Document some invariants.
20         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
21         introduced below, and add a couple of others, 
22
23 2006-12-30  Marek Safar  <marek.safar@gmail.com>
24
25         * attribute.cs (GetMethodObsoleteAttribute): Uses new
26         GetPropertyFromAccessor and GetEventFromAccessor.
27         
28         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
29         overrides non-obsolete one.
30         (Indexer.Define): Error message has been moved to the parser.
31
32         * cs-parser.jay: Better syntax errors handling.
33
34         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
35         when an invocation has no arguments.
36
37         * ecore.cs: Removed not used caching.
38
39         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
40         implementation.
41
42         * report.cs: Add a new warning.
43
44         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
45
46         * typemanager.cs (enumeration_type): Removed.
47         (CSharpSignature): Reuses IsSpecialMethod.
48         (IsEqual): Hack for MS BCL.
49         (GetPropertyFromAccessor): New method.
50         (GetEventFromAccessor): New method.
51         (IsSpecialMethod): Fixed to handle more cases.
52
53 2006-12-30  Marek Safar  <marek.safar@gmail.com>
54
55         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
56         Made white spaces array static.
57
58         * ecore.cs (RemoveGenericArity): Optimized.
59
60         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
61         10 times faster).
62         (MyBitVector.initialize_vector): Simplified.
63
64 2006-12-22  Miguel de Icaza  <miguel@novell.com>
65
66         * ecore.cs: Am not entirely happy with this hack, but it seems to
67         address the issue in 80257 (a small test case for
68         CreativeDocs.NET). 
69
70         I set the MethodGroupExpr.Type to an internal compiler type
71         (itself in this case) to force the resolution to take place.   Why
72         it does not take place with a null is beyond me.
73
74 2006-12-20  Marek Safar  <marek.safar@gmail.com>
75
76         A fix for bug #80288
77         * expression.cs (ResolveOperator): Consider user defined conversion for
78         logical and operator too.
79         (EmitBranchable): Optimization for logical and when full constant folding
80         could not be applied but one operand is constant.
81
82 2006-12-19  Marek Safar  <marek.safar@gmail.com>
83
84         * class.cs (GetClassBases): Write 5 times every day, will never use
85         FullName for error reporting.
86
87         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
88
89 2006-12-19  Martin Baulig  <martin@ximian.com>
90
91         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
92         the symbol file info here.
93
94 2006-12-18  Marek Safar  <marek.safar@gmail.com>
95
96         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
97         of `elseif' is taking then following sections are not taking.
98         Fixes an issue reported on mono mailing list.
99
100 2006-12-18  Marek Safar  <marek.safar@gmail.com>
101
102         A fix for bug #80300
103         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
104         a caller is not taking.
105
106 2006-12-18  Raja R Harinath  <rharinath@novell.com>
107
108         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
109         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
110         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
111         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
112         * class.cs: Update to changes.
113
114 2006-12-17  Marek Safar  <marek.safar@gmail.com>
115
116         A fix for bug #79934
117         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
118         partial container.
119
120         * class.cs (ResolveMembers): Register an iterator in current container and
121         not in shared one.
122
123 2006-12-16  Raja R Harinath  <rharinath@novell.com>
124
125         Fix test-543.cs
126         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
127         satisfy a params annotated parameter.
128
129 2006-12-16  Marek Safar  <marek.safar@gmail.com>
130
131         A fix for bug #77014
132         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
133         paramters correctly and not rely on hacks in Parameters class.
134         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
135         at any possition.
136         (Invocation.VerifyArgumentsCompat): Ditto.
137         (Invocation.EmitArguments): Changed to correctly emit params arguments at
138         any possition.
139
140         * parameter.cs (HasParams): Don't assume that params is the last one.
141
142         * support.cs (ReflectionParameters.ctor): Look for params attribute
143         correctly.
144         (ReflectionParameters.ParameterType): Removed hack when we returned last
145         parameter for out of range parameters.
146         (ParameterName, ParameterModifier): Ditto.
147
148 2006-12-14  Marek Safar  <marek.safar@gmail.com>
149
150         A fix for bug #79987
151         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
152         when assembly is not CLS compliant but type is. I have no idea why is this
153         allowed.
154
155         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
156
157 2006-12-13  Miguel de Icaza  <miguel@novell.com>
158
159         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
160         in struct constructors, they are basically no-ops.
161
162 2006-12-12  Marek Safar  <marek.safar@gmail.com>
163
164         * cs-tokenizer.cs (Position): Save preprocessor status too.
165
166 2006-12-12  Marek Safar  <marek.safar@gmail.com>
167
168         A fix for bug #77794
169         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
170
171 2006-12-12  Marek Safar  <marek.safar@gmail.com>
172
173         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
174         Fixes #69299.
175         (pp_expr): Report error for an invalid expression.
176         (handle_preprocessing_directive): Simplified; add more error checking.
177
178 2006-12-11  Marek Safar  <marek.safar@gmail.com>
179
180         A fix for bug #74939
181         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
182         directives handling.
183
184 2006-12-10  Marek Safar  <marek.safar@gmail.com>
185
186         A fix for bugs #80093, and #75984
187         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
188         logic, it seems to me as it worked before "by coincidence".
189         (xtoken): Simplified to use reworked handle_preprocessing_directive.
190         (cleanup): Enabled endif check.
191
192 2006-12-09  Marek Safar  <marek.safar@gmail.com>
193
194         A fix for bug #80162
195         * statement.cs (CollectionForeach.TryType): Generics and non-generics
196         enumerators are never ambiguous.
197
198 2006-12-08  Raja R Harinath  <rharinath@novell.com>
199
200         Fix #80060
201         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
202
203 2006-12-06  Marek Safar  <marek.safar@gmail.com>
204
205         A fix for bug #80144
206         * class.cs (EventProperty.Define): Explicit implementation means
207         that an even is used.
208
209 2006-12-06  Marek Safar  <marek.safar@gmail.com>
210
211         Fixes the operators implementation (part II)
212
213         * cfold.cs (DoConstantNumericPromotions): Renamed to
214         DoBinaryNumericPromotions and simplified.
215         (BinaryFold): Couple of conversion fixes; simplified.
216
217         * constant.cs, ecore.cs, literal.cs
218         (ToType): Renamed to ConvertImplicitly.
219         (Reduce): Renamed to ConvertExplicitly.
220
221         * class.cs, convert.cs: Updated.
222
223         * expression.cs: TryReduce doesn't throw an exception.
224
225 2006-12-01  Marek Safar  <marek.safar@gmail.com>
226
227         A fix for bug #80108
228         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
229         compatible.
230
231 2006-11-30  Marek Safar  <marek.safar@gmail.com>
232
233         Fixes unary operators implementation (part I)
234         Also fixes #80026
235
236         * cfold.cs (Error_CompileTimeOverflow): Made internal
237
238         * const.cs (IConstant): Changed to use reference to constant and
239         not constant itself.
240         Updated IConstant implementations.
241
242         * constant.cs (CreateConstant): New factory method.
243         Updated IConstant implementation.
244
245         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
246
247         * ecore.cs: Updated to use CreateConstantReference.
248
249         * enum.cs: Reflects IConstant changes.
250
251         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
252
253         * literal.cs (NullConstant): Change to be independently usable.
254
255 2006-11-29  Martin Baulig  <martin@ximian.com>
256
257         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
258         we need to emit the scope initializer before calling the base .ctor.
259
260         * anonymous.cs: Merged back from the new anonymous methods branch.
261         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
262
263         * expression.cs (ParameterReference.DoResolveBase): Create a
264         "normal" ScopeInfo when capturing parameters rather than using the
265         root scope; this makes things work with anonymous methods having
266         parameters.
267
268         * statement.cs
269         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
270
271 2006-11-22  Marek Safar  <marek.safar@gmail.com>
272
273         A fix for bug #79987
274         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
275         check to a base class.
276         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
277         only when assembly has missing attribute.
278         * report.cs: Update.
279
280 2006-11-21  Marek Safar  <marek.safar@gmail.com>
281
282         * cs-tokenizer.cs: Merged with gmcs version.
283
284 2006-11-20  Marek Safar  <marek.safar@gmail.com>
285
286         * cs-tokenizer.cs,
287         * cs-parser.jay: Better error message when partial keyword is misplaced.
288
289 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
290
291         A fix for bug #79810
292         report.cs: CS1058 only applies to 2.0 profile (gmcs).
293         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
294         a RuntimeWrappedException by default.
295
296 2006-11-18  Marek Safar  <marek.safar@gmail.com>
297
298         A fix for bug #79843
299         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
300         implementation.
301         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
302
303 2006-11-18  Marek Safar  <marek.safar@gmail.com>
304
305         * driver.cs, namespace.cs: Uses faster IndexOf version.
306
307 2006-11-17  Marek Safar  <marek.safar@gmail.com>
308
309         A fix for bug #79941
310         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
311         operators.
312         (Operator.Define): Implicit/Explicit operator of same type is duplicate
313         even if internal name is different.
314         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
315         (UserDefinedConversion): Simplified as the operators cannot be internal.
316         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
317         conversions.
318         (MethodLookup): Replaced EmitContext with parentType.
319         * expression.cs: Updated.
320
321 2006-11-09  Raja R Harinath  <rharinath@novell.com>
322
323         * driver.cs (BadAssembly): Handle all the ugliness of
324         DefineDynamicAssembly.
325
326 2006-11-08  Raja R Harinath  <rharinath@novell.com>
327
328         Address parts of #58244 -- most of what's left is in the runtime
329         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
330         CS1509 error checks, and handle them for all assembly loads, not
331         just the first invocation.
332         (LoadModule): Likewise.  Move handling of 'adder_method' ...
333         * codegen.cs (AssemblyClass.AddModule): ... here.
334
335 2006-11-02  Marek Safar  <marek.safar@gmail.com>
336
337         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
338         IEnumerable<T> is ambiguous.
339
340 2006-10-31  Marek Safar  <marek.safar@gmail.com>
341
342         A fix for bug #67689
343         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
344         GetEnumerator is ambiguous.
345
346         * report.cs: Add new warning.
347
348 2006-10-29  Marek Safar  <marek.safar@gmail.com>
349
350         A fix for bug #78602
351         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
352         to protected member can be nested type.
353
354 2006-10-28  Marek Safar  <marek.safar@gmail.com>
355
356         A fix for bug #78965
357         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
358         to protected member must derive from current type.
359
360 2006-10-27  Marek Safar  <marek.safar@gmail.com>
361
362         assign.cs: Reuses error method.
363
364         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
365         instead of type for constants.
366         (Expression.Error_ValueAssignment): Common error method.
367
368         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
369         for any assignment.
370
371 2006-10-27  Marek Safar  <marek.safar@gmail.com>
372
373         A fix for bug #79081
374         * expression.cs (MemberAccess.DoResolve): Check nested type
375         accessibility.
376
377 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
378
379         * doc.cs : nested delegates were not handled. Fixed bug #79754.
380
381 2006-10-26  Marek Safar  <marek.safar@gmail.com>
382
383         A fix for bug #76591
384         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
385
386 2006-10-26  Marek Safar  <marek.safar@gmail.com>
387
388         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
389         type forwarder of the same type multiple times.
390
391 2006-10-26  Raja R Harinath  <rharinath@novell.com>
392
393         Fix #78820
394         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
395         instance as an rvalue, even when we later resolve as an lvalue.
396
397 2006-10-25  Martin Baulig  <martin@ximian.com>
398
399         * anonymous.cs: Fix #79673.
400
401 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
402
403         A fix for bug #79666
404         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
405         ignored when is optimized (= default value) as its value is already set.
406
407 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
408
409         A fix for bug #79724
410         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
411         TypeContainer for type lookup.
412
413 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
414
415         A fix for bug #79231
416         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
417         * expression.cs (OverloadResolve): Always convert type name for
418         an error message.
419         (ResolveNamespaceOrType): Don't confuse a nested type with any 
420         other member.
421
422 2006-10-18  Martin Baulig <martin@ximian.com>
423
424         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
425
426 2006-10-17  Miguel de Icaza  <miguel@novell.com>
427
428         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
429         an int32, but requesting an int64 from the conversion
430
431 2006-10-12  Martin Baulig  <martin@ximian.com>
432
433         * anonymous.cs
434         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
435         
436 2006-10-12  Martin Baulig  <martin@ximian.com>
437
438         * statement.cs
439         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
440
441 2006-10-11  Miguel de Icaza  <miguel@novell.com>
442
443         * convert.cs: Remove broken code: I was doing the "Existance"
444         tests for Implicit conversions.
445
446 2006-10-10  Miguel de Icaza  <miguel@novell.com>
447
448         * convert.cs: Added one missing case in
449         ImplicitStandardConversionExists uint64 to intptr.
450
451         Fixes #59800
452         
453         * typemanager.cs (uintptr_type): another core known type.   
454
455         * ecore.cs (OperatorCast): routine used to do cast operations that
456         depend on op_Explicit.  We could change some of the Decimal
457         conversions to use this.
458
459         This one has a probe mechanism that checks both types for an op_
460         which it coudl be used to eliminate two classes: CastToDecimal
461         and CastFromDecimal.
462
463         * convert.cs: Implement the conversions documented in #59800
464         
465 2006-10-10  Martin Baulig  <martin@ximian.com>
466
467         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
468         before RootScope.ResolveMembers().
469
470         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
471         `CurrentType' if appropriate.
472
473 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
474
475         A fix for bug #78568
476         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
477         when contains binary operators.
478         * cs-parser.jay: Updated.
479
480 2006-10-09  Martin Baulig  <martin@ximian.com>
481
482         * delegate.cs
483         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
484         moved that into Define() and also do the other type parameter
485         checks there.  Fixes #79094.  Added gtest-292.cs.
486
487         * expression.cs
488         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
489         since that doesn't include type parameters; don't use `Ldelema'
490         for type parameters.  Fixes #78980.  Added gtest-293.cs.
491
492 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
493
494         A fix for #77796
495         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
496         conversion is allowed.
497
498 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
499
500         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
501         error reporting when no error occurs.
502
503 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
504
505         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
506         does not exist.
507
508 2006-10-06  Raja R Harinath  <rharinath@novell.com>
509
510         Fix #79584
511         * class.cs (DefineTypeBuilder): Check circular dependencies before
512         setting the parent of the TypeBuilder.
513         (CheckRecursiveDefinition): Don't use 'BaseType', since
514         it may not be valid until after DefineTypeBuilder.  Use
515         'base_type' instead.
516
517 2006-10-04  Martin Baulig  <martin@ximian.com>
518
519         Merged the Anonymous Methods patch.
520
521         * anonymous.cs, iterators.cs: The new anonymous methods code.
522
523         * statement.cs (Variable): New public abstract class.
524         (LocalInfo.Variable): New public property.
525         (LocalInfo.ResolveVariable): New public method.
526         (Block.Flags): Add `IsIterator'.
527         (Block.AddVariable): Improved the CS0136 check.
528         (Block.AnonymousChildren): New public property.
529         (Block.AddAnonymousChild): New public method.
530         (ToplevelBlock): Update to use the new anonymous method framework.
531         (ToplevelBlock.ctor): `container' is now a `Block' and not a
532         `ToplevelBlock'; this is required to correctly implement the
533         CS0136 check.
534         (Fixed, Using): Use `TemporaryVariable' instead of directly
535         creating the `LocalBuilder'.
536
537         * parameter.cs (Parameter.ResolveVariable): New public method.
538         (Parameters.ResolveVariable): Likewise.
539
540         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
541
542         * class.cs (TypeContainer): Replaced the `iterators' list and
543         corresponding methods with a list of `CompilerGeneratedClass'es.
544         (TypeContainer.ResolveMembers): New public method.
545         (Method): `IIteratorContainer' has been replaced by
546         `IAnonymousHost'.
547
548         * expression.cs (VariableReference): New public abstract base
549         class for `LocalVariableReference', `ParameterReference' and
550         `This'.
551
552         * codegen.cs (EmitContext): Removed `capture_context',
553         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
554         (EmitContext.EmitThis): Removed.
555
556         * cs-parser.jay: Replace `iterator_container' with
557         `anonymous_host'.       
558
559 2006-10-04  Martin Baulig  <martin@ximian.com>
560
561         * generic.cs (GenericMethod): Don't make this abstract.
562         (Constraints.Clone): Added dummy implementation.
563
564 2006-10-04  Raja R Harinath  <harinath@gmail.com>
565
566         Fix #79577
567         * namespace.cs (LookForAnyGenericType): Avoid nullref on
568         'declspaces'.  Avoid allocating arrays willy-nilly.
569
570         Fix #79553
571         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
572         cases out of the switch.
573
574 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
575
576         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
577         message when non-generic type is used with the type arguments.
578         * expression.cs: Updated.
579
580 2006-09-28  Raja R Harinath  <rharinath@novell.com>
581
582         Fix #79013
583         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
584         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
585         Change semantics slightly.  Don't insist on having only one
586         temporary EmptyExpression -- just throttle the creation of new ones.
587
588         Fix #79451
589         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
590         non-interfaces too.  If no methods are found, don't try to create
591         a MethodGroupExpr.
592
593 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
594
595         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
596         generic type.
597
598         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
599         us produce better error message.
600
601 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
602
603         * expression.cs (Binary.ResolveOperator): Warn about a side effect
604         of the `|' operator.
605
606         * report.cs: A new warning added.
607
608 2006-09-27  Martin Baulig  <martin@ximian.com>
609
610         * generic.cs (GenericMethod): Don't make this abstract.
611
612 2006-09-27  Martin Baulig  <martin@ximian.com>
613
614         * report.cs
615         (InternalErrorException): Added overloaded ctor taking a params array.
616
617 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
618
619         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
620         Fixed the cases when same error was reported twice.
621
622         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
623         now report symbol information.
624
625 2006-09-25  Martin Baulig  <martin@ximian.com>
626
627         * class.cs: Completely unified with the gmcs version.
628
629 2006-09-25  Martin Baulig  <martin@ximian.com>
630
631         * typemanager.cs (TypeManager.IsNullableType): New public function.
632         (TypeManager.IsNullableTypeOf): Likewise.
633         (TypeManager.IsNullableValueType): Likewise.
634
635         * class.cs (MethodCore): Added the `GenericMethod' argument from
636         gmcs and also unified all classes derived from `MethodCore' with gmcs.
637
638 2006-09-24  Raja R Harinath  <harinath@gmail.com>
639
640         * convert.cs: Unify with gmcs version.
641
642 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
643
644         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
645         verify them as well.
646
647         * report.cs: New warning.
648
649 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
650
651         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
652         for anonymous block with out argument.
653
654 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
655
656         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
657         not used private events only.
658
659 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
660
661         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
662
663         * const.cs (Const.Define): Check for constant type.
664         (Const.IsConstantTypeValid): Looks for valid constant types.
665
666         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
667
668         * ecore.cs (EmptyConstantCast): New common class for all constant based
669         EmptyCast(s).
670
671         * expression.cs (Is.DoResolve): Handle null constant especially.
672         (New.DoResolve): Check for new void().
673         (MemberAccess.DoResolve): Cope with all kind of nulls.
674
675         * literal.cs (NullConstant): Uses EmptyConstantCast.
676         (NullDefault): Based on EmptyConstantCast.
677         (NullLiteral): Uses EmptyConstantCast.
678
679         * statement.cs (Block.ResolveMeta): Check for constant type.
680
681 2006-09-22  Martin Baulig  <martin@ximian.com>
682
683         * delegate.cs, attribute.cs: Merged with the gmcs versions.
684
685 2006-09-22  Raja R Harinath  <rharinath@novell.com>
686
687         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
688         not the null type.
689
690         Fix part of #79451
691         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
692         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
693         code slightly.
694
695 2006-09-22  Martin Baulig  <martin@ximian.com>
696
697         * ecore.cs: Merged with the gmcs version.
698
699         * generic.cs (ConstructedType): New dummy class.
700         (TypeArguments): Don't make this abstract.
701
702         * typemanager.cs
703         (TypeManager.IsGenericTypeDefinition): New method.
704         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
705
706 2006-09-22  Raja R Harinath  <rharinath@novell.com>
707
708         * expression.cs (ComposedCast): Check for arrays of TypedReference
709         before creating the type, not after.
710
711 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
712
713         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
714         after ToType change.
715
716         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
717         when constant must be implicitly convertible.
718
719         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
720
721         * ecore.cs (NullCast): Derives from NullConstant.
722
723         * expression.cs (Is.DoResolve): Removed useless variables.
724         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
725         (New.Constantify): Add enum support.
726         (MemberAccess.DoResolve): Add warning when accessing null constant or
727         variable.
728
729         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
730         property.
731
732         * literal.cs (NullConstant): New abstract class with common
733         functionality for all null specializations.
734         (NullDefault): Represents default(X) when result can be
735         reduced to null.
736         (NullLiteral): Updated.
737
738         * report.cs: Add new warning.
739
740 2006-09-21  Martin Baulig  <martin@ximian.com>
741
742         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
743
744 2006-09-21  Martin Baulig  <martin@ximian.com>
745
746         * generic.cs (GenericConstraints): New dummy class.
747         (Constraints): Likewise.
748         (TypeParameter): Likewise.
749         (TypeParameterName): Likewise.
750         (GenericMethod): Likewise.
751
752         * typemanager.cs (TypeManager.GetGenericArguments): New method.
753
754         * decl.cs: Merged with the gmcs version.
755
756 2006-09-21  Raja R Harinath  <rharinath@novell.com>
757
758         * generic.cs (TypeParameter): Implement IMemberContainer.
759         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
760
761         * rootcontext.cs: Unify with gmcs version.
762
763         * report.cs: Unify with gmcs version.
764         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
765         from gmcs/generics.cs.
766         * generics.cs (TypeParameter): New dummy class.
767
768         * support.cs: Unify with gmcs version.
769
770 2006-09-20  Raja R Harinath  <rharinath@novell.com>
771
772         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
773         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
774
775         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
776         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
777         * mcs.exe.sources: Add generic.cs.
778
779         * codegen.cs: Unify with gmcs version.
780
781         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
782         (EmitContext): Add GenericDeclContainer implementation.
783         * decl.cs (MemberCore, DeclSpace): Likewise.
784         * namespace.cs: Remove #ifdef GMCS_SOURCE.
785
786         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
787         MCS TypeManager has a corresponding dummy method.
788
789 2006-09-19  Martin Baulig  <martin@ximian.com>
790
791         * expression.cs: Completely merged with the gmcs version.
792
793 2006-09-19  Martin Baulig  <martin@ximian.com>
794
795         * expression.cs (Invocation): Merged with the gmcs version.
796         (ArrayAccess.GetStoreOpcode): Likewise.
797
798 2006-09-19  Martin Baulig  <martin@ximian.com>
799
800         * typemanager.cs
801         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
802         (TypeManager.IsGenericMethodDefinition): Likewise.
803
804 2006-09-19  Martin Baulig  <martin@ximian.com>
805
806         * typemanager.cs
807         (TypeManager.IsEqual): Moved the gmcs implementation here.
808         (TypeManager.DropGenericTypeArguments): Likewise.
809         (TypeManager.DropGenericMethodArguments): Likewise.
810         (TypeManager.GetTypeArguments): Moved here from gmcs.
811         (TypeManager.HasGenericArguments): Likewise.
812
813 2006-09-19  Martin Baulig  <martin@ximian.com>
814
815         * expression.cs (Binary): Merged with the gmcs version.
816
817 2006-09-19  Martin Baulig  <martin@ximian.com>
818
819         * expression.cs (Probe, As, Is): Merged with the gmcs version.
820
821 2006-09-19  Martin Baulig  <martin@ximian.com>
822
823         * typemanager.cs: Merged with the gmcs version.
824
825 2006-09-16  Raja R Harinath  <rharinath@novell.com>
826
827         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
828         * driver.cs: Likewise.
829
830 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
831
832         A fix for #79401
833         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
834         only if parent type is class.
835         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
836         update.
837
838 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
839
840         * cs-parser.jay,
841         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
842         keywords are used.
843         * typemanager.cs(CSharpName): Converts NullType to null.
844
845 2006-09-15  Martin Baulig  <martin@ximian.com>
846
847         * typemanager.cs
848         (TypeManager.GetMethodName): Added mcs implementation.
849         (TypeManager.IsEqual): Likewise.
850
851         * ecore.cs
852         (SimpleName.RemoveGenericArity): Added dummy implementation.
853
854         * pending.cs: Merged with the gmcs version.     
855
856 2006-09-15  Martin Baulig  <martin@ximian.com>
857
858         * statement.cs: Merge with the gmcs version.
859
860 2006-09-15  Martin Baulig  <martin@ximian.com>
861
862         * statement.cs (Switch): Merge with the gmcs implementation
863         (without nullables), which is newer.
864
865 2006-09-15  Martin Baulig  <martin@ximian.com>
866
867         * statement.cs (Block.Variables): Make this public.
868         (ToplevelBlock.Parameters): Make this a property.
869         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
870
871 2006-09-15  Martin Baulig  <martin@ximian.com>
872
873         * namespace.cs: Merge with the gmcs version.
874
875 2006-09-15  Martin Baulig  <martin@ximian.com>
876
877         * decl.cs (MemberName): Minor code cleanups.
878
879 2006-09-15  Martin Baulig  <martin@ximian.com>
880
881         * parameter.cs: Merge with the gmcs version.
882
883 2006-09-15  Martin Baulig  <martin@ximian.com>
884
885         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
886         and an error in mcs.
887
888 2006-09-15  Martin Baulig  <martin@ximian.com>
889
890         * flowanalysis.cs: Merged from GMCS; added the generics code into
891         a `GMCS_SOURCE' conditional so we can share this file.
892
893 2006-09-08  Martin Baulig  <martin@ximian.com>
894
895         * typemanager.cs (TypeManager.interlocked_type): New public field.
896         (TypeManager.int_interlocked_compare-exchange): New public field.
897         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
898         enumerator types here and call InitGenericCoreTypes().
899         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
900         after calling InitEnumUnderlyingTypes().
901
902         * rootcontext.cs
903         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
904         `classes_second_stage'. 
905
906 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
907
908         * assign.cs, ecore.cs, expression.cs: Share error message text.
909         * class.cs (FieldMember.Define): Check for varible of static type.
910         * driver.cs (LoadAssembly): Uses error output for errors.
911         * statement.cs: Updated.
912
913 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
914
915         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
916         type instance.
917
918 2006-09-07  Martin Baulig  <martin@ximian.com>
919
920         * driver.cs
921         (MainDriver): Revert r62663 from Marek; see #70506 for details.
922
923 2006-08-29  Miguel de Icaza  <miguel@novell.com>
924
925         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
926         
927 2006-08-17  Miguel de Icaza  <miguel@novell.com>
928
929         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
930         #52019 and #79064, the use of the \uXXXX sequence in source code
931         to represent unicode characters.
932
933 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
934
935         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
936         support.
937         * class.cs, ecore.cs, statement.cs: Merged to one error message.
938
939 2006-08-13  Miguel de Icaza  <miguel@novell.com>
940
941         * assign.cs: Catch attempts to assign to a method groups in += and
942         report as 1656
943
944 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
945
946         A fix for #79056
947         * cs-parser.jay: Don't destroy current array type by typeof of array's.
948
949 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
950
951         * class.cs (Method.Define): Issue a warning when generic method looks like
952         an entry point.
953         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
954         as well.
955
956 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
957  
958         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
959         looking for ctor.
960         * decl.cs (MemberCache.FindMembers): When container is interface we need to
961         search all base interfaces as a member can be ambiguous.
962         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
963         Constructor member type filter. 
964         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
965         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
966         reporting for returned memberinfos.
967         * report.cs: Updated.
968         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
969         version to work on all runtimes.
970         (TypeManager.RealMemberLookup): Removed members filtering.
971
972 2006-08-08  Raja R Harinath  <rharinath@novell.com>
973
974         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
975         (PropertyExpr.EmitAssign): Likewise.
976         * expression.cs (Indirection.EmitAssign): Likewise.
977         (LocalVariableReference.EmitAssign): Likewise.
978         (ParameterReference.EmitAssign): Likewise.
979         (Invocation.EmitArguments): Likewise.
980         (ArrayAccess.EmitAssign): Likewise.
981         (IndexerAccess.EmitAssign): Likewise.
982         (This.EmitAssign): Likewise.
983         (ConditionalLogicalOperator.Emit): Likewise.
984
985         Fix #79026
986         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
987         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
988         leave it in after returning it.
989         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
990
991 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
992
993         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
994         message.
995
996 2006-08-03  Raja R Harinath  <rharinath@novell.com>
997
998         Fix cs0146-3.cs and cs0146-4.cs.
999         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
1000         enclosing types don't depend on the current type.
1001
1002 2006-08-02  Raja R Harinath  <rharinath@novell.com>
1003
1004         Fix #77963
1005         * class.cs (TypeContainer.DoDefineMembers): Use
1006         FindBaseMemberWithSameName on Parent, since we're interested in
1007         whether we hide inherited members or not.
1008         (FindBaseMemberWithSameName): Make slightly more robust.
1009
1010         Fix the non-generic testcase from #77396
1011         * decl.cs (DeclSpace.DeclContainer): Remove override.
1012
1013         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
1014         declspaces for doppelgangers too.
1015         (UsingEntry): Implement IResolveContext.
1016         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
1017         'this' as the resolve context.
1018         (LocalAliasEntry): Likewise.
1019
1020         Implement parts of #77403
1021         * roottypes.cs (RootDeclSpace): New.  Used to represent the
1022         toplevel declaration space.  Each namespace declaration introduces
1023         a "partial" root declaretion space.
1024         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
1025         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
1026         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
1027         from 'current_namespace.SlaveDeclSpace'.
1028         (namespace_declaration): Likewise.
1029         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
1030         check.  It can't happen now.
1031         * decl.cs (DeclSpace.LookupType): Likewise.
1032         * driver.cs (MainDriver): Sanity check.
1033
1034 2006-08-01  Raja R Harinath  <rharinath@novell.com>
1035
1036         * decl.cs (DeclSpace.FindNestedType): Remove.
1037         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
1038         LookupTypeContainer to get the container of the nested type.
1039         * class.cs (TypeContainer.FindNestedType): Make non-override.
1040
1041 2006-07-31  Raja R Harinath  <rharinath@novell.com>
1042
1043         * decl.cs (DeclSpace.PartialContainer): Move field from ...
1044         * class.cs (TypeContainer.PartialContainer): ... here.
1045         (TypeContainer.AddBasesForPart): New helper.
1046         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
1047         instead.
1048         * cs-parser.jay (current_class): Convert to DeclSpace.
1049         (struct_declaration, interface_declaration, class_declaration):
1050         Use AddBasesForPart instead of .Bases directly.
1051         * const.cs, iterators.cs: Update to changes.
1052
1053 2006-07-28  Raja R Harinath  <rharinath@novell.com>
1054
1055         * class.cs (TypeContainer.AddMemberType): Rename from
1056         AddToTypeContainer.
1057         (TypeContainer.AddMember): Rename from AddToMemberContainer.
1058         (AddTypeContainer): New.  Combine AddClassOrStruct and
1059         AddInterface.
1060         (AddPartial): Update.  Add 'is_partial' argument.
1061         * roottypes.cs: Update to changes.
1062         * cs-parser.jay (push_current_class): New helper for handling
1063         current_container and current_class.
1064         (struct_declaration, interface_declaration, class_declaration):
1065         Use it.
1066
1067 2006-07-26  Raja R Harinath  <rharinath@novell.com>
1068
1069         * roottypes.cs: Rename from tree.cs.
1070
1071         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
1072         * tree.cs (Tree, ITreeDump): Remove types.
1073         * rootcontext.cs (tree, Tree): Remove fields.
1074         (root, ToplevelTypes): New.
1075         * *.cs: Update to rename.
1076
1077         * tree.cs (Tree.RecordDecl): Remove.
1078         (RootTypes.AddToTypeContainer): Record the toplevel type in its
1079         namespace here.
1080         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1081
1082 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1083
1084         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1085         DoFlowAnalysis and OmitStructFlowAnalysis here.
1086         (ec.With): Rename from WithUnsafe and generalize.
1087         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1088         (ec.WithFlowAnalyis): New.
1089         * ecore.cs, expression.cs, statement.cs: Update.
1090
1091 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1092
1093         * statement.cs (Block.ResolveMeta): Simplify slightly.
1094
1095         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1096         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1097         check_state to flags.
1098         (CheckState, ConstantCheckState): Update.
1099         (InUnsafe): New read-only property.
1100         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1101         arbitrary flags.
1102         (WithUnsafe): New helper similar to WithCheckState.
1103         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1104         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1105
1106 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1107
1108         Make comparisons use the same IL irrespective of whether they're
1109         in a 'checked' or 'unchecked' context: one of the issues in #78899
1110         * codegen.cs (EmitContext.CheckState): Make read-only property.
1111         (EmitContext.ConstantCheckState): Likewise.
1112         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1113         helper that implement a save/restore stack for CheckState
1114         values.  This is the only way to change check-state.
1115         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1116         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1117         (CheckedExpr.EmitBranchable): New forwarding method.
1118         (UnCheckedExpr): Likewise.
1119         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1120         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1121         (Checked.Resolve, checked.DoEmit): Likewise.
1122
1123 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1124
1125         * anonymous.cs: Cache the resolved anonymous delegate, and return
1126         this so that the ResolveTopBlock is only triggered once, not
1127         twice.
1128
1129         Currently we trigger ResolvetopBlock twice due to a first pass of
1130         argument check compatibility, and a second pass that does the
1131         actual resolution.   
1132         
1133 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1134
1135         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1136         modifiers.
1137         * rootcontext.cs (Reset): Add helper_classes.
1138
1139 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1140
1141         A fix for #78860
1142         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1143         correctly.
1144
1145 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1146
1147         * statement.cs (Lock): Handle expressions of type
1148         TypeManager.null_type specially.  Fixes #78770
1149
1150 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1151
1152         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1153         to an event.
1154
1155 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1156
1157         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1158         for accessors as well.
1159         * ecore.cs (EventExpr): Add AccessorTable.
1160
1161 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1162
1163         A fix for #78738
1164         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1165         for CS0122 where appropriate.
1166         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1167         level attributes.
1168         (Filter): Assembly can be null in the case of top level attributes.
1169
1170 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1171
1172         A fix for #78690
1173
1174         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1175         is done at global level.
1176
1177 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1178
1179         A fix for #77002, Implemented TypeForwarder support.
1180
1181         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1182         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1183         * typemanager.cs (): Add type_forwarder_attr_type.
1184
1185 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1186
1187         * report.cs: Add CS0469 warning.
1188
1189 2006-06-21  Martin Baulig  <martin@ximian.com>
1190
1191         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1192         the `try'-block, so we also report CS0016 etc. there.
1193
1194 2006-06-21  Martin Baulig  <martin@ximian.com>
1195
1196         * delegate.cs
1197         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1198
1199 2006-06-21  Martin Baulig  <martin@ximian.com>
1200
1201         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1202         also report CS1686 for parameters.
1203
1204 2006-06-21  Martin Baulig  <martin@ximian.com>
1205
1206         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1207         instead of an error if the value is not implicitly convertible to
1208         the switch types; fixes #77964.
1209
1210 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1211
1212         Fix #78673
1213         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1214         FieldBuilder is null.
1215
1216         Fix #78662
1217         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1218         'left' and 'right' before error-checking.
1219
1220 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1221
1222         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1223         Fixed bug #78601.
1224         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1225         (FieldExpr.DoResolve): likewise.
1226         (PropertyExpr.InstanceResolve): likewise.
1227         (EventExpr.InstanceResolve): likewise. 
1228
1229 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1230
1231         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1232         attribute applicable tests for attribute argument.
1233
1234 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1235
1236         Fix #78079
1237         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1238         (Binary.OverloadResolve_PredefinedIntegral): New.
1239         (Binary.OverloadResolve_PredefinedFloating): New.
1240         (Binary.OverloadResolve_PredefinedString): New.
1241         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1242         Follow the standard more closely, and treat numeric promotions in
1243         terms of overload resolution.
1244         (Binary.CheckShiftArguments): Simplify.
1245
1246 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1247
1248         * flowanalysis.cs (MyBitVector): Simplify representation.
1249         (MyBitVector.Clone): Avoid allocating BitArray.
1250         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1251         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1252         (*): Update.  Change all references to MyBitVector.And and
1253         MyBitVector.Or to &= and |=.
1254
1255 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1256
1257         Fix cs0231-[34].cs.
1258         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1259         to param arguments too.
1260
1261 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1262
1263         * cs-parser.jay: Catch another parsing form for arglist being
1264         followed by other arguments.  Fixes #78313.
1265
1266 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1267
1268         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1269         checking of out parameters to ...
1270         (FlowBranchingToplevel.Merge): ... here.
1271         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1272         set, propagate the origin upward, and only complain if there was
1273         no other error.
1274         (FlowBranchingException.AddContinueOrigin): Likewise.
1275         (FlowBranchingException.AddReturnOrigin): Likewise.
1276         (FlowBranchingException.AddGotoOrigin): Likewise.       
1277
1278 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1279
1280         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1281         unreachable, skip it.
1282         (FlowBranchingException.Merge): Always propagate jumps, even if
1283         the finally block renders subsequent code unreachable.
1284
1285 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1286
1287         Fix #77601
1288         * statement.cs (Goto.Resolve): Move responsibility for resolving
1289         'goto' to FlowBranching.AddGotoOrigin.
1290         (Goto.SetResolvedTarget): New.  Callback to set the
1291         LabeledStatement that's the target of the goto.
1292         (Goto.DoEmit): Use Leave instead of Br when crossing an
1293         unwind-protect boundary.
1294         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1295         LookupLabel and adjust to new semantics.
1296         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1297         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1298         Goto.SetResolvedTarget to update target.
1299         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1300         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1301         AddBreakOrigin & co.  Delay propagation until ...
1302         (FlowBranchingException.Merge): ... this.
1303
1304         * statement.cs (Block.Resolve): Always depend on flow-branching to
1305         determine unreachability.  Kill workaround that originally emitted
1306         only one statement after an "unreachable" label (see infloop in
1307         test-515.cs).
1308
1309         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1310         This is still "wrong", but anything better would probably need a
1311         multi-pass algorithm.
1312         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1313         usage vector.  Force current usage vector to be reachable, to
1314         optimistically signify backward jumps.
1315         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1316         detected.
1317         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1318         detected, return the original salted-away usage vector instead,
1319         updated with appropriate changes.  Print unreachable warning if
1320         necessary.
1321         * statement.cs (Block.Resolve): Don't print unreachable warning on
1322         a labeled statement.
1323
1324 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1325
1326         * driver.cs: Pass filename without path to AssemblyBuilder's 
1327         AddResourceFile. Fixes bug #78407.
1328
1329 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1330
1331         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1332         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1333         (FlowBranching.MergeChild): Overwrite
1334         reachability information from Labeled branchings too.
1335
1336 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1337
1338         * statement.cs (Goto.Resolve): Merge jump origins here ...
1339         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1340
1341         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1342         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1343         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1344         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1345         here, ...
1346         * statement.cs (Goto.Resolve): ... not here.
1347         (Goto.Emit): Remove CS1632 check.
1348
1349 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1350
1351         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1352         error message.
1353
1354 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1355
1356         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1357         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1358         (FlowBranchingException.Label): Likewise.
1359
1360         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1361         given value.
1362         (MyBitVector.Or): Use it to avoid losing information (Count).
1363         (FlowBranching.MergeOrigins): Likewise.
1364
1365         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1366         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1367         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1368         (UsageVector.ToString): Simplify.
1369         (UsageVector.MergeSiblings): Move here from ...
1370         (FlowBranching.Merge): ... here.
1371         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1372         not a MyBitVector.
1373
1374 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1375
1376         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1377         null bitvector is treated as all-true.
1378
1379         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1380         (MyBitVector): Rationalize invariants.  'vector != null' implies
1381         that we have our own copy of the bitvector.  Otherwise,
1382         'InheritsFrom == null' implies all inherited bits are true.
1383
1384 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1385
1386         * statement.cs (LocalInfo): Add IsConstant.
1387         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1388         local variable for constants.
1389
1390 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1391
1392         * flowanalysis.cs (MyBitVector.Empty): New.
1393         (MyBitVector): Don't allow InheritedFrom to be null.
1394         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1395         (UsageVector, FlowBranching): Update to changes.
1396
1397         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1398         recursion.  The 'Parent == null' condition isn't sufficient for
1399         anonymous methods.
1400         (FlowBranching.AddBreakOrigin): Likewise.
1401         (FlowBranching.AddContinueOrigin): Likewise.
1402         (FlowBranching.AddReturnOrigin): Likewise.
1403         (FlowBranching.StealFinallyClauses): Likewise.
1404         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1405         (FlowBranching.CheckOutParameters): Likewise.
1406         (FlowBranchingToplevel): Terminate all the above recursions here.
1407         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1408         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1409
1410         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1411         toplevel block.
1412         (FlowBranchingToplevel): New.  Empty for now.
1413         (FlowBranching.MergeTopBlock): Update.
1414         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1415         branching for the anonymous delegate.
1416         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1417
1418         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1419         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1420         information at the start of the merge.  Reorganize.
1421
1422 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1423
1424         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1425
1426 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1427
1428         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1429         to newly introduced ctor.
1430
1431         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1432         message to one place.
1433         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1434         global namespace.
1435
1436 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1437
1438         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1439
1440         * ecore.cs (Expression.ResolveAsConstant): Updated.
1441
1442         * statement.cs (ResolveMeta): Updated.
1443
1444 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1445
1446         * cs-parser.jay: __arglist cannot be used in initializer.
1447
1448 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1449
1450         A fix for #77879
1451         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1452         private types.
1453
1454 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1455
1456         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1457         (LabeledStatement): Add 'name' parameter.
1458         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1459         (Block.AddLabel): Update to changes.
1460         * cs-parser.jay (labeled_statement): Likewise.
1461
1462         * flowanalysis.cs (BranchingType.Labeled): New.
1463         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1464         (FlowBranchingLabeled): New.  Does nothing for now, but will
1465         eventually handle 'goto' flows.
1466         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1467         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1468         that's terminated ...
1469         (Block.Resolve): ... here.
1470
1471         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1472         (UsageVector.MergeFinallyOrigins): Likewise.
1473         (FlowBranching.InTryOrCatch): Likewise.
1474         (FlowBranching.AddFinallyVector): Likewise.
1475         (FlowBranchingException): Update to changes.
1476
1477         Fix #78290
1478         * statement.cs (Return.Resolve): Move error checking to ...
1479         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1480         (FlowBranchingException): Handle return origins like break and
1481         continue origins.
1482         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1483
1484 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1485
1486         A fix for #76122
1487         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1488         filter.
1489
1490 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1491
1492         A fix for #77543
1493         * class.cs (MethodData.Define): Do public accessor check only when method
1494         implements an interface.
1495
1496 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1497
1498         Remove special handling of 'break'
1499         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1500         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1501         (UsageVector.Break): Remove.
1502         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1503         reachability.
1504         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1505
1506         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1507         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1508
1509 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1510
1511         A fix for #75726
1512         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1513         be the interface member.
1514
1515 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1516
1517         A fix for #60069
1518         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1519         for emitting small (int) values.
1520
1521 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1522
1523         Fix #59427
1524         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1525         control-flow passes through the 'finally' after merging-in all the
1526         control-flows from 'try' and the 'catch' clauses.
1527
1528         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1529         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1530         always true at the only non-recursive entry point.
1531         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1532         FlowBranchingBreakable.
1533         (FlowBranchingLoop): Remove.
1534         * statement.cs (Return.DoResolve): Update to changes.
1535
1536         Fix #76471, #76665
1537         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1538         (FlowBranching.CreateBranching): Handle it: create a
1539         FlowBranchingContinuable.
1540         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1541         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1542         except that it handles the 'continue' command.
1543         (FlowBranching.UsageVector.MergeOrigins): Rename from
1544         MergeBreakOrigins.
1545         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1546         except that it overrides AddContinueOrigin.
1547         (FlowBranchingException): Override AddContinueOrigin, similar to
1548         AddBreakOrigin.
1549         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1550         Create a new branching around the embedded statement.
1551         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1552         control flow after the embedded statement.
1553         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1554
1555         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1556         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1557         FlowBranchingBreakable.
1558         (FlowBranchingSwitch): Remove.
1559
1560         Fix test-503.cs
1561         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1562         error reporting to ...
1563         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1564         Rename from 'AddBreakVector'.  Add new location argument.  Return
1565         a bool indicating whether the 'break' crosses an unwind-protect.
1566         (FlowBranchingException.AddBreakOrigin): Add.
1567         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1568         flowbranching after updating with the effects of the 'finally'
1569         clause.
1570         (FlowBranchingBreakable): New common base class for
1571         FlowBranchingLoop and FlowBranchingSwitch.
1572
1573         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1574         embedded statement.
1575         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1576
1577 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1578
1579         * statement.cs (Do.Resolve): If the loop is infinite, set the
1580         barrier.
1581         (While.Resolve, For.Resolve): Set a barrier after the embedded
1582         statement.  There's no direct control flow that goes from the end
1583         of the embedded statement to the end of the loop.
1584         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1585         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1586         above ensure that the reachability is correctly computed.
1587
1588         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1589         (UsageVector.MergeBreakOrigins): If the current path is
1590         unreachable, treat it as if all parameters/locals are initialized.
1591         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1592         infinite loops before merging-in break origins.
1593
1594         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1595         (Reachability.Reachable): Split part into ...
1596         (Reachability.Unreachable): ... this.  Simplify.
1597         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1598
1599         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1600         (Reachability.SetThrowsSometimes): Likewise.
1601         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1602         TriState.Always, use corresponding property.
1603         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1604         (Block.Resolve): Likewise.  Remove some redundant checks.
1605
1606 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1607
1608         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1609         (Reachability.Meet): Don't bother checking AlwaysThrows --
1610         barrier is always set.
1611         (FlowBranchingBlock.Merge): Likewise.
1612
1613 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1614
1615         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1616         checks for unreachable.
1617
1618 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1619
1620         A fix for #77980
1621         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1622
1623         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1624         whether field is really assigned.
1625
1626 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1627
1628         * flowanalysis.cs (Reachability): Make 4-argument constructor
1629         private.
1630         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1631         (Reachability.Always): Rename from the highly misleading
1632         'Reachability.Never'.
1633         (FlowBranching.Merge): Update to changes.  Mark an impossible
1634         situation with a 'throw'.
1635         (*): Update to changes.
1636
1637 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1638
1639         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1640         Remove 'Undefined'.
1641         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1642         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1643         (*): Update to changes.
1644         * statement.cs: Update to changes.
1645
1646 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1647
1648         A fix for #78049
1649         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1650
1651 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1652
1653         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1654         dummy UsageVector.
1655
1656         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1657         argument to two arguments: an usage-vector and a bool.  Move call
1658         to FlowBranching.Merge () ...
1659         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1660
1661         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1662         handling of loop and switch reachability to ...
1663         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1664
1665 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1666
1667         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1668         handling to FlowBranchingLoop.InLoop.
1669         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1670
1671 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1672
1673         A fix for #78115
1674         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1675         anonymous method is allowed from AnonymousContainer here.
1676
1677         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1678
1679 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1680
1681         Fix #78156
1682         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1683
1684 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1685
1686         A fix for #49011.
1687         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1688         (DoubleConstant.Reduce): Ditto.
1689
1690 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1691
1692         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1693         Remove 'lvalue_right_side' argument.  Move parts to ...
1694         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1695         (LocalVariable.DoResolveLValue): ... these.
1696
1697 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1698
1699         Fix cs1655.cs
1700         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1701         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1702         (LocalVariableReference.DoResolveBase): Use it to implement new
1703         CS1655 check.
1704         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1705         (Argument.Resolve): Simplify.  Move CS1510 check ...
1706         * ecore.cs (Expression.ResolveLValue): ... here.
1707         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1708         (PropertyExpr.DoResolveLValue): Likewise.
1709         (FieldExpr.Report_AssignToReadonly): Likewise.
1710         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1711         LValueMemberAccess or LValueMemberOutAccess on instance depending
1712         on it.
1713         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1714         DoResolve as appropriate.
1715
1716 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1717
1718         Fix #75800
1719         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1720         implicit conversions on 'out' and 'ref' arguments.
1721
1722         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1723         improve clarity.  Remove dead code.
1724
1725         Fix #66031
1726         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1727         (Catch.Resolve): Resolve VarBlock if it exists.
1728
1729 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1730
1731         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1732         twice, this was some residual code, the enumerator was emitted
1733         properly in the two branche of if later.
1734
1735 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1736
1737         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1738         cast is never an lvalue.
1739         (Cast.DoResolve, Cast.ResolveRest): Combine.
1740         (Argument.Emit): Simplify slightly.  Move 'Expr is
1741         IMemoryLocation' check ...
1742         (Argument.Resolve): ... here.
1743         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1744
1745         Simplifications.  Fix cs0191-2.cs
1746         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1747         CS1649 and CS1651 to ...
1748         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1749         the actual selection of the error code and message to a lookup
1750         table.  Add a dummy return value to simplify callsites.
1751         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1752         readonly fields of other instances of the same type.  Move CS0197
1753         warning from ...
1754         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1755         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1756         resolution of an out or ref argument.  The code simplification
1757         above uses this invariant.
1758
1759 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1760
1761         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1762         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1763         CheckMarshallByRefAccess.  Drop parameter.
1764         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1765         warning.
1766         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1767         InstanceExpression.
1768         * report.cs (AllWarnings): Add CS1690.
1769         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1770         for ref access too.
1771         (LocalVariableReference.DoResolveBase): Update.
1772
1773 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1774
1775         * class.cs (MethodOrOperator): Moved common parts from method class.
1776         detect obsolete attributes.
1777         (Method.Define): Simplified as it reuses code from base.
1778         (Constructor.ValidAttributeTargets): Fixed issue found during
1779         refactoring.
1780         (Destructor.ValidAttributeTargets): Fixed issue found during
1781         refactoring.
1782         (Operator): Finished refactoring set off by #78020. Operator class is now
1783         ordinary method class.
1784
1785         * anonymous.cs: Updated.
1786
1787         * decl.cs (DeclSpace): Add IsGeneric
1788
1789 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1790
1791         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1792
1793 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1794
1795         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1796         detect obsolete attributes.
1797         (Method.CreateEmitContext): Moved to MethodOrOperator.
1798
1799 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1800
1801         A fix for #78048.
1802         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1803         customized exception to make crash detection easier.
1804         (MethodOrOperator): Started to work on new base class for methods and
1805         operators.
1806         (Method): Derives from MethodOrOperator.
1807         (Constructor.Emit): Emits its own attributes.
1808         (AbstractPropertyEventMethod.Emit): Ditto.
1809         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1810         patch.
1811         (Operator.Emit): It's temporary more tricky than should be.
1812         
1813         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1814
1815         * report.cs (InternalErrorException): Add ctor with inner exception.
1816
1817 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1818
1819         A fix for #76744.
1820         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1821         only not visible.
1822
1823 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1824
1825         A fix for #77916.
1826         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1827         array.
1828
1829 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1830
1831         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1832         attribute is present and Guid not.
1833         (Interface.ApplyAttributeBuilder): Ditto.
1834
1835         * attribute.cs: Add error message.
1836
1837 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1838
1839         A fix for #78020.
1840
1841         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1842         sources (it's composite) so hold them in extra array as they are used in
1843         Emit phase only. It worked in the previous versions by mistake.
1844         (Attribute.Emit): Emit attribute for more owners when exist.
1845
1846         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1847         it has now different behaviour.
1848
1849 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1850
1851         * constant.cs (Constant.IsDefaultInitializer): New method.
1852
1853         * class.cs: Updated.
1854
1855         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1856         re-initialize default values. It saves KBs almost for every assembly.
1857         Thanks Zoltan for the idea.
1858         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1859         (ArrayCreation.DoResolve): Resolve only once.
1860         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1861         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1862
1863 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1864
1865         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1866         From #77961.
1867
1868 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1869
1870         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1871         in an embedded statement too.
1872
1873 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1874
1875         Fix #77958
1876         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1877
1878 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1879
1880         A fix for #77966.
1881
1882         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1883         was not specified.
1884
1885         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1886
1887 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1888
1889         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1890         phase.
1891
1892         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1893         LocalTemporary change.
1894
1895         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1896         TypeContainer.
1897         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1898         initializers optimization.
1899         (ClassOrStruct.TypeAttr): Moved from modifiers.
1900         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1901         (FieldBase.ResolveInitializer): Resolves initializer.
1902         (FieldBase.HasDefaultInitializer): New property.
1903
1904         * cs-parser.jay: Removed message.
1905
1906         * expression.cs (CompilerGeneratedThis): New specialization.
1907
1908         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1909
1910 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1911
1912         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1913
1914 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1917         be now EnumConstants only.
1918
1919 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1920
1921         * attribute.cs, driver.cs: Reset more caches.
1922
1923 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1924
1925         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1926
1927 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1928
1929         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1930         for easier reuse. Updated all overrides.
1931         (IntegralConstant): New base class for all integral constants.
1932         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1933         of the constant range, report custom error.
1934         (UIntConstant.Reduce): Fixed uint conversion.
1935
1936         * ecore.cs, literal.cs: Reduce updates.
1937
1938 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1939
1940         A fix for #75813.
1941
1942         * class.cs (Constructor.Define): Removed extra if for default ctors.
1943         A patch from Atsushi Enomoto.
1944
1945 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1946
1947         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1948         GetAttributableValue.
1949
1950         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1951         when required.
1952
1953         * convert.cs (ImplicitConversionRequired): Error message moved to
1954         DoubleLiteral.
1955
1956         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1957         automatic implicit conversion of an output value.
1958         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1959
1960         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1961         conversion.
1962         (TypeOf.GetAttributableValue): Add extra handling for object type.
1963
1964         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1965         special error message.
1966
1967 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1968
1969         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1970         InternalCall.
1971         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1972         compatible with MS runtime.
1973
1974 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1975
1976         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1977         attribute arguments here.
1978
1979         * class.cs (Indexer.Define): The check was moved to attribute class.
1980
1981 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1982
1983         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1984         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1985         easier.
1986
1987 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1988
1989         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1990         mcs to keep code differences small.
1991         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1992         * typemanager.cs (parameter_default_value_attribute_type): New.
1993         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1994         CS1908 check.
1995
1996 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1997
1998         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1999
2000 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
2001
2002         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
2003
2004         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
2005         the blocks too.
2006
2007 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
2008
2009         * doc-bootstrap.cs : fix build.
2010
2011 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2012
2013         * expression.cs (StringConcat.Append): Issue a warning when empty string
2014         is going to append.
2015
2016 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
2017
2018         * assign.cs (CompoundAssign.ResolveSource): Removed.
2019
2020         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
2021         clean up.
2022
2023         * class.cs (TypeContainer.FindMethods): Removed.
2024         (TypeContainer.CheckMemberUsage): Made static.
2025
2026         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
2027
2028         * constant.cs (CheckRange): Removed unused type argument.
2029         (CheckUnsigned): Removed unused type argument.
2030
2031         * cs-parser.jay: Updated after MemberAccess clean up.
2032         Uses Length for empty string test.
2033
2034         * cs-tokenizer.cs: Uses Length for empty string test.
2035         (IsCastToken): Made static.
2036         (is_hex): Made static.
2037         (real_type_suffix): Made static.
2038
2039         * decl.cs (SetupCache): Made static.
2040         (OnGenerateDocComment): Removed unused ds argument.
2041
2042         * delegate.cs (VerifyDelegate): Removed unused argument.
2043
2044         * doc.cs: Uses Length for empty string test.
2045
2046         * driver.cs: Uses Length for empty string test.
2047
2048         * enum.cs (IsValidEnumType): Made static
2049
2050         * expression.cs (EnumLiftUp): Removed unused argument.
2051         (ResolveMethodGroup): Ditto.
2052         (BetterConversion): Ditto.
2053         (GetVarargsTypes): Ditto.
2054         (UpdateIndices): Ditto.
2055         (ValidateInitializers): Ditto.
2056         (MemberAccess.ctor): Ditto.
2057         (GetIndexersForType): Ditto.
2058
2059         * flowanalysis.cs: (MergeFinally): Removed unused argument.
2060
2061         * iterators.cs: Updated after MemberAccess clean up.
2062
2063         * location.cs: Uses Length for empty string test.
2064
2065         * namespace.cs: Uses Length for empty string test.
2066
2067          * report.cs (CheckWarningCode): Made static.
2068
2069         * statement.cs (LabeledStatement): Removed unused argument.
2070
2071         * typemanager.cs (FilterNone): Removed.
2072
2073 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2074
2075         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
2076         obsolete.
2077
2078         * class.cs: Updated.
2079
2080 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2081
2082         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2083
2084 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2085
2086         A fix for #77822.
2087
2088         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2089         reporting, it's more tricky than I thought.
2090
2091 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2092
2093         A fix for #77816.
2094
2095         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2096         host container.
2097         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2098         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2099         Add more error reporting; Fixed issue with params.
2100
2101         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2102
2103         * cs-parser.jay: AnonymousMethod requires host container.
2104
2105         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2106
2107 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2108
2109         * class.cs: Change 'TypeContainer ds' constructor argument to
2110         'DeclSpace parent'.  Some classes were missed below due to
2111         different naming convention.
2112
2113         * class.cs (MemberCore.Parent): Delete.  This makes the
2114         ParentContainer changes below enforceable by the compiler.
2115
2116         Treat pointers to enclosing declaration space as 'DeclSpace', not
2117         'TypeContainer'.
2118         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2119         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2120
2121         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2122         of TypeContainer.
2123         (Block.AddThisVariable): Likewise.
2124         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2125         (AbstractPropertyEventMethod.Emit): Likewise.
2126         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2127         (GetMethod.Define, SetMethod.Define): Likewise.
2128         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2129         (DelegateMethod.EmitMethod): Likewise.
2130
2131         Fix regression test-partial-13.cs.
2132         Rationalize use of PartialContainer.  Ensure that the partial
2133         class semantics can be tied to type-correctness, i.e., any
2134         violation will cause a compile error.
2135         * class.cs, const.cs: Access all fields that belong to class
2136         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2137         Resolve()-like functions still use 'Parent'.
2138
2139         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2140         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2141         (PropertyMethod.CheckModifiers): Remove unused argument.
2142         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2143         DeclSpace.
2144
2145 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2146
2147         Make semantics of PartialContainer simpler.
2148         * decl.cs (DeclSpace.IsPartial): Remove.
2149         * class.cs (TypeContainer.IsPartial): Likewise.
2150         (TypeContainer..ctor): Set PartialContainer to point to self.
2151         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2152         (TypeContainer.FindNestedType): Likewise.
2153         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2154
2155 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2156
2157         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2158
2159 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2160
2161         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2162         classes.
2163
2164 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2165
2166         * class.cs (Operator.Define): An error for base conversion was not
2167         reported correctly.
2168
2169 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2170
2171         * iterator.cs : yield break is allowed in try statement which has
2172           catch clauses. Fixed bug #77767.
2173
2174 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2175
2176         A fix for #77593, #77574.
2177
2178         * class.cs (MethodCore.CheckBase): Another if for operator.
2179
2180 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2181
2182         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2183         were not resolved
2184
2185         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2186         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2187         conversion test.
2188         
2189         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2190         not needed.
2191
2192         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2193         Updated after another emitcontext usage was clean up. It should help us to
2194         synchronize with gmcs easier.
2195
2196 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2197
2198         A fix for #77353.
2199
2200         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2201         (Event.Define): ditto
2202         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2203
2204         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2205         Removed redundant code and set NewSlot for Invoke method too.
2206
2207         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2208         (Parameters.MergeGenerated): New method. Use this method when you merge
2209         compiler generated argument with user arguments.
2210
2211 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2212
2213         * attribute.cs (ResolveAsTypeTerminal): Removed.
2214
2215         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2216         specialization for predefined types; 30% speed up.
2217         Finally placed obsolete check to right place.
2218         (Expression.ResolveType): Removed.
2219
2220         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2221         Updated after ResolveType was removed.
2222
2223         * expression.cs (Cast.ctor): Check void cast.
2224         (Binary.ResolveAsTypeTerminal): Is never type.
2225         (Conditional.ResolveAsTypeTerminal): Is never type.
2226
2227         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2228
2229 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2230
2231         Fix #77679.
2232         * expression.cs (ParameterReference.DoResolveBase): Change return
2233         type to bool.
2234         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2235         Update.
2236
2237         Fix #77628.
2238         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2239
2240         Fix #77642.
2241         * typemanager.cs (GetFullNameSignature): Don't nullref on
2242         protected accessors.
2243
2244 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2245
2246         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2247         these two separated members to simplify the code.
2248         (Attribute.Resolve): Refactored to use new fields and methods.
2249         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2250         implemented obsolete attribute checking.
2251         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2252         implemented obsolete checking again. It look line never ending quest ;-)
2253         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2254
2255         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2256
2257         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2258
2259         *class.cs (Property.Define): Add RegisterProperty call.
2260
2261         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2262         argument groups (only 2).
2263
2264         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2265         encoding expression to arguments.
2266         (Expression.ExprClassToResolveFlags): Just turned to property.
2267
2268         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2269         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2270         optimized as well as implemented support for zero-length attributes.
2271
2272         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2273         Add caching of PropertyInfo's.
2274
2275 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2276
2277         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2278         error multiple times.
2279
2280 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2281
2282         New partial class implementation.
2283         A fix for #77027, #77029, #77403
2284
2285         * attribute.cs (Attributable): Made attributes protected.
2286
2287         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2288         the replacements of ClassPart and PartialContainer.
2289         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2290         (TypeContainer.AddInterface): Ditto.
2291         (TypeContainer.AddPartial): The main method for partial classes. It checks
2292         for errors and merges ModFlags and attributes. At the end class is added to
2293         partial_parts list.
2294         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2295         required here.
2296         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2297         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2298         from the rest of partial classes.
2299         (TypeContainer.GetClassBases): Simplified.
2300         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2301         DefineType.
2302         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2303         (TypeContainer.HasExplicitLayout): Uses Flags now.
2304         (PartialContainer): Removed.
2305         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2306         (StaticClass): Was merged with Class.
2307         (Class.GetClassBases): class and static class bases are verified here.
2308         (Class.TypeAttr): Added static attributes when class is static.
2309         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2310         (MemberBase): In some cases we need to call parent container for partial
2311         class. It should be eliminated but it's not easy now.
2312
2313         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2314
2315         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2316         partial classed to accumulate class comments.
2317         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2318
2319         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2320
2321         * driver.cs (MainDriver): Tree.GetDecl was removed.
2322
2323         * modifiers.cs (Modifiers): Add partial modifier.
2324
2325         * tree.cs (Tree.decl): Removed.
2326         (RootTypes): Started to use this class more often for root types
2327         specializations.
2328
2329 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2330
2331         A fix for #77615
2332
2333         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2334         external interface does not have an attribute.
2335
2336 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2337
2338         Another prerequisites for new partial classs implementation.
2339         
2340         * attribute.cs (Attribute.Equal): Implemented.
2341         (Attribute.Emit): Changed as attributes can be applied more than twice.
2342         (Attributes.Emit): Check for duplicate attributes here.
2343
2344         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2345         as a parameter, clean-up.
2346
2347 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2348
2349         A fix for #77485
2350
2351         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2352         contains obsolete attribute check which can in some cases look for base
2353         type of current class which is not initialized yet.
2354         (TypeContainer.BaseType): Replacement of ptype.
2355
2356         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2357
2358 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2359
2360         First of prerequisites for new partial classs implemention.
2361         
2362         * attribute.cs (Attributable): Extended by ResolveContext;
2363         Attributes finally have correct context for resolving in all cases.
2364         (AttachTo): Attribute owner is assigned here.
2365
2366         * codegen.cs (IResolveContext): Introduce new interface to hold
2367         all information needed in resolving phase.
2368         (EmitContext): Implements IResolveContext; more clean-up needed here.
2369         
2370         * decl.cs (MemberCore): Implemented IResolveContext.
2371
2372         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2373         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2374         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2375         Refactored to use new IResolveContext instead of EmitContext; cleanup
2376
2377 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2378
2379         * codegen.cs (EmitScopeInitFromBlock): check here the
2380         capture_context, there is no need to make two calls to the
2381         EmitContext. 
2382
2383         * anonymous.cs: Add some debugging messages that might help me
2384         track other instances of this problem in the future (the
2385         regression of test 467).
2386
2387         * cs-parser.jay: track the variable block, as we need to initalize
2388         any captured variables declared in this block for the "catch"
2389         portion of the "Try" statement.
2390
2391         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2392         scope initialization for captured variables. 
2393
2394         Also, move the emit for the variables after the block location has
2395         been marked.
2396
2397 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2398
2399         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2400
2401 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2402
2403         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2404         commit yesterday, the initialization for the roots is necessary.
2405         What is not necessary is the scope activation.
2406
2407 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2408
2409         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2410         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2411         CS0206 checks.
2412         (Argument.Resolve): Remove CS0206 checks.
2413
2414 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2415
2416         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2417         scopes for all the roots, the scopes will now be emitted when the
2418         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2419
2420         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2421         code.  This reduces a lot of existing cruft.
2422         
2423         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2424         that the ScopeInfo is generated as we enter the scope, not at the
2425         time of use, which is what we used to do before.
2426
2427         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2428         every time a Block is about to be emitted if we have a
2429         CaptureContext. 
2430
2431 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2432
2433         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2434         (Reset): Update.
2435         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2436
2437         * typemanager.cs (cons_param_array_attribute): Make private.
2438         (Reset): Set it to null.
2439         (InitCoreHelpers): Don't initialize it.
2440         (ConsParamArrayAttribute): New.  Initialize it as needed.
2441         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2442
2443 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2444
2445         * expression.cs: There might be errors reported during the
2446         selection of applicable methods.  If there are errors, do not
2447         continue execution as it will lead the compiler to crash.
2448
2449 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2450
2451         * expression.cs: Member access is not allowed on anonymous
2452         methods.  Fixes #77402.
2453
2454 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2455
2456         Fix #77401
2457         * cs-parser.jay (VariableDeclaration): Don't set
2458         current_array_type to null.
2459         (field_declaration, event_declaration, declaration_statement):
2460         Set it to null here.
2461
2462 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2463
2464         * typemanager.cs (GenericParameterPosition): New.
2465         * doc.cs: Use it.
2466
2467 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2468
2469         * doc.cs : To process "include" elements, first we should create
2470           another list than XmlNodeList, because it could result in node
2471           removal, which could result in that the XmlNodeList gives up
2472           yielding next node.
2473
2474           (Also made code identical to gmcs again.)
2475
2476 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2477
2478         * ecore.cs: Introduce an error report that we were not catching
2479         before, if not silent, we must report the error.  Gonzalo ran into
2480         it.
2481
2482 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2483
2484         A fix for bug: #76957
2485         
2486         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2487         ComputeMethodHost before creating the method, this is a new
2488         requirement. 
2489
2490         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2491         that this method references (RegisterScope).  The actual scope
2492         where the method is hosted is computed with the ComputeMethodHost
2493         before we create the method.
2494
2495         Moved the Deepest routine here.
2496
2497         (AnonymousContainer.ComputeMethodHost): New routine used to
2498         compute the proper ScopeInfo that will host the anonymous method.
2499
2500         (ScopeInfo): Deal with multiple roots.  The problem was that we
2501         did not have a unique root where all ScopeInfos could be hanged
2502         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2503         of roots.  
2504
2505         Remove AdjustMethodScope which is now computed at the end.  Remove
2506         LinkScope which did a partial link, instead link all ScopeInfos
2507         before code generation from the new "LinkScopes" routine. 
2508
2509         Simplify all the Add* routines as they no longer need to maintain
2510         the tree, they just need to record that they are using variables
2511         from a ScopeInfo.
2512
2513         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2514         routines to produce the forest of ScopeInfo trees.
2515
2516         * class.cs (TypeContainer.AppendMethod): This is just like
2517         AddMethod, but ensures that an interface implementation method
2518         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2519         methods, but at the end.
2520
2521         We use this functionality to ensure that the generated MoveNext
2522         method in the iterator class is resolved/emitted before the
2523         enumerator methods created.   
2524
2525         This is required because the MoveNext method computes the right
2526         ScopeInfo for the method.  And the other methods will eventually
2527         need to resolve and fetch information computed from the anonymous
2528         method. 
2529
2530 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2531             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2532
2533         Fix rest of #76995.
2534         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2535         the 'aliases' hash.
2536         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2537         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2538
2539 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2540
2541         Fix #76656, cs0231-2.cs.
2542         * cs-parser.jay (formal_parameter_list): Make error case catch
2543         more issues.
2544         (parenthesized_expression_0): Add CS1026 check.
2545         (invocation_expression): Remove unused { $$ = lexer.Location }.
2546
2547 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2548
2549         Fix #76824.
2550         * cs-parser.jay (statement_expression): Don't list out the
2551         individual statement-expressions.  Convert syntax error into
2552         CS0201 check.
2553
2554 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2555
2556         Fix #76874.
2557         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2558         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2559         CheckIntermediateModification.
2560         (FieldExpr.DoResolve): Add new two-argument version that
2561         allows us to resolve the InstanceExpression as an lvalue.
2562         The one-argument variant is now just a wrapper.
2563         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2564         Resolve the lhs as an lvalue if the it has a value type.
2565         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2566         from Assign.DoResolve.
2567         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2568         resolved as an lvalue.
2569         (PropertyExpr.DoResolve): Update.
2570         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2571         has a value type.  Move CS1612 check here from
2572         CheckIntermediateModification.
2573         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2574         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2575         'right_side' of a ResolveLValue on an 'out' argument.
2576         (EmptyExpression.LValueMemberAccess): New.  Used as the
2577         'right_side' of a propagated ResolveLValue on a value type.
2578         (LocalVariableReference.DoResolveBase): Recognize
2579         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2580         Add CS1654 check.
2581         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2582         EmptyExpression.Null.
2583
2584 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2585
2586         * typemanager.cs : added IsGenericParameter(). In mcs it always
2587           return false.
2588         * doc.cs : for generic parameters, use GenericParameterPosition,
2589           not FullName.
2590
2591 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2592
2593         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2594
2595 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2596
2597         This fixes the problem where we used ldfld instead of ldflda to
2598         load the "THIS" pointer on captured parameters, when THIS is a
2599         value type.  See bug #77205.
2600         
2601         * iterators.cs (CapturedThisReference.Emit): Pass false to
2602         EmitThis (we do not need the address).
2603
2604         * codegen.cs (EmitThis): it needs to know whether we need the
2605         address of `this' or not.  This is used by value types.  
2606
2607         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2608         every other call passes false.
2609
2610 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2611
2612         Fix #77221.
2613         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2614         GetOverride.
2615         * expression.cs (Invocation.OverloadResolve): Update.
2616         (Invocation.DoResolve): Avoid double resolution of invocation.
2617
2618 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2619
2620         Fix #77180.
2621         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2622         unary negation of floating point types as 0-expr; negation cannot
2623         overflow in floating point types.
2624
2625         Fix #77204.
2626         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2627         on operands of 'void' type.
2628
2629         Fix #77200.
2630         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2631         and ExclusiveOr for boolean constants too.
2632
2633 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2634
2635         Fix #75636.
2636         * expression.cs (Invocation.OverloadResolve): Replace reflected
2637         override methods with their base virtual methods, rather than
2638         skipping over them.
2639         * typemanager.cs (TypeManager.GetOverride): New.
2640
2641 2006-01-05  Jb Evain  <jbevain@gmail.com>
2642
2643         * class.cs (Property.Define, Indexer.Define): do not tag the
2644         properties as SpecialName | RTSpecialName.
2645
2646 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2647
2648         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2649         doing a low-level comparission of parameter types.  It was lacking
2650         a check for __argslist. 
2651
2652 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2653
2654         * expression.cs (ParameterReference.DoResolveBase): Allow
2655         reference parameters if they are local to this block. 
2656
2657         This allows the ref and out parameters of a delegate to be used in
2658         an anonymous method, for example:
2659
2660         delegate void set (out int x);
2661
2662         set s = delegate (out int x){
2663                 x = 0;
2664         };
2665
2666         This is used by functionality introduced late in the C# language.
2667         
2668         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2669         method that take ref and out parameters. 
2670
2671         Fixes #77119 which was a late change in the spec.
2672
2673 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2674
2675         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2676         parent if its the same scope.  Fixes #77060.
2677
2678 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2679
2680         * driver.cs: Report the case of no source files and no -out:
2681         argument provided.
2682
2683 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2684
2685         Fix #77035.
2686         * expression.cs (ComposedCast.GetSignatureForError): Define.
2687
2688 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2689
2690         Fix #76995
2691
2692         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2693         ListDictionary, to contain the ExternAliasEntry entries (in
2694         addition to the NamespaceEntry.aliases hashtable). This field is
2695         shared between the original entry and its doppelganger (bodyless 
2696         copy of it).
2697         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2698         extern_aliases field.
2699         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2700         lookup in extern_aliases.
2701
2702 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2703
2704         Fix #77006.
2705         * class.cs (TypeContainer.Mark_HasEquals): New.
2706         (TypeContainer.Mark_HasGetHashCode): New.
2707         (ClassPart): Override them.
2708         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2709
2710         Fix #77008.
2711         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2712         'parent' argument to the base constructor.
2713
2714         Remove all mention of TypeContainer from decl.cs.
2715         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2716         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2717         (DeclSpace.DeclSpace): Likewise.
2718         (DeclSpace.DefineMembers): Remove unused argument.
2719         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2720         debugging check -- we don't care if the debug code throws an
2721         InvalidCastException instead of an InternalErrorException.
2722         * class.cs (TypeContainer.DefineMembers): Update to changes.
2723         (TypeContainer.DoDefineMembers): Likewise.
2724         (TypeContainer.GetMethods): Likewise.
2725         (PropertyMember.Define): Likewise.
2726         (MemberBase.Parent): New property that forwards to
2727         MemberCore.Parent, but ensures that we get a TypeContainer.
2728         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2729         (RootContext.PopulateTypes): Likewise.  Remove special case code
2730         for !RootContext.StdLib: DefineMembers is idempotent.
2731
2732 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2733
2734         * convert.cs (ExplicitConversionCore): Check the return value from
2735         ExplicitConversionCore which can return null on failure.  Fixes #76914
2736
2737 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2738
2739         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2740
2741 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2742
2743         * doc.cs : The search for referenced namespace was insufficient to
2744           get global one as it used to do. Fixed bug #76965.
2745
2746 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2747
2748         * doc.cs : check name in cref in the last phase that whether it is
2749           namespace or not.
2750
2751 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2752
2753         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2754           Mono.C5.
2755
2756 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2757
2758         * doc.cs : so it turned out that we cannot skip override check for 
2759           interface members. Fixed bug #76954.
2760
2761 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2762
2763         * cs-tokenizer.cs : fixed bug #75984:
2764           - #warning and #error should not be handled when the source line
2765             is disabled.
2766           - #line is not checked strictly when the source line is disabled.
2767           - #define and #undef is on the other hand checked strictly at any
2768             state.
2769
2770 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2771
2772         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2773           CS1027 report.
2774
2775 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2776
2777         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2778
2779         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2780         event initializers.
2781         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2782         (FieldBase.Initializer): Initializer is now optional.
2783         (EventField.Define): Only event field can have initializer.
2784
2785         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2786
2787         * const.cs (Const): Reuse initializer.
2788
2789         * cs-parser.jay: Updated after FieldBase changes.
2790         Added current_array_type to simplify array initializers.
2791
2792         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2793
2794         * expression.cs, iterators.cs: Updated.
2795
2796         * namespace.cs (NamespaceEntry): Made UsingFound private.
2797
2798 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2799
2800         * parameterCollection.cs: Obsolete, removed.
2801         * parser.cs: Obsolete, removed.
2802
2803 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fix #76849.
2806         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2807
2808         * enum.cs (Enum.Define): Set obsolete context here.
2809
2810 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2811
2812         * doc.cs :
2813           - FindDocumentedMember() now expects 1) paramList as null
2814             when "we don't have to check the number of parameters" and
2815             2) Type.EmptyTypes when "there is no arguments".
2816           - Introduced FoundMember struct to hold the exact type which was
2817             used to find the documented member (the above change broke
2818             test-xml-044; it might be better just to use DeclaringType than
2819             what MS does, like this change does, but it depends on usage.)
2820
2821 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2822
2823         * doc.cs : documented member might be from DeclaringType for nested
2824           types. Fixed bug #76782.
2825
2826 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2827
2828         * anonymous.cs: Have the param code handle leaving copies on the
2829         stack etc. Allows anonymous params to take part in the assignment
2830         code (++, +=, etc). Fixes bug #76550
2831
2832         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2833         it down to the anon code.
2834
2835         * iterators.cs: Use dummy var here
2836
2837         * codegen.cs: Handle new vars
2838
2839 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2840
2841         Fix #76849.
2842         * class.cs (MethodData.Define): Set proper Obsolete context.
2843
2844         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2845         obsolete context.
2846         (FieldExpr.DoResolve): Ditto.
2847
2848 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2849
2850         Fix #76849.
2851         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2852         parent is not obsolete.
2853
2854 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2855
2856         * doc.cs : (FindDocumentedMember) find parameterless members first
2857           and get CS0419 in the early stage. Fixed first case of bug #76727.
2858
2859 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2860
2861         Fix #76859.
2862         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2863         no error was reported.
2864
2865         *expression.cs (Binary.DoResolve): left can be null.
2866
2867 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2868
2869         Fix #76783.
2870         * class.cs (MethodData.Emit): Parameters should be labeled first.
2871
2872 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2873
2874         Fix #76761.
2875         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2876
2877 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2878
2879         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2880
2881         * class.cs (MethodCore): Parameter clean up.
2882         (IMethodData): Added ParameterInfo.
2883         (MethodData): Parameter clean up.
2884         (Indexer.Define): Parameter clean up.
2885
2886         * anonymous.cs,
2887         * codegen.cs,
2888         * cs-parser.jay,
2889         * decl.cs,
2890         * doc.cs,
2891         * ecore.cs,
2892         * flowanalysis.cs,
2893         * iterators.cs,
2894         * pending.cs,
2895         * statement.cs,
2896         * typemanager.cs: Parameter clean up.
2897
2898         * delegate.cs (Define): Get rid of duplicated code.
2899
2900         * expression.cs (ParameterReference): Removed useless parameters
2901         and simplified.
2902         (Invocation): Ditto.
2903
2904         * parameter.cs (ParamsParameter): New class, params specialization.
2905         (ArglistParameter): Attemp to separate arglist.
2906         (Parameter): Refactored to be reusable and faster.
2907         (Parameter.Modifier): Made understandable.
2908         (Parameters): Changed to be used as a class for `this' assembly
2909         parameters. Refactored to use new specialized classes.
2910
2911         * support.cs (ParameterData): Added Types property.
2912         (InternalParameters): Deleted.
2913
2914 2005-08-20  Martin Baulig  <martin@ximian.com>
2915
2916         Merging this patch from GMCS to fix #75867.
2917
2918         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2919         scope if we don't already have it.
2920
2921 2005-11-17  Martin Baulig  <martin@ximian.com>
2922
2923         * anonymous.cs
2924         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2925         inherit the scope from our parent.  Fixes #76653.
2926
2927 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2928
2929         * doc.cs : the previous patch does not actually fix the bug.
2930           PropertyInfo override check is now implemented and really fixed it.
2931         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2932
2933 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2934
2935         * doc.cs : apply "override filter" also to properties.
2936           Fixed bug #76730.
2937
2938 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2939
2940         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2941           no need to check overrides. For classes, omit those results from 
2942           interfaces since they must exist in the class. Fixed bug #76726.
2943
2944 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2945
2946         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2947           with different parameters. Fixed the second problem in #76685.
2948
2949 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2950
2951         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2952           get expected 'protected' access in CheckValidFamilyAccess()).
2953           Fixed bug #76692.
2954
2955 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2956
2957         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2958           Fixed bug #76705.  CS1569 was incorrectly commented out.
2959
2960 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2961
2962         * doc.cs : use Invocation.IsOverride() to do real override check.
2963         * expression.cs : made Invocation.IsOverride() internal.
2964
2965 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2966
2967         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2968           TypeBuilder.FindMembers() and filter overriden base members out.
2969           Fixed bug #76990.
2970
2971 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2972
2973         * doc.cs : ref/out parameters are represented as '@' (instead of
2974           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2975
2976 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2977
2978         * doc.cs : when there was no '.' in cref to methods in doc comment,
2979           then parameters were missing in the output. Fixed bug #76691.
2980
2981 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2982
2983         * driver.cs : don't output docs when there is an error.
2984           Fixed bug #76693.
2985
2986 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2987
2988         * doc.cs :
2989           Now it should detect indexers. Fixed primary concern in bug #76685.
2990           Fixed CS0419 message to not show the identical member signature in
2991           the message.
2992
2993 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2994
2995         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2996           instead of Type.FindMembers() since it does not handle events.
2997           Fixed bug #71604.
2998
2999 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
3000
3001         * codegen.cs: Fixed typo (speficied -> specified).
3002
3003 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3004
3005         Fix #76369.
3006         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
3007
3008 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
3009
3010         * attribute.cs: Changed error message.
3011
3012         * cs-tokenizer.cs: One more check.
3013
3014 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3015
3016         * statement.cs (Block.Resolve): Ignore empty statement.
3017
3018 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
3019
3020         * report.cs: Made error/warning methods more strict to avoid
3021         their misuse.
3022
3023         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
3024         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
3025         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
3026         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
3027
3028 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
3029
3030         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
3031         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
3032
3033         * class.cs (TypeContainer.IsComImport): New property.
3034         (Constructor.Define): Create proper ctor for ComImport types.
3035
3036         * expression.cs (New.CheckComImport): Fixed.
3037
3038 2005-11-07  Miguel de Icaza  <miguel@novell.com>
3039
3040         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
3041         that a parameter has been captured does not mean that we do not
3042         have to do the rest of the processing.  This fixes the second part
3043         of #76592.  If there was another anonymous method capturing
3044         values in the past, the Scope would never be set for the second
3045         method that captured the same parameter.
3046
3047         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
3048         properly manipulate the stack.   Second part of fix for #76592.
3049
3050         * expression.cs (New): Add support for invoking "new" on
3051         interfaces that have been flagged with the ComImport attribute and
3052         the CoClass.  Fixes #76637 
3053
3054         * statement.cs (Try.DoEmit): When a variable is captured, do not
3055         try to emit the vi.LocalBuilder variable as it has been captured.
3056         Create a temporary variable and store the results on the
3057         FieldBuilder.  Fixes #76642
3058
3059 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
3060
3061         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
3062
3063         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
3064
3065         * expression.cs (Binary.DoResolve): Added && optimalization.
3066     
3067         * typemanager.cs (AddUserType): Removed useless argument.
3068
3069 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
3070
3071         * statement.cs (Block.variables): Uses ListDictionary.
3072
3073 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3074
3075         Fix #75969.
3076         * class.cs (PartialContainer.EmitType): Customized to emit
3077         security attributes.
3078         (ClassPart.ApplyAttributeBuilder): Transform security attribute
3079         for partial classes.
3080
3081 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3082
3083         Fix #76599.
3084         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3085         access has to be fixed.
3086         
3087         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3088
3089 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3090
3091         Fix #76590.
3092         * ecore.cs (NullCast.Reduce): Implemented.
3093
3094         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3095         constant type.
3096         
3097         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3098         properly.
3099         (Foreach.Resolve): Catch null properly.
3100
3101 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3102  
3103         * cs-tokenizer.cs: Warning text fix.
3104
3105         * driver.cs: AllWarningNumbers exposed on public interface.
3106
3107         * report.cs (): Reviewed warning numbers.
3108         (IsValidWarning): Use binary search.
3109
3110 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3111  
3112         * driver.cs: Implemeted resource visibility.
3113         (Resources): New class for code sharing between /res: and
3114         /linkres:
3115  
3116 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3117
3118         Fix #76568.
3119         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3120         folding.
3121         
3122         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3123         contants only.
3124         
3125         * ecore.cs (NullCast): Child is contant only.
3126         
3127         * literal.cs (NullLiteral.Reduce): null can be converted to any
3128         reference type.
3129
3130 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3131
3132         * driver.cs: Use Encoding.Default as default code page instead
3133           of ISO-28591.
3134
3135 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3136
3137         Fix #76085.
3138         * expression.cs (Invocation.Error_InvalidArguments): Handle
3139         __arglist parameters.
3140         (Invocation.VerifyArgumentsCompat): Likewise.
3141         * support.cs (ReflectionParameters.GetSignatureForError): Print
3142         __arglist parameters.
3143         (InternalParamters.GetSignatureForError): Likewise.
3144         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3145
3146 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3147
3148         * attribute.cs (GetPropertyValue): Made public.
3149
3150         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3151         Resolve.
3152         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3153         attribute.
3154         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3155         is not defined.
3156         
3157         * driver.cs: Reflect method name change.
3158         
3159         * statement.cs (Try.Resolve): Warn when try has both general
3160         exception handlers.
3161         
3162         * typemanager.cs: runtime_compatibility_attr_type new predefined
3163         type.
3164
3165 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3166
3167         Fix #76419.
3168         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3169         treat it as an empty parameter list.
3170
3171 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3172
3173         Fix #76271.     
3174         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3175         ResolveAsTypeStep silent.
3176         * statement.cs (Block.AddConstant): Mark block as used.
3177         (Block.ResolveMeta): Avoid piling on error messages
3178         if a constant initializer resolution fails.
3179
3180 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3181
3182         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3183         Remove.
3184         (NamespaceEntry.VerifyAllUsing): New.
3185         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3186         behaviour.  Delegates actual resolution of alias to ...
3187         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3188         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3189         Update.
3190         * driver.cs (Driver.MainDriver): Update.
3191         
3192         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3193         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3194         property.
3195         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3196         Remove.
3197         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3198         RootNamespace.DefineNamespacesForAll.
3199
3200 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3201
3202         * typemanager.cs (assemblies, external_aliases, modules)
3203         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3204         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3205         overhead.  Move resposibility ...
3206         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3207         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3208
3209 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3210
3211         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3212         cached_namespaces.  Improve usage.
3213         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3214         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3215         Move from GlobalRootNamespace and simplify.
3216         (RootNamespace.Global): Make instance variable.
3217         (RootNamespace.RootNamespace): Add "alias name" parameter.
3218         (GlobalRootNamespace): Simplify drastically.
3219         (Namespace.Lookup): Don't use GetNamespace.
3220         * typemanager.cs (GetRootNamespace): Rename from
3221         ComputeNamespaceForAlias.
3222         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3223
3224 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3225
3226         * anonymous.cs (AnonymousContainer): Don't crash when container
3227         doesn't exist.
3228
3229 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3230
3231         * expression.cs (Binary.DoResolve): Warn when comparing same
3232         values.
3233
3234 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3235
3236         Fix #76486.
3237         * expression.cs (Binary.DoResolve): It looks like there are no
3238         convetsion rules in enum context.
3239
3240 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3241
3242         Add support for extern alias qualifiers.
3243         * typemanager.cs: Move some LookupTypeReflection code
3244         to namespace.cs, to have cleaner code. Added some methods
3245         to help us keep track of the extern aliased references.
3246         * driver.cs: Add suport for extern alias assemblies on command
3247         line and check for their warnings/errors. Also keep track of the
3248         extern aliased assemblies.
3249         * namespace.cs: Move the global functionality of Namespace
3250         to GlobalRootNamespace/RootNamespace. Now the global namespace
3251         is GlobalRootNamespace.Globa. Also the code moved from 
3252         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3253         Finally added LocalAliasEntry (AliasEntry before) and
3254         ExternAliasEntry, to handle alias statements.
3255         * cs-parser.jay: Add support in the grammar for extern alias
3256         statement.
3257         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3258         Update callings to Namespace (now in GlobalRootNamespace).
3259
3260 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3261
3262         Fix #76371.
3263         * class.cs (TypeContainer.DefineType): Move updating of
3264         topological sort earlier in the code.
3265         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3266
3267 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3268
3269         Fix #76273.
3270         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3271         
3272         * constant.cs (Constant.TryReduce): Moved from Cast class.
3273         (Reduce): Made little bit more OO and fixed missing conversions.
3274         
3275         * ecore.cs (Reduce): Implemented.
3276         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3277         
3278         * literal.cs (Reduce): Implemented.
3279         
3280         * class.cs: Reverted Miguel's wrong commit.
3281
3282 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3283
3284         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3285
3286 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3287
3288         * cs-parser.jay, expression.cs : CS0214 was missing error location
3289           for constants. Fixed bug #76404.
3290
3291 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3292
3293         Fix #76370.
3294         * convert.cs (ExplicitConversionCore): Fixed object->enum
3295         conversion.
3296
3297 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3298
3299         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3300         InstanceExpression.
3301         (PropertyExpr.EmitCall): Likewise.
3302         * expression.cs (Invocation.EmitArguments): Handle case where
3303         arguments == null.
3304         (Invocation.EmitCall): Avoid allocating temporary variable if
3305         there are no arguments.
3306
3307 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3308
3309         Fix #76323.
3310         * convert.cs (ImplicitConversionStandard): Move conversion of
3311         void* to arbitrary pointer types ...
3312         (ExplicitConversionStandard): .. here.
3313         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3314         error to always print typenames.
3315
3316 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3317
3318         * convert.cs (GetConversionOperator): Rename from
3319         GetConversionOperators.  Move operator selection code from ...
3320         (UserDefinedConversion): ... here.
3321
3322 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3323
3324         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3325         conversion.
3326
3327 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3328
3329         * assign.cs (Assign.DoResolve): Error method changed.
3330
3331         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3332         
3333         * const.cs (ResolveValue): Reset in_transit immediately.
3334         
3335         * constant.cs: Error method changed.
3336         
3337         * convert.cs: Removed useless location parameter.
3338         (ExplicitNumericConversion): Don't do double enum check.
3339         (ExplicitConversionCore): Renamed from ExplicitConversion.
3340         (ExplicitUnsafe): Extracted from ExplicitConversion.
3341         (ExplicitConversion): Uses for error reporting.
3342         
3343         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3344         error messages.
3345         (ResolveBoolean): Uses common error method.
3346         (CastToDecimal): Get rid of ec.
3347         (CastFromDecimal): Optimized.
3348         (ConvCast): Get rid of ec.
3349         
3350         * enum.cs (ResolveValue): Reset in_transit immediately.
3351         (Emit): Return after first error.
3352         
3353         * expression.cs: Convert changes.
3354         
3355         * literal.cs: Error method changed.
3356         
3357         * statement.cs: Error method changed.
3358
3359 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3360
3361         * support.cs (SeekableStreamReader.Position): Don't error out when
3362         the requested position is just beyond the end of the current
3363         buffered data.
3364
3365 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3366
3367         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3368         try to keep in sync with the byte count of the underlying Stream.
3369         However, this limits us to a window size of 2048 characters: i.e.,
3370         the maximum lookahead of our lexer/parser can be 2048 characters.
3371
3372 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3373
3374         Fix #76255.
3375         * driver.cs: Fix compilation files with full root path.
3376
3377 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3378
3379         * report.cs (SymbolRelatedToPreviousError): Format the output so
3380         it does not use an open parenthesis that is never closed. 
3381
3382         * driver.cs: Follow coding guidelines
3383
3384 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3385
3386         Fix #72930.
3387         * const.cs (Const.ResolveValue): Check for assigning non-null
3388         value to reference type.
3389
3390 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * anonymous.cs: Implemented ExprClassName.
3393         
3394         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3395         delegate.
3396         
3397         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3398         check.
3399         
3400         * class.cs (StaticClass.DefineContainerMembers): Report protected
3401         members as error.
3402         
3403         * codegen.cs: if(ed) PRODUCTION.
3404         
3405         * convert.cs (Error_CannotImplicitConversion): Better error
3406         distinction.
3407         
3408         * cs-parser.jay: More error checks.
3409         
3410         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3411         
3412         * driver.cs (CSCParseOption): Enabled wrong option check.
3413         
3414         * ecore.cs (Expression.ExprClassName): Turned to property.
3415         (MemberExpr.CheckIntermediateModification): For checking boxed
3416         value types     modification.
3417         
3418         * statement.cs (Fixed.Resolve): Expression type must be
3419         convertible to fixed type.
3420         (CollectionForeach.GetEnumeratorFilter,TryType):
3421         Small refactoring for easier error checking.
3422
3423 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3424
3425         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3426         attributes.
3427         
3428         * class.cs (GeneratedBaseInitializer): New class for customization
3429         compiler generated initializers.
3430         (MemberBase.DoDefine): Check Obsolete attribute here.
3431         (FieldMember.DoDefine): Ditto.
3432         
3433         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3434         constants.
3435         
3436         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3437         (MemberCore.GetObsoleteAttribute): Removed argument.
3438         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3439         (MemberCore.CheckObsoleteType): New helper.
3440         
3441         * delegate.cs,
3442         * enum.cs,
3443         * statement.cs: Updates after MemberCore changes.
3444         
3445         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3446         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3447         
3448         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3449         obsolete attribute for compiler construct.
3450         (As.DoResolve): Cache result.
3451         
3452         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3453
3454 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3455
3456         Fix #76133.
3457         * expression.cs (This.VerifyFixed): In a value type T, the type of
3458         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3459         value type R, 'this' is treated as a value parameter.
3460
3461 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3462
3463         * statement.cs (Lock): Use the TemporaryVariable class instead of
3464         manually using local variables as those do not work when variables
3465         are captured.
3466
3467         * ecore.cs: Moved the TemporaryVariable class from being a nested
3468         class inside Foreach to be a public class that can be employed in
3469         other places. 
3470
3471 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3472
3473         * cs-parser.jay: interface_accessors replaced by
3474         accessor_declarations.
3475
3476         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3477         location.
3478         
3479         * statement.cs (GotoCase.Resolve): Convert null constant to
3480         null case.
3481         (SwitchLabel.ResolveAndReduce): Ditto.
3482         (SwitchLabel.NullStringCase): Custom null stamp.
3483         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3484         
3485         typemanager.cs (CSharpSignature): Don't skip first argument
3486         for full names.
3487
3488 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3489
3490         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3491
3492         * location.cs (InEmacs): in this mode, do not report column
3493         location as it confuses Emacs.
3494
3495 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3496
3497         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3498         expression.cs, iterators.cs, literal.cs: Store constants and
3499         literals location.
3500         
3501         * class.cs (MemberBase.ShortName): Pass location.
3502         
3503         * cs-parser.jay: Some location fixes.
3504         
3505         * ecore.cs (Expression.Location): Made virtual.
3506
3507 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3508
3509         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3510         if the underlying types are the same, otherwise we need to produce
3511         code that will do the proper cast.
3512
3513         This was exposed by Marek's constant rewrite which produced
3514         invalid code for the call site:
3515
3516         enum X : long { a }
3517         void Method (X v) {}
3518
3519         Method ((X) 5)
3520
3521         This fixes test-49.cs
3522
3523 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3524
3525         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3526           Type/Object should be allowed as well. Fixed bug #75968.
3527
3528 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3529
3530         * expression.cs : (Binary.DoResolve): when one is enum constant and
3531           another is constant 0, then return enum one *as enum type*.
3532           Fixed bug 74846.
3533
3534 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3535
3536         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3537         internal.
3538
3539         Fix #75941.
3540         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3541         flow-branching for LocalVariableReferences in case we were invoked
3542         from a MemberAccess.
3543         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3544         Carved out of ...
3545         (LocalVariableReference.DoResolveBase): ... this.
3546         (MemberAccess.Resolve): Do the check that was disabled during
3547         SimpleNameResolve.
3548
3549 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3550
3551         * class.cs :
3552           (PartialContainer.Create): check abstract/sealed/static strictly
3553           but abstract/sealed can exist only at one side. Fixed bug #75883.
3554
3555 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3556
3557         Fix #75945.
3558         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3559         specified, don't default to UnmanagedType.I4.
3560
3561 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3562
3563         * expression.cs : conditional operator should check possibly
3564           incorrect assign expression. Fixed bug #75946.
3565
3566 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3567
3568         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3569           Reverting the change. gmcs is much complex than mcs on this matter.
3570
3571 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3572
3573         * cs-tokenizer.cs : To read another token ahead of the actual 
3574           consumption, use new SavedToken and cache token instead of moving
3575           back the stream with SeekableStreamReader (it seemed problematic).
3576         * cs-parser.jay,
3577           driver.cs : Thus use StreamReader directly.
3578         * support.cs : Thus removed SeekableStreamReader.
3579
3580 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3581
3582         Fix #75934.
3583         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3584         (ScopeInfo.EmitScopeType): Use it to construct field names from
3585         names of captured locals.
3586
3587         Fix #75929.
3588         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3589         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3590         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3591         (ExplicitConversion): Remove enum cases already handled by
3592         implicit conversion.  Move implicit conversion check to the beginning.
3593         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3594         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3595         Don't treat System.Enum as a struct.
3596
3597 2005-08-30  Jb Evain  <jbevain@gmail.com>
3598
3599         * attribute.cs: handles as expression in parameters.
3600
3601 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3602
3603         Fix #75802.
3604         * class.cs (TypeContainer.VerifyClsName): Don't use a
3605         PartialContainer when verifying CLS compliance.
3606         (AbstractPropertyEventMethod): Set Parent here, ...
3607         (PropertyMethod): ... not here.
3608
3609 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3610
3611         * attribute.cs : escaped attribute name should not be allowed to be
3612           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3613
3614 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3615
3616         Fix #75927.
3617         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3618         when converting a long constant to unsigned long.
3619         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3620         detect where IsApplicable and VerifyArgumentsCompat disagree.
3621
3622 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3623         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3624
3625         Fix #75848.
3626         * class.cs (TypeContainer.CanElideInitializer): New helper.
3627         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3628         can safely emitting the initializer of a field.
3629
3630 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3631
3632         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3633           allowed inside a switch (without loop). Fixed bug #75433.
3634
3635 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3636
3637         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3638         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3639
3640 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3641
3642         * driver.cs : kinda reverting the default encoding changes (not exact 
3643           revert since I noticed that "codepage:reset" might not work fine).
3644
3645 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3646
3647         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3648           Location. Now getter and setter store location correctly.
3649           (errors/cs0111-12.cs now reports the expected location.)
3650
3651 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3652
3653         * driver.cs : Use default encoding on the environment.
3654           Removed (now that) extra parameter for SeekableStreamReader.
3655         * support.cs : (SeekableStreamReader) third .ctor() argument for
3656           StreamReader is not required (always true). preamble size could
3657           be acquired in simpler and safe way.
3658
3659 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3660
3661         * cs-parser.jay: report CS0642 at warning level 3
3662           and report CS0642 for an if else statement also
3663           fixes bug #74745. Patch by John Luke (and a bit
3664           modified by me).
3665           Removed extra CS0642 warning check for "while",
3666           "for" and "fixed".
3667         * statement.cs: In Block.Resolve(), CS0642 check
3668           is reimplemented to check a sequence of an empty
3669           statement and a block.
3670
3671           Both fix bug #66777.
3672
3673 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3674
3675         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3676         detection until I fix it.
3677         
3678         * cs-tokenizer.cs: Changed error message.
3679         
3680         * cs-parser.jay: Fixed 2 error locations.
3681         
3682         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3683         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3684         properties.
3685         
3686         * enum.cs (GetSignatureForError): Fixed.
3687         
3688         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3689         method detection.
3690         
3691         * class.cs,
3692         * typemanager.cs (RegisterProperty): Removed.
3693         
3694         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3695
3696 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3697
3698         Fix #75874.
3699         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3700         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3701
3702 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3703
3704         * expression.cs : tiny fix is required for not warning positive ulong.
3705           See test-441.cs.
3706
3707 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3708
3709         * expression.cs : add CS0652 check for constant and integral
3710           expression. Fixed bug #53974.
3711
3712 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3713
3714         * expression.cs : in DoNumericPromotions(), check if there is implicit
3715           conversion overload for string (to check CS0034). Fixed bug #52492.
3716
3717 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3718
3719         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3720
3721 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3722
3723         * ecore.cs : report location when it is *not* Null.
3724
3725 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3726
3727         * codegen.cs,
3728           ecore.cs,
3729           flowanalysis.cs,
3730           expression.cs:
3731           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3732           correctly. Fixed bug #75721.
3733
3734 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3735
3736         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3737         loop that performs 'min (pos, char_count)'.
3738
3739         Fix #75862.
3740         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3741         converted value in Operator.OnesComplement.
3742
3743 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3744
3745         * anonymous.cs: If the anon method is pulled into a helper class,
3746         it needs to be `internal' not `private'. Fixes runtime behavior on
3747         msft. bug #75704
3748
3749 2005-08-20  Martin Baulig  <martin@ximian.com>
3750
3751         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3752         scope if we don't already have it.
3753
3754         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3755         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3756         fixes #75867.
3757
3758 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3759
3760         Fix #75803
3761         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3762         is a partial class.
3763
3764 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3765
3766         The big constants rewrite
3767         Fix #75746, #75685 and more
3768         As a side effect saved 1MB for MWF ;-)
3769         
3770         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3771         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3772         enum based for corlib compilation.
3773         
3774         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3775         subtractions.
3776         
3777         * class.cs (FixedField.Define): Use ResolveAsConstant.
3778         
3779         * const.cs (IConstant): Interface constants and enums.
3780         (Const.ResolveValue): New method for constant resolvning.
3781         (ExternalConstant): Constants from imported assemblies.
3782         
3783         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3784         conversion; like enums.
3785         (Constant.ToType): Converts this constant to different type.
3786         (Constant.Increment): Adds 1.
3787         
3788         * convert.cs (ImplicitConversionRequired): Simplified.
3789         
3790         * cs-parser.jay: Create EnumMember directly.
3791         
3792         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3793         
3794         * doc.cs (GenerateEnumDocComment): Removed.
3795         
3796         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3797         (ConvertIntLiteral): Removed.
3798         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3799         
3800         * enum.cs (EnumMember): Implement IConstant.
3801         (Enum.IsValidEnumConstant): Removed.
3802         (Enum.GetNextDefaultValue): Removed.
3803         (Enum.FindMembers): Updated.
3804         (Enum.GenerateDocComment): Iterate enum members.
3805         
3806         * expression.cs (Cast.TryReduce): Handle enums correctly.
3807         (New.Constantify): Made public.
3808         (MemberAccess.DoResolve): Removed contant specific if(s).
3809         
3810         * literal.cs (NullLiteral): Implement new abstract methods.
3811         
3812         * statement.cs (GotoCase.Resolve): Use new constant methods.
3813         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3814         
3815         * typemanager.cs (LookupEnum): Removed.
3816         (IsEnumType): Fixed to work with corlib.
3817         (RegisterConstant): Removed.
3818         (LookupConstant): Removed.
3819         (GetConstant): Changed to work with IConstant.
3820
3821 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3822
3823         * location.cs : Fixed overflown (>255) column number.
3824
3825 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3826
3827         First cut of the qualified-alias-member feature.
3828         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3829         token.
3830         * cs-parser.jay (DOUBLE_COLON): New token.
3831         (namespace_or_type_name): Add rule for recognizing
3832         qualified-alias-members.
3833         (primary_expression): Likewise.
3834         (element_access): Allow QualifiedAliasMember as a possible
3835         type-bearing expression.
3836         (local_variable_type, local_variable_pointer_type): Likewise.
3837         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3838         aliases in the current and enclosing namespace declarations.
3839         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3840         * decl.cs (MemberName.is_double_colon): New.
3841         (MemberName.MemberName): Add new constructor for alias-member.
3842         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3843         * expression.cs (QualifiedAliasMember): New expression type.
3844
3845 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3846
3847         * location.cs : it borked when no argument was specified.
3848
3849 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3850
3851         * location.cs : tiny ToString() format fix.
3852
3853 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3854
3855         * statement.cs : oops, it was missing.
3856
3857 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3858
3859         A set of fixes for precise line/column location.
3860
3861         * location.cs :
3862           "token" field now holds a file/line "delta", a line number offset 
3863           from the segment, and a column number. See also:
3864           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3865           December/009508.html
3866           Removed static IsNull. Use instance IsNull property instead.
3867         * cs-tokenizer.cs :
3868           For some tokens it stores Location. For Identifier it stores
3869           LocatedToken which is a pair of string name and location.
3870           Column numbers are adjusted only at getChar().
3871         * report.cs :
3872           Use Location.ToString() for reporting (it now contains column).
3873         * cs-parser.jay :
3874           Largely modified to use LocatedToken instead of
3875           string (IDENTIFIER), and to acquire Location from some tokens.
3876         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3877           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3878           codegen.cs :
3879           Now MemberName holds Location. DeclSpace.ctor() receives Location
3880           as a parameter. Removed extra parameters to all derived classes.
3881           Replaced Location.IsNull() with instance property.
3882         * assign.cs, expression.cs :
3883           Added .ctor() overload that omits Location.
3884         * attribute.cs :
3885           Added "nameEscaped" flag that indicates the identifier was escaped
3886           in the source file. This fixes bug #57047.
3887
3888 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3889
3890         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3891         New method, looking for lo-case imported cls type.
3892
3893         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3894         here.
3895
3896         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3897
3898         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3899
3900         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3901         all_imported_types.
3902         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3903
3904         Optimized to save 3.5 MB for SWF compilation.
3905
3906 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3907
3908         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3909         (PartialContainer.Create): Moved logic AddToContainer.
3910         (PartialContainer.MarkForDuplicationCheck): Shares name.
3911         
3912         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3913         place.
3914         
3915         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3916         initialization.
3917         (Namespace.GetSignatureForError): New method.
3918         
3919         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3920         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3921
3922 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3923
3924         Fix #75669.
3925         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3926         member lookup rather than qualifier_type, since qualifier_type can
3927         be null.
3928
3929 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3930
3931         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3932         enum member.
3933
3934 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3935
3936         * statement.cs: Copy the local exception into the exception
3937         captured local.  Fixes 75674
3938
3939 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3940
3941         Fix #75658.
3942         * expression.cs (Invocation.OverloadResolve): Don't report error
3943         CS1501 if error CS1502 has been reported.
3944         (New.DoResolve): Delegate CS1501 reporting to
3945         Invocation.OverloadResolve.
3946
3947         Fix #75656.
3948         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3949         invariant-meaning-in-block property in an enclosing block if
3950         necessary.
3951
3952 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3955         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3956         (Switch.CheckSwitch): Just save 50kb for SWF.
3957
3958 2005-07-27  Martin Baulig  <martin@ximian.com>
3959
3960         * anonymous.cs (CaptureContext.AddField): Added
3961         `AnonymousContainer am' argument; compute its toplevel scope if
3962         it's not already computed.  Fixes #75649.
3963
3964 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3965
3966         Fix #75628.
3967         * class.cs (Constructor.Emit): Reset block to null if the block
3968         resolve fails.
3969
3970 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3971
3972         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3973
3974 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3975
3976         * class.cs (MethodData.Define): Check whether accessor implementing
3977         interface is public.
3978
3979         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3980
3981 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3982
3983         Fix #57245
3984         * namespace.cs (LookupType): Moved same type check to...
3985         
3986         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3987         with the same name.
3988
3989 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3990
3991         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3992         already found a typebuilder.
3993         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3994         MemberNames, not strings.
3995
3996         * const.cs (Error_ExpressionMustBeConst): 
3997         Rename from Error_EpressionMustBeConst.
3998         * const.cs, class.cs, statement.cd: Update.
3999
4000 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
4001
4002         Fix #65573
4003
4004         * const.cs (Const.LookupConstantValue): Report missing contant expression
4005         everytime.
4006         (Error_EpressionMustBeConstant): Only one error method.
4007
4008         * class.cs, statement.c: Updated.
4009
4010 2005-07-20  Raja R Harinath  <rharinath@novell.com>
4011
4012         * statement.cs (Block.Flags): Add back HasVarargs.
4013         (Block.flags): Make protected.
4014         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
4015
4016         * typemanager.cs (types, typecontainers, user_types): Remove.
4017         (UserTypes, TypeContainers): Likewise.
4018         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
4019         (CleanUp, Reset): Update.
4020         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
4021         (GetNestedType): Use Type.GetNestedType.
4022         (CoreLookupType): Take two arguments, the namespace and the
4023         basename of the type.  Update to use the Namespace.Lookup
4024         mechanism.
4025         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
4026         (RealMemberLookup): Use IsNestedChildOf instead of playing with
4027         string concatenation and substring matches.
4028         * class.cs, enum.cs, delegate.cs: Update to changes.
4029
4030 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
4031
4032         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
4033         Expression and made virtual.
4034
4035         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
4036         (ImplicitStandardConversionExists): Fixed `byte' typo ?
4037
4038         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
4039
4040         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
4041         error message.
4042
4043         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
4044         change.
4045
4046 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
4047
4048         Fix #57707
4049         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
4050         AssemblyCultureAttribute is not used on executable.
4051
4052         * rootcontext.cs,
4053         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
4054
4055 2005-07-16  Raja R Harinath  <rharinath@novell.com>
4056
4057         Fix #60638.
4058         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
4059         New.  Reports CS0252/CS0253.
4060         Mostly taken from preliminary patch by Duncak Mak.
4061         (Binary.DoResolveOperator): Store results of operator lookup.
4062         Use them to detect if we need to warn about unintended reference
4063         comparisons.
4064
4065 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4066
4067         Fix #72969.
4068         * namespace.cs (Namespace.Lookup): Add back location parameter.
4069         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
4070         * delegate.cs, ecore.cs, expression.cs: Update to changes.
4071
4072         * codegen.cs (EmitContext.DeclSpace): Make readonly.
4073         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
4074         (Namespace.LookupType): ... this.
4075         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
4076         of namespaces.
4077         * typemanager.cs (LookupTypeReflection): Remove buggy code that
4078         purported to handle pointers.
4079         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
4080         CoreLookupType.
4081
4082 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4083
4084         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4085         type as namespace.
4086
4087 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4088
4089         * namespace.cs (Namespace.Lookup): Drop location parameter.
4090         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4091         (NamespaceEntry.Lookup): ... this.
4092         (NamespaceEntry.Error_AmbiguousTypeReference):
4093         Move here from DeclSpace.
4094         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4095         names ...
4096         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4097         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4098         Move to NamespaceEntry.
4099         * delegate.cs, expression.cs: Update to changes.
4100
4101 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4102
4103         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4104         CheckAttributeType and refactored.
4105         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4106         ResolveAsTypeTerminal error handling.
4107         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4108         handling.
4109         (GetSignatureForError): Print errors in same way.
4110
4111         * class.cs,
4112         * codegen.cs: Reflect attribute GetSignatureForError change.
4113
4114         * ecore.cs,
4115         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4116
4117         * namespace.cs (UsingEntry): Refactored to make fields private.
4118
4119         * assign.cs,
4120         statement.cs: Error_UnexpectedKind has extra parameter.
4121
4122 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4123
4124         * ecore.cs (IAlias): Remove.
4125         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4126         that implement the interface.
4127         * namespace.cs (Namespace): Likewise.
4128         (Namespace.declspaces): Renamed from 'defined_names'.
4129         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4130         DeclSpace instead of an IAlias.
4131         * tree.cs (Tree.AddDecl): Update.
4132
4133 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4134
4135         * statement.cs (Block.Flags); Remove HasVarargs.
4136         (Block.HasVarargs): Move to ToplevelBlock.
4137         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4138         (Block.Variables): Make protected.  Initialize variable hashtable
4139         if necessary.
4140         (Block.AddVariable): Update.
4141         (Block.Resolve): Update to changes.
4142         (ToplevelBlock.HasVarargs): New boolean.
4143         (ToplevelBlock.ThisVariable): Move here from Block.
4144         (ToplevelBlock.AddThisVariable): Likewise.
4145         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4146         * expression.cs (This.ResolveBase): Update to changes.
4147         (ArglistAccess.DoResolve): Likewise.
4148
4149 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4150
4151         Fix #75321
4152         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4153
4154         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4155         not used and not used & assigned.
4156         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4157
4158 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4159
4160         Fix #75053
4161         * expression.cs (Is.DoResolve): null is never provided type.
4162
4163 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4164
4165         Fix #52496
4166         * cs-parser.jay: Less strict event error rule to catch more errors.
4167
4168 2005-07-08  Martin Baulig  <martin@ximian.com>
4169
4170         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4171         gettter (allowed) or setter (not allowed).
4172
4173         * class.cs (Accessor): Implement IIteratorContainer.
4174         (Accessor.Yields): New public field.
4175         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4176         per-accessor basis.
4177
4178         * cs-parser.jay
4179         (get_accessor_declaration, set_accessor_declaration): Set the
4180         `yields' flag on the accessor, not the property.
4181         (property_declaration): Do the iterators check on a per-accessor
4182         basis and not for the whole property.
4183
4184 2005-07-08  Martin Baulig  <martin@ximian.com>
4185
4186         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4187         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4188
4189 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4190
4191         Fix #74975
4192         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4193         (ExtractSecurityPermissionSet): Cope with self referencing security
4194         attributes properly.
4195
4196         * driver.cs (SetOutputFile): Made public property OutputFile.
4197
4198 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4199
4200         Fix #75486.
4201         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4202         has_nonstatic_fields.  Make into a FieldBase pointer.
4203         (TypeContainer.AddField): Add CS0282 check.
4204         (TypeContainer.EmitType): Update.
4205
4206 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4207
4208         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4209         compare if they start with __.
4210
4211 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4212
4213         * statement.cs (Switch.SwitchGoverningType): Only look at
4214         UserCasts that don't need implicit standard conversions to one of
4215         the allowed switch types (Fixes test-322.cs).
4216         (LocalInfo.Resolve): Re-enable sanity-test.
4217
4218 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4219
4220         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4221         
4222         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4223         
4224         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4225
4226 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4227
4228         Fix #75472.
4229         * ecore.cs (SimpleName.GetSignatureForError): Add.
4230         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4231         (MemberAccess.GetSignatureForError): Add.
4232
4233 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4234  
4235         The big error and warning messages review.
4236         
4237         * anonymous.cs,
4238         * assign.cs,
4239         * attribute.cs,
4240         * class.cs,
4241         * codegen.cs,
4242         * convert.cs,
4243         * cs-parser.jay,
4244         * cs-tokenizer.cs,
4245         * decl.cs,
4246         * delegate.cs,
4247         * doc.cs,
4248         * driver.cs,
4249         * ecore.cs,
4250         * enum.cs,
4251         * expression.cs,
4252         * flowanalysis.cs,
4253         * iterators.cs,
4254         * literal.cs,
4255         * location.cs,
4256         * modifiers.cs,
4257         * namespace.cs,
4258         * parameter.cs,
4259         * pending.cs,
4260         * report.cs,
4261         * rootcontext.cs,
4262         * statement.cs,
4263         * support.cs,
4264         * tree.cs,
4265         * typemanager.cs: Updated.
4266         
4267         * class.cs: (MethodCore.SetYields): Moved here to share.
4268         (PropertyMethod.Define): Moved iterator setup here.
4269         
4270         * iterators.cs: Add orig_method to have full access to parent
4271         container.
4272
4273 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4274
4275         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4276         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4277         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4278         variable of struct type.
4279         * expression.cs (Unary.ResolveOperator): Update to change.
4280         (Indirection.VerifyFixed): Likewise.
4281         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4282         (ParameterReference.VerifyFixed): Value parameters are fixed.
4283         (This.VerifyFixed): Treat 'this' as a value parameter.
4284         * statement.cs (LocalInfo.IsFixed): Remove.
4285
4286 2005-07-01  Martin Baulig  <martin@ximian.com>
4287
4288         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4289         `ec.EmitThis ()' to get the correct scope.
4290
4291 2005-07-01  Martin Baulig  <martin@ximian.com>
4292
4293         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4294         instance is a ParameterReference; fixes #75299.
4295
4296 2005-07-01  Martin Baulig  <martin@ximian.com>
4297
4298         Reverted Marek's latest patch (r46725):
4299         - it contains structural changes which are neither mentioned in
4300           the ChangeLog nor explained anywhere; for example the additional
4301           argument of EmitContext's and Iterator's .ctor's and the
4302           TypeContainer.DefineMembers() change.
4303         - structural changes like this should go in in seperate patches
4304           and not be hidden in a huge patch which just seems to affect
4305           warnings and errors.
4306           a big and hard to understand patch.
4307         - it breaks iterators and causes regressions, for instance in
4308           test-iter-03.cs.      
4309
4310 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4311
4312         Fix #75412.
4313         * expression.cs (Indexers.map): Remove.
4314         (Indexers.Append): Filter out inaccessible setters and getters.
4315         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4316
4317         Fix #75283.
4318         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4319         Refactored from ...
4320         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4321         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4322         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4323         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4324
4325 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4326
4327         Fix #75322
4328         * class.cs (FieldBase.GetInitializerExpression): One more field
4329         for backup.
4330
4331 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4332
4333         * pending.cs: Do not define a proxy if the base method is virtual,
4334         it will be picked up by the runtime (bug 75270).
4335
4336 2005-06-08  Martin Baulig  <martin@ximian.com>
4337
4338         The big Iterators rewrite :-)
4339
4340         * iterators.cs: Rewrite this to use the anonymous methods framework.
4341
4342         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4343         before the TypeContainers; see 2test-21.cs.
4344
4345         * class.cs
4346         (TypeContainer.DefineType): Don't create a new EmitContext if we
4347         already have one (this only happens if we're an Iterator).
4348         (TypeContainer.Define): Also call Define() on all our iterators.
4349         (Method.CreateEmitContext): Added support for iterators.
4350
4351         * anonymous.cs
4352         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4353         (AnonymousContainer.CreateMethodHost): Moved here from
4354         AnonymousMethod and made abstract.
4355         (AnonymousContainer.CreateScopeType): New abstract method.
4356         (AnonymousContainer.IsIterator): New public property.
4357         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4358         get the ScopeTypeBuilder rather than manually defining it here. 
4359         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4360         iterators here.
4361
4362         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4363         before RootContext.DefineTypes().
4364
4365         * codegen.cs (EmitContext.RemapToProxy): Removed.
4366         (EmitContext.CurrentAnonymousMethod): Changed type from
4367         AnonymousMethod -> AnonymousContainer.
4368         (EmitContext.ResolveTopBlock): Protect from being called twice.
4369         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4370         (EmitContext.EmitThis): Removed the iterators hacks; use the
4371         anonymous methods framework for that.
4372
4373         * statement.cs
4374         (ToplevelBlock.Container): Make this a property, not a field.
4375         (ToplevelBlock.ReParent): New public method; move the
4376         ToplevelBlock into a new container.
4377         (Foreach.TemporaryVariable): Simplify.
4378
4379 2005-06-05  Martin Baulig  <martin@ximian.com>
4380
4381         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4382         (Block.AddTemporaryVariable): New public method; creates a new
4383         `LocalInfo' for a temporary variable.
4384         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4385         variables here.
4386         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4387         non-iterator variables.
4388
4389 2005-06-05  Martin Baulig  <martin@ximian.com>
4390
4391         * statement.cs (Foreach.TemporaryVariable): Create the
4392         LocalBuilder in the Emit phase and not in Resolve since in some
4393         situations, we don't have an ILGenerator during Resolve; see
4394         2test-19.cs for an example.
4395
4396 2005-06-04  Martin Baulig  <martin@ximian.com>
4397
4398         **** Merged r45395 from GCS ****
4399
4400         The big Foreach rewrite - Part II.
4401
4402         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4403         with `PropertyInfo ienumerator_getcurrent'.
4404
4405         * codegen.cs (VariableStorage): Removed.
4406
4407         * statement.cs
4408         (Foreach): Derive from Statement, not ExceptionStatement.
4409         (Foreach.CollectionForeach): New nested class.  Moved all the code
4410         dealing with collection foreach here.
4411         (Foreach.ForeachHelperMethods): Removed.
4412         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4413
4414 2005-05-23  Martin Baulig  <martin@ximian.com>
4415
4416         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4417         don't need to.  Fix #75014.
4418
4419 2005-05-20  Martin Baulig  <martin@ximian.com>
4420
4421         Merged r44808 from GMCS.
4422
4423         * class.cs (TypeContainer.CircularDepException): Removed.
4424         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4425         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4426         (CS0146) and interface (CS0529) dependencies here.
4427
4428 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4429
4430         * expression.cs (Invocation.EmitCall): Fix initialization
4431         'this_call' to reflect current behaviour.  Fix indentation.
4432
4433         * convert.cs (FindMostEncompassedType): Add two trivial special
4434         cases (number_of_types == 0 || number_of_types == 1).
4435         (FindMostEncompasingType): Likewise.
4436
4437 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4438
4439         Some cleanups preparing for the fix of #75283.
4440         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4441         error testing.
4442         (EventExpr.InstanceResolve): Likewise.
4443         (EventExpr.DoResolve): Remove redundant checks.
4444
4445 2005-06-10  Duncan Mak  <duncan@novell.com>
4446
4447         * cs-tokenizer.cs (process_directives): New flag for controlling
4448         the processing of preprocessor directives.
4449         (x_token): After seeing a '#', return Token.NONE instead of going
4450         to handle_preprocessing_directive() when not processing
4451         directives. This avoids unnecessary processing during the token peek in
4452         is_punct().
4453
4454         This fixes #74939.
4455
4456         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4457         the existing error reporting methods instead of Report.Error.
4458
4459         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4460         after Raja's rewrite.
4461
4462 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4463
4464         * class.cs: Small fix.
4465
4466 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4467
4468         Fix #75160.
4469         * class.cs (GetPartialBases): Fix return value check of
4470         part.GetClassBases.
4471
4472 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4473
4474         Ensure that partial classes are registered in their enclosing
4475         namespace.  Initial part of fix of #75160.
4476         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4477         Register declspace with namespace here, not in
4478         DeclSpace.RecordDecl.
4479         * cs-parser.jay: Pass namespace to RecordDecl.
4480         * class.cs (PartialContainer.Create): Likewise.
4481         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4482         called.
4483         * decl.cs (Declspace.RecordDecl): Remove.
4484         * namespace.cs (NamespaceEntry.DefineName): Remove.
4485
4486 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4487
4488         * rootcontext.cs: Reset TargetExt as well.
4489
4490 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4491
4492         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4493         -langversion:ISO-1.
4494
4495 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4496
4497         Fix #75080, cs0119.cs.
4498         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4499         of ...
4500         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4501         allowing ExprClass.Type and ExprClass.Namespace for
4502         ResolveFlags.VariableOrValue.
4503         (Expression.Resolve) [1-argument variant]: Change default resolve
4504         flags based on language version.
4505         (Expression.Error_UnexpectedKind): Use a simple string array
4506         rather than an ArrayList.
4507         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4508         not ExprClass.Type.
4509         (TypeOfVoid.DoResolve): Likewise.
4510         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4511         flags argument -- it always has the same value.
4512
4513 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4514
4515         Fix #75081.
4516         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4517         Use it in the error message.
4518         * assign.cs, expression.cs, statement.cs: Update.
4519
4520 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4521
4522         Fix #75088.
4523         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4524         the "almostMatchedMember" case too.
4525         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4526         that failed the accessibility checks to 'almost_match'.
4527
4528 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4529
4530         * attribute.cs: Use internal MethodBuilder methods to set
4531         ExactSpelling and SetLastError on PInvoke methods, instead
4532         of passing them via charset.  Fixes #75060.
4533
4534 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4535
4536         * parameter.cs (Parameter): Remove TODO comment.
4537         (Parameter.DefineParameter): Remove Location parameter.
4538         (Parameters.LabelParameters): Likewise.
4539         * class.cs (Constructor.Emit): Update to change.
4540         (MethodData.Emit): Likewise.
4541         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4542         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4543
4544 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4545
4546         * parameter.cs,
4547           Removed Parameters.Location and added Parameter.Location instead.
4548           Removed Location parameter from Emit() and GetSignature().
4549         * anonymous.cs,
4550           class.cs,
4551           cs-parser.jay,
4552           delegate.cs,
4553           iterators.cs,
4554           statement.cs :
4555           Modified all related calls.
4556
4557 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4558
4559         Improve user-defined conversion handling.
4560         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4561         applicable operators.
4562         (AddConversionOperators): New.  Helper for GetConversionOperators.
4563         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4564         there is only one most encompassed/encompassing type.
4565         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4566         "applicable operator" handling.
4567         (UserConversion): Move cache here from GetConversionOperators.
4568         Directly cache the chosen operator, rather than the whole
4569         MethodGroup.
4570         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4571         case.  Allow conversion of decimal to sbyte and byte too.
4572         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4573         New static methods.  Used to avoid allocating EmptyExpressions in
4574         convert.cs.
4575
4576 2005-05-24  Duncan Mak  <duncan@novell.com>
4577
4578         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4579         another class, used in Convert.ExplicitNumericConversion.
4580         (CastToDecimal): New class, similar to above, but casts to
4581         System.Decimal, used in Convert.ImplicitNumericConversion and also
4582         in explicit convesion from double/float to decimal.
4583
4584         * convert.cs (ImplicitNumericConversion): Handle implicit
4585         conversions to System.Decimal.
4586         (ExplicitNumericConversion): handle explicit conversions to
4587         System.Decimal.
4588
4589         This fixes #68711.
4590         
4591 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4592
4593         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4594         know the type at this stage, just break through.   Fixes #75008 
4595
4596 2005-05-19  Martin Baulig  <martin@ximian.com>
4597
4598         * delegate.cs
4599         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4600         to disable error reporting.
4601
4602         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4603         here since we don't want to report an error; see the new test-336.cs.
4604
4605 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4606
4607         * statement.cs (ToplevelBlock.GetParameterReference)
4608         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4609         Move here from class Block.
4610         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4611         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4612
4613 2005-05-18  Martin Baulig  <martin@ximian.com>
4614
4615         Fix #74978.
4616
4617         * flowanalysis.cs
4618         (FlowBranching.Reachability): Add non-static public And() and Or()
4619         methods.
4620         (FlowBranchingSwitch): New class; do the `break_origins' thing
4621         like in FlowBranchingLoop.
4622         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4623         reachability, not just locals and parameters.
4624         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4625         switch; MergeBreakOrigins() now takes care of that.
4626
4627 2005-05-18  Martin Baulig  <martin@ximian.com>
4628
4629         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4630         a loop and may leave it, reset the barrier; fixes #74974.
4631
4632 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4633         
4634         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4635         is back.
4636         
4637         * cs-parser.jay: Catch more lexical errors.
4638         
4639         * report.cs: Add one more Error method.
4640         
4641         * rootcontext.cs,
4642         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4643
4644 2005-05-17  Martin Baulig  <martin@ximian.com>
4645
4646         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4647         #70970. 
4648
4649 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4650
4651         Fix test-382.cs.  Emit values of decimal constants.
4652         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4653         Carved out of ...
4654         (TypeContainer.AddField): ... this.
4655         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4656         with initializers to include 'Const's.
4657         (ClassPart.RegisterFieldForInitialization): Forward to
4658         PartialContainer.
4659         * const.cs (Const.Const): Pass initializer to base class.
4660         (Const.Define): In case of decimal constants, register them for
4661         initialization in a static constructor.
4662
4663 2005-05-14  Martin Baulig  <martin@ximian.com>
4664
4665         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4666         do not call ResolveUnreachable() on unreachable statements in
4667         here, see the comment in the source code.
4668
4669 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4670
4671         Fix #74934.
4672         * expression.cs (BinaryResolveOperator): If one of the operands of
4673         an equality comparison is 'null' and the other is a pointer type,
4674         convert the null to a NullPointer.
4675         * convert.cs (ImplicitReferenceConversion): If the expression is a
4676         NullLiteral and the target type is a pointer type, return a
4677         NullPointer instead.
4678         (ImplicitConversionStandard): Likewise.
4679
4680 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4681         
4682         * cs-parser.jay: Set readonly context based on special constructs.
4683         
4684         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4685         readonly variable error handling.
4686         
4687         * rootcontext.cs (EmitCode): Don't verify members when error
4688         occurred.
4689         
4690         * statement.cs (LocalInfo): Add reaodnly context information.
4691         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4692
4693 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4694
4695         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4696         for #74041 to initialize 'resolved' to false only for explicit
4697         blocks.  Fixes #74873.
4698
4699 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4700
4701         Fix #74920.
4702         * typemanager.cs (unmanaged_enclosing_types): New.
4703         (IsUnmanagedType): Avoid infloops by using
4704         'unmanaged_enclosing_types' to talk with recursive invocations.
4705
4706 2005-05-13  Martin Baulig  <martin@ximian.com>
4707
4708         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4709         instance variable, not a local.  Fix #74873.
4710         (Block.ResolveUnreachable): Set it to true here.
4711
4712 2005-05-11  Duncan Mak  <duncan@novell.com>
4713
4714         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4715         continuing to process for 'arg'.
4716         (handle_preprocessing_directive): Check the argument of the #endif
4717         directive and report error CS1025 if there are any trailing
4718         characters.
4719
4720         According to the C# spec, having even whitespace after the #endif
4721         directive is illegal; however, because we call arg.TrimEnd ()
4722         beforehand, we have the same behavior as csc, allowing whitespace
4723         after the directive.
4724
4725         Fixes #74892.
4726
4727 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4728
4729         Fix #74863.
4730         
4731         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4732         (Constructor.GetObsoleteAttribute): Implemented correctly.
4733
4734 2005-05-10  Martin Baulig  <martin@ximian.com>
4735
4736         * support.cs (ReflectionParameters.ParameterModifier): Use
4737         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4738         and `ParameterAttributes.In'.  Fixes #74884.
4739
4740 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4741
4742         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4743         
4744         * expression.cs (Argument.GetParameterModifier): Turned to property.
4745         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4746         
4747         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4748         its C# equivalent.
4749         
4750 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4751
4752         Fix #74852.
4753         * decl.cs (MemberCache.AddMethods): Register override methods,
4754         rather than non-override methods.
4755         * typemanager.cs (RegisterOverride): New.
4756         (IsOverride): Update.
4757
4758 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4759
4760         Fix #73105.
4761         
4762         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4763         recursive declaration.
4764         
4765         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4766         
4767 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4768
4769         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4770         
4771         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4772
4773 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4774
4775         Fix #74797.
4776         * decl.cs (DeclSpace.FamilyAccessible): 
4777         Use TypeManager.IsNestedFamilyAccessible.
4778
4779         Fix reopened #64812.
4780         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4781         internal'.
4782
4783 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4784             Abin Thomas  <projectmonokochi@rediffmail.com>
4785             Anoob V E  <projectmonokochi@rediffmail.com>
4786             Harilal P R  <projectmonokochi@rediffmail.com>
4787
4788         Fix #64812.
4789         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4790         allow access to all static members.
4791
4792 2005-05-04  Martin Baulig  <martin@ximian.com>
4793
4794         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4795
4796 2005-05-04  Martin Baulig  <martin@ximian.com>
4797
4798         Fix #74655.
4799
4800         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4801         section at the end; make things work if `default' is not the last
4802         section.        
4803
4804 2005-05-04  Martin Baulig  <martin@ximian.com>
4805
4806         Fix #70400.
4807
4808         * statement.cs (Switch): Replaced the `got_default' field with a
4809         `default_section' one.
4810         (Switch.CheckSwitch): Set `default_section' here.
4811         (Switch.Resolve): If we're a constant switch and the constant is
4812         not found, use the default section.
4813
4814 2005-05-03  Martin Baulig  <martin@ximian.com>
4815
4816         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4817
4818         * statement.cs (Foreach.ArrayForeach): New nested class.
4819         (Foreach.TemporaryVariable): New nested class.
4820         (Foreach.EmitArrayForeach): Removed; this is now in the new
4821         ArrayForeach class.
4822
4823 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4824
4825         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4826         more conservative.
4827         (VerifyPendingMethods): Revert change below.
4828
4829         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4830         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4831         that used to trigger warning -28.  Remove warning -28.
4832         * expression.cs (Invocation.OverloadResolve): Use
4833         TypeManager.IsOverride to distinguish override methods.
4834
4835         Fix #74773.
4836         * pending.cs (VerifyPendingMethods): If a base type implements the
4837         requested interface, don't bother checking individual methods of
4838         the base type.  As a side-effect, this prevents the creation of
4839         unnecessary proxies.
4840
4841 2005-05-02  Martin Baulig  <martin@ximian.com>
4842
4843         Fix #70182.
4844
4845         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4846         Also `And' the locals if the old vector is null.
4847         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4848         null; in this case we basically reset all the variables.        
4849
4850 2005-05-02  Martin Baulig  <martin@ximian.com>
4851
4852         Fix #74529.
4853
4854         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4855         Added `FlowBranching branching' argument; always `and' the
4856         variables instead of `or'ing them unless we're an infinite loop.
4857
4858         * statement.cs (While.Resolve): Create a new sibling unless we're
4859         infinite.       
4860
4861 2005-05-02  Martin Baulig  <martin@ximian.com>
4862
4863         Fix #70140.
4864
4865         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4866         arguments; use it instead of creating a new TopLevelBlock.
4867         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4868         our ConstructorInitializer.
4869
4870         * statement.cs
4871         (TopLevelBlock.TopLevelBranching): New public property.
4872         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4873         and create our `TopLevelBranching'.
4874
4875         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4876         anonymous method host, use `block.TopLevelBranching' rather than
4877         creating a new branching.
4878
4879 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4880
4881         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4882         a ScopeInfo, if any of the current children is a child of the new
4883         entry, move those children there.
4884
4885 2005-04-30  Martin Baulig  <martin@ximian.com>
4886
4887         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4888         at the beginning of a SwitchSection.  Fix #73335.
4889
4890 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4891
4892         Fix #74378
4893         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4894         
4895         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4896         (FieldExpr.DoResolve): Obsolete members are ignored for field
4897         initializers.
4898         
4899 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4900
4901         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4902         of arrays detection.
4903
4904         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4905         verification.
4906         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4907
4908         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4909         arrays report.
4910
4911 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4912
4913         * cs-parser.jay: Use the prefered version of -unsafe in error
4914         message.
4915
4916 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4917
4918         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4919         circumstances.
4920
4921 2005-04-20  John Luke  <john.luke@gmail.com>
4922
4923         * driver.cs: fix typo in error message, --outout to --output
4924
4925 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4926
4927         * codegen.cs (InRefOutArgumentResolving): New field.
4928         
4929         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4930         fields outside contructor.
4931         
4932         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4933         
4934 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4935
4936         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4937         parameter code was not completed ever, so it was not as up-to-date
4938         as local variables.  Must finish it.
4939
4940         The bug fix was to compare the Toplevel of the block, not the
4941         current block.  Thanks for Ben for pointing this out. 
4942
4943 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4944
4945         * decl.cs (AddMethods): Use the declaring type of the problem
4946         method to determine if we want to squash a warning.
4947
4948 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4949
4950         * attribute.cs: Removed debug output.
4951
4952         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4953         
4954         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4955         Report.Stderr.
4956         
4957 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4958
4959         Fix #74481.
4960         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4961         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4962         all null comparisons against reference types.
4963
4964 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4965
4966         Fix# 74565
4967         * class.cs (TypeContainer.CircularDepException) New nested
4968         exception class.
4969         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4970         (TypeContainer.DefineType): Removed error, reset InTransit before
4971         exit.
4972         (Class.DefineType): Throw exception when is in Transit.
4973         Catch exception and report error.
4974         (Struct.DefineType): Throw exception when is in Transit.
4975         Catch exception and report error.
4976         (Interface.DefineType): Throw exception when is in Transit.
4977         Catch exception and report error.
4978
4979         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4980         handle nested exception handlers.
4981
4982         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4983         a catch.
4984
4985         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4986         InFinally and InCatch storage.
4987
4988         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4989         (Catch.Resolve): Set and Restore ec.InCatch.
4990         (Try.Resolve): Set and Restore ec.InFinally.
4991         (Try.HasCatch): True when try has catch.
4992
4993 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4994
4995         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4996           for the same event member, so exclude such cases from warning 419.
4997           Fixed bug #74633.
4998
4999 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5000
5001         * expression.cs (Binary.ResolveOperator): Apply patch from John
5002         Luke to fix bug 59864: operators &, | and ^ on enumerations
5003         require that the same enum type on both sides.
5004
5005         * driver.cs: Add warnings to old flag usage, this is to assist
5006         people who produce Makefiles and hope that the Makefiles will be
5007         used on Windows.
5008
5009         * class.cs (TypeContainer.EmitType): Moved the definition of the
5010         special $PRIVATE$ field from the resolve phase to the Emit phase.
5011         During resolve we do not know if we are a struct with
5012         HasExplicitLayout, we know this only after the attributes for the
5013         type are emitted.
5014
5015         Set the FieldOffset to zero on the dummy field that we create for
5016         the class.   Fixes 74590.
5017
5018 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5019
5020         Fix #73834.
5021         * ecore.cs (PropertyExpr.resolved): New.
5022         (DoResolve): Use it to handle a case of double resolution here.
5023         Handle a case of identical-name-and-type-name.
5024         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5025         resolution by storing the results of expression resolution back
5026         into the "probes" array.
5027
5028 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5029
5030         Fix cs0208-7.cs and cs0208-8.cs.
5031         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5032         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5033         error reporting to point out the reason a struct is not unmanaged.
5034
5035 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5036
5037         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5038           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5039
5040 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5041
5042         Fix #74528.
5043         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5044         IdenticalNameAndTypeName here.
5045         (EventExpr.InstanceResolve): Likewise.
5046
5047 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5048
5049         C# 2.0 DefaultCharSetAttribute implementation
5050         
5051         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5052         which allows us to set GlobalNamespace for every resolve.
5053         (Attribute.ResolveArguments): Cut from Resolve.
5054         (Attribute.GetCharSetValue): Returns CharSet named argument.
5055         (Attribute.DefinePInvokeMethod): Gets default charset from
5056         module settings.
5057         (GlobalAttribute.ResolveAsTypeStep): Override.
5058         (GlobalAttribute.ResolveArguments): Override.
5059         
5060         * class.cs (TypeAttr): Is protected.
5061         
5062         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5063         (ModuleClass.DefaultCharSetType): New memeber.
5064         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5065         
5066         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5067         charset from module.
5068         
5069         * delegate.cs (TypeAttr): Override.
5070         (Delegate.DefineType): Use this TypeAttr.
5071         
5072         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5073         at very early stage (before types are defined) to resolve model
5074         module attributes. It will probably not work with corlib but it
5075         should be ok.
5076         
5077         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5078         charset from module.
5079         
5080         * typemanager.cs (default_charset_type): New type.
5081
5082 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5083
5084         * decl.cs (MemberCache.AddMethods): Don't warn if
5085         System.Object.Finalize has buggy MethodAttributes.
5086
5087         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5088         removed below.
5089
5090 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5091
5092         * doc.cs : detect ambiguous reference to overloaded members.
5093           Fixed bug #71603. MS 1.1 csc does not detect it.
5094
5095 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5096
5097         * doc.cs : delegates must not be referenced with parameters.
5098           Fixed bug #71605.
5099
5100 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5101
5102         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5103
5104 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5105
5106         * driver.cs (MainDriver): Stop processing if the CLS stage found
5107         errors. 
5108
5109         (CompilerCallableEntryPoint.InvokeCompiler): Always
5110         reset after execution;   Take a TextWriter argument for the
5111         output.
5112
5113         * report.cs: Use the error stream instead of hardcoding stderr. 
5114
5115 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5116
5117         * class.cs: Reduce code paths to test, too small of an
5118         optimization to make it worth the extra testing.  Always perform
5119         it. 
5120
5121 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5122
5123         Fix #74510.
5124         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5125         operators that had errors reported on them.
5126
5127 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5128
5129         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5130         argument types.
5131         (Attribute.Resolve): Add named argument type checking.
5132         
5133         * class.cs (FixedField.Define): Use IsPrimitiveType
5134         
5135         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5136         
5137         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5138         unsafe parameter types.
5139         
5140         * statement.cs (Using.ResolveExpression): Add better error description.
5141         
5142         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5143         
5144 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5145
5146         Fix #74484.
5147         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5148         AttributeUsageAttribute in the emitcontext of the attribute class,
5149         not in the emitcontext of the attributable entity it was attached to.
5150         * cs-parser.jay: Use 'current_class', not 'current_container',
5151         when creating a GlobalAttribute.
5152
5153 2005-04-08  Alp Toker  <alp@atoker.com>
5154
5155         * pending.cs: The fix to #58413 failed to compile methods implementing
5156         interfaces with/without params modifiers and vice versa, even though
5157         params modifiers aren't part of the signature. Make the modifier check
5158         less strict as in csc.
5159
5160 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5161             Anoob V E  <projectmonokochi@rediffmail.com>
5162             Harilal P R  <projectmonokochi@rediffmail.com>
5163
5164         Fix #58413.
5165         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5166         modifiers of pending methods.
5167         (PendingImplementation.PendingImplementation): Initialize it.
5168         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5169         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5170         with ParameterData.  Add check for modifiers.
5171         * class.cs (MethodData.Define): Update to changes.
5172
5173 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5174
5175         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5176
5177 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5178
5179         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5180         property.
5181         
5182         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5183         
5184         * rootcontext.cs,
5185         * typemanager.cs: Registered RequiredAttributeAttribute.
5186         
5187 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5188
5189         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5190         Warning CS0169 is back at level 3.
5191         (IMethodData.SetMemberIsUsed): New method.
5192         
5193         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5194         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5195         
5196         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5197
5198         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5199         contants.
5200         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5201         is used.
5202         
5203         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5204         is used.
5205         
5206         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5207         to avoid the problems with nested types.
5208
5209 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5210             Anoob V.E  <projectmonokochi@rediffmail.com>
5211             Harilal P.R  <projectmonokochi@rediffmail.com>
5212             Raja R Harinath  <rharinath@novell.com>
5213
5214         Fix #73820.
5215         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5216         attribute.
5217         * typemanager (GetConstructor): Make public.
5218
5219 2005-04-05  John Luke  <john.luke@gmail.com>
5220             Raja R Harinath  <rharinath@novell.com>
5221
5222         Fix #62232.
5223         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5224         struct too.  Return false quicker in a few cases.
5225         (VerifyUnManaged): Use it.
5226
5227 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5228
5229         Fix #74041.
5230         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5231         not 'unreachable_seen'.
5232
5233 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5234
5235         * attribute.cs (Attribute.GetValue): Removed unused.
5236         
5237         * codegen.cs (CodeGen.TrimExt): Removed unused.
5238         
5239         * cs-parser.jay (output): Removed unused.
5240         
5241         * cs-tokenizer.cs (hex_digits): Removed unused.
5242         
5243         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5244         
5245         * expression.cs (Indirection.LoadExprValue): Removed unused.
5246         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5247         
5248         * iterators.cs (Iterator.param_types): Removed unused.
5249         
5250         * statement.cs (Goto.block): Removed unused.
5251         (ToplevelBlock.did): Removed unused.
5252         (Switch.ResolveConstantSwitch): Removed unused.
5253
5254 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5255
5256         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5257         resetting thingy.
5258
5259 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5260
5261         Fix #74232 and cs0208-3.cs.
5262         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5263         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5264         unmanaged type.  Don't use FieldBuilders when 't' is a
5265         TypeBuilder.  Use ModFlags and MemberType fields.
5266         * class.cs (MemberBase.member_type): Rename from MemberType.
5267         (MemberBase.MemberType): New property.  Determines member_type on
5268         demand.
5269         (MemberBase.DoDefine): Don't initialize MemberType here.
5270         (FieldMember.Define): Likewise.
5271
5272 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5273
5274         Fix #74241
5275         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5276         Attributes are emitted there.
5277         
5278 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5279
5280         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5281         keyword in 'partial enum' too.
5282         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5283         is not allowed).
5284         Report from Kamil Skalski <nazgul@omega.pl>.
5285
5286         Fix #74309.
5287         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5288         have partial containers too.
5289
5290         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5291         in block' checks to Block.CheckInvariantMeaningInBlock.
5292         * statement.cs (Block.GetKnownVariableInfo): Make private.
5293         (Block.IsVariableUsedInChildBlock): Remove.
5294         (Block.IsVariableUsedInBlock): Likewise.
5295         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5296         conflicting declaration.
5297         (Block.AddVariable): Make error messages less long-winded and more
5298         specific.  Show location of conflicting declaration.
5299         * parameter.cs (Parameters.Location): New readonly property.
5300
5301 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5302
5303         Clean up semantics of invoking ResolveMemberAccess.
5304         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5305         can have an instance, ensure that we pass in a non-TypeExpression
5306         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5307         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5308         argument.  Update to changes and simplify.
5309         (FieldExpr.Emitinstance): Remove CS0120 check.
5310         (PropertyExpr.EmitInstance): Likewise.
5311         * expression.cs (Argument.Resolve): Likewise.
5312         (Invocation.DoResolve): Update to changes in semantics of
5313         InstanceExpression.
5314
5315 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5316
5317         Fix #74241
5318         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5319         customization.
5320         
5321         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5322
5323 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5324
5325         Fix difference in behaviour with commandline invocation.
5326         * driver.cs (Driver.Reset): New.
5327         (CompilerCallableEntryPoint): Call it.
5328
5329         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5330         variable" warnings if the boolean expression failed to resolve.
5331
5332 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5333
5334         * attribute.cs: Fix the union of several permissions when some of them
5335         are unrestricted (so the result isn't an unrestricted permission set).
5336         Fix #74036.
5337
5338 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5339
5340         * ecore.cs (MemberExpr): New class.  Convert from interface
5341         IMemberExpr.
5342         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5343         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5344         error checks.
5345         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5346         (MethodGroupExpr.IsExplicitImpl): Remove.
5347         (Expression.GetFieldFromEvent): Remove.
5348         (SimpleName.MemberStaticCheck): Remove.
5349         (SimpleName.DoSimpleNameResolve): Update to changes.
5350         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5351         (MemberAccess.IdenticalNameAndTypeName): Remove.
5352         (MemberAccess.error176): Move to MemberExpr.
5353         (MemberAccess.DoResolve): Update to changes.
5354         (BaseAccess.DoResolve): Likewise.
5355
5356 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5357
5358         C# 2.0 Conditional attribute class implementation
5359         
5360         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5361         Analyzes class whether it has attribute which has ConditionalAttribute
5362         and its condition is not defined.
5363         
5364         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5365         (Class.IsExcluded): New method. Search for at least one defined
5366         condition in ConditionalAttribute of attribute class.
5367
5368 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5369
5370         * ecore.cs (PropertyExpr): Derive from Expression, not
5371         ExpressionStatement.
5372         (PropertyExpr.EmitStatement): Remove.
5373
5374 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5375
5376         Fix #74060.
5377         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5378         internal field "value__" of an enum be private.  The examples for
5379         "value__" that I found on MSDN all used FieldAttributes.Private.
5380
5381         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5382         Don't mention IL method attribute names.
5383
5384         Fix #47991.  Remove a TODO.
5385         * statement.cs (Block.Toplevel): Make into a field.
5386         (Block.Parameters): Move into ToplevelBlock.
5387         (Block.known_variables): Rename from child_variable_names.
5388         (Block.Block): Remove variants that take Parameters.  Initialize
5389         'Toplevel' with the immediately surrounding toplevel block.
5390         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5391         LocalInfo parameter.
5392         (Block.GetKnownVariableInfo): New.
5393         (Block.IsVariableNameUsedInChildBlock): Update.
5394         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5395         the block, even though it may not be in scope.
5396         (Block.AddVariable): Remove Parameters parameter.  Use
5397         Toplevel.Parameters instead.
5398         (Block.AddConstant): Remove Parameters parameter.
5399         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5400         (Block.IsParamaterReference): Likewise.
5401         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5402         (ToplevelBlock.Parameters): New.  Moved from Block.
5403         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5404         initialize Parameters to a non-null value.
5405         * cs-parser.jay: Update to changes.
5406         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5407         simple names that mean different things in the same block.  Use
5408         Block.IsVariableNameUsedInBlock.
5409
5410 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5411
5412         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5413         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5414         GetTypeHandle.  It is possible for a reflected type to derive from
5415         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5416         System.Array during mscorlib compilation).
5417         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5418         contain a method_hash, don't create one either.  Don't create a
5419         deep copy of the base cache's method_hash.
5420         (MemberCache.SetupCache): Rename back from DeepCopy.
5421         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5422         already initialized.  If we see an override function, add its
5423         underlying base virtual function to the member_hash too.
5424
5425         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5426
5427 2005-03-26  Raja R Harinath  <harinath@acm.org>
5428
5429         Fix #73038.
5430         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5431         fails to resolve, ensure that the LHS is still resolved as an
5432         lvalue.
5433
5434 2005-03-25  Raja R Harinath  <harinath@acm.org>
5435
5436         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5437         ec.ContainerType.
5438         (Enum.current_ec): Remove.
5439         (Enum.LookupEnumValue): Remove EmitContext argument.
5440         Just uses the one created during DefineType.
5441         (Enum.FindMembers): Update.
5442         * expression.cs (MemberAccess.DoResolve): Update.
5443
5444 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5445
5446         * assign.cs (Assign.DoResolve): Check for CS1717 when
5447         source and target are same (uses Equals).
5448
5449         * expression.cs (LocalVariableReference, ParameterReference,
5450         This): Implemented Equals, GetHashCode.
5451
5452         * statement.cs (Block.GetParameterReference): Removed useless
5453         local variable.
5454
5455 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5456
5457         Fix cs0128.cs
5458         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5459         blocks before deciding whether the error is cs0136 or cs0128.
5460
5461         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5462         (using_alias_directive, using_namespace_directive): Pass
5463         MemberName, not an expression to Namespace.UsingAlias and
5464         Namespace.Using.
5465         (MakeName): Use the MemberName of the namespace.
5466         * namespace.cs (Namespace.MemberName): New.
5467         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5468         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5469         Likewise.
5470         * decl.cs (MemberName.Name): Make readonly.
5471         (MemberName.FromDotted): New "constructor".
5472         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5473         (MemberCore.Name): Compute from MemberName on demand.
5474         (MemberCore.SetMemberName): Provide a way to change the
5475         MemberName.
5476         (MemberCore.AddToContainer): Don't take a fullname parameter.
5477         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5478         fully qualified name of the container to the member name.
5479         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5480         only if the type is a member of the root container.
5481         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5482         MemberName.Left rather than searching for an embedded ".".
5483         (PartialContainer.CreatePart): Update to changes in RootContext.
5484         (MemberBase.ShortName): Turn into a property.  Use
5485         MemberCore.SetMemberName.
5486         (MemberBase.ExplicitInterfaceName): Remove.
5487         (MemberBase.UpdateMemberName): Remove.
5488         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5489         (PropertyBase.SetMemberName): New override.
5490         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5491         (Tree.GetDecl): New.
5492         (Tree.AllDecls): Rename from Decls.
5493         * attribute.cs, enum.cs, report.cs: Update to changes.
5494         * driver.cs (MainDriver): Use MemberName.FromDotted on
5495         RootContext.MainClass.
5496
5497 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5498
5499         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5500         checks.
5501
5502         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5503
5504 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5505
5506         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5507         property accessor modifiers.
5508
5509         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5510         fixed buffer attribute (CS1716).
5511         (PropertyMethod.HasCustomAccessModifier): When property accessor
5512         has custom modifier.
5513
5514         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5515         modifiers.
5516         (PropertyExpr.DoResolveLValue): Add CS0272.
5517
5518 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5519
5520         * convert.cs: When converting to a pointer, use the proper Conv.U
5521         or Conv.I depending on the source data type.
5522
5523         * cs-tokenizer.cs: Make the size for large decimal constants,
5524         fixes #72957.
5525
5526 2005-03-17  Martin Baulig  <martin@ximian.com>
5527
5528         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5529         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5530
5531 2005-03-17  Martin Baulig  <martin@ximian.com>
5532
5533         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5534         to bool so we can return an error condition.
5535         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5536         returned an error.
5537
5538 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5539
5540         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5541         attributes.
5542
5543 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5544
5545         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5546         Refactor to avoid traversing the list of assemblies, and to avoid
5547         string concatenation.
5548         * typemanager.cs (guid_attr_type): Remove.
5549         (negative_hits, pointers, references): Remove hashes.
5550         (type_hash): New.
5551         (GetConstructedType): New.  Uses type_hash to handle constructed
5552         types (arrays, references, pointers).
5553         (GetReferenceType, GetPointerType): Use it.
5554         (GetNestedType): New.  Uses type_hash to handle nested types of
5555         reflected types.
5556         (LookupType, LookupTypeDirect): Remove.
5557         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5558         'types' hash and LookupTypeReflection directly.
5559         (params_string, params_object): Use GetConstructedType.
5560         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5561         top-level types.
5562         (Namespace.Lookup): Use cached_types.
5563         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5564         provided by old TypeManager.LookupType.
5565         * rootcontext.cs (MakeFQN): Remove.
5566         * decl.cs (DeclSpace.MakeFQN): Likewise.
5567         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5568         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5569         TypeManager.GetConstructedType.
5570         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5571
5572 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5573
5574         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5575         indexers.
5576
5577         * cs-parser.jay: Reports CS1527 for any namespace element.
5578
5579         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5580         Added CS0407.
5581
5582         * expression.cs (ParameterReference.IsAssigned): Changed error to
5583         CS0269.
5584         (Error_WrongNumArguments): Moved CS0245 detection here.
5585
5586         * statement.cs (Return.Resolve): Add CS1622 report.
5587
5588 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5589
5590         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5591
5592 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5593
5594         * attribute.cs expression.cs: Get rid of some allocations.
5595
5596 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5597
5598         * doc.cs : just eliminate the latest change.
5599
5600 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5601
5602         * doc.cs : commented out the latest change. It breaks xml-030.cs
5603
5604 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5605
5606         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5607           fail. So invoke CreateType() in FindDocumentedType().
5608
5609 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5610
5611         * cs-tokenizer.cs : added IsKeyword().
5612         * doc.cs : Detect keyword incorrectly used as identifier.
5613           Allow identifiers prefixed by @.
5614
5615 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5616
5617         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5618         It caused exception in namespace resolving (again!).
5619         
5620         * class.cs (Class.ctor): Removed exit.
5621         (PropertyMethod.ctor): ditto.
5622         
5623         * codegen.cs (Codegen.Reset): Reset static data.
5624         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5625         
5626         * cs-tokenizer.cs (Cleanup): Removed.
5627         
5628         * driver.cs (GetSystemDir): Rewrote to one line command.
5629         It caused problem with unloaded dynamic modules.
5630         (UnixParseOption): Removed Exit.
5631         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5632         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5633         Now can be mcs used as library.
5634         
5635         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5636         empty location.
5637         
5638         * location.cs (Reset): Reset static data.
5639         
5640         * namespace.cs (Reset): Reset static data.
5641         
5642         * report.cs (Report.Reset): Reset static data.
5643         
5644         * rootcontext.cs (RootContext.Reset): Reset static data.
5645         
5646         * tree.cs (RootTypes.ctor): Use Location.Null
5647         
5648         * typemanager.cs (TypeManager.Reset): Reset static data.
5649         (CoreLookupType): Removed Exit.
5650         (TypeHandle.Reset): Reset static data.
5651         
5652 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5653
5654         Fix #73516.
5655         * typemanager.cs (ComputeNamespaces): Import namespaces from
5656         referenced modules too.
5657
5658 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5659
5660         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5661         than '.'.
5662
5663 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5664
5665         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5666         enclosing DeclSpace.  This ensures that a name-lookup populates
5667         more caches and there are fewer 'TypeExpression's.  Carve out
5668         nested type lookup into ...
5669         (LookupNestedTypeInHierarchy): ... this.
5670
5671 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5672
5673         Clean up a few partial-class semantics.  
5674         Fixes test-357.cs and cs1618-2.cs.
5675         * cs-parser.jay (struct_declaration): Use 'current_class' as
5676         parent of newly-created struct.  Remove call to Register ().
5677         Use 'pop_current_class' to complete handing the current struct.
5678         (interface_declaration): Likewise.
5679         (class_declaration): Likewise.
5680         (enum_declaration): Use 'current_class' as parent of newly created
5681         enum.
5682         (delegate_declaration): Likewise.
5683         (pop_current_class): New function.  This is used to handle closing
5684         up the 'current_class' and 'current_container', and pointing them
5685         to the enclosing class/container.
5686         (CSharpParser): Initialize 'current_class' too.
5687         * decl.cs (MemberCore): Add check for invariant: a partial
5688         container is not a parsed entity, and thus does not enclose any
5689         parsed members.
5690         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5691         (DeclSpace.BaseTypeExpr): Use it.
5692         (DeclSpace.LookupType): Add check for invariant.
5693         * class.cs (TypeContainer): Add check for invariant: a nested
5694         class should have the same NamespaceEntry as its enclosing class.
5695         (TypeContainer.EmitFieldInitializers): Make virtual.
5696         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5697         MemberCore.
5698         (TypeContainer.Register): Remove.
5699         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5700         null.  Use TypeResolveEmitContext for resolving base types and
5701         interfaces.  Move initialization of Parts.TypeBuilder here from
5702         ...
5703         (TypeContainer.DefineNestedTypes): ... here.
5704         (PartialContainer): Take a Namespace not a NamespaceEntry.
5705         (PartialContainer.Create): Don't use Register.  Call the
5706         appropriate Add... function directly.
5707         (ClassPart): Take both the PartialContainer and the enclosing
5708         class as constructor arguments.
5709         (ClassPart.EmitFieldInitializers): Override.
5710         (ClassPart.PartFindNestedTypes): Remove.
5711         (FieldBase.GetInitializerExpression): Resolve the initializer
5712         expression in the emit context of the enclosing class.
5713         * tree.cs (RootTypes): Remove Register ().
5714         
5715 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5716
5717         * cs-parser.jay: Removed CS0134.
5718         
5719         * driver.cs: Removed CS1901.
5720         
5721         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5722         for predefined types.
5723
5724 2005-03-07  Duncan Mak  <duncan@novell.com>
5725
5726         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5727         well. Fixes bug #73454.
5728
5729 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5730
5731         * cs-tokenizer.cs (xtoken): Add CS1035.
5732         
5733         * class.cs (MethodData.Define): Add CS0683.
5734         (FieldMember.ctor): Add CS0681.
5735
5736 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5737
5738         * ecore.cs (SimpleName.DoResolve): Rename from
5739         SimpleName.DoResolveAllowStatic.
5740         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5741         Pass 'intermediate' flag to MemberStaticCheck.
5742         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5743         of "intermediate" lookups via MemberAccess.
5744         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5745         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5746
5747 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5748
5749         Fix #73394.
5750         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5751         slipped in because of variable names that are identical to a
5752         builtin type's BCL equivalent ('string String;', 'int Int32;').
5753         (PropertyExpr.EmitInstance): Likewise.
5754
5755 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5756
5757         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5758         
5759         * report.cs (warning_ignore_table): Made public.
5760
5761 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5762
5763         Fix #73282.
5764         * class.cs (MethodData.Emit): Pass 'container' to
5765         container.GetObsoleteAttribute instead of 'container.Parent'.
5766
5767 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5768
5769         * cs-parser.jay: Add 1534 error test.
5770
5771         * iterators.cs (Yield.CheckContext): Add error 1629.
5772         (Iterator.ctor): Save unsafe modifier.
5773         (MoveNextMethod.DoEmit): Restore unsafe context.
5774
5775         * namespace.cs (UsingAlias): Better error message.
5776
5777 2005-03-03  Dan Winship  <danw@novell.com>
5778
5779         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5780         the warning message [#73219]
5781
5782 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5783
5784         Fix compile with MCS 1.0.0.0.
5785         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5786         w_restore to not depend on string constant folding.
5787
5788 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5789
5790         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5791         CS0246 check to users who passed 'silent = false'.
5792         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5793         check.
5794         (SimpleName.SimpleNameResolve): Update.
5795         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5796         (MemberAccess.IdenticalNameAndTypeName): Update.
5797         * doc.cs (FindDocumentedTypeNonArray): Update.
5798
5799 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5800
5801         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5802         * parameters.cs (ComputeAndDefineParameters): Remove.
5803         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5804         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5805         Use GetParameterInfo.
5806
5807 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5808
5809         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5810
5811 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5812
5813         Unify DeclSpace.LookupType and DeclSpace.FindType.
5814         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5815         is in charge of defining nested types on demand.
5816         (DeclSpace.LookupType): Use it when the current_type is a
5817         TypeBuilder.  Use LookupTypeDirect for reflected types.
5818         (DeclSpace.FindType): Remove.
5819         (DeclSpace.LookupInterfaceOrClass): Likewise.
5820         (DeclSpace.DefineTypeAndParents): Likewise.
5821         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5822         DeclSpace.LookupType.
5823         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5824         * typemanager.cs (LookupType): Simplify.
5825         (AddUserType): Remove type from negative_hits.
5826         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5827         * class.cs (TypeContainer.FindMembers): Move handling of nested
5828         types ...
5829         (TypeContainer.FindMembers_NestedTypes): ... here.
5830         (TypeContainer.FindNestedType): Implement override.
5831         (ClassPart.FindNestedType): Delegate to PartialContainer.
5832         (ClassPart.PartFindNestedType): Looks up the nested types of the
5833         part alone.
5834
5835 2005-03-02  Martin Baulig  <martin@ximian.com>
5836
5837         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5838         static constructor in static classes.
5839
5840 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5841
5842         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5843         sizeParamIndex is not specified.
5844
5845 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5846
5847         Fix #73117
5848         * report.cs (WarningMessage.IsEnabled): Missing null check.
5849
5850 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5851
5852         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5853         in the fields and not in the properties.
5854
5855 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5856
5857         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5858         fields as well.
5859
5860 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5861
5862         * attribute.cs: Small refactoring (improved robustness).
5863         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5864         (ValidateGuid): Removed.
5865         (Resolve): Removed referenced to above mentioned.
5866         (GetAttributeUsage): Made private and changed to work without
5867         class assistance.
5868         (GetIndexerAttributeValue): Don't crash.
5869         (GetConditionalAttributeValue): Ditto.
5870         (GetClsCompliantAttributeValue): Ditto.
5871         (ExtractSecurityPermissionSet): All attributes exceptions are
5872         error 648.
5873         (GetPropertyValue): New helper.
5874         (GetMethodImplOptions): New method.
5875         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5876         some missing properties.
5877         
5878         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5879         (Method.ApplyAttributeBuilder): Updated.
5880         
5881         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5882         exception.
5883
5884 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5885
5886         Fix #73052.
5887         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5888         non-simple types (array, pointer, reference).
5889
5890 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5891
5892         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5893
5894         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5895         for operators.
5896         (Method.CheckBase): Catch wrong destructor here.
5897         (MethodData.Define): Add errors 550, 668.
5898
5899         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5900
5901         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5902
5903         * pending.cs (VerifyPendingMethods): Add error 551.
5904
5905         * typemanager.cs (CSharpName): Next error report helper.
5906
5907 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5908
5909         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5910         attributes. Removed useless attribute double check.
5911         It saves almost 2MBs for corlib.
5912
5913 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5914
5915         Fix #72924.
5916         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5917         called twice in case of error.
5918
5919 2005-02-23  Chris Toshok  <toshok@ximian.com>
5920
5921         Fix compiler portions of #72827.
5922         * statement.cs (Block.Emit): call Begin/EndScope on the
5923         EmitContext instead of the ILGenerator.
5924
5925         * codegen.cs (EmitContext.BeginScope): new method, call
5926         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5927         we have one.)
5928         (EmitContext.BeginScope): same, but EndScope and CloseScope
5929
5930         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5931         offset and call the superclass's OpenScope(int) with it.
5932         (SymbolWriter.CloseScope): get the current il
5933         offset and call superclass's CloseScope(int) with it.
5934
5935 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5936
5937         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5938         CS1677 for out and ref as well.
5939
5940         * class.cs (Method.Define): Add error CS1599 detection.
5941         
5942         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5943         
5944         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5945         
5946         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5947         
5948         * support.cs.cs (ModifierDesc): New helper method.
5949
5950 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5951             Abin Thomas  <projectmonokochi@rediffmail.com>
5952             Anoob V E  <projectmonokochi@rediffmail.com>
5953             Harilal P R  <projectmonokochi@rediffmail.com>
5954
5955         Fix #57851, #72718.
5956         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5957         MemberLookup (used for error reporting) actually returns a result.
5958         Fix error report number (122, not 112).
5959
5960 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5961             Anoob V E  <projectmonokochi@rediffmail.com>
5962             Harilal P R  <projectmonokochi@rediffmail.com>
5963
5964         Fix #71134.
5965         * pending.cs (PendingImplementation.GetAbstractMethods):
5966         Find NonPublic members too.
5967
5968 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5969
5970         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5971         Fixed error 217.
5972         
5973         * class.cs (MethodCore.CheckMethodAgainstBase):
5974         Add error 239 report.
5975
5976 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5977
5978         Fix #68955.
5979         * expression.cs (Invocation.IsApplicable): Make public.
5980         (Invocation.IsParamsMethodApplicable): Likewise.
5981         * delegate.cs (Delegate.VerifyApplicability): Don't use
5982         Invocation.VerifyArgumentCompat for parameter applicability
5983         testing.  Use Invocation.IsApplicable and
5984         Invocation.IsParamsMethodApplicable.
5985
5986 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5989         
5990         * class.cs (Operator.Define): Add error 217 report.
5991         
5992 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5993
5994         * namespace.cs (UsingEntry.Resolve): Undo change below.
5995
5996 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5997
5998         Fix #72756.
5999         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6000         disable the error message when the extended MemberLookup also
6001         fails.
6002         (Expression.MemberLookupFinal): Update.
6003         (SimpleName.DoSimpleNameResolve): Update.
6004         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6005         Don't use MemberLookupFinal.
6006         (New.DoResolve): Update.
6007         (BaseAccess.CommonResolve): Update.
6008
6009 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6010
6011         Fix #72732.
6012         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6013         occured previously, don't resolve again.
6014
6015 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6016
6017         Fix #69949
6018         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6019         argument. Call ResolveAttributeUsage for unresolved.
6020         when types doesn't match ctor arguments.
6021         
6022         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6023         for nested attribute classes.
6024         (Class.attribute_usage): Removed.
6025         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6026         for attribute class.
6027         
6028         * ecore.cs (IsAttribute): Removed.
6029         
6030         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6031         
6032         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6033         now normal types.
6034         (attribute_types): Removed.
6035         (EmitCode): Global attributes are emited as the latest.
6036
6037 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6038
6039         * class.cs (EmitFieldInitializers): Don't emit field initializer
6040         for default values when optimilization is on.
6041         
6042         * constant.cs (Constant.IsDefaultValue): New property.
6043         
6044         * driver.cs: Add /optimize handling.
6045         
6046         * constant.cs,
6047         * ecore.cs,
6048         * literal.cs: Implement new IsDefaultValue property.
6049         
6050         * rootcontext.cs (Optimize): New field, holds /optimize option.
6051
6052 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6053
6054         Fix crasher in re-opened #72347.
6055         * namespace.cs (Namespace.Lookup): Return null if
6056         DeclSpace.DefineType returns null.
6057
6058         Fix #72678.
6059         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6060
6061 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6062
6063         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6064         now returns null if it cannot resolve to an lvalue.
6065         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6066         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6067         returned null.  Remove check for SimpleName.
6068         (EventExpr.DoResolveLValue): New.
6069         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6070         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6071         error from ...
6072         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6073         avoid CS0131 error.
6074         (Unary.ResolveOperator): Move CS0211 check ...
6075         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6076         CS0131 error.
6077         (Unary.DoResolveLValue): Simplify.
6078         (AddressOf.DoResolveLValue): New.
6079         (ArrayAccess.DoResolveLValue): New.
6080
6081 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6082
6083         * attribute.cs (Attribute.Resolve): Add arguments casting for
6084         when types doesn't match ctor arguments.
6085
6086 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6087
6088         Fix parts of #63202.
6089         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6090         lookup of operator in base type.  Ensure that all checks happen
6091         when the operator resolves to an "op_..." method.
6092
6093 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6094
6095         Fix #71992.
6096         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6097         'ignore_cs0104' parameter.  Pass it to ...
6098         (NamespaceEntry.Lookup): ... this.
6099         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6100         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6101         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6102         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6103         Update.  Request that cs0104 errors be ignored.
6104         (ComposedCast.ResolveAsTypeStep): Update.
6105
6106 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6107
6108         Fix #59209.
6109         * expression.cs (Invocation.BetterFunction): Remove support for
6110         comparing virtual functions and their overrides.
6111         (Invocation.IsOverride): New.
6112         (Invocation.OverloadResolve): Don't consider 'override' functions
6113         during candidate selection.  Store them in a lookaside list.
6114         If the selected method is a 'virtual' function, use the list to
6115         find any overrides that are closer to the LHS type.
6116
6117 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6118
6119         * expression.cs (New.DoResolve): Add complex core type reduction.
6120         (New.Constantify): Converts complex core type syntax like 'new int ()'
6121         to simple constant.
6122         
6123 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6124
6125         * decl.cs (EntryType.EntryType): New constructor to create an
6126         updated copy of a cache entry.
6127         (MemberCache.AddMethods): Use it.
6128         (MemberCache.ClearDeclaredOnly): Remove.
6129         (MemberCache.MemberCache): Update.
6130
6131 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6132
6133         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6134         variable.  This one is represents the actual low-level declaration
6135         of the method, as opposed to the semantic level `IsStatic'.   
6136
6137         An anonymous method which is hosted into a static method might be
6138         actually an instance method.  IsStatic would reflect the
6139         container, while MethodIsStatic represents the actual code
6140         generated.
6141
6142         * expression.cs (ParameterReference): Use the new MethodIsStatic
6143         instead of IsStatic.
6144
6145         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6146         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6147         set on the current EmitContext. 
6148
6149         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6150         resolve our casted expression as an LValue.  This triggers the
6151         proper LValue processing that is later required by Assign.
6152
6153         This fixes 72347.
6154
6155         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6156
6157 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6158
6159         C# 2.0 Fixed buffer implementation
6160
6161         * anonymous.cs: Update after RegisterHelperClass renaming.
6162
6163         * attribute.cs (AttributeTester.fixed_buffer_cache):
6164         Cache of external fixed buffers.
6165         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6166         implementation if field is fixed buffer else null.
6167
6168         * class.cs
6169         (TypeContainer.AddField): Accept FieldMember instead of Field.
6170         (FieldBase.IsFieldClsCompliant): Extracted code from
6171         VerifyClsCompliance descendant customization.
6172         (FixedField): New class handles fixed buffer fields.
6173         (FixedFieldExternal): Keeps information about imported fixed
6174         buffer.
6175         (IFixedField): Make access to internal or external fixed buffer
6176         same.
6177
6178         * cs-parser.jay: Add fixed buffer parsing.
6179
6180         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6181         buffer.
6182
6183         * expression.cs (Indirection): Extended implementation to accept
6184         fixed buffer field.
6185         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6186         (ElementAccess.MakePointerAccess): Get type as parameter.
6187         (DoResolve): Add fixed buffer field expression conversion.
6188         (DoResolveLValue): Ditto.
6189         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6190         (ArrayPtr): Derives from FixedBufferPtr.
6191         (ArrayPtr.Emit): Add extra emit for array elements.
6192
6193         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6194
6195         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6196         for compiler generated types.
6197         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6198
6199         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6200         and consume less memory.
6201         (Fixed.Resolve): Add fixed buffer case.
6202
6203         * typemanager.cs (compiler_generated_attr_ctor,
6204         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6205         (HasElementType): Add our own implementation to work on every
6206         runtime.
6207
6208 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6209
6210         * anonymous.cs (CaptureContext): Track whether `this' has been
6211         referenced.   
6212
6213         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6214         only captured `this' if it was implicitly done (instance
6215         methods/variables were used). 
6216
6217         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6218         `this' must be captured.
6219
6220 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6221  
6222         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6223         is null it means that there has been no need to capture anything,
6224         so we just create a sibling.
6225
6226         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6227
6228         Just a partial fix.  The other half is fairly elusive.
6229         
6230 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6231
6232         Fix #52586, cs0121-4.cs.
6233         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6234         and return a hashtable.
6235         (MemberCache.ClearDeclaredOnly): New.
6236         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6237         the method_hash of a base type too.
6238         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6239         type methods.  Overwrite entries with the same MethodHandle so
6240         that the ReflectedType is correct.  The process leaves in base
6241         virtual functions and their overrides as distinct entries.
6242         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6243         matters since it was boxed in a ArrayList before.
6244         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6245         modifier.
6246         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6247         case of a virtual function and its override (choose the overload
6248         as better).
6249         (Invocation.OverloadResolve): Avoid 'override' members during
6250         'applicable_type' calculation.
6251
6252 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6253
6254         Combine two near-redundant caches.
6255         * typemanager.cs (method_params): Rename from method_internal_params.
6256         (TypeManager.GetParameterData): New.  Replace
6257         Invocation.GetParameterData.
6258         (TypeManager.LookupParametersByBuilder): Remove.
6259         * expression.cs (Invocation.method_parameter_cache): Remove.
6260         (Invocation.GetParameterData): Remove.
6261         Update to changes.
6262         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6263         Update to changes.
6264
6265 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6266
6267         Fix #72015.
6268         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6269         TypeManager.multicast_delegate_type is null, resolve it by looking
6270         up "System.MulticastDelegate".
6271         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6272
6273 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6274             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6275             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6276
6277         Fix cs0164.cs.
6278         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6279         (LabeledStatement.AddReference): New.  Set 'referenced'.
6280         (Goto.Resolve): Use it.
6281
6282 2005-02-05  John Luke  <john.luke@gmail.com>
6283
6284         * driver.cs: remove duplicate -doc line in Usage ()
6285
6286 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6287
6288         * location.cs (Location.AddFile): Fix CS2002 error report.
6289
6290 2005-02-02  Martin Baulig  <martin@ximian.com>
6291
6292         * delegate.cs (Delegate.DefineType): Report an internal error if
6293         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6294         details.        
6295
6296 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6297
6298         Fix a crasher in a variant of #31984.
6299         * const.cs (Constant.CheckBase): New override that defers the
6300         new-or-override check in case the base type hasn't been populated
6301         yet.
6302         (Constant.Define): Ensure the new-or-override check is performed.
6303
6304 2005-02-01  Duncan Mak  <duncan@ximian.com>
6305
6306         * const.cs (LookupConstantValue): Check that `ce' is not null
6307         before calling GetValue ().
6308
6309 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6310
6311         Fix test-334.cs (#69519).
6312         * cs-parser.jay (using_alias_directive): Pass in an expression to
6313         NamespaceEntry.UsingAlias.
6314         (using_namespace_directive): Pass in an expression to
6315         NamespaceEntry.Using.
6316         (namespace_name): Don't flatten to a string.
6317         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6318         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6319         ResolveAsTypeStep.
6320         (NamespaceEntry.UsingEntry): Likewise.
6321         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6322         changes.
6323         (NamespaceEntry.LookupForUsing): Remove.
6324         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6325         names.
6326         (NamespaceEntry.Lookup): Remove support for dotted names.
6327
6328 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6329
6330         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6331         split into two.
6332         (NamespaceEntry.ImplicitParent): Compute on demand.
6333         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6334         parallels the current.
6335         (NamespaceEntry.LookupForUsing): Use it.
6336         (NamespaceEntry.Lookup): If the current namespace-entry is
6337         implicit, don't search aliases and using tables.
6338
6339 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6340
6341         Fix #31984.
6342         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6343         BaseCache here.
6344         (TypeContainer.BaseCache): Compute on demand.
6345         (TypeContainer.FindMembers): Define constants and types if they're
6346         not already created.
6347         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6348         check.
6349         * const.cs (Constant.Define): Make idempotent.
6350
6351 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6352
6353         * pending.cs: Produce better code (no nops produced by using Ldarg
6354         + value).
6355         
6356         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6357         i - 1' it should be arg + 1.
6358
6359         Fixes bug #71819.
6360
6361 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6362
6363         * attribute.cs (Attribute.CheckAttributeType): Make private
6364         non-virtual.
6365         (Attribute.ResolveType): Make virtual.
6366         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6367         handling of RootContext.Tree.Types.
6368
6369 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6370
6371         Update attribute-handling to use the SimpleName/MemberAccess
6372         mechanisms.
6373         * cs-parser.jay (attribute): Pass in an expression to the
6374         constructors of Attribute and GlobalAttribute.
6375         * attribute.cs (Attribute): Take an expression for the name.
6376         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6377         passed in attribute name expression.
6378         (Attribute.CheckAttributeType): Use it.
6379         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6380         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6381         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6382         argument to prevent error messages if the lookup fails.
6383
6384 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6385
6386         * expression.cs (Indirection): Implemented IVariable interface
6387         to support indirection in AddressOf operator.
6388         (PointerArithmetic.Emit): Add optimalization for case where
6389         result can be precomputed.
6390
6391 2005-01-26  Martin Baulig  <martin@ximian.com>
6392
6393         * class.cs (TypeContainer.AttributeTargets): Return the correct
6394         AttributeTargets depending on our `Kind' instead of throwing an
6395         exception; fixes #71632.
6396
6397 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6398
6399         Fix #71257
6400         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6401         constant members.
6402
6403 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6404
6405         Fix #71602.
6406         * expression.cs (MemberAccess.DoResolve): Don't complain with
6407         cs0572 when the LHS of a member access has identical name and type
6408         name.
6409
6410 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6411
6412         Fix #71651, #71675
6413         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6414         CreatePermission.
6415         Create custom PermissionSet only for PermissionSetAttribute.
6416
6417 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6418
6419         Fix #71649
6420         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6421         delegates in static class.
6422
6423 2005-01-24  Martin Baulig  <martin@ximian.com>
6424
6425         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6426         merging an implicit block, just use its reachability.
6427
6428         * statement.cs (Block.Resolve): Make the unreachable code check
6429         work wrt. implicit blocks; see test-337 from #63842.
6430
6431 2005-01-21  Alp Toker  <alp@atoker.com>
6432  
6433         * cs-parser.jay: destructor_declaration's container is PartialContainer
6434         not Class when partial types are used, so use Kind prop instead of
6435         'is'.
6436         
6437 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6438
6439         * cs-parser.jay: Improve error reporting when an interface
6440         declares new types.
6441
6442 2005-01-20  Dick Porter  <dick@ximian.com>
6443
6444         * support.cs: SeekableStreamReader fix from Sandor Dobos
6445         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6446         chars are read.  Fixes bug 70369.
6447
6448 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6449
6450         * cs-parser.jay (catch_clause): Simplify current_block handling
6451         somewhat.
6452
6453 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6454
6455         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6456         code with ImplicitStandardConversion to handle the implicit
6457         conversion of method groups into valid delegate invocations. 
6458
6459         The problem is that in parameter handling we were using this code
6460         path.  Fixes bug #64698
6461
6462 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6463
6464         * cs-parser.jay: Fix several infelicities.
6465         - Avoid assigning to the parser value stack.  Code like 
6466           '$3 = null' is unclean.  Synthesize a value for the code block
6467           instead. 
6468         - Avoid using oob_stack for storing location information.  Use ...
6469         (_mark_): ... this.  New (empty) rule.  Saves the current location
6470         in $$.
6471         (foreach_statement): Avoid using oob_stack for current_block
6472         handling.  Use technique used in for_statement and
6473         using_statement.  Synthesize a value for the code block to store
6474         additional intermediate information.
6475
6476 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6477
6478         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6479         of a different type is only allowed to private fields of a
6480         containing type, not on fields of a base class.
6481
6482         See test-174.cs and error cs0122-9.cs
6483
6484 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6485
6486         Fix test-335.cs (bug #58126).
6487         * cs-parser.jay (argument): Split out non-expression parts of the
6488         rule into 'non_simple_argument'.
6489         (invocation_expression): Support parenthesized invocations with
6490         multiple arguments, and with single non-simple arguments.
6491
6492 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6493
6494         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6495         places.
6496
6497 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6498
6499         Fix cs0038-1.cs, cs1640-6.cs.
6500         * ecore.cs (Expression.Resolve): Remove special-case for
6501         SimpleName in error-handling.
6502         (Expression.almostMatchedMembers): Relax access permission to
6503         protected.
6504         (Expression.MemberLookupFailed): Handle duplicates in
6505         almostMatchedMembers list.
6506         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6507         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6508         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6509         overload if the passed in MemberInfo is a MethodBase.
6510
6511 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6512
6513         Fix #70749
6514         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6515         for non-CAS & merge permission sets properly.
6516
6517 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6518
6519         Improve standard-compliance of simple name and member access 
6520         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6521         * ecore.cs (FullNamedExpression): New abstract base class 
6522         for Namespaces and TypeExpressions.
6523         (ResolveFlags.SimpleName): Remove.
6524         (SimpleName): Remove support for dotted names.
6525         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6526         DeclSpace.FindType and DeclSpace.LookupType.
6527         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6528         (Expression.ExprClassName): Make member function.
6529         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6530         a namespace.  Remove creation of dotted "SimpleName"s.
6531         (MemberAccess.DoResolve): Likewise.
6532         * decl.cs (DeclSpace.Cache): Make private.
6533         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6534         (DeclSpace.FindType): Update.
6535         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6536         FullNamedExpression.
6537         * namespace.cs (Namespace): Derive from FullNamedExpression
6538         so that it can be part of expression resolution.
6539         (Namespace.Lookup): Return an FullNamedExpression.
6540         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6541         namespace.
6542         * rootcontext.cs (NamespaceLookup): Remove.
6543         (LookupType): Move to DeclSpace.
6544         * attribute.cs (CheckAttributeType): Update.
6545         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6546         (FindDocumentedTypeNonArray): Likewise.
6547
6548 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6549
6550         Fix cs0509.cs, cs1632.cs.
6551         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6552         is the same as IsInterface.
6553         (TypeContainer.GetClassBases): Likewise.
6554         * statement.cs (LabeledStatement.ig): New field.
6555         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6556         label.
6557         (LabeledStatement.DoEmit): Check that the label was created with
6558         the same ILGenerator.
6559
6560 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6561
6562         Fix #71058
6563         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6564         accessors to its properties.
6565
6566         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6567         from accessors to property.
6568         
6569 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6570
6571         Fix #70722
6572         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6573         only for overrides.
6574         
6575 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6576
6577         * attribute.cs: Check for null and empty strings.  
6578
6579         I have lost another battle to Paolo.
6580
6581 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6582
6583         Fix #70942
6584         * class.cs (PropertyMethod): Set Parent field in ctors.
6585         (SetMethod.InternalParameters): Add unsafe switch hack.
6586         Override MarkForDuplicationCheck where it is appropriate.
6587
6588         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6589         It says whether container allows members with the same name.
6590         Base default is no.
6591         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6592         Removed is_method parameter.
6593
6594 2005-01-06  Duncan Mak  <duncan@ximian.com>
6595
6596         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6597         because the previous change led to incorrect reporting of CS1032
6598         ("Cannot define/undefine preprocessor symbols after first token in
6599         file"). Instead of using `tokens_seen' as the only flag that
6600         triggers CS1040, introduce `comments_seen'. This new flag is used
6601         to signify having seen comments on the current line, so it is
6602         unset after a newline.
6603
6604 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6605
6606         * doc.cs : When searching for a type, find nested type too.
6607           This fixes bug #71040.
6608
6609 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6610
6611         * doc.cs :
6612           - Warn missing member comment on those classes which also does not
6613             have doc comments. Fixed bug #71041.
6614           - Don't warn missing doc comment on default constructor.
6615             Fixed bug #71042.
6616
6617 2005-01-06  Duncan Mak  <duncan@ximian.com>
6618
6619         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6620         comments, set `tokens_seen' to true. This allows us to detect
6621         misplaced preprocessor directives (i.e. not at the beginning of
6622         the a line, nor after whitespaces). In that case, report error
6623         CS1040. This fixes bug #56460.
6624
6625         * cs-parser.jay (interface_member_declaration): Add checks for
6626         IsExplicitImpl, and report CS0541 error if an interface member is
6627         defined as an explicit interface declaration.
6628
6629 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6630
6631         Fix #70817
6632         * class.cs (PropertyMethod): Set Parent field in ctors.
6633         (SetMethod.InternalParameters): Add unsafe switch hack.
6634         
6635         * decl.cs (MemberCore.Parent): Cannot be readonly.
6636
6637 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6638
6639         * decl.cs (DeclSpace.ResolveType): Remove.
6640         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6641         Merge in code from ...
6642         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6643         * class.cs, enum.cs: Update to changes.
6644
6645 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6646
6647         * anonymous.cs: Ensure that we init the scope of our parent if it
6648         has not been initialized yet.
6649
6650 2004-12-30  Duncan Mak  <duncan@ximian.com>
6651
6652         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6653         if field.FieldBuilder is null. Fixes #70758.
6654
6655         * convert.cs: Fixed some typos and updated some of the comments.
6656         (ImplicitStandardConversionExists):
6657         (TryImplicitIntConversion): If `target_type' is an interface and
6658         the type of `ic' implements this interface, return true or a new
6659         BoxedCast instead of null. This fixes #70468.
6660
6661 2004-12-29  Duncan Mak  <duncan@ximian.com>
6662
6663         * expression.cs (Argument.Emit): Check that Expr is
6664         IMemoryLocation before casting to it, and report CS1510 otherwise.
6665
6666         This fixes #70402.
6667
6668 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6669
6670         * statement.cs (Block.ThisVariable): remove the recursion here, to
6671         make the --profile more sane.
6672
6673 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6674
6675         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6676         assembly, by JB Evain.
6677
6678 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6679
6680         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6681           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6682         "parent" refers to enclosing type/class.  "base" refers to superclass.
6683
6684 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6685
6686         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6687         Ensure that we only have GlobalAttributes.
6688         * attribute.cs (Attribute.Emit): Make non-virtual.
6689         (GlobalAttribute.Emit): Remove.
6690         (Attribute.Resolve): Make virtual.
6691         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6692         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6693         the argument. Don't create one.
6694         (Attribute.GetObsoleteAttribute): Likewise.
6695         (Attribute.GetClsCompliantAttributeValue): Likewise.
6696         * class.cs, decl.cs: Update to changes.
6697
6698 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6699
6700         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6701         
6702         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6703         
6704         * statement.cs (Foreach.Resolve): Add error 186 report.
6705
6706 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6707
6708         * expression.cs (Conditional.DoResolve): Add warning 429.
6709         
6710         * statement.cs (If.Resolve): Add warning 665.
6711
6712 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6713
6714         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6715         except when in the parser, and in GlobalAttribute.
6716         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6717         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6718         RootContext.Tree.Types.NamespaceEntry once work is done.
6719         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6720         and resets RootContext.Tree.Types.NamespaceEntry.
6721
6722 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6723
6724         * cs-parser.jay: Don't create a block for every variable.
6725
6726 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * location.cs: Provide extra information.
6729
6730         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6731         variables from the captured environment, it is the ldarg_0.
6732
6733 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6734
6735         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6736         find a conclusion.
6737         
6738         * class.cs: Changed warning level for 169 to avoid developer
6739         displeasure from warning flooding. It will be changed back when they
6740         fix most of current BCL warnings.
6741         
6742         * RootContext.cs: Pushed default WarningLevel to 3.
6743         
6744         * statement.cs: Removed unused variable.
6745
6746 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6747
6748         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6749         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6750         Add error 502 report.
6751         (StaticClass.DefineType): Add error 441 report.
6752         (Class.AllowedModifiersProp): New virtual property as temporary
6753         extension to AllowedModifiers.
6754         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6755         to share implementation with StaticClass and don't call virtual
6756         methods from ctor.
6757         
6758         * driver.cs (MainDriver): Add error 1558 test.
6759
6760         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6761         report. Moved error 36 test here.
6762
6763         * statement.cs (Throw.Resolve): Add error 724 report.
6764
6765         * typemanager.cs: Add out_attribute_type core type.
6766         
6767 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6768
6769         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6770         3018 report.
6771         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6772
6773         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6774         3017 report.
6775         
6776         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6777
6778         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6779         Add error 3023 report.
6780         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6781
6782         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6783         implementation.
6784
6785 2004-12-12  John Luke  <john.luke@gmail.com>
6786
6787         * driver.cs (AddArgs): take -- into account when
6788         adding arguments, fixes bug 65710 
6789
6790 2004-12-12  Martin Baulig  <martin@ximian.com>
6791
6792         * expression.cs (Unary.TryReduceNegative): Added support for
6793         SByteConstant and ByteConstant.
6794         (Unary.Reduce): Check error values from TryReduceNegative().
6795
6796 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6797
6798         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6799         and report exception as error 182.
6800
6801 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6802
6803         * driver.cs (Main): Fix message when there are warnings.
6804
6805 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6806
6807         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6808
6809 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6810
6811         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6812         Reduced number of warnings.
6813         
6814         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6815
6816 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6817
6818         * driver.cs: Removed message.
6819
6820         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6821
6822 2004-12-08    <vargaz@freemail.hu>
6823
6824         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6825
6826 2004-12-08  Martin Baulig  <martin@ximian.com>
6827
6828         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6829         instead of a CS3002 for properties and indexer.
6830
6831 2004-12-08  Martin Baulig  <martin@ximian.com>
6832
6833         * decl.cs (MemberName.ToString): Make this work again.
6834
6835 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6836
6837         * attribute.cs (Resolve): Add error 591 detection.
6838
6839         * class.cs (FieldMember.Define): Add error 1547 detection.
6840         (Indexer.Define): Add error 620 detection.
6841         (Operator.Define): Add error 590 detection.
6842
6843         * ecore.cs: Missing argument for error 79.
6844
6845         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6846         detection.
6847
6848 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6849
6850         Fix #70106
6851         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6852         only.
6853
6854 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6855
6856         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6857           Some operator comments were suppressed.
6858         * doc.cs : Implicit/explicit operator name in doc comments are like
6859           "op_Explicit(type)~returnType", so added suffix handling.
6860
6861 2004-12-07  Martin Baulig  <martin@ximian.com>
6862
6863         * decl.cs
6864         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6865         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6866         (DeclSpace.ec): New protected field; store the EmitContext here.
6867         (DeclSpace.EmitContext): New public property; moved here from
6868         `TypeContainer'.
6869         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6870         EmitContext.
6871
6872         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6873         (Enum.Emit): Don't create a new EmitContext.
6874
6875         * delegate.cs (Delegate.DefineType): Always create the
6876         EmitContext.
6877
6878         * iterators.cs (Iterators.DefineIterator): Create a new
6879         EmitContext and store it in `ec'.
6880
6881 2004-08-24  Martin Baulig  <martin@ximian.com>
6882
6883         * typemanager.cs
6884         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6885         this for accessibility checks.
6886         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6887         IsNestedFamilyAccessible.
6888         (TypeManager.IsSubclassOf): New method, do what the name actually
6889         says.   
6890
6891 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6892
6893         Fix crash on cs0657-17.cs.
6894         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6895         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6896         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6897         the case where the NamespaceEntry gets overwritten.
6898
6899 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6900
6901         Fixed #69195, #56821
6902         * ecore.cs (ResolveBoolean): Tiny refactoring.
6903
6904         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6905         of right expression resolving when left is false constant and
6906         operator is LogicalAnd OR true constant and operator is LogicalOr.
6907
6908         * statement.cs (ResolveUnreachable): Always reports warning.
6909
6910 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6911
6912         * class.cs: Distinguish between 1721 and 1722 (just a little help
6913         for the programmer).
6914
6915 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6916
6917         * delegate.cs: Only allow this on new versions of the language. 
6918
6919 2004-12-02  Duncan Mak  <duncan@ximian.com>
6920
6921         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6922         Expression class.
6923         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6924         here as a static method. Take an additional bool out parameter
6925         `must_do_cs1540_check' for signaling to InstanceResolve.
6926         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6927         member field from PropertyExpr class and made it an argument of
6928         the method instead.
6929         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6930         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6931         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6932         and `remove_accessor' as well as InstanceResolve: report CS0122
6933         where applicable.
6934
6935         Fixes #70129.
6936
6937 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6938
6939         Fix test-327.cs, test-328.cs, and put in early infrastructure
6940         for eventually fixing #52697.
6941         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6942         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6943         from other methods.
6944         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6945         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6946         (VerifyUsing, error246): Update.
6947         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6948         'NamespaceEntry.LookupNamespaceOrType'.
6949
6950 2004-12-03  Martin Baulig  <martin@ximian.com>
6951
6952         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6953         method as our child, call AnonymousMethod.Compatible() on it.
6954
6955 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6956
6957         Disable XML documentation support in 'basic' profile.
6958         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6959         Redirect XmlElement to System.Object.
6960         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6961         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6962         * mcs.exe.sources: Add doc-bootstrap.cs.
6963         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6964         of doc.cs.
6965
6966 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6967
6968         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6969           comments are allowed.
6970
6971 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6972
6973         * delegate.cs: Add checks for subtypes in paramaters and return values
6974         in VerifyMethod () to add support for Covariance/Contravariance
6975         in delegates.
6976         
6977 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6978
6979         * report.cs: Remove extra closing parenthesis.
6980
6981         * convert.cs (Error_CannotImplicitConversion): If the name of the
6982         types are the same, provide some extra information.
6983
6984         * class.cs (FieldBase): Use an unused bit field from the field to
6985         encode the `has_offset' property from the FieldMember.  This saves
6986         a couple of Ks on bootstrap compilation.
6987
6988         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6989         method as our child, return the AnonymousMethod resolved
6990         expression.
6991
6992         * expression.cs (New.DoResolve): Allow return values from
6993         NewDelegate to also include AnonymousMethods.
6994
6995         Fixes #70150.
6996
6997 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6998
6999         Fix bug #70102
7000         * attribute.cs (Resolve): Improved implementation of params
7001         attribute arguments.
7002
7003         * support.cs (ParameterData): Add HasParams to be faster.
7004
7005 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7006
7007         all things are for /doc support:
7008
7009         * doc.cs: new file that supports XML documentation generation.
7010         * mcs.exe.sources: added doc.cs.
7011         * driver.cs:
7012           Handle /doc command line option.
7013           Report error 2006 instead of 5 for missing file name for /doc.
7014           Generate XML documentation when required, after type resolution.
7015         * cs-tokenizer.cs:
7016           Added support for picking up documentation (/// and /** ... */),
7017           including a new XmlCommentState enumeration.
7018         * cs-parser.jay:
7019           Added lines to fill Documentation element for field, constant,
7020           property, indexer, method, constructor, destructor, operator, event
7021           and class, struct, interface, delegate, enum.
7022           Added lines to warn incorrect comment.
7023         * rootcontext.cs :
7024           Added Documentation field (passed only when /doc was specified).
7025         * decl.cs:
7026           Added DocComment, DocCommentHeader, GenerateDocComment() and
7027           OnGenerateDocComment() and some supporting private members for
7028           /doc feature to MemberCore.
7029         * class.cs:
7030           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7031         * delegate.cs:
7032           Added overriden DocCommentHeader.
7033         * enum.cs:
7034           Added overriden DocCommentHeader and GenerateDocComment().
7035
7036 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7037
7038         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7039         unwrapping the enumeration values, chain to
7040         DoConstantNumericPromotions again, so we can promote things to the
7041         fundamental types (takes care of enums that are bytes, sbytes).
7042
7043         Fixes bug #62054.
7044
7045 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7046
7047         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7048         Fix long-standing bug in type-lookup.  Use FindType instead of
7049         LookupType when ec.ResolvingTypeTree.
7050         (Attribute.ResolveType, Attribute.Resolve)
7051         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7052         Update to changes.
7053         (Attributes.Search): Remove internal version.  Update.
7054         (Attributes.SearchMulti): Update.
7055         (Attributes.GetClsCompliantAttribute): Remove.
7056         (Attributes.GetIndexerNameAttribute): Remove.
7057         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7058         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7059         * class.cs (Indexer.Define): Likewise.
7060
7061 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7062
7063         Fix bug #68790
7064         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7065         MarshallByReference members access.
7066
7067         * expression.cs: Use CheckMarshallByRefAccess;
7068         Better error CS0197 message.
7069
7070         * report.cs: Print whole related error message.
7071
7072 2004-11-30  Raja R Harinath  <rharinath@novell.com>
7073
7074         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
7075         the current directory to help debugging.
7076
7077 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7078
7079         * class (GetClassBases): Better error 60 report.
7080         (EventProperty): Disabled warning 67 detection.
7081
7082 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7083
7084         Fix bug #60324
7085         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7086
7087         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7088         precise values.
7089
7090 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7091
7092         Fix bug #49488
7093         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7094
7095         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7096
7097 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7098
7099         * attribute.cs (Attribute.Resolve): Refine error reporting and
7100         report a cs0117 if the identifier does not exist, to distinguish
7101         from 0617 which is a miss-use of the actual identifier.
7102
7103         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7104         between cs0070 and cs0079.
7105
7106         * class.cs (MemberBase.DoDefine): When reporting a wrong
7107         accessibility level, we use MethodCore to compare instead of
7108         Method (this was a regression in some refactoring effort).
7109
7110         So now we correctly report cs0056 again.
7111
7112         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7113         testing the target_type (which was known to be object_type) and
7114         not the source type (which is anonymous_method).
7115
7116         Fixed reporting of error cs1660.
7117
7118         * expression.cs (UserCast.Source): Expose the underlying cast.
7119
7120         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7121         allowed types to find a match to int32 first (most common).
7122
7123         In addition, it ignores any ImplicitUserConversions that did an
7124         internal implicit conversion (as the switch statement allows only
7125         one integral conversion to exist).
7126
7127         * class.cs (PartialContainer.Create): rename `name' to
7128         `member_name' for clarity.  Then replace the string calls with a
7129         call to MemberName.GetPartialName, as now using
7130         MemberName.ToString is an error (this is due to the side effects
7131         it had, that were fixed in the past).
7132
7133         This will restore the error reporting on a number of partial class
7134         errors that were missusing this (and getting an exception as a
7135         results, which is now just a plain textual warning, because
7136         yyparse debug output would crash otherwise).
7137
7138 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7139
7140         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7141
7142 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7143
7144         * rootcontext.cs (LookupType): Make sure to cache lookups that
7145         don't give us a negative result. This saves about 5% of corlib
7146         compilation time.
7147
7148 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7149
7150         * report.cs (AbstractMessage.Print): messages are sent to stderr
7151
7152         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7153         non-interface in the list of interfaces (at this point, either
7154         parent was properly set, or a base class is being listed in the
7155         interfaces section).
7156
7157         This flags error 1722, and resolves the crash from bug 69259.
7158
7159 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7160
7161         * statement.cs (Using.EmitExpressionFinally): make this work right
7162         for valuetypes. Fixes 69926.
7163
7164 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7165
7166         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7167         converted to an enum" here, before we try to change the underlying
7168         type.  This code exists, but it is a different code path than the
7169         one used while encoding constants.
7170
7171         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7172         old bug: when converting from the null literal to a pointer,
7173         return an EmptyCast, not the NullLiteral.
7174
7175         This fixes #69921, the recent null_type changes probably made this
7176         bug more prominent.
7177
7178         (ImplicitReferenceConversionExists): In addition, resynchronized
7179         the code here, so it matches the same code in
7180         ImplicitReferenceConversionExists for the `from any class-type S
7181         to any interface-type T'.
7182         
7183
7184 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7185
7186         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7187
7188 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7189
7190         * cs-parser.jay: Use verbosity accordingly. 
7191
7192 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7193
7194         * expression.cs (Unary.ResolveOperator): Do not report warning;
7195         AddressOf reads from variable.
7196         
7197         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7198
7199 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7200
7201         Fix bug #69462
7202
7203         * attribute.cs (Attributable): Removed CheckTargets.
7204         (Attributes.Emit): Explicit attribute targets are tested here.
7205
7206         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7207         not enabled for interfaces.
7208
7209         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7210         (GetAssemblyName): Ouch next bug there.
7211
7212 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7213
7214         * expression.cs: Error 275 added.
7215         
7216 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7217
7218         Fix bug #69177 (Implemented decimal constant support)
7219
7220         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7221         (BinaryFold): Add DecimalConstant.
7222
7223         * const.cs (Define): Decimal constant 
7224         (is not constant.
7225         (ChangeType): Add decimal type handling.
7226         (LookupConstantValue): Don't set value for decimal type but
7227         emit DecimalConstantAttribute. Needed for constant optimization.
7228
7229         * constant.cs (ToDecimal): New method.
7230         (ConvertToDecimal): New method.
7231         (IntConstant): Implemented ConvertToDecimal.
7232         (DecimalConstant.Emit): Emit optimized version for decimals in
7233         int range.
7234
7235         * expression.cs (ResolveOperator): Changed order of constant
7236         reduction to work correctly with native types which have
7237         overloaded operators.
7238         (ResolveMemberAccess): Extract constant value from attribute
7239         for decimal type.
7240
7241         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7242
7243         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7244         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7245         (ChangeType): Decimal is special.
7246         (TypeToCoreType): Add decimal type.
7247
7248 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7249
7250         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7251         decimal types.
7252
7253 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7254
7255         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7256         test cs1667-5.cs.
7257
7258 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7259
7260         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7261
7262         * pending.cs (PendingImplementation): Grab only interfaces.
7263
7264 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7265
7266         * statement.cs (ForeachHelperMethods): Add location member and
7267         error 202 detection.
7268
7269 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7270
7271         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7272         automatically handled by executable.make.
7273         (PROGRAM): Make profile-specific.
7274
7275 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7276
7277         * expression.cs (DoResolveBase): Fixed wrong warning for out
7278         variables.
7279
7280 2004-11-18  Martin Baulig  <martin@ximian.com>
7281
7282         Merged latest changes into gmcs.  Please keep this comment in
7283         here, it makes it easier for me to see what changed in MCS since
7284         the last time I merged.
7285
7286 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7287
7288         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7289         (TypeHandle.GetMemberCache): New.
7290         (TypeHandle.TypeHandle): Update.
7291         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7292         (TypeManager.LookupParentInterfacesCache):
7293         Rename from LookupInterfaceCache.  Optimize slightly.
7294         (TypeManager.MemberLookup_FindMembers): Update.
7295         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7296         multi-type variant.
7297         (AddCacheContents): Rename from AddHashtable.
7298         * class.cs (TypeContainer.parent_container): Remove.
7299         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7300         (TypeContainer.DoDefineMembers): Don't initialize it.
7301         Update to name changes.
7302         
7303 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7304
7305         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7306         that factors the code to check access modifiers on override.  
7307
7308         (PropertyBase): Use the code here.
7309
7310         Patch from Lluis S'anchez, fixes bug #69361.
7311
7312 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7313
7314         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7315         routine that is used to report the use of a captured variable
7316         whose address has been taken.
7317
7318         There are two checks: one when variables are being captured and
7319         the other check is when the address of a variable is taken. 
7320         
7321         (because an anonymous methods might be resolved before *or* after
7322         the address has been taken) and 
7323
7324         * expression.cs (Conditional.DoResolve): Remove the special
7325         casing that Martin added to trueExpr and falseExpr being both
7326         NullLiteral.  We get the right behavior now just by introducing
7327         the null_type into the compiler. 
7328
7329         * convert.cs (ExplicitConversion): Change the code to use
7330         null_type instead of testing `expr is NullLiteral'.
7331         (ImplicitConversionStandard): use null_type too.
7332         (ImplicitReferenceConversionExists): use null_type too.
7333         (ImplicitReferenceConversion): use null_type too.
7334
7335         * literal.cs: The type of `NullLiteral' is now null_type instead
7336         of object_type. 
7337         (Resolve): Set the type here.
7338
7339         * typemanager.cs: Introduce null_type.
7340
7341 2004-11-17  Martin Baulig  <martin@ximian.com>
7342
7343         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7344         direction, like FindMembers() does.  Fixes #69546, testcase is in
7345         test-315.cs.    
7346
7347 2004-11-16  Martin Baulig  <martin@ximian.com>
7348
7349         This is based on a patch from Marek Safar, see bug #69082.
7350         Fixes bugs #63705 and #67130.
7351
7352         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7353         method; create a MemberCache for an interface type and cache the
7354         result.
7355
7356         * decl.cs (IMemberContainer.ParentContainer): Removed.
7357         (IMemberContainer.ParentCache): New property.
7358         (MemberCache.SetupCacheForInterface): Removed.
7359         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7360         to create a cache for an interface's "parent".
7361
7362         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7363         interfaces too.
7364
7365 2004-11-16  Martin Baulig  <martin@ximian.com>
7366
7367         Merged back from gmcs; these changes already went into gmcs a
7368         couple of weeks ago.
7369
7370         * typemanager.cs
7371         (TypeManager.AddUserType): Removed the `ifaces' argument.
7372         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7373         `TypeExpr []'.
7374         (TypeManager.AddUserInterface): Removed.
7375         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7376         `TypeExpr []'.
7377         (TypeManager.GetInterfaces): Likewise.
7378         (TypeManager.GetExplicitInterfaces): Likewise.
7379
7380         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7381
7382         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7383         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7384
7385 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7386
7387         * statement.cs: Avoid adding bools to a hashtable.
7388
7389 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7390
7391         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7392         calling an unsafe method from a safe location.
7393
7394 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7395
7396         Fix #69167
7397         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7398
7399 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7400
7401         * namespace.cs (VerifyUsing): use GetPartialName instead of
7402         ToString. 
7403
7404 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7405
7406         * statement.cs (Return.Resolve): Fix regression in typo: if
7407         `in_exc', we have to request a NeedReturnLabel, this was a typo
7408         introduced in the anonymous method check-in.  Fixes #69131.
7409
7410         * Indexers were using the ShortName when defining themselves,
7411         causing a regression in the compiler bootstrap when applying the
7412         patch from 2004-11-02 (first part), now they use their full name
7413         and the bug is gone.
7414
7415 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7416
7417         * driver.cs: Strip the path from the names of embedded resources. Fixes
7418         #68519.
7419
7420 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7421
7422         Fix error message regression: cs0104-2.cs.
7423         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7424         (AliasEntry.Resolve): Update.
7425         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7426         'silent' flag.
7427         (RootContext.LookupType): Update.
7428
7429 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7430
7431         * cs-parser.jay: Add support for handling accessor modifiers
7432         * class: Add support port accessor modifiers and error checking,
7433         define PropertyMethod.Define as virtual (not abstract anymore)
7434         * ecore.cs: Add checking for proeprties access with access modifiers
7435         * iterators.cs: Modify Accessor constructor call based in the modified
7436         constructor
7437 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7438
7439         * expression.cs (StringConcat): Handle being called twice,
7440         as when we have a concat in a field init with more than two
7441         ctors in the class
7442
7443 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7444
7445         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7446         special case explicit implementations, we should always produce
7447         the .property or .event declaration.
7448         
7449         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7450         since it will not return correct data if people use this
7451         unresolved in the presence of using statements (see test-313).
7452
7453         * class.cs (MethodData.Define): If we are an explicit interface
7454         implementation, set the method name to the full name of the
7455         interface plus the name of the method.  
7456
7457         Notice that using the method.MethodName.GetFullName() does not
7458         work, as it will only contain the name as declared on the source
7459         file (it can be a shorthand in the presence of using statements)
7460         and not the fully qualifed type name, for example:
7461
7462         using System;
7463
7464         class D : ICloneable {
7465                 object ICloneable.Clone ()  {
7466                 }
7467         }
7468
7469         Would produce a method called `ICloneable.Clone' instead of
7470         `System.ICloneable.Clone'.
7471
7472         * namespace.cs (Alias.Resolve): Use GetPartialName.
7473         
7474 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7475
7476         * cs-parser.jay: Add error 1055 report.
7477
7478 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7479
7480         * assign.cs (Assign.DoResolve): Only do the transform of
7481         assignment into a New if the types are compatible, if not, fall
7482         through and let the implicit code deal with the errors and with
7483         the necessary conversions. 
7484
7485 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7486
7487         * cs-parser.jay: Add error 1031 report.
7488
7489         * cs-tokenizer.cs: Add location for error 1038.
7490
7491 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7492
7493         * cs-parser.jay: Add error 1016 report.
7494
7495 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7496
7497         * cs-parser.jay: Add errors 1575,1611 report.
7498
7499 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7500
7501         * cs-parser.jay: Add error 1001 report.
7502
7503 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7504
7505         Fix #68850
7506         * attribute.cs (GetMarshal): Add method argument for
7507         caller identification.
7508
7509         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7510         agument for GetMarshal and RuntimeMissingSupport.
7511
7512 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7513
7514         * attribute.cs (ExtractSecurityPermissionSet): Removed
7515         TypeManager.code_access_permission_type.
7516
7517         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7518
7519 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7520
7521         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7522         for obsolete use of a variable here.   Fixes regression on errors
7523         cs0619-25 and cs0619-26.
7524
7525 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7526
7527         Fix #62358, implemented security attribute encoding.
7528
7529         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7530         Tests permitted SecurityAction for assembly or other types.
7531         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7532         data from SecurityPermissionAttribute to PermisionSet class.
7533
7534         * class.cs (ApplyAttributeBuilder): Added special handling
7535         for System.Security.Permissions.SecurityAttribute based types.
7536
7537         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7538         special handling for System.Security.Permissions.SecurityAttribute
7539         based types.
7540
7541         * enum.cs (ApplyAttributeBuilder): Added special handling
7542         for System.Security.Permissions.SecurityAttribute based types.
7543
7544         * parameter.cs (ApplyAttributeBuilder): Added special handling
7545         for System.Security.Permissions.SecurityAttribute based types.
7546
7547         * rootcontext.cs: Next 2 core types.
7548
7549         * typemanager.cs (TypeManager.security_permission_attr_type):
7550         Built in type for the SecurityPermission Attribute.
7551         (code_access_permission_type): Build in type.
7552
7553 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7554
7555         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7556         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7557         all of this information into
7558         EmitContext.EmitCapturedVariableInstance.
7559         
7560         * codegen.cs (EmitCapturedVariableInstance): move here the
7561         funcionality of emitting an ldarg.0 in the presence of a
7562         remapping.   This centralizes the instance emit code.
7563
7564         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7565         then emit a load of this: it means that we have reached the
7566         topmost ScopeInfo: the one that contains the pointer to the
7567         instance of the class hosting the anonymous method.
7568
7569         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7570         captures to the topmost CaptureContext.
7571
7572 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7573
7574         * expression.cs (LocalVariableReference): Move the knowledge about
7575         the iterators into codegen's EmitCapturedVariableInstance.
7576
7577 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7578
7579         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7580         all code paths return a value from an anonymous method (it is the
7581         same as the 161 error, but for anonymous methods).
7582
7583 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7584
7585         The introduction of anonymous methods in the compiler changed
7586         various ways of doing things in the compiler.  The most
7587         significant one is the hard split between the resolution phase
7588         and the emission phases of the compiler.
7589
7590         For instance, routines that referenced local variables no
7591         longer can safely create temporary variables during the
7592         resolution phase: they must do so from the emission phase,
7593         since the variable might have been "captured", hence access to
7594         it can not be done with the local-variable operations from the runtime.
7595         
7596         * statement.cs 
7597
7598         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7599         is a toplevel block.
7600
7601         (ToplevelBlock): A new kind of Block, these are the blocks that
7602         are created by the parser for all toplevel method bodies.  These
7603         include methods, accessors and anonymous methods.
7604
7605         These contain some extra information not found in regular blocks:
7606         A pointer to an optional CaptureContext (for tracking captured
7607         local variables and parameters).  A pointer to the parent
7608         ToplevelBlock.
7609         
7610         (Return.Resolve): Catch missmatches when returning a value from an
7611         anonymous method (error 1662).
7612         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7613         phase.
7614
7615         (Break.Resolve): ditto.
7616
7617         (SwitchLabel): instead of defining the labels during the
7618         resolution phase, we now turned the public ILLabel and ILLabelCode
7619         labels into methods called GetILLabelCode() and GetILLabel() that
7620         only define the label during the Emit phase.
7621
7622         (GotoCase): Track the SwitchLabel instead of the computed label
7623         (its contained therein).  Emit the code by using
7624         SwitchLabel.GetILLabelCode ().
7625
7626         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7627         whether the Local has been captured or not.
7628
7629         (LocalInfo.IsCaptured): New property, used to tell whether the
7630         local has been captured.
7631         
7632         * anonymous.cs: Vastly updated to contain the anonymous method
7633         support.
7634
7635         The main classes here are: CaptureContext which tracks any
7636         captured information for a toplevel block and ScopeInfo used to
7637         track the activation frames for various local variables.   
7638
7639         Each toplevel block has an optional capture context associated
7640         with it.  When a method contains an anonymous method both the
7641         toplevel method and the anonymous method will create a capture
7642         context.   When variables or parameters are captured, they are
7643         recorded on the CaptureContext that owns them, for example:
7644
7645         void Demo () {
7646              int a;
7647              MyDelegate d = delegate {
7648                  a = 1;
7649              }
7650         }
7651
7652         Here `a' will be recorded as captured on the toplevel
7653         CapturedContext, the inner captured context will not have anything
7654         (it will only have data if local variables or parameters from it
7655         are captured in a nested anonymous method.
7656
7657         The ScopeInfo is used to track the activation frames for local
7658         variables, for example:
7659
7660         for (int i = 0; i < 10; i++)
7661                 for (int j = 0; j < 10; j++){
7662                    MyDelegate d = delegate {
7663                         call (i, j);
7664                    }
7665                 }
7666
7667         At runtime this captures a single captured variable `i', but it
7668         captures 10 different versions of the variable `j'.  The variable
7669         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7670         recorded on a child.  
7671
7672         The toplevel ScopeInfo will also track information like the `this'
7673         pointer if instance variables were referenced (this is necessary
7674         as the anonymous method lives inside a nested class in the host
7675         type of the method). 
7676
7677         (AnonymousMethod): Expanded to track the Toplevel, implement
7678         `AnonymousMethod.Compatible' to tell whether an anonymous method
7679         can be converted to a target delegate type. 
7680
7681         The routine now also produces the anonymous method content
7682
7683         (AnonymousDelegate): A helper class that derives from
7684         DelegateCreation, this is used to generate the code necessary to
7685         produce the delegate for the anonymous method that was created. 
7686
7687         * assign.cs: API adjustments for new changes in
7688         Convert.ImplicitStandardConversionExists.
7689
7690         * class.cs: Adjustments to cope with the fact that now toplevel
7691         blocks are of type `ToplevelBlock'. 
7692
7693         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7694         insteda of standard blocks.
7695
7696         Flag errors if params arguments are passed to anonymous methods.
7697
7698         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7699         `CurrentAnonymousMethod' which points to the current Anonymous
7700         Method.  The variable points to the AnonymousMethod class that
7701         holds the code being compiled.  It is set in the new EmitContext
7702         created for the anonymous method.
7703
7704         (EmitContext.Phase): Introduce a variable and an enumeration to
7705         assist in enforcing some rules about when and where we are allowed
7706         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7707         only one that enfonces this right now).
7708
7709         (EmitContext.HaveCaptureInfo): new helper method that returns
7710         whether we have a CapturedContext initialized.
7711
7712         (EmitContext.CaptureVariable): New method used to register that a
7713         LocalInfo must be flagged for capturing. 
7714
7715         (EmitContext.CapturedParameter): New method used to register that a
7716         parameters must be flagged for capturing. 
7717         
7718         (EmitContext.CapturedField): New method used to register that a
7719         field must be flagged for capturing. 
7720
7721         (EmitContext.HaveCapturedVariables,
7722         EmitContext.HaveCapturedFields): Return whether there are captured
7723         variables or fields. 
7724
7725         (EmitContext.EmitMethodHostInstance): This is used to emit the
7726         instance for the anonymous method.  The instance might be null
7727         (static methods), this (for anonymous methods that capture nothing
7728         and happen to live side-by-side with the current method body) or a
7729         more complicated expression if the method has a CaptureContext.
7730
7731         (EmitContext.EmitTopBlock): Routine that drives the emission of
7732         code: it will first resolve the top block, then emit any metadata
7733         and then emit the code.  The split is done so that we can extract
7734         any anonymous methods and flag any captured variables/parameters.
7735         
7736         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7737         during this phase, the ILGenerator should not be used as labels
7738         and local variables declared here might not be accessible to any
7739         code that is part of an anonymous method.  
7740
7741         Exceptions to this include the temporary variables that are
7742         created by some statements internally for holding temporary
7743         variables. 
7744         
7745         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7746         metadata for a cb
7747
7748         (EmitContext.TemporaryReturn): This method is typically called
7749         from the Emit phase, and its the only place where we allow the
7750         ReturnLabel to be defined other than the EmitMeta.  The reason is
7751         that otherwise we would have to duplicate a lot of logic in the
7752         Resolve phases of various methods that today is on the Emit
7753         phase. 
7754
7755         (EmitContext.NeedReturnLabel): This no longer creates the label,
7756         as the ILGenerator is not valid during the resolve phase.
7757
7758         (EmitContext.EmitThis): Extended the knowledge in this class to
7759         work in anonymous methods in addition to iterators. 
7760
7761         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7762         code is necessary on the stack to access the instance to a local
7763         variable (the variable will be accessed as a field).
7764
7765         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7766         EmitContext.EmitAddressOfParameter): Routines to support
7767         parameters (not completed at this point). 
7768         
7769         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7770         will also remove the parameters.
7771
7772         * convert.cs (Convert): Define a `ConstantEC' which points to a
7773         null.  This is just to prefity some code that uses
7774         ImplicitStandardConversion code and do not have an EmitContext
7775         handy.
7776
7777         The idea is to flag explicitly that at that point in time, it is
7778         known that the conversion will not trigger the delegate checking
7779         code in implicit conversions (which requires a valid
7780         EmitContext). 
7781
7782         Everywhere: pass new EmitContext parameter since
7783         ImplicitStandardConversionExists now requires it to check for
7784         anonymous method conversions. 
7785
7786         (Convert.ImplicitStandardConversionExists): If the type of an
7787         expression is the anonymous_method_type, and the type is a
7788         delegate, we invoke the AnonymousMethod.Compatible method to check
7789         whether an implicit conversion is possible. 
7790
7791         (Convert.ImplicitConversionStandard): Only do implicit method
7792         group conversions if the language level is not ISO_1.
7793
7794         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7795         MethodInfo for the Invoke method.  used by Delegate and
7796         AnonymousDelegate.
7797
7798         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7799         method conversions if the target type is a delegate.
7800
7801         Removed extra debugging nops.
7802
7803         (LocalVariableReference): Turn the `local_info' into a public
7804         field. 
7805
7806         Add `prepared' field, the same hack used for FieldExprs to cope
7807         with composed assignments, as Local variables do not necessarily
7808         operate purely on the stack as they used to: they can be captured
7809         fields. 
7810
7811         Add `temp' for a temporary result, like fields.
7812
7813         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7814
7815         It now copes with Local variables that are captured and emits the
7816         proper instance variable to load it from a field in the captured
7817         case. 
7818
7819         (ParameterReference.DoResolveBase): During the resolve phase,
7820         capture parameters if we are in an anonymous method.
7821
7822         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7823         anonymous method, use the EmitContext helper routines to emit the
7824         parameter reference.
7825
7826         * iterators.cs: Set RemapToProxy to true/false during the
7827         EmitDispose class.
7828
7829         * parameters.cs (GetParameterByName): New helper method. 
7830
7831         * typemanager.cs (anonymous_method_type) a new type that
7832         represents an anonyous method.  This is always an internal type,
7833         used as a fencepost to test against the anonymous-methodness of an
7834         expression. 
7835         
7836 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7837
7838         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7839         561 report.
7840         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7841
7842 2004-10-18  Martin Baulig  <martin@ximian.com>
7843
7844         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7845         `Type' directly, but call ResolveType() on it.
7846         (Catch.Resolve): Likewise.
7847         (Foreach.Resolve): Likewise.
7848
7849 2004-10-18  Martin Baulig  <martin@ximian.com>
7850
7851         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7852         `Type' directly, but call ResolveType() on it.
7853         (Probe.DoResolve): Likewise.
7854         (ArrayCreation.LookupType): Likewise.
7855         (TypeOf.DoResolve): Likewise.
7856         (SizeOf.DoResolve): Likewise.
7857
7858 2004-10-18  Martin Baulig  <martin@ximian.com>
7859
7860         * expression.cs (Invocation.BetterFunction): Put back
7861         TypeManager.TypeToCoreType().
7862
7863 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7864
7865         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7866         the ResolveType.
7867
7868 2004-10-18  Martin Baulig  <martin@ximian.com>
7869
7870         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7871         `Type' directly, but call ResolveType() on it.
7872
7873 2004-10-18  Martin Baulig  <martin@ximian.com>
7874
7875         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7876         `Type' directly, but call ResolveType() on it.
7877         (MemberBase.DoDefine): Likewise.
7878
7879         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7880         `Type' directly, but call ResolveType() on it.
7881         (ComposedCast.DoResolveAsTypeStep): Likewise.
7882
7883         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7884         `Type' directly, but call ResolveType() on it.
7885
7886 2004-10-17  John Luke  <john.luke@gmail.com>
7887
7888         * class.cs (Operator.GetSignatureForError): use CSharpName
7889
7890         * parameter.cs (Parameter.GetSignatureForError): Returns
7891         correct name even if was not defined.
7892
7893 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7894
7895         Fix #65816.
7896         * class.cs (TypeContainer.EmitContext): New property.
7897         (DefineNestedTypes): Create an emitcontext for each part.
7898         (MethodCore.DoDefineParameters): Use container's emitcontext.
7899         Pass type array to InternalParameters.
7900         (MemberBase.DoDefine): Use container's emitcontext.
7901         (FieldMember.Define): Likewise.
7902         (Event.Define): Likewise.
7903         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7904         Pass type array to InternalParameters.
7905         (SetIndexerMethod.GetParameterInfo): Likewise.
7906         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7907         * delegate.cs (Define): Pass emitcontext to
7908         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7909         array to InternalParameters.
7910         * expression.cs (ParameterReference.DoResolveBase): Pass
7911         emitcontext to GetParameterInfo.
7912         (ComposedCast.DoResolveAsTypeStep): Remove check on
7913         ec.ResolvingTypeTree.
7914         * parameter.cs (Parameter.Resolve): Change argument to
7915         EmitContext.  Use ResolveAsTypeTerminal.
7916         (Parameter.GetSignature): Change argument to EmitContext.
7917         (Parameters.ComputeSignature): Likewise.
7918         (Parameters.ComputeParameterTypes): Likewise.
7919         (Parameters.GetParameterInfo): Likewise.
7920         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7921         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7922         * support.cs (InternalParameters..ctor): Remove variant that takes
7923         a DeclSpace.
7924         * typemanager.cs (system_intptr_expr): New.
7925         (InitExpressionTypes): Initialize it.
7926
7927 2004-10-12  Chris Toshok  <toshok@ximian.com>
7928
7929         * cs-parser.jay: fix location for try_statement and catch_clause.
7930
7931 2004-10-11  Martin Baulig  <martin@ximian.com>
7932
7933         * report.cs: Don't make --fatal abort on warnings, we have
7934         -warnaserror for that.
7935
7936 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7937
7938         More DeclSpace.ResolveType avoidance.
7939         * decl.cs (MemberCore.InUnsafe): New property.
7940         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7941         with newly created EmitContext.
7942         (FieldMember.Define): Likewise.
7943         * delegate.cs (Delegate.Define): Likewise.
7944         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7945         only if normal name-lookup fails.
7946         (TypeExpr.DoResolve): Enable error-checking.
7947         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7948         (SizeOf.DoResolve): Likewise.
7949         (ComposedCast.DoResolveAsTypeStep): Likewise.
7950         (StackAlloc.DoResolve): Likewise.
7951         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7952         (Block.Unsafe): New property.
7953         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7954         (Unsafe): Set 'unsafe' flag of contained block.
7955         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7956         (Fixed.Resolve): Likewise.
7957         (Catch.Resolve): Likewise.
7958         (Using.ResolveLocalVariableDecls): Likewise.
7959         (Foreach.Resolve): Likewise.
7960
7961 2004-10-05  John Luke <john.luke@gmail.com>
7962
7963         * cs-parser.jay: add location to error CS0175
7964
7965 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7966
7967         * ecore.cs (Expression.Constantity): Add support for turning null
7968         into a constant.
7969
7970         * const.cs (Const.Define): Allow constants to be reference types
7971         as long as the value is Null.
7972
7973 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7974
7975         * namespace.cs (NamespaceEntry.Using): No matter which warning
7976         level is set, check if this namespace name has already been added.
7977
7978 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7979
7980         * expression.cs: reftype [!=]= null should always use br[true,false].
7981         # 67410
7982
7983 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7984
7985         Fix #67108
7986         * attribute.cs: Enum conversion moved to 
7987         GetAttributeArgumentExpression to be applied to the all
7988         expressions.
7989
7990 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7991
7992         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7993         * class.c (TypeContainer.DefineType): Flag error if
7994         base types aren't accessible due to access permissions.
7995         * decl.cs (DeclSpace.ResolveType): Move logic to
7996         Expression.ResolveAsTypeTerminal.
7997         (DeclSpace.ResolveTypeExpr): Thin layer over
7998         Expression.ResolveAsTypeTerminal.
7999         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8000         Refactor code into NestedAccess.  Use it.
8001         (DeclSpace.NestedAccess): New.
8002         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8003         argument to silence errors.  Check access permissions.
8004         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8005         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8006         (Cast.DoResolve): Likewise.
8007         (New.DoResolve): Likewise.
8008         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8009         (TypeOf.DoResolve): Likewise.
8010
8011         * expression.cs (Invocation.BetterConversion): Return the Type of
8012         the better conversion.  Implement section 14.4.2.3 more faithfully.
8013         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8014         section 14.4.2.2 explicit.
8015         (Invocation.OverloadResolve): Update.
8016         (Invocation): Remove is_base field.
8017         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8018         (Invocation.Emit): Likewise.
8019
8020 2004-09-27  Raja R Harinath  <rharinath@novell.com>
8021
8022         * README: Update to changes.
8023
8024 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8025
8026         * cs-parser.jay: Reverted 642 warning fix.
8027
8028 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8029
8030         Fix bug #66615
8031         * decl.cs (FindMemberWithSameName): Indexer can have more than
8032         1 argument.
8033
8034 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8035
8036         * expression.cs (LocalVariableReference.DoResolveLValue):
8037         Do not report warning 219 for out values.
8038         (EmptyExpression.Null): New member to avoid extra allocations.
8039
8040 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8041
8042         * cs-parser.jay: Fix wrong warning 642 report.
8043
8044         * cs-tokenizer.cs (CheckNextToken): New helper;
8045         Inspect next character if is same as expected.
8046
8047 2004-09-23  Martin Baulig  <martin@ximian.com>
8048
8049         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8050         (Convert.ImplicitReferenceConversionExists): Likewise.
8051
8052 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8053
8054         * class.cs (Operator.Define): Add error 448 and 559 report.
8055
8056 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * class.cs (MemberBase.IsTypePermitted): New protected
8059         method for checking error CS0610.
8060
8061 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8062
8063         * class.cs (TypeContainer.HasExplicitLayout): New property
8064         Returns whether container has StructLayout attribute set Explicit.
8065         (FieldMember): New abstract class for consts and fields.
8066         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8067         (Field): Reuse FieldMember.
8068
8069         * const.cs (Const): Reuse FieldMember.
8070
8071         * rootcontext.cs: EmitConstants call moved to class.
8072
8073 2004-09-22  Martin Baulig  <martin@ximian.com>
8074
8075         Thanks to Peter Sestoft for this bug report.
8076
8077         * expression.cs (Conditional): If both the `trueExpr' and the
8078         `falseExpr' is a NullLiteral, return a NullLiteral.
8079
8080 2004-09-22  Martin Baulig  <martin@ximian.com>
8081
8082         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8083         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8084         for the "get_Current" call.
8085
8086 2004-09-22  Martin Baulig  <martin@ximian.com>
8087
8088         Marek and me just fixed one of our oldest bugs: #28562 :-)
8089
8090         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8091
8092         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8093         we're an EnumConstant, just return that.
8094         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8095         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8096         to get the value which'll actually be written into the attribute.
8097         However, we have to use GetValue() to access the attribute's value
8098         in the compiler.        
8099
8100 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8101
8102         * constant.cs (Constant.IsNegative): New abstract property
8103         IsNegative.
8104
8105         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8106         (StackAlloc.DoResolve): Reused IsNegative.
8107
8108 2004-09-21  Martin Baulig  <martin@ximian.com>
8109
8110         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8111         if we're used in an iterator, we may be called from different
8112         methods.
8113
8114         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8115         we actually have an exception block.
8116
8117 2004-09-20  John Luke <jluke@cfl.rr.com>
8118
8119         * class.cs, cs-parser.jay: Improve the error report for 1520:
8120         report the actual line where the error happens, not where the
8121         class was declared.
8122
8123         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8124         Pass location information that was available elsewhere.
8125
8126 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8127
8128         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8129         runtime to delay sign assemblies.
8130
8131 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8132
8133         * cs-parser.jay: Do not report the stack trace, this is barely
8134         used nowadays.
8135
8136 2004-08-22  John Luke  <john.luke@gmail.com>
8137  
8138         * driver.cs : check that a resource id is not already used
8139         before adding it, report CS1508 if it is, bug #63637
8140
8141 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8142
8143         * ecore.cs: Removed dead code.
8144
8145 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8146
8147         * class.cs: Do not report warning CS0067 on the interfaces.
8148
8149 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8150
8151         * cs-parser.jay: Add error 504 report.
8152
8153 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8154
8155         * rootcontext.cs: WarningLevel is 4 by default now.
8156
8157         * statement.cs (Fixed.Resolve): Do not null
8158         VariableInfo.
8159
8160 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8161
8162         Fixed bug #55780
8163         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8164         deep search when property is not virtual.
8165         (PropertyExpr.ResolveAccessors): Make one call for both
8166         accessors.
8167
8168 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8169
8170         Fixed bug #65766
8171         * statement.cs: Error 152 report constains also location.
8172
8173 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8174
8175         Fixed bug #65766
8176         * const.cs: Explicitly set constant as static.
8177
8178 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8179
8180         Fixed bug #64226
8181         * cs-parser.jay: Add error 1017 report.
8182
8183 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8184
8185         Fixed bug #59980, #64224
8186         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8187
8188         * typemanager.cs (IsSpecialMethod): Simplified
8189
8190 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8191
8192         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8193         condition with better params.
8194
8195 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8196
8197         Fixed bug #65238
8198         * attribute.cs (Resolve): Property has to have both
8199         accessors.
8200
8201 2004-09-14  Martin Baulig  <martin@ximian.com>
8202
8203         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8204
8205 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8206
8207         Fixed bug #61902
8208         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8209         called and is obsolete then this member suppress message
8210         when call is inside next [Obsolete] method or type.
8211
8212         * expression.cs: Use TestObsoleteMethodUsage member.
8213
8214 2004-09-14  Martin Baulig  <martin@ximian.com>
8215
8216         * cs-parser.jay: Sync a bit with the GMCS version.
8217
8218 2004-09-14  Martin Baulig  <martin@ximian.com>
8219
8220         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8221         (CSharpParser.yacc_verbose_flag): New public field.
8222
8223         * genericparser.cs: Removed.
8224
8225 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8226
8227         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8228
8229 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8230
8231         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8232
8233 2004-09-10  Martin Baulig  <martin@ximian.com>
8234
8235         Backported my MemberName changes from GMCS into MCS.
8236
8237         - we are now using a special `MemberName' class instead of using
8238         strings; in GMCS, the `MemberName' also contains the type
8239         arguments.
8240
8241         - changed the grammar rules a bit:
8242           * the old `member_name' is now a `namespace_or_type_name':
8243             The rule is that we use `namespace_or_type_name' everywhere
8244             where we expect either a "member name" (GetEnumerator) or a
8245             "member name" with an explicit interface name
8246             (IEnumerable.GetEnumerator).
8247             In GMCS, the explicit interface name may include type arguments
8248             (IEnumerable<T>.GetEnumerator).
8249           * we use `member_name' instead of just `IDENTIFIER' for
8250             "member names":
8251             The rule is that we use `member_name' wherever a member may
8252             have type parameters in GMCS.       
8253
8254         * decl.cs (MemberName): New public class.
8255         (MemberCore.MemberName): New public readonly field.
8256         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8257         (DeclSpace): Likewise.
8258
8259         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8260         * enum.cs (Enum.ctor): Likewise.
8261
8262         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8263         MemberName.     
8264         (AliasEntry.ctor): Take a MemberName, not an Expression.
8265         (AliasEntry.UsingAlias): Likewise.
8266
8267         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8268         (IMethodData.MemberName): Changed type from string to MemberName.
8269         (MemberBase.ExplicitInterfaceName): Likewise.
8270         (AbstractPropertyEventMethod.SetupName): Make this private.
8271         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8272         argument; compute the member name here.
8273         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8274         on the `member.MemberName' and the `prefix'.
8275
8276         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8277         not `type_name'.
8278         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8279         thus, we get a `MemberName' instead of a `string'.  These
8280         declarations may have type parameters in GMCS.
8281         (interface_method_declaration, delegate_declaration): Likewise.
8282         (class_declaration, interface_declaration): Likewise.
8283         (method_header): Use `namespace_or_type_name' instead of
8284         `member_name'.  We may be an explicit interface implementation.
8285         (property_declaration, event_declaration): Likewise.
8286         (member_name): This is now just an `IDENTIFIER', not a
8287         `namespace_or_type_name'.
8288         (type_name, interface_type): Removed.
8289         (namespace_or_type_name): Return a MemberName, not an Expression.
8290         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8291         call GetTypeExpression() on the MemberName to get an expression.
8292         (IndexerDeclaration.interface_type): Changed type from string to
8293         MemberName.
8294         (MakeName): Operate on MemberName's instead of string's.
8295
8296 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8297
8298         Fix bug #55770.
8299         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8300         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8301         lookup to avoid symbols introduced by 'using'.
8302         * rootcontext.cs (NamespaceLookup): Update.
8303
8304 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8305
8306         * class.cs (TypeContainer.DoDefineMembers): Do not call
8307         DefineDefaultConstructor for static classes.
8308
8309 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8310
8311         * attribute.cs (Attribute.Resolve): Add error 653 report.
8312
8313         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8314         report.
8315         (Method.ApplyAttributeBuilder): Add error 685 report.
8316         (Operator.Define): Add error 564 report.
8317
8318         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8319
8320         * expression.cs (Invocation.DoResolve): Add error
8321         245 and 250 report.
8322
8323         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8324         error 674 report.
8325
8326 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8327
8328         * class.cs (ConstructorInitializer.Resolve):
8329         Wrong error number (515->516).
8330
8331 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8332
8333         * class.cs (Indexer.Define): Add error 631 report.
8334
8335 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8336
8337         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8338
8339 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8340
8341         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8342
8343 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8344
8345         * cs-parser.jay: Added error CS0241 report.
8346
8347 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8348
8349         * cs-parser.jay (fixed_statement): Introduce a scope for the
8350         declaration in the 'fixed' statement.
8351
8352 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8353
8354         * cs-parser.jay: Added CS0230 error report.
8355
8356 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8357
8358         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8359
8360 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8361
8362         * expression.cs (Argument.Resolve): Added error CS0192 and
8363         CS0199 report.
8364
8365 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8366
8367         C# 2.0 #pragma warning feature
8368
8369         * cs-tokenizer.cs (PreProcessPragma): New method; 
8370         Handles #pragma directive.
8371
8372         * report.cs (WarningRegions): New class; Support
8373         class for #pragma warning directive. It tests whether
8374         warning is enabled for a given line.
8375
8376 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8377
8378         * const.cs: Add more descriptive error report, tahnks to
8379         Sebastien. 
8380
8381 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8384
8385 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8386
8387         * expression.cs: Apply patch from Ben: Remove dead code from
8388         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8389         as that code just threw an exception anwyays.
8390
8391         * const.cs: Remove the call to the turnintoconstant, for details
8392         see bug: #63144
8393         
8394         * literal.cs: The type of the null-literal is the null type;  So
8395         we use a placeholder type (literal.cs:System.Null, defined here)
8396         for it.
8397
8398         * expression.cs (Conditional.DoResolve): Remove some old code that
8399         is no longer needed, conversions have been fixed.
8400
8401         (ArrayCreationExpression.DoResolve): Return false if we fail to
8402         resolve the inner expression.
8403
8404 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8405
8406         Fix test-290.cs.
8407         * cs-parser.jay (delegate_declaration): Record a delegate
8408         declaration as a type declaration.
8409         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8410
8411 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8412
8413         * parameter.cs: Do not crash if the type can not be resolved. 
8414
8415         * expression.cs: Report errors with unsafe pointers, fixes #64896
8416
8417 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8418
8419         * expression.cs: Pointer arith always needs to do a conv.i
8420         if the operand is a long. fix 65320
8421
8422 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8423
8424         Fixed cs0619-37.cs, cs0619-38.cs
8425
8426         * enum.cs (GetObsoleteAttribute): Removed.
8427
8428         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8429         on Enum member is double staged. The first is tested member
8430         and then enum.
8431
8432 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8433
8434         Fixed #56986, #63631, #65231
8435
8436         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8437         adds member to name container.
8438         (TypeContainer.AddToTypeContainer): New method, adds type to
8439         name container.
8440         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8441         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8442         AddOperator): Simplified by reusing AddToMemberContainer.
8443         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8444         instead of field.
8445         (Method.CheckForDuplications): Fixed implementation to test all
8446         possibilities.
8447         (MemberBase): Detection whether member is explicit interface
8448         implementation is now in constructor.
8449         (MemberBase.UpdateMemberName): Handles IndexerName.
8450         (Accessor): Changed to keep also location information.
8451         (AbstractPropertyEventMethod): Is derived from MemberCore.
8452         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8453         will be emited or not.
8454         (PropertyBase.AreAccessorsDuplicateImplementation):
8455         Tests whether accessors are not in collision with some method.
8456         (Operator): Is derived from MethodCore to simplify common
8457         operations.
8458
8459         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8460         must be performed.
8461         (DeclSpace.AddToContainer): Adds the member to defined_names
8462         table. It tests for duplications and enclosing name conflicts.
8463
8464         * enum.cs (EnumMember): Clean up to reuse the base structures
8465
8466 2004-09-03  Martin Baulig  <martin@ximian.com>
8467
8468         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8469         into TypeContainer, to make partial classes work again.
8470
8471 2004-09-03  Martin Baulig  <martin@ximian.com>
8472
8473         * rootcontext.cs (RootContext.V2): Removed.
8474
8475 2004-03-23  Martin Baulig  <martin@ximian.com>
8476
8477         * expression.cs (Invocation.OverloadResolve): Added `bool
8478         may_fail' argument and use it instead of the Location.IsNull() hack.
8479
8480 2004-09-03  Martin Baulig  <martin@ximian.com>
8481
8482         Merged latest changes into gmcs.  Please keep this comment in
8483         here, it makes it easier for me to see what changed in MCS since
8484         the last time I merged.
8485
8486 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8487
8488         Fix #61128.
8489         * expression.cs (BetterConversion): Don't allow either conversion 
8490         to be null.  Remove redundant implicit conversion test when 'q ==
8491         null' -- when this function is invoked, we already know that the
8492         implicit conversion exists.
8493         (BetterFunction): Assume that 'best' is non-null.  Remove
8494         redundant reimplementation of IsApplicable when 'best' is null.
8495         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8496         number of arguments.
8497         (IsAncestralType): Extract from OverloadResolve.
8498         (OverloadResolve): Make robust to the MethodGroupExpr being
8499         unsorted.  Implement all the logic of Section 14.5.5.1, and
8500         support overloading of methods from multiple applicable types.
8501         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8502
8503         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8504         (RealError, Warning): Append type of report to related symbol.
8505
8506 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8507
8508         * enum.cs: Fixed CLS-Compliance checks for enum members.
8509         Error tests cs3008-8.cs, cs3014-8.cs
8510
8511 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8512
8513         Fixed bug #62342, #63102
8514         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8515         like ImplementMethod.
8516
8517 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8518
8519         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8520         Fixed bug #65170.
8521
8522 2004-09-02  Martin Baulig  <martin@ximian.com>
8523
8524         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8525         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8526         on the MethodBase.
8527
8528 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8529
8530         C# 2.0 Static classes implemented
8531
8532         * class.cs (TypeContainer): instance_constructors,
8533         initialized_fields, initialized_static_fields,
8534         default_constructor, base_inteface_types are protected to be
8535         accessible from StaticClass.
8536         (TypeContainer.DefineDefaultConstructor): New virtual method
8537         for custom default constructor generating
8538         (StaticClass): New class to handle "Static classes" feature.
8539
8540         * cs-parser.jay: Handle static keyword on class like instance
8541         of StaticClass.
8542
8543         * driver.cs: Added "/langversion" command line switch with two
8544         options (iso-1, default).
8545
8546 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8547
8548         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8549
8550 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8551
8552         * delegate.cs: Style.
8553
8554 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8555
8556         * delegate.cs: Add seperate instance expr field for miguel.
8557
8558 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8559
8560         * PointerArithmetic (Resolve): make sure we are not doing
8561         pointer arith on void*. Also, make sure we are resolved
8562         by not setting eclass until resolve.
8563
8564         All callers: Make sure that PointerArithmetic gets resolved.
8565
8566 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8567
8568         * ArrayCreation (LookupType): If the type does not resolve 
8569         to an array, give an error.
8570
8571 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8572
8573         * statement.cs (Try.Resolve): Fixed bug #64222
8574
8575 2004-08-27  Martin Baulig  <martin@ximian.com>
8576
8577         * class.cs
8578         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8579         crash here.     
8580
8581 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8582
8583         * ecore.cs (Constantify): Get underlying type via
8584         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8585         Windows in special cases.
8586
8587 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8588
8589         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8590         for obtaining also private methods.
8591         (GetRemoveMethod): Used GetRemoveMethod (true)
8592         for obtaining also private methods.
8593
8594 2004-08-24  Martin Baulig  <martin@ximian.com>
8595
8596         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8597         MethodAttributes.HideBySig for operators.
8598
8599 2004-08-23  Martin Baulig  <martin@ximian.com>
8600
8601         Back to the old error reporting system :-)
8602
8603         * report.cs (Message): Removed.
8604         (Report.MessageData, ErrorData, WarningData): Removed.
8605         (Report.Error, Warning): Back to the old system.
8606
8607 2004-08-23  Martin Baulig  <martin@ximian.com>
8608
8609         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8610
8611         * class.cs (TypeContainer.ParentContainer): New public virtual
8612         method; replaces the explicit interface implementation.
8613         (ClassPart.ParentContainer): Override.
8614
8615 2004-08-23  Martin Baulig  <martin@ximian.com>
8616
8617         * statement.cs (Switch): Added support for constant switches; see
8618         #59428 or test-285.cs.
8619
8620 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8621
8622         Fixed bug #62740.
8623         * statement.cs (GetEnumeratorFilter): Removed useless
8624         logic because C# specs is strict. GetEnumerator must be
8625         public.
8626
8627 2004-08-22  Martin Baulig  <martin@ximian.com>
8628
8629         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8630         a switch and may break, reset the barrier.  Fixes #59867.
8631
8632 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8633
8634         CLS-Compliance speed up (~5% for corlib)
8635
8636         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8637         New method. Tests container for CLS-Compliant names
8638
8639         * class.cs (TypeContainer.VerifyClsName): New method.
8640         Checks whether container name is CLS Compliant.
8641         (Constructor): Implements IMethodData.
8642
8643         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8644         low-case table for CLS Compliance test.
8645         (MemberCache.VerifyClsParameterConflict): New method.
8646         Checks method parameters for CS3006 error.
8647
8648         * enum.cs (EnumMember): Is derived from MemberCore.
8649         (Enum.VerifyClsName): Optimized for better performance.
8650
8651 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8652
8653         * report.cs: Renamed Error_T to Error and changed all
8654         references.
8655
8656 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8657
8658         * class.cs (TypeContainer.IndexerArrayList): New inner class
8659         container for indexers.
8660         (TypeContainer.DefaultIndexerName): New constant for default
8661         indexer name. Replaced all "Item" with this constant.
8662         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8663
8664         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8665         DefaultMemberAttribute constructor.
8666
8667 2004-08-05  Martin Baulig  <martin@ximian.com>
8668
8669         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8670         Fix bug #59429.
8671
8672 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8673
8674         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8675         multi platforms problem.
8676
8677         * compiler.csproj: Included shared files.
8678
8679 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8680
8681         Fix bug 60333, 55971 in the more general way
8682         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8683         Added arg_type argument for constant conversion.
8684         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8685
8686 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8687
8688         Fix bug #59760
8689         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8690         OperatorArrayList, MethodCoreArrayList for typecontainer
8691         containers. Changed class member types to these new types.
8692         (MethodArrayList.DefineMembers): Added test for CS0659.
8693
8694 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8695
8696         * cfold.cs: Synchronize the folding with the code in expression.cs
8697         Binary.DoNumericPromotions for uint operands.
8698
8699         * attribute.cs: Revert patch from Raja, it introduced a regression
8700         while building Blam-1.2.1 (hard to isolate a test case).
8701
8702 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8703
8704         Fix for #55382
8705         * class.cs:
8706         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8707         name collision.
8708         (MethodCore.parent_method): New member. The method we're overriding
8709         if this is an override method.
8710         (MethodCore.CheckBase): Moved from Method class and made common.
8711         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8712         private.
8713         (MethodCore.CheckForDuplications): New abstract method. For custom
8714         member duplication search in a container
8715         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8716         method and its return type.
8717         (Event.conflict_symbol): New member. Symbol with same name in the
8718         parent class.
8719
8720         * decl.cs:
8721         (MemberCache.FindMemberWithSameName): New method. The method
8722         is looking for conflict with inherited symbols.
8723
8724 2004-08-04  Martin Baulig  <martin@ximian.com>
8725
8726         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8727
8728         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8729
8730 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8731
8732         * report.cs (Message): New enum for better error, warning reference in
8733         the code.
8734         (MessageData): New inner abstract class. It generally handles printing of
8735         error and warning messages.
8736         Removed unused Error, Warning, Message methods.
8737
8738 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8739
8740         Fix for cs0592-8.cs test
8741         * attribute.cs
8742         (Attributable.ValidAttributeTargets): Made public.
8743         (Attribute.ExplicitTarget): New member for explicit target value.
8744         (Attribute.CheckTargets): Now we translate explicit attribute
8745         target to Target here.
8746
8747 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8748
8749         * ecore.cs (MethodGroupExpr): new IsBase property.
8750
8751         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8752
8753         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8754         rather than an instance expr.
8755
8756         (DelegateCreation.Emit): Use the method group rather than
8757         the instance expression. Also, if you have base.Foo as the
8758         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8759
8760         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8761
8762         (NewDelegate.DoResolve): Only check for the existance of Invoke
8763         if the method is going to be needed. Use MethodGroupExpr.
8764
8765         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8766
8767         * expression.cs: For pointer arith., make sure to use
8768         the size of the type, not the size of the pointer to
8769         the type.
8770
8771 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8772
8773         Fix for #60722
8774         * class.cs (Class): Added error CS0502 test.
8775
8776 2004-08-03  John Luke  <jluke@cfl.rr.com>
8777             Raja R Harinath  <rharinath@novell.com>
8778
8779         Fix for #60997.
8780         * attribute.cs (Attribute.complained_before): New flag.
8781         (Attribute.ResolveType, Attribute.Resolve),
8782         (Attribute.DefinePInvokeMethod): Set it.
8783         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8784         
8785 2004-08-03  Martin Baulig  <martin@ximian.com>
8786
8787         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8788         use a user-defined operator; we still need to do numeric
8789         promotions in case one argument is a builtin type and the other
8790         one has an implicit conversion to that type.  Fixes #62322.
8791
8792 2004-08-02  Martin Baulig  <martin@ximian.com>
8793
8794         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8795         (LocalInfo.IsThis): New public property.
8796         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8797
8798 2004-08-01  Martin Baulig  <martin@ximian.com>
8799
8800         * class.cs (TypeContainer.GetClassBases): Don't set the default
8801         here since we may get called from GetPartialBases().
8802         (TypeContainer.DefineType): If GetClassBases() didn't return a
8803         parent, use the default one.
8804
8805 2004-07-30  Duncan Mak  <duncan@ximian.com>
8806
8807         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8808
8809 2004-07-30  Martin Baulig  <martin@ximian.com>
8810
8811         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8812
8813         * class.cs (SourceMethod): New public class, derive from the
8814         symbol writer's ISourceMethod.
8815         (Method): Use the new symbol writer API.
8816
8817         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8818         as argument and use the new symbol writer.
8819
8820         * location.cs
8821         (SourceFile): Implement the symbol writer's ISourceFile.
8822         (Location.SymbolDocument): Removed.
8823         (Location.SourceFile): New public property.
8824
8825         * symbolwriter.cs: Use the new symbol writer API.
8826
8827 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8828
8829         * Makefile (install-local): Remove.  Functionality moved to
8830         executable.make.
8831
8832 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8833
8834         * Makefile: Install mcs.exe.config file together with mcs.exe.
8835         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8836         correct runtime version.
8837         
8838 2004-07-25  Martin Baulig  <martin@ximian.com>
8839
8840         * class.cs
8841         (TypeContainer.RegisterOrder): Removed, this was unused.
8842         (TypeContainer, interface_order): Removed.
8843         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8844         TypeContainer as argument since we can also be called with a
8845         `PartialContainer' for a partial class/struct/interface.
8846         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8847         of checking whether we're an `Interface' - we could be a
8848         `PartialContainer'.
8849         (PartialContainer.Register): Override; call
8850         AddClass()/AddStruct()/AddInterface() on our parent.
8851
8852         * cs-parser.jay (interface_member_declaration): Add things to the
8853         `current_container', not the `current_class'.
8854
8855         * rootcontext.cs (RegisterOrder): The overloaded version which
8856         takes an `Interface' was unused, removed.
8857
8858         * typemanager.cs (TypeManager.LookupInterface): Return a
8859         `TypeContainer', not an `Interface'.
8860         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8861         contain a `PartialContainer' for an interface, so check it's
8862         `Kind' to figure out what it is.
8863
8864 2004-07-25  Martin Baulig  <martin@ximian.com>
8865
8866         * class.cs (Class.DefaultTypeAttributes): New public constant.
8867         (Struct.DefaultTypeAttributes): Likewise.
8868         (Interface.DefaultTypeAttributes): Likewise.
8869         (PartialContainer.TypeAttr): Override this and add the
8870         DefaultTypeAttributes.
8871
8872 2004-07-25  Martin Baulig  <martin@ximian.com>
8873
8874         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8875         we can just use the `Parent' field instead.
8876
8877 2004-07-25  Martin Baulig  <martin@ximian.com>
8878
8879         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8880
8881 2004-07-25  Martin Baulig  <martin@ximian.com>
8882
8883         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8884         our parts before defining any methods.
8885         (TypeContainer.VerifyImplements): Make this virtual.
8886         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8887         on our PartialContainer.
8888
8889 2004-07-25  Martin Baulig  <martin@ximian.com>
8890
8891         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8892
8893         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8894         argument, we can just use the `Parent' field instead.
8895
8896         * class.cs
8897         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8898         (MemberBase.DoDefine): Likewise.
8899
8900 2004-07-24  Martin Baulig  <martin@ximian.com>
8901
8902         * decl.cs (MemberCore.Parent): New public field.
8903         (DeclSpace.Parent): Moved to MemberCore.
8904
8905         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8906         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8907         parent's .ctor.
8908         (FieldBase, Field, Operator): Likewise.
8909         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8910         (EventField, Event): Likewise.
8911
8912 2004-07-23  Martin Baulig  <martin@ximian.com>
8913
8914         * class.cs (PartialContainer): New public class.
8915         (ClassPart): New public class.
8916         (TypeContainer): Added support for partial classes.
8917         (TypeContainer.GetClassBases): Splitted some of the functionality
8918         out into GetNormalBases() and GetPartialBases().
8919
8920         * cs-tokenizer.cs (Token.PARTIAL): New token.
8921         (Tokenizer.consume_identifier): Added some hacks to recognize
8922         `partial', but only if it's immediately followed by `class',
8923         `struct' or `interface'.
8924
8925         * cs-parser.jay: Added support for partial clases.
8926
8927 2004-07-23  Martin Baulig  <martin@ximian.com>
8928
8929         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8930         a `DeclSpace' and also made it readonly.
8931         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8932         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8933         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8934
8935         * cs-parser.jay: Pass the `current_class', not the
8936         `current_container' (at the moment, this is still the same thing)
8937         to a new Method, Property, Event, Indexer or Constructor.
8938
8939 2004-07-23  Martin Baulig  <martin@ximian.com>
8940
8941         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8942         and removed the `current_interface' one.
8943         (struct_declaration, class_declaration, interface_declaration):
8944         Set `current_class' to the newly created class/struct/interface;
8945         set their `Bases' and call Register() before parsing their body.
8946
8947 2004-07-23  Martin Baulig  <martin@ximian.com>
8948
8949         * class.cs (Kind): New public enum.
8950         (TypeContainer): Made this class abstract.
8951         (TypeContainer.Kind): New public readonly field.
8952         (TypeContainer.CheckDef): New public method; moved here from
8953         cs-parser.jay.
8954         (TypeContainer.Register): New public abstract method.
8955         (TypeContainer.GetPendingImplementations): New public abstract
8956         method.
8957         (TypeContainer.GetClassBases): Removed the `is_class' and
8958         `is_iface' parameters.
8959         (TypeContainer.DefineNestedTypes): Formerly known as
8960         DoDefineType().
8961         (ClassOrStruct): Made this class abstract.
8962
8963         * tree.cs (RootTypes): New public type. 
8964
8965 2004-07-20  Martin Baulig  <martin@ximian.com>
8966
8967         * tree.cs (Tree.RecordNamespace): Removed.
8968         (Tree.Namespaces): Removed.
8969
8970         * rootcontext.cs (RootContext.IsNamespace): Removed.
8971
8972         * cs-parser.jay (namespace_declaration): Just create a new
8973         NamespaceEntry here.
8974
8975 2004-07-20  Martin Baulig  <martin@ximian.com>
8976
8977         * statement.cs (ExceptionStatement): New abstract class.  This is
8978         now used as a base class for everyone who's using `finally'.
8979         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8980         our local variables before using them.
8981
8982         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8983         virtual method.  This is used by Yield.Resolve() to "steal" an
8984         outer block's `finally' clauses.
8985         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8986         argument.
8987
8988         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8989         version which takes an ExceptionStatement.  This version must be
8990         used to create exception branchings.
8991
8992         * iterator.cs
8993         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8994         (Iterator.EmitMoveNext): Added exception support; protect the
8995         block with a `fault' clause, properly handle 'finally' clauses.
8996         (Iterator.EmitDispose): Run all the `finally' clauses here.
8997
8998 2004-07-20  Martin Baulig  <martin@ximian.com>
8999
9000         * iterator.cs: This is the first of a set of changes in the
9001         iterator code.  Match the spec more closely: if we're an
9002         IEnumerable, then GetEnumerator() must be called.  The first time
9003         GetEnumerator() is called, it returns the current instance; all
9004         subsequent invocations (if any) must create a copy.
9005
9006 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
9007
9008         * expression.cs: Resolve the constant expression before returning
9009         it. 
9010
9011 2004-07-19  Martin Baulig  <martin@ximian.com>
9012
9013         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
9014         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
9015         the return type of the new EmitContext.
9016
9017 2004-07-18  Martin Baulig  <martin@ximian.com>
9018
9019         * class.cs (Property.Define): Fix iterators.
9020
9021         * iterators.cs (Iterator.Define): Moved the
9022         `container.AddInterator (this)' call here from the .ctor; only do
9023         it if we resolved successfully.
9024
9025 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
9026
9027         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
9028         `true' for preprocessing directives that we parse.  The return
9029         value indicates whether we should return to regular tokenizing or
9030         not, not whether it was parsed successfully.
9031
9032         In the past if we were in: #if false ... #line #endif, we would
9033         resume parsing after `#line'.  See bug 61604.
9034
9035         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
9036         building: IsEnumType should return true only for enums, not for
9037         enums or System.Enum itself.  This fixes #61593.
9038
9039         Likely what happened is that corlib was wrong: mcs depended on
9040         this bug in some places.  The bug got fixed, we had to add the
9041         hack, which caused bug 61593.
9042
9043         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
9044         that was a workaround for the older conditions.
9045
9046 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
9047
9048         * assign.cs: IAssignMethod has a new interface, as documented
9049         inline. All assignment code now uses this new api.
9050
9051         * ecore.cs, expression.cs: All classes which implement
9052         IAssignMethod now use the new interface.
9053
9054         * expression.cs (Invocation): add a hack to EmitCall so that
9055         IndexerAccess can be the target of a compound assignment without
9056         evaluating its arguments twice.
9057
9058         * statement.cs: Handle changes in Invocation api.
9059
9060 2004-07-16  Martin Baulig  <martin@ximian.com>
9061
9062         * iterators.cs: Rewrote this.  We're now using one single Proxy
9063         class for both the IEnumerable and the IEnumerator interface and
9064         `Iterator' derives from Class so we can use the high-level API.
9065
9066         * class.cs (TypeContainer.AddIterator): New method.
9067         (TypeContainer.DoDefineType): New protected virtual method, which
9068         is called from DefineType().
9069         (TypeContainer.DoDefineMembers): Call DefineType() and
9070         DefineMembers() on all our iterators.
9071         (TypeContainer.Emit): Call Emit() on all our iterators.
9072         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9073
9074         * codegen.cs (EmitContext.CurrentIterator): New public field.
9075
9076 2004-07-15  Martin Baulig  <martin@ximian.com>
9077
9078         * typemanager.cs
9079         (TypeManager.not_supported_exception_type): New type.   
9080
9081 2004-07-14  Martin Baulig  <martin@ximian.com>
9082
9083         * iterators.cs: Use real error numbers.
9084
9085 2004-07-14  Martin Baulig  <martin@ximian.com>
9086
9087         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9088         requires this to be a System.Collection.IEnumerable and not a
9089         class implementing that interface.
9090         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9091
9092 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9093
9094         * class.cs: Fixed previous fix, it broke some error tests.
9095
9096 2004-07-12  Martin Baulig  <martin@ximian.com>
9097
9098         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9099         Fixes #61293.
9100
9101 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9102
9103         * assign.cs (LocalTemporary): Add new argument: is_address,If
9104         `is_address' is true, then the value that we store is the address
9105         to the real value, and not the value itself.
9106         
9107         * ecore.cs (PropertyExpr): use the new local temporary
9108         stuff to allow us to handle X.Y += z (where X is a struct)
9109
9110 2004-07-08  Martin Baulig  <martin@ximian.com>
9111
9112         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9113         not always return, just like we're doing in Using.Resolve().
9114
9115 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9116
9117         * cs-parser.jay (fixed_statement): flag this as Pinned.
9118
9119 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9120
9121         * typemanager.cs (TypeManager): Removed MakePinned method, this
9122         mechanism is replaced with the .NET 2.x compatible mechanism of
9123         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9124
9125         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9126         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9127         `IsFixed' property which has a different meaning.
9128
9129 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9130
9131         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9132         visible from inside a nested class, not just the names of the
9133         immediately enclosing class.
9134         Fix for bug #60730.
9135
9136 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9137
9138         * expression.cs (BetterConversion): Remove buggy special-case
9139         handling of "implicit constant expression conversions".  At this
9140         point, we already know that the conversion is possible -- we're
9141         only checking to see which is better.
9142
9143 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9144
9145         * cs-parser.jay: Added error CS0210 test.
9146
9147 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9148
9149         * cs-parser.jay: Added error CS0134 test.
9150
9151 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9152
9153         Fix bug #52507
9154         * cs-parser.jay: Added error CS0145 test.
9155
9156 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9157
9158         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9159
9160 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9161         
9162         * expression.cs (StackAlloc.Resolve): The argument may not
9163         be a constant; deal with this case.
9164         
9165 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9166
9167         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9168         GetIndexerAttributeValue.
9169         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9170
9171         * class.cs (Indexer.Define): Added error tests for CS0415,
9172         CS0609.
9173
9174 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9175
9176         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9177         property code.
9178
9179 2004-06-23  Martin Baulig  <martin@ximian.com>
9180
9181         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9182         neither return nor throw, reset the barrier as well.  Fixes #60457.
9183
9184 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9185
9186         * class.cs : EventAttributes is now set to None by default.
9187           This fixes bug #60459.
9188
9189 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9190
9191         Fix bug #60219
9192         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9193         Don't throw exception but return null (it's sufficient now).
9194
9195 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9196
9197         * typemanager.cs (GetArgumentTypes): Faster implementation.
9198
9199 2004-06-18  Martin Baulig  <martin@ximian.com>
9200
9201         * attribute.cs (Attribute.Resolve): Check whether we're an
9202         EmptyCast which a Constant child.  Fixes #60333.
9203
9204 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9205
9206         * statement.cs (EmitCollectionForeach): Account for the fact that
9207         not all valuetypes are in areas which we can take the address of.
9208         For these variables, we store to a temporary variable. Also, make
9209         sure that we dont emit a `callvirt' on a valuetype method.
9210
9211 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9212
9213         * expression.cs (StackAlloc.DoReSolve): Added test for
9214         negative parameter (CS0247).
9215
9216 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9217
9218         Fix bug #59792
9219         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9220
9221 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9222
9223         Fix bug #59781
9224         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9225         ulong.
9226
9227 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9228
9229         Fix bug #58254 & cs1555.cs, cs1556.cs
9230         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9231
9232 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9233
9234         * cs-parser.jay: Added error CS1669 test for indexers.
9235
9236 2004-06-11  Martin Baulig  <martin@ximian.com>
9237
9238         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9239         call this twice: for params and varargs methods.
9240
9241 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9242
9243         * class.cs:
9244         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9245
9246 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9247
9248         * attribute.cs (Attribute.GetValidTargets): Made public.
9249
9250         * class.cs: 
9251         (AbstractPropertyEventMethod): New class for better code sharing.
9252         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9253         CS1667 report.
9254         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9255
9256 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9257
9258         Fix bug #59477.
9259         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9260         that the call to Resolve is part of a MemberAccess.
9261         (Expression.Resolve): Use it for SimpleName resolution.
9262         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9263         Add 'intermediate' boolean argument.
9264         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9265         error message when the SimpleName can be resolved ambiguously
9266         between an expression and a type.
9267         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9268         public.
9269         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9270         call on the left-side.
9271
9272 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9273
9274         * class.cs:
9275         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9276
9277 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9278
9279         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9280
9281 2004-06-11  Martin Baulig  <martin@ximian.com>
9282
9283         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9284         varargs methods if applicable.
9285
9286 2004-06-11  Martin Baulig  <martin@ximian.com>
9287
9288         * expression.cs (Invocation.EmitCall): Don't use
9289         `method.CallingConvention == CallingConventions.VarArgs' since the
9290         method could also have `CallingConventions.HasThis'.
9291
9292 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9293
9294         * class.cs (Event.GetSignatureForError): Implemented.
9295         Fixed crash in error test cs3010.cs
9296
9297 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9298
9299         * cs-tokenizer.cs: Change the way we track __arglist to be
9300         consistent with the other keywords.
9301
9302 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9303
9304         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9305         tomorrow.
9306
9307 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9308
9309         * codegen.cs: Check that all referenced assemblies have a strongname
9310         before strongnaming the compiled assembly. If not report error CS1577.
9311         Fix bug #56563. Patch by Jackson Harper.
9312         * typemanager.cs: Added a method to return all referenced assemblies.
9313         Fix bug #56563. Patch by Jackson Harper.
9314
9315 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9316
9317         * class.cs:
9318         (Method.ApplyAttributeBuilder): Moved and added conditional
9319         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9320
9321         * delegate.cs:
9322         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9323
9324 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9325
9326         Fixed #59640
9327         * class.cs: (EventField.attribute_targets): Changed default target.
9328
9329 2004-06-08  Martin Baulig  <martin@ximian.com>
9330
9331         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9332
9333 2004-06-08  Martin Baulig  <martin@ximian.com>
9334
9335         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9336
9337 2004-06-07  Martin Baulig  <martin@ximian.com>
9338
9339         Added support for varargs methods.
9340
9341         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9342         keyword.
9343
9344         * cs-parser.jay: Added support for `__arglist'.
9345
9346         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9347
9348         * expression.cs (Argument.AType): Added `ArgList'.
9349         (Invocation): Added support for varargs methods.
9350         (ArglistAccess): New public class.
9351         (Arglist): New public class.
9352
9353         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9354
9355         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9356         a method's top-level block if the method has varargs.
9357
9358         * support.cs (ReflectionParameters, InternalParameters): Added
9359         support for varargs methods.    
9360
9361 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9362
9363         * class.cs: Provide location in indexer error report.
9364
9365         * driver.cs: Use standard names.
9366
9367         * namespace.cs: Catch the use of using after a namespace has been
9368         declared also on using aliases.
9369
9370 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9371
9372         Bug #50820.
9373         * typemanager.cs (closure_private_ok, closure_invocation_type)
9374         (closure_qualifier_type, closure_invocation_assembly)
9375         (FilterWithClosure): Move to ...
9376         (Closure): New internal nested class.
9377         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9378         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9379         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9380         (MemberLookup, MemberLookupFailed): Use it.
9381         * expression.cs (New.DoResolve): Treat the lookup for the
9382         constructor as being qualified by the 'new'ed type.
9383         (Indexers.GetIndexersForTypeOrInterface): Update.
9384
9385 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9386
9387         * attribute.cs
9388         (GetConditionalAttributeValue): New method. Returns
9389         condition of ConditionalAttribute.
9390         (SearchMulti): New method.  Returns all attributes of type 't'.
9391         Use it when attribute is AllowMultiple = true.
9392         (IsConditionalMethodExcluded): New method.
9393
9394         * class.cs
9395         (Method.IsExcluded): Implemented. Returns true if method has conditional
9396         attribute and the conditions is not defined (method is excluded).
9397         (IMethodData): Extended interface for ConditionalAttribute support.
9398         (PropertyMethod.IsExcluded): Implemented.
9399
9400         * decl.cs
9401         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9402
9403         * expression.cs
9404         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9405         on the method.
9406
9407 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9408
9409         * expression.cs (ArrayCreationExpression): Make this just an
9410         `expression'. It can't be a statement, so the code here was
9411         dead.
9412
9413 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9414
9415         Fixed #59072
9416         * typemanager.cs (GetFullNameSignature): New method for
9417         MethodBase types.
9418
9419 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9420
9421         Fixed #56452
9422         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9423         Use this method when MethodBuilder is null.
9424         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9425         Added test for error CS0626 (MONO reports error for this situation).
9426         (IMethodData.GetSignatureForError): Extended interface.
9427
9428 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9429
9430         * attribute.cs
9431         (AttributeTester.GetObsoleteAttribute): Returns instance of
9432         ObsoleteAttribute when type is obsolete.
9433
9434         * class.cs
9435         (TypeContainer.VerifyObsoleteAttribute): Override.
9436         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9437         (MethodCode.VerifyObsoleteAttribute): Override.
9438         (MemberBase.VerifyObsoleteAttribute): Override.
9439
9440         * decl.cs
9441         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9442         and report proper error.
9443
9444         *delegate.cs
9445         Delegate.VerifyObsoleteAttribute): Override.
9446
9447         * ecore.cs
9448         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9449         and report proper error.
9450         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9451
9452         * enum.cs
9453         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9454         and enum member.
9455
9456         * expression.cs
9457         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9458         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9459         Added test for ObsoleteAttribute.
9460
9461         * statement.cs
9462         (Catch): Derived from Statement.
9463
9464 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9465  
9466         Fixed bug #59071 & cs0160.cs
9467  
9468         * statement.cs (Try.Resolve): Check here whether order of catch
9469         clauses matches their dependencies.
9470
9471 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9472
9473         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9474         caused a regression: #59343.  Referencing nested classes from an
9475         assembly stopped working.
9476
9477 2004-05-31  Martin Baulig  <martin@ximian.com>
9478
9479         MCS is now frozen for beta 2.
9480
9481 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9482
9483         * convert.cs: add a trivial cache for overload operator resolution.
9484
9485 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9486
9487         * decl.cs: If possible, use lookuptypedirect here. We can only do
9488         this if there is no `.' after the namespace. Avoids using
9489         LookupType, which does lots of slow processing.
9490         (FindNestedType) New method, does what it says :-).
9491         * namespace.cs: use LookupTypeDirect.
9492         * rootcontext.cs: use membercache, if possible.
9493         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9494
9495 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9496
9497         * expression.cs:
9498         According to the spec, 
9499
9500         In a member access of the form E.I, if E is a single identifier,
9501         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9502         field, property, localvariable, or parameter with the same type as
9503         the meaning of E as a type-name (§3.8), then both possible
9504         meanings of E are permitted.
9505
9506         We did not check that E as a simple-name had the same type as E as
9507         a type name.
9508
9509         This trivial check gives us 5-7% on bootstrap time.
9510
9511 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9512
9513         * expression.cs (Invocation.OverloadResolve): Avoid the
9514         use of hashtables and boxing here by allocating on demand.
9515
9516 2004-05-30  Martin Baulig  <martin@ximian.com>
9517
9518         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9519         we're doing a silent lookup.  Don't try to lookup nested types in
9520         TypeManager.object_type (thanks to Ben Maurer).
9521
9522 2004-05-30  Martin Baulig  <martin@ximian.com>
9523
9524         Committing a patch from Ben Maurer.
9525
9526         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9527
9528 2004-05-29  Martin Baulig  <martin@ximian.com>
9529
9530         * class.cs (IMethodData.ShouldIgnore): New method.
9531
9532         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9533         `Location' argument, we don't need it anywhere.  Use
9534         `IMethodData.ShouldIgnore ()' instead of
9535         `MethodData.GetMethodFlags ()'.
9536         (TypeManager.AddMethod): Removed.
9537         (TypeManager.AddMethod2): Renamed to AddMethod.
9538
9539 2004-05-29  Martin Baulig  <martin@ximian.com>
9540
9541         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9542
9543         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9544         converting from a class type S to an interface type and we already
9545         have an object on the stack, don't box it again.  Fixes #52578.
9546
9547 2004-05-29  Martin Baulig  <martin@ximian.com>
9548
9549         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9550         Added support for `params' parameters.  Fixes #59267.
9551
9552 2004-05-29  Martin Baulig  <martin@ximian.com>
9553
9554         * literal.cs (NullPointer): Provide a private .ctor which sets
9555         `type' to TypeManager.object_type.  Fixes #59048.
9556
9557 2004-05-29  Martin Baulig  <martin@ximian.com>
9558
9559         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9560         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9561
9562         * ecore.cs (EventExpr.instance_expr): Make the field private.
9563
9564 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9565
9566         Fixed bug #50080 & cs0214-2.cs
9567         * expression.cs (Cast.DoResolve): Check unsafe context here.
9568         
9569         * statement.cs (Resolve.DoResolve): Likewise.
9570
9571 2004-05-26  Martin Baulig  <martin@ximian.com>
9572
9573         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9574
9575         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9576         (RootContext.LookupType): Pass down the `silent' flag.
9577
9578 2004-05-25  Martin Baulig  <martin@ximian.com>
9579
9580         * expression.cs
9581         (MethodGroupExpr.IdenticalTypeName): New public property.
9582         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9583         expression actually refers to a type.
9584
9585 2004-05-25  Martin Baulig  <martin@ximian.com>
9586
9587         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9588         for #56176 and made it actually work.
9589
9590 2004-05-25  Martin Baulig  <martin@ximian.com>
9591
9592         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9593         (FieldExpr, PropertyExpr): Override and implement
9594         CacheTemporaries.  Fixes #52279.
9595
9596 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9597
9598         * location.cs: In the new compiler listing a file twice is a
9599         warning, not an error.
9600
9601 2004-05-24  Martin Baulig  <martin@ximian.com>
9602
9603         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9604         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9605
9606 2004-05-24  Martin Baulig  <martin@ximian.com>
9607
9608         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9609         walking the `using' list.  Fixes #53921.
9610
9611 2004-05-24  Martin Baulig  <martin@ximian.com>
9612
9613         * const.cs (Const.LookupConstantValue): Added support for
9614         EmptyCast's; fixes #55251.
9615
9616 2004-05-24  Martin Baulig  <martin@ximian.com>
9617
9618         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9619         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9620         which does the CS0135 check.  The reason is that we first need to
9621         check whether the variable actually exists.
9622
9623 2004-05-24  Martin Baulig  <martin@ximian.com>
9624
9625         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9626         than RootContext.LookupType() to find the explicit interface
9627         type.  Fixes #58584.
9628
9629 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9630
9631         * Makefile: Simplify.  Use executable.make.
9632         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9633
9634 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9635
9636         * decl.cs:
9637         * enum.cs:
9638         Use the invariant culture when doing String.Compare for CLS case
9639         sensitivity.
9640         
9641 2004-05-23  Martin Baulig  <martin@ximian.com>
9642
9643         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9644         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9645
9646         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9647         
9648 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9649
9650         * class.cs (MemberBase.Define): Reuse MemberType member for 
9651         resolved type. Other methods can use it too.
9652
9653 2004-05-23  Martin Baulig  <martin@ximian.com>
9654
9655         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9656         the variable also exists in the current block (otherwise, we need
9657         to report a CS0103).  Fixes #58670.
9658
9659 2004-05-23  Martin Baulig  <martin@ximian.com>
9660
9661         * flowanalysis.cs (Reachability.Reachable): Compute this
9662         on-the-fly rather than storing it as a field.
9663
9664 2004-05-23  Martin Baulig  <martin@ximian.com>
9665
9666         * flowanalysis.cs (Reachability.And): Manually compute the
9667         resulting `barrier' from the reachability.      
9668        
9669 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9670
9671         Fix bug #57835
9672         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9673         instance of ObsoleteAttribute when symbol is obsolete.
9674
9675         * class.cs
9676         (IMethodData): Extended interface for ObsoleteAttribute support.
9677
9678 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9679
9680         * attribute.cs: Fix bug #55970
9681
9682 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9683
9684         Fix bug #52705
9685         * attribute.cs
9686         (GetObsoleteAttribute): New method. Creates the instance of
9687         ObsoleteAttribute.
9688         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9689         ObsoleteAttribute when member is obsolete.
9690         (AttributeTester.Report_ObsoleteMessage): Common method for
9691         Obsolete error/warning reporting.
9692
9693         * class.cs
9694         (TypeContainer.base_classs_type): New member for storing parent type.
9695
9696         * decl.cs
9697         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9698         for this MemberCore.
9699
9700 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9701
9702         * attribute.cs, const.cs: Fix bug #58590
9703
9704 2004-05-21  Martin Baulig  <martin@ximian.com>
9705
9706         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9707         out parameters if the end of the method is unreachable.  Fixes
9708         #58098. 
9709
9710 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9711
9712         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9713         Hari was right, why extra method.
9714
9715 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9716
9717         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9718
9719 2004-05-20  Martin Baulig  <martin@ximian.com>
9720
9721         Merged this back from gmcs to keep the differences to a minumum.
9722
9723         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9724         instead of a Declspace.
9725         (Attribute.ResolveType): Likewise.
9726         (Attributes.Search): Likewise.
9727         (Attributes.Contains): Likewise.
9728         (Attributes.GetClsCompliantAttribute): Likewise.
9729
9730         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9731         argument.
9732         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9733         DeclSpace.
9734
9735 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9736
9737         Fix bug #58688 (MCS does not report error when the same attribute
9738         is assigned twice)
9739
9740         * attribute.cs (Attribute.Emit): Distinction between null and default.
9741
9742 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9743
9744         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9745         of a top-level attribute without an attribute target.
9746         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9747         Make non-static.
9748         (Attribute.Conditional_GetConditionName), 
9749         (Attribute.Obsolete_GetObsoleteMessage): Update.
9750         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9751         part of ScanForIndexerName.
9752         (Attribute.CanIgnoreInvalidAttribute): New function.
9753         (Attribute.ScanForIndexerName): Move to ...
9754         (Attributes.ScanForIndexerName): ... here.
9755         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9756         (Attributes.Search): New internal variant that can choose not to
9757         complain if types aren't resolved.  The original signature now
9758         complains.
9759         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9760         complaints suppressed.
9761         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9762         only if it not useful.
9763         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9764         top-level for attributes that are shared between the assembly
9765         and a top-level class.
9766         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9767         * class.cs: Update to reflect changes.
9768         (DefineIndexers): Fuse loops.
9769         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9770         a couple more variants of attribute names.
9771
9772 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9773
9774         Fix bug #52585 (Implemented explicit attribute declaration)
9775
9776         * attribute.cs:
9777         (Attributable.ValidAttributeTargets): New abstract method. It gets
9778         list of valid attribute targets for explicit target declaration.
9779         (Attribute.Target): It holds target itself.
9780         (AttributeSection): Removed.
9781         (Attribute.CheckTargets): New method. It checks whether attribute
9782         target is valid for the current element.
9783
9784         * class.cs:
9785         (EventProperty): New class. For events that are declared like
9786         property (with add and remove accessors).
9787         (EventField): New class. For events that are declared like field.
9788         class.cs
9789
9790         * cs-parser.jay: Implemented explicit attribute target declaration.
9791
9792         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9793         Override ValidAttributeTargets.
9794
9795         * parameter.cs:
9796         (ReturnParameter): Class for applying custom attributes on 
9797         the return type.
9798         (ParameterAtribute): New class. Class for applying custom
9799         attributes on the parameter type.
9800
9801 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9804         definitions. 
9805
9806         (Method): Allow UNSAFE here.
9807
9808         * modifiers.cs: Support unsafe reporting.
9809
9810 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9811
9812         * decl.cs: Fix bug #58478.
9813
9814 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9815
9816         * statement.cs: When checking for unreachable code on an EmptyStatement,
9817         set the location. Fixes bug #58488.
9818
9819 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9820
9821         * driver.cs: Add -pkg handling.
9822
9823         From Gonzalo: UseShelLExecute=false
9824
9825 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9826
9827         * attribute.cs:
9828         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9829         for attribute.
9830         (Attribute.IsClsCompliaceRequired): Moved to base for better
9831         accesibility.
9832         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9833         when attribute is AttributeUsageAttribute.
9834         (Attribute.GetValidTargets): Simplified.
9835         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9836         attribute for this type.
9837         (Attribute.ApplyAttributes): Method renamed to Emit and make
9838         non-static.
9839         (GlobalAttributeSection): New class for special handling of global
9840         attributes (assembly, module).
9841         (AttributeSection.Emit): New method.
9842
9843         * class.cs: Implemented Attributable abstract methods.
9844         (MethodCore.LabelParameters): Moved to Parameter class.
9845         (Accessor): Is back simple class.
9846         (PropertyMethod): Implemented Attributable abstract class.
9847         (DelegateMethod): Implemented Attributable abstract class.
9848         (Event): New constructor for disctintion between normal Event
9849         and Event with accessors.
9850
9851         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9852
9853         * codegen.cs, const.cs, decl.cs, delegate.cs:
9854         (CommonAssemblyModulClass): Implemented Attributable abstract class
9855         and simplified.
9856
9857         * enum.cs: Implement IAttributeSupport interface.
9858         (EnumMember): New class for emum members. Implemented Attributable
9859         abstract class
9860
9861         * parameter.cs:
9862         (ParameterBase): Is abstract.
9863         (ReturnParameter): New class for easier [return:] attribute handling.
9864
9865         * typemanager.cs: Removed builder_to_attr.
9866
9867 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9868
9869         Fix bug #57151.
9870         * attribute.cs (Attribute.GetPositionalValue): New function.
9871         * class.cs (TypeContainer.VerifyMembers): New function.
9872         (TypeContainer.Emit): Use it.
9873         (ClassOrStruct): New base class for Class and Struct.
9874         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9875         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9876         class.
9877         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9878         then each non-static field should have a FieldOffset attribute.
9879         Otherwise, none of the fields should have a FieldOffset attribute.
9880         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9881         and FieldOffset attributes.
9882         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9883         (TypeManager.field_offset_attribute_type): New core types.
9884         (TypeManager.InitCoreTypes): Initialize them.
9885
9886 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9887
9888         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9889         Return correct type.
9890         From bug #58270.
9891
9892 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9893
9894         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9895         be implicitly converted to ulong.
9896         
9897         * expression.cs: The logic for allowing operator &, | and ^ worked
9898         was wrong, it worked before because we did not report an error in
9899         an else branch.  Fixes 57895.
9900
9901         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9902         allow volatile fields to be reference types.
9903
9904 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9905
9906         * driver.cs: Add support for /debug-
9907
9908 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9909
9910         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9911         Add a 'complain' parameter to silence errors.
9912         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9913         silently overlooked type-resolutions.
9914         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9915         to reflect changes.
9916         (Attributes.Search): New function.
9917         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9918         (Attributes.GetAttributeFullName): Remove hack.
9919         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9920         Update to reflect changes.
9921         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9922         Use Attributes.Search instead of nested loops.
9923
9924 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9925
9926         * decl.cs:
9927         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9928         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9929         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9930
9931         * report.cs: (Report.Warning): Renamed to Warning_T because of
9932         parameter collision.
9933
9934 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9935
9936         * expression.cs (MemberAccess.ResolveMemberAccess):
9937         Exit with non-zero status after Report.Error.
9938         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9939         Likewise.
9940         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9941
9942 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9943
9944         * support.cs: Don't hang when the file is empty.
9945
9946 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9947
9948         * support.cs: In SeekableStreamReader, compute the preamble size of the
9949           underlying stream. Position changes should take into account that initial
9950           count of bytes.
9951
9952 2004-05-03  Todd Berman  <tberman@sevenl.net>
9953
9954         * driver.cs: remove unused GetSysVersion function.
9955
9956 2004-05-03  Todd Berman  <tberman@sevenl.net>
9957
9958         * driver.cs: Remove the hack from saturday, as well as the hack
9959         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9960         link_paths to get that bit proper.
9961
9962 2004-05-01  Todd Berman  <tberman@sevenl.net>
9963
9964         * driver.cs: Try a LoadFrom before a Load, this checks the current
9965         path. This is currently a bug in mono that is be fixed, however, this
9966         provides a workaround for now. This will be removed when the bug
9967         is fixed.
9968
9969 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9970
9971         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9972         incomplete key pairs (#57941).
9973
9974 2004-05-01  Todd Berman  <tberman@sevenl.net>
9975
9976         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9977         from the GAC
9978
9979 2004-04-30  Jackson Harper  <jackson@ximian.com>
9980
9981         * codegen.cs: Open keys readonly.
9982         
9983 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9984
9985         * typemanager.cs: don't report cyclic struct layout when a struct
9986         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9987         which has 2 Pango.Rectangle fields.
9988
9989 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9990
9991         * expression.cs: Handle IntPtr comparisons with IL code
9992         rather than a method call.
9993
9994 2004-04-29  Martin Baulig  <martin@ximian.com>
9995
9996         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9997         the list of PropertyInfo's in class hierarchy and find the
9998         accessor.  Fixes #56013.
9999
10000 2004-04-29  Martin Baulig  <martin@ximian.com>
10001
10002         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10003
10004 2004-04-29  Martin Baulig  <martin@ximian.com>
10005
10006         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10007
10008         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10009
10010 2004-04-29  Martin Baulig  <martin@ximian.com>
10011
10012         * class.cs (ConstructorInitializer.Resolve): Check whether the
10013         parent .ctor is accessible.  Fixes #52146.
10014
10015 2004-04-29  Martin Baulig  <martin@ximian.com>
10016
10017         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10018
10019         * statement.cs (Using.EmitLocalVariableDecls): Use
10020         TypeManager.idisposable_type, not typeof (IDisposable).
10021         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10022
10023 2004-04-29  Martin Baulig  <martin@ximian.com>
10024
10025         * class.cs (Event.Define): Don't emit the field and don't set
10026         RTSpecialName and SpecialName for events on interfaces.  Fixes
10027         #57703. 
10028
10029 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10030
10031         Refactor Attribute.ApplyAttributes.
10032         * attribute.cs (Attributable): New base class for objects that can
10033         have Attributes applied on them.
10034         (Attribute): Make AttributeUsage fields public.
10035         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10036         (Attribute.IsInternalCall): New property.
10037         (Attribute.UsageAttr): Convert to a public read-only property.
10038         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10039         (Attribute.ResolveType, Attribute.Resolve)
10040         (Attribute.ScanForIndexerName): Update to reflect changes.
10041         (Attribute.CheckAttributeTarget): Re-format.
10042         (Attribute.ApplyAttributes): Refactor, to various
10043         Attributable.ApplyAttributeBuilder methods.
10044         * decl.cs (MemberCore): Make Attributable.
10045         * class.cs (Accessor): Make Attributable.
10046         (MethodData.ApplyAttributes): Use proper attribute types, not
10047         attribute names.
10048         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10049         (TypeContainer.ApplyAttributeBuilder)
10050         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10051         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10052         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10053         (Operator.ApplyAttributeBuilder): New factored-out methods.
10054         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10055         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10056         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10057         * parameter.cs (ParameterBase): New Attributable base class
10058         that can also represent Return types.
10059         (Parameter): Update to the changes.
10060
10061 2004-04-29  Jackson Harper  <jackson@ximian.com>
10062
10063         * driver.cs: Prefer the corlib system version when looking for
10064         assemblies in the GAC. This is still a hack, but its a better hack
10065         now.
10066         
10067 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10068
10069         * decl.cs, enum.cs: Improved error 3005 reporting.
10070   
10071         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10072         (related_symbols): New private member for list of symbols
10073         related to reported error/warning.
10074         
10075         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10076
10077 2004-04-29  Martin Baulig  <martin@ximian.com>
10078
10079         * ecore.cs (Expression.Constantify): If we're an enum and
10080         TypeManager.TypeToCoreType() doesn't give us another type, use
10081         t.UnderlyingSystemType.  Fixes #56178.  
10082
10083 2004-04-29  Martin Baulig  <martin@ximian.com>
10084
10085         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10086         interfaces and for each interface, only add members directly
10087         declared in that interface.  Fixes #53255.
10088
10089 2004-04-28  Martin Baulig  <martin@ximian.com>
10090
10091         * expression.cs (ConditionalLogicalOperator): Use a temporary
10092         variable for `left' to avoid that we evaluate it more than once;
10093         bug #52588.
10094
10095 2004-04-28  Martin Baulig  <martin@ximian.com>
10096
10097         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10098         `void[]' (CS1547).
10099
10100 2004-04-28  Martin Baulig  <martin@ximian.com>
10101
10102         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10103         void (CS1547).
10104
10105         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10106         whether the type is not void (CS1547).
10107
10108 2004-04-28  Martin Baulig  <martin@ximian.com>
10109
10110         * expression.cs (Unary.DoResolveLValue): Override this and report
10111         CS0131 for anything but Operator.Indirection.
10112
10113 2004-04-28  Martin Baulig  <martin@ximian.com>
10114
10115         Committing a patch from Ben Maurer; see bug #50820.
10116
10117         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10118         check for classes.
10119
10120         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10121         classes.        
10122
10123 2004-04-28  Martin Baulig  <martin@ximian.com>
10124
10125         Committing a patch from Ben Maurer; see bug #50820.
10126
10127         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10128         check for classes.
10129
10130         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10131         classes.        
10132
10133 2004-04-28  Martin Baulig  <martin@ximian.com>
10134
10135         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10136         (Block.AddLabel): Call DoLookupLabel() to only search in the
10137         current block.
10138
10139 2004-04-28  Martin Baulig  <martin@ximian.com>
10140
10141         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10142         comparing StringConstants and NullLiterals in Equality and Inequality.
10143
10144 2004-04-28  Jackson Harper  <jackson@ximian.com>
10145
10146         * driver.cs: Attempt to load referenced assemblies from the
10147         GAC. This is the quick and dirty version of this method that
10148         doesnt take into account versions and just takes the first
10149         canidate found. Will be good enough for now as we will not have more
10150         then one version installed into the GAC until I update this method.
10151
10152 2004-04-28  Martin Baulig  <martin@ximian.com>
10153
10154         * typemanager.cs (TypeManager.CheckStructCycles): New public
10155         static method to check for cycles in the struct layout.
10156
10157         * rootcontext.cs (RootContext.PopulateTypes): Call
10158         TypeManager.CheckStructCycles() for each TypeContainer.
10159         [Note: We only need to visit each type once.]
10160
10161 2004-04-28  Martin Baulig  <martin@ximian.com>
10162
10163         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10164
10165         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10166         success and added `out object value'.  Use a `bool resolved' field
10167         to check whether we've already been called rather than
10168         `ConstantValue != null' since this breaks for NullLiterals.
10169
10170 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10171
10172         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10173         setting of this flag, since the 'set' method may be non-public.
10174
10175 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10176
10177         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10178         check on current_vector.Block.
10179
10180 2004-04-27  Martin Baulig  <martin@ximian.com>
10181
10182         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10183         a field initializer.  Fixes #56459.
10184
10185 2004-04-27  Martin Baulig  <martin@ximian.com>
10186
10187         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10188         we're not attempting to use an indexer.  Fixes #52154.
10189
10190 2004-04-27  Martin Baulig  <martin@ximian.com>
10191
10192         * statement.cs (Return): Don't create a return label if we don't
10193         need it; reverts my change from January 20th.  Thanks to Ben
10194         Maurer for this.
10195
10196 2004-04-27  Martin Baulig  <martin@ximian.com>
10197
10198         According to the spec, `goto' can only leave a nested scope, but
10199         never enter it.
10200
10201         * statement.cs (Block.LookupLabel): Only lookup in the current
10202         block, don't recurse into parent or child blocks.
10203         (Block.AddLabel): Check in parent and child blocks, report
10204         CS0140/CS0158 if we find a duplicate.
10205         (Block): Removed this indexer for label lookups.
10206         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10207         this already does the error reporting for us.
10208
10209         * flowanalysis.cs
10210         (FlowBranching.UsageVector.Block): New public variable; may be null.
10211         (FlowBranching.CreateSibling): Added `Block' argument.
10212         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10213         label for the target of a `goto' and check whether we're not
10214         leaving a `finally'.
10215
10216 2004-04-27  Martin Baulig  <martin@ximian.com>
10217
10218         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10219         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10220         just for returns).
10221
10222 2004-04-27  Martin Baulig  <martin@ximian.com>
10223
10224         * statement.cs (Block.AddLabel): Also check for implicit blocks
10225         and added a CS0158 check.
10226
10227 2004-04-27  Martin Baulig  <martin@ximian.com>
10228
10229         * flowanalysis.cs (FlowBranchingLoop): New class.
10230         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10231         UsageVector's instead of an ArrayList.
10232         (FlowBranching.Label): Likewise.
10233         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10234         (FlowBranching.AddBreakVector): New method.
10235
10236 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10237
10238         * attribute.cs: Small regression fix: only convert the type if we
10239         the type is different, fixes System.Drawing build.
10240
10241 2004-04-27  Martin Baulig  <martin@ximian.com>
10242
10243         * attribute.cs (Attribute.Resolve): If we have a constant value
10244         for a named field or property, implicity convert it to the correct
10245         type.
10246
10247 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10248
10249         * statement.cs (Block.Block): Implicit blocks share
10250         'child_variable_names' fields with parent blocks.
10251         (Block.AddChildVariableNames): Remove.
10252         (Block.AddVariable): Mark variable as "used by a child block" in
10253         every surrounding block.
10254         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10255         been used in a child block, complain about violation of "Invariant
10256         meaning in blocks" rule.
10257         * cs-parser.jay (declare_local_variables): Don't use
10258         AddChildVariableNames.
10259         (foreach_statement): Don't create an implicit block: 'foreach'
10260         introduces a scope.
10261
10262 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10263
10264         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10265         converting from 0L to ulong.  Fixes 57522.
10266
10267 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10268
10269         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10270         derived class hides via 'new' keyword field from base class (test-242.cs).
10271         TODO: Handle this in the more general way.
10272         
10273         * class.cs (CheckBase): Ditto.
10274
10275 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10276
10277         * decl.cs (caching_flags): New member for storing cached values
10278         as bit flags.
10279         (MemberCore.Flags): New enum where bit flags for caching_flags
10280         are defined.
10281         (MemberCore.cls_compliance): Moved to caching_flags.
10282         (DeclSpace.Created): Moved to caching_flags.
10283
10284         * class.cs: Use caching_flags instead of DeclSpace.Created
10285         
10286 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10287
10288         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10289         if we are only a derived class, not a nested class.
10290
10291         * typemanager.cs: Same as above, but do this at the MemberLookup
10292         level (used by field and methods, properties are handled in
10293         PropertyExpr).   Allow for the qualified access if we are a nested
10294         method. 
10295
10296 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10297
10298         * class.cs: Refactoring.
10299         (IMethodData): New inteface; Holds links to parent members
10300         to avoid member duplication (reduced memory allocation).
10301         (Method): Implemented IMethodData interface.
10302         (PropertyBase): New inner classes for get/set methods.
10303         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10304         (Event): New inner classes for add/remove methods.
10305         (Event.DelegateMethod): Implemented IMethodData interface.
10306
10307         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10308         EmitContext (related to class.cs refactoring).
10309
10310 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10311
10312         * delegate.cs (Delegate.VerifyApplicability): If the number of
10313         arguments are the same as the number of parameters, first try to
10314         verify applicability ignoring  any 'params' modifier on the last
10315         parameter.
10316         Fixes #56442.
10317
10318 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10319
10320         * class.cs (TypeContainer.AddIndexer): Use
10321         'ExplicitInterfaceName' to determine if interface name was
10322         explicitly specified.  'InterfaceType' is not initialized at this time.
10323         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10324         Indexers array is already in the required order.  Initialize
10325         'IndexerName' only if there are normal indexers.
10326         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10327         (TypeContainer.Emit): Emit DefaultMember attribute only if
10328         IndexerName is initialized.
10329         Fixes #56300.
10330
10331 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10332
10333         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10334         Fixes #57007
10335
10336 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10337
10338         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10339         attributes.
10340         Fix for #56456.
10341
10342         * attribute.cs (Attribute.Resolve): Check for duplicate named
10343         attributes.
10344         Fix for #56463.
10345
10346 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10347
10348         * iterators.cs (MarkYield): track whether we are in an exception,
10349         and generate code accordingly.  Use a temporary value to store the
10350         result for our state.
10351
10352         I had ignored a bit the interaction of try/catch with iterators
10353         since their behavior was not entirely obvious, but now it is
10354         possible to verify that our behavior is the same as MS .NET 2.0
10355
10356         Fixes 54814
10357
10358 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * iterators.cs: Avoid creating temporaries if there is no work to
10361         do. 
10362
10363         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10364         Enumerations, use TypeManager.EnumToUnderlying and call
10365         recursively. 
10366
10367         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10368         bug #57013
10369
10370         (This.Emit): Use EmitContext.EmitThis to emit our
10371         instance variable.
10372
10373         (This.EmitAssign): Ditto.
10374
10375         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10376         codepaths, we will move all the functionality into
10377         Mono.CSharp.This 
10378
10379         (FieldExpr.EmitAssign): Ditto.
10380
10381         This fixes several hidden bugs that I uncovered while doing a code
10382         review of this today.
10383
10384         * codegen.cs (EmitThis): reworked so the semantics are more clear
10385         and also support value types "this" instances.
10386
10387         * iterators.cs: Changed so that for iterators in value types, we
10388         do not pass the value type as a parameter.  
10389
10390         Initialization of the enumerator helpers is now done in the caller
10391         instead of passing the parameters to the constructors and having
10392         the constructor set the fields.
10393
10394         The fields have now `assembly' visibility instead of private.
10395
10396 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10397
10398         * expression.cs (Argument.Resolve): Check if fields passed as ref
10399         or out are contained in a MarshalByRefObject.
10400
10401         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10402         another compiler type.
10403
10404 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10405
10406         * class.cs (Indexer.Define): use the new name checking method.
10407         Also, return false on an error.
10408         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10409         (is_identifier_[start/part]_character): make static.
10410
10411 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10412
10413         * expression.cs (Binary.ResolveOperator): Do no append strings
10414         twice: since we can be invoked more than once (array evaluation)
10415         on the same concatenation, take care of this here.  Based on a fix
10416         from Ben (bug #56454)
10417
10418 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10419
10420         * codegen.cs: Fix another case where CS1548 must be reported (when 
10421         delay-sign isn't specified and no private is available #56564). Fix
10422         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10423         error when MCS is used on the MS runtime and we need to delay-sign 
10424         (which seems unsupported by AssemblyBuilder - see #56621).
10425
10426 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10427
10428         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10429         (TypeManager.ComputeNamespaces): Faster implementation for
10430         Microsoft runtime.
10431
10432         * compiler.csproj: Updated AssemblyName to mcs.
10433
10434 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10435
10436         * rootcontext.cs: Add new types to the boot resolution.
10437
10438         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10439         MulticastDelegate is not allowed.
10440
10441         * typemanager.cs: Add new types to lookup: System.TypedReference
10442         and ArgIterator.
10443
10444         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10445         check for TypedReference or ArgIterator, they are not allowed. 
10446
10447         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10448         makes us properly catch 1510 in some conditions (see bug 56016 for
10449         details). 
10450
10451 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10452
10453         * CryptoConvert.cs: update from corlib version
10454         with endian fixes.
10455
10456 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10457
10458         * class.cs (Indexer.Define): Check indexername declaration
10459
10460 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10461
10462         * attribute.cs (IsClsCompliant): Fixed problem with handling
10463         all three states (compliant, not-compliant, undetected).
10464
10465 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10466
10467         * attribute.cs (Attribute): Location is now public.
10468         (Resolve): Store resolved arguments (pos_values) in attribute class.
10469         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10470         (GetClsCompliantAttributeValue): New method that gets
10471         CLSCompliantAttribute value.
10472         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10473         if exists else null.
10474         (AttributeTester): New class for CLS-Compliant verification routines.
10475
10476         * class.cs (Emit): Add CLS-Compliant verification.
10477         (Method.GetSignatureForError): Implemented.
10478         (Constructor.GetSignatureForError): Implemented
10479         (Constructor.HasCompliantArgs): Returns if constructor has
10480         CLS-Compliant arguments.
10481         (Constructor.Emit): Override.
10482         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10483         is needed to test only parameters.
10484         (FieldBase.GetSignatureForError): Implemented.
10485         (TypeContainer): New member for storing base interfaces.
10486         (TypeContainer.FindMembers): Search in base interfaces too.
10487
10488         * codegen.cs (GetClsComplianceAttribute): New method that gets
10489         assembly or module CLSCompliantAttribute value.
10490         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10491         for assembly.
10492         (ModuleClass.Emit): Add error 3012 test.
10493
10494         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10495
10496         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10497         state for all decl types.
10498         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10499         if CLS-Compliant tests are required.
10500         (IsClsCompliaceRequired): New method. Analyze whether code
10501         must be CLS-Compliant.
10502         (IsExposedFromAssembly): New method. Returns true when MemberCore
10503         is exposed from assembly.
10504         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10505         value or gets cached value.
10506         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10507         is explicitly marked with CLSCompliantAttribute.
10508         (IsIdentifierClsCompliant): New abstract method. This method is
10509         used to testing error 3005.
10510         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10511         for identifier and parameters CLS-Compliant testing.
10512         (VerifyClsCompliance): New method. The main virtual method for
10513         CLS-Compliant verifications.
10514         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10515         null. I don't know why is null (too many public members !).
10516         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10517         and get value of first CLSCompliantAttribute that found.
10518
10519         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10520         (VerifyClsCompliance): Override and add extra tests.
10521
10522         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10523         clscheck- disable CLS-Compliant verification event if assembly is has
10524         CLSCompliantAttribute(true).
10525
10526         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10527         ApllyAttribute is now called in emit section as in the other cases.
10528         Possible future Emit integration.
10529         (IsIdentifierClsCompliant): New override.
10530         (VerifyClsCompliance): New override.
10531         (GetEnumeratorName): Returns full enum name.
10532
10533         * parameter.cs (GetSignatureForError): Implemented.
10534
10535         * report.cs (WarningData): New struct for Warning message information.
10536         (LocationOfPreviousError): New method.
10537         (Warning): New method. Reports warning based on the warning table.
10538         (Error_T): New method. Reports error based on the error table.
10539
10540         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10541         verifications are done here.
10542
10543         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10544
10545         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10546         CLSCompliantAttribute.
10547         (all_imported_types): New member holds all imported types from other
10548         assemblies.
10549         (LoadAllImportedTypes): New method fills static table with exported types
10550         from all referenced assemblies.
10551         (Modules): New property returns all assembly modules.
10552
10553 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10556         throwing a parser error.
10557
10558         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10559         which removes the hardcoded get_/set_ prefixes for properties, as
10560         IL allows for the properties to be named something else.  
10561
10562         Bug #56013
10563
10564         * expression.cs: Do not override operand before we know if it is
10565         non-null.  Fix 56207
10566
10567 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10568
10569         * typemanager.cs: support for pinned variables.
10570
10571 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10572
10573         * decl.cs, typemanager.cs: Avoid using an arraylist
10574         as a buffer if there is only one result set.
10575
10576 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10577
10578         * expression.cs: Make sure you cant call a static method
10579         with an instance expression, bug #56174.
10580
10581 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10582
10583         * class.cs (IsDuplicateImplementation): Improve error reporting to
10584         flag 663 (method only differs in parameter modifier).
10585
10586         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10587         in preprocessor directives.
10588
10589         * location.cs (LookupFile): Allow for the empty path.
10590
10591         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10592         better approach for some of that patch, but its failing with the
10593         CharSet enumeration.  For now try/catch will do.
10594
10595         * typemanager.cs: Do not crash if a struct does not have fields.
10596         Fixes 56150.
10597
10598 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10599
10600         * expression.cs: cs0213, cant fix a fixed expression.
10601         fixes 50231.
10602
10603 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10604
10605         * cs-parser.jay: detect invalid embeded statements gracefully.
10606         bug #51113.
10607
10608 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10609
10610         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10611         As a regex:
10612         s/
10613         the invocation type may not be a subclass of the tye of the item/
10614         The type of the item must be a subclass of the invocation item.
10615         /g
10616
10617         Fixes bug #50820.
10618
10619 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10620
10621         * attribute.cs: Added methods to get a string and a bool from an
10622         attribute. Required to information from AssemblyKeyFileAttribute,
10623         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10624         * codegen.cs: Modified AssemblyName creation to include support for
10625         strongnames. Catch additional exceptions to report them as CS1548.
10626         * compiler.csproj: Updated include CryptoConvert.cs.
10627         * compiler.csproj.user: Removed file - user specific configuration.
10628         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10629         Mono.Security assembly. The original class is maintained and tested in
10630         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10631         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10632         like CSC 8.0 (C# v2) supports.
10633         * Makefile: Added CryptoConvert.cs to mcs sources.
10634         * rootcontext.cs: Added new options for strongnames.
10635
10636 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10637
10638         * driver.cs: For --expect-error, report error code `2'
10639         if the program compiled with no errors, error code `1' if
10640         it compiled with an error other than the one expected.
10641
10642 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10643
10644         * compiler.csproj: Updated for Visual Studio .NET 2003.
10645         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10646         * compiler.sln: Updated for Visual Studio .NET 2003.
10647
10648 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10649
10650         * expression.cs: Fix bug #47234. We basically need to apply the
10651         rule that we prefer the conversion of null to a reference type
10652         when faced with a conversion to 'object' (csc behaviour).
10653
10654 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10655
10656         * statement.cs: Shorter form for foreach, eliminates
10657         a local variable. r=Martin.
10658
10659 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10660
10661         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10662         checks if we can use brtrue/brfalse to test for 0.
10663         * expression.cs: use the above in the test for using brtrue/brfalse.
10664         cleanup code a bit.
10665
10666 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10667
10668         * expression.cs: Rewrite string concat stuff. Benefits:
10669
10670         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10671         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10672         rather than a concat chain.
10673
10674         * typemanager.cs: Add lookups for more concat overloads.
10675
10676 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10677
10678         * expression.cs: Emit shorter il code for array init.
10679
10680         newarr
10681         dup
10682         // set 1
10683
10684         // set 2
10685
10686         newarr
10687         stloc.x
10688
10689         ldloc.x
10690         // set 1
10691
10692         ldloc.x
10693         // set 2
10694
10695 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10696
10697         * statement.cs: Before, two switch blocks would be merged if the
10698         total size of the blocks (end_item - begin_item + 1) was less than
10699         two times the combined sizes of the blocks.
10700
10701         Now, it will only merge if after the merge at least half of the
10702         slots are filled.
10703
10704         fixes 55885.
10705
10706 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10707
10708         * class.cs : csc build fix for GetMethods(). See bug #52503.
10709
10710 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10711
10712         * expression.cs: Make sure fp comparisons work with NaN.
10713         This fixes bug #54303. Mig approved this patch a long
10714         time ago, but we were not able to test b/c the runtime
10715         had a related bug.
10716
10717 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10718
10719         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10720
10721 2004-03-19  Martin Baulig  <martin@ximian.com>
10722
10723         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10724         error here and not in our caller.
10725
10726 2004-03-19  Martin Baulig  <martin@ximian.com>
10727
10728         * interface.cs: Completely killed this file.
10729         (Interface): We're now a TypeContainer and live in class.cs.
10730
10731         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10732         argument; we're now also called for interfaces.
10733         (TypeContainer.DefineMembers): Allow this method being called
10734         multiple times.
10735         (TypeContainer.GetMethods): New public method; formerly known as
10736         Interface.GetMethod().  This is used by PendingImplementation.
10737         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10738         it's now private and non-static.
10739         (Interface): Moved this here; it's now implemented similar to
10740         Class and Struct.
10741         (Method, Property, Event, Indexer): Added `bool is_interface'
10742         argument to their .ctor's.
10743         (MemberBase.IsInterface): New public field.
10744
10745         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10746         instances instead of InterfaceMethod, InterfaceProperty, etc.
10747         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10748         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10749
10750 2004-03-19  Martin Baulig  <martin@ximian.com>
10751
10752         * class.cs (MethodCore.IsDuplicateImplementation): New private
10753         method which does the CS0111 checking.
10754         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10755         Use IsDuplicateImplementation().
10756
10757 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10758
10759         * decl.cs (FindMemberToOverride): New method to find the correct
10760         method or property to override in the base class.
10761         * class.cs
10762             - Make Method/Property use the above method to find the
10763               version in the base class.
10764             - Remove the InheritableMemberSignatureCompare as it is now
10765               dead code.
10766
10767         This patch makes large code bases much faster to compile, as it is
10768         O(n) rather than O(n^2) to do this validation.
10769
10770         Also, it fixes bug 52458 which is that nested classes are not
10771         taken into account when finding the base class member.
10772
10773         Reviewed/Approved by Martin.
10774
10775 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10776
10777         * interface.cs: In all interface classes removed redundant
10778         member initialization.
10779
10780 2004-03-16  Martin Baulig  <martin@ximian.com>
10781
10782         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10783
10784 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * decl.cs (DefineTypeAndParents): New helper method to define a
10787         type's containers before the type itself is defined;  This is a
10788         bug exposed by the recent changes to Windows.Forms when an
10789         implemented interface was defined inside a class that had not been
10790         built yet.   
10791
10792         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10793
10794         (Check): Loop correctly to report errors modifiers
10795         (UNSAFE was not in the loop, since it was the same as TOP).
10796
10797         * interface.cs: Every interface member now takes a ModFlags,
10798         instead of a "is_new" bool, which we set on the base MemberCore. 
10799
10800         Every place where we called "UnsafeOk" in the interface, now we
10801         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10802         the unsafe settings from the member declaration instead of the
10803         container interface. 
10804
10805         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10806
10807         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10808         `set_indexer_name' to the pending bits (one per type).
10809
10810         We fixed a bug today that was picking the wrong method to
10811         override, since for properties the existing InterfaceMethod code
10812         basically ignored the method name.  Now we make sure that the
10813         method name is one of the valid indexer names.
10814
10815 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10816  
10817         * support.cs (SeekableStreamReader): Keep track of stream byte
10818         positions and don't mix them with character offsets to the buffer.
10819
10820         Patch from Gustavo Giráldez
10821
10822 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10823
10824         * interface.cs (InterfaceSetGetBase): Removed double member
10825         initialization, base class does it as well.
10826
10827 2004-03-13  Martin Baulig  <martin@ximian.com>
10828
10829         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10830         when compiling corlib.
10831
10832 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10833
10834         * convert.cs (ExplicitConversion): We were reporting an error on
10835         certain conversions (object_type source to a value type, when the
10836         expression was `null') before we had a chance to pass it through
10837         the user defined conversions.
10838
10839         * driver.cs: Replace / and \ in resource specifications to dots.
10840         Fixes 50752
10841
10842         * class.cs: Add check for duplicate operators.  Fixes 52477
10843
10844 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10845
10846         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10847         that are in the middle of the statements, not only at the end.
10848         Fixes #54987
10849
10850         * class.cs (TypeContainer.AddField): No longer set the
10851         `HaveStaticConstructor' flag, now we call it
10852         `UserDefineStaticConstructor' to diferentiate the slightly
10853         semantic difference.
10854
10855         The situation is that we were not adding BeforeFieldInit (from
10856         Modifiers.TypeAttr) to classes that could have it.
10857         BeforeFieldInit should be set to classes that have no static
10858         constructor. 
10859
10860         See:
10861
10862         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10863
10864         And most importantly Zoltan's comment:
10865
10866         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10867
10868         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10869          before its static fields are used', i.e. initialization does not need
10870          to be triggered by the first access to the type. Setting this flag
10871          helps the JIT to compile better code, since it can run the static
10872          constructor at JIT time, and does not need to generate code to call it
10873          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10874          this flag for lots of classes like String. 
10875          
10876          csc sets this flag if the type does not have an explicit static 
10877          constructor. The reasoning seems to be that if there are only static
10878          initalizers for a type, and no static constructor, then the programmer
10879          does not care when this initialization happens, so beforefieldinit
10880          can be used.
10881          
10882          This bug prevents the AOT compiler from being usable, since it 
10883          generates so many calls to mono_runtime_class_init that the AOT code
10884          is much slower than the JITted code. The JITted code is faster, 
10885          because it does not generate these calls if the vtable is type is
10886          already initialized, which is true in the majority of cases. But the
10887          AOT compiler can't do this."
10888
10889 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10890
10891         * class.cs (MethodData.Emit): Refactor the code so symbolic
10892         information is generated for destructors;  For some reasons we
10893         were taking a code path that did not generate symbolic information
10894         before. 
10895
10896 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10897
10898         * class.cs: Create a Constructor.CheckBase method that
10899         takes care of all validation type code. The method
10900         contains some code that was moved from Define.
10901
10902         It also includes new code that checks for duplicate ctors.
10903         This fixes bug #55148.
10904
10905 2004-03-09  Joshua Tauberer <tauberer@for.net>
10906
10907         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10908         a { ... }-style array creation invokes EmitStaticInitializers
10909         which is not good for reference-type arrays.  String, decimal
10910         and now null constants (NullCast) are not counted toward
10911         static initializers.
10912
10913 2004-03-05  Martin Baulig  <martin@ximian.com>
10914
10915         * location.cs (SourceFile.HasLineDirective): New public field;
10916         specifies whether the file contains or is referenced by a "#line"
10917         directive.
10918         (Location.DefineSymbolDocuments): Ignore source files which
10919         either contain or are referenced by a "#line" directive.        
10920
10921 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10922
10923         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10924         direct access to our parent, so check the method inline there.
10925
10926 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10927
10928         * expression.cs (Invocation.EmitCall): Miguel's last commit
10929         caused a regression. If you had:
10930
10931             T t = null;
10932             t.Foo ();
10933
10934         In Foo the implict this would be null.
10935
10936 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10937
10938         * expression.cs (Invocation.EmitCall): If the method is not
10939         virtual, do not emit a CallVirt to it, use Call.
10940
10941         * typemanager.cs (GetFullNameSignature): Improve the method to
10942         cope with ".ctor" and replace it with the type name.
10943
10944         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10945         as an argument the ConstructorBuilder where it is being defined,
10946         to catch the recursive constructor invocations.
10947
10948 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10949
10950         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10951         routines to check if a type is an enumerable/enumerator allow
10952         classes that implement the IEnumerable or IEnumerator interfaces.
10953
10954         * class.cs (Property, Operator): Implement IIteratorContainer, and
10955         implement SetYields.
10956
10957         (Property.Define): Do the block swapping for get_methods in the
10958         context of iterators.   We need to check if Properties also
10959         include indexers or not.
10960
10961         (Operator): Assign the Block before invoking the
10962         OperatorMethod.Define, so we can trigger the Iterator code
10963         replacement. 
10964
10965         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10966         Property and Operator classes are not created when we parse the
10967         declarator but until we have the block completed, so we use a
10968         singleton SimpleIteratorContainer.Simple to flag whether the
10969         SetYields has been invoked.
10970
10971         We propagate this setting then to the Property or the Operator to
10972         allow the `yield' to function.
10973
10974 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10975
10976         * codegen.cs: Implemented attribute support for modules.
10977         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10978         Assembly/Module functionality.
10979
10980         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10981         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10982         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10983
10984 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10985
10986         * interface.cs (FindMembers): The operation is performed on all base
10987         interfaces and not only on the first. It is required for future CLS Compliance patch.
10988
10989 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10990
10991         * statement.cs, codegen.cs:
10992         This patch deals with patterns such as:
10993
10994         public class List : IEnumerable {
10995
10996                 public MyEnumerator GetEnumerator () {
10997                         return new MyEnumerator(this);
10998                 }
10999
11000                 IEnumerator IEnumerable.GetEnumerator () {
11001                         ...
11002                 }
11003                 
11004                 public struct MyEnumerator : IEnumerator {
11005                         ...
11006                 }
11007         }
11008
11009         Before, there were a few things we did wrong:
11010         1) we would emit callvirt on a struct, which is illegal
11011         2) we emited ldarg when we needed to emit ldarga
11012         3) we would mistakenly call the interface methods on an enumerator
11013         type that derived from IEnumerator and was in another assembly. For example:
11014
11015         public class MyEnumerator : IEnumerator
11016
11017         Would have the interface methods called, even if there were public impls of the
11018         method. In a struct, this lead to invalid IL code.
11019
11020 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11021
11022         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11023           renamed to Emit.
11024
11025         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11026
11027 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * cs-parser.jay: Fix small regression: we were not testing V2
11030         compiler features correctly.
11031
11032         * interface.cs: If the emit context is null, then create one
11033
11034 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11035
11036         * decl.cs (GetSignatureForError): New virtual method to get full name
11037           for error messages.
11038
11039         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11040           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11041
11042         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11043           Duplicated members and code in these classes has been removed.
11044           Better encapsulation in these classes.
11045
11046 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * assign.cs (Assign.DoResolve): When dealing with compound
11049         assignments, there is a new rule in ECMA C# 2.4 (might have been
11050         there before, but it is documented here) that states that in:
11051
11052         a op= b;
11053
11054         If b is of type int, and the `op' is a shift-operator, then the
11055         above is evaluated as:
11056
11057         a = (int) a op b 
11058
11059         * expression.cs (Binary.ResolveOperator): Instead of testing for
11060         int/uint/long/ulong, try to implicitly convert to any of those
11061         types and use that in pointer arithmetic.
11062
11063         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11064         method to print information for from the type, not from the
11065         null-method we were given.
11066
11067 2004-02-01  Duncan Mak  <duncan@ximian.com>
11068
11069         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11070         parsing for cmd, fixes bug #53694.
11071
11072 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11073
11074         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11075         in the member name duplication tests. Property and operator name duplication
11076         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11077
11078 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11079
11080         * interface.cs (PopulateMethod): Fixed crash when interface method
11081         returns not existing type (error test cs0246-3.cs).
11082
11083 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11084
11085         * cs-parser.jay (interface_accessors): Re-write actions to also
11086         store attributes attached to get and set methods. Fix spelling
11087         while at it.
11088
11089         (inteface_property_declaration): Modify accordingly.
11090
11091         (InterfaceAccessorInfo): New helper class to store information to pass
11092         around between rules that use interface_accessors.
11093
11094         * interface.cs (Emit): Apply attributes on the get and set
11095         accessors of properties and indexers too.
11096
11097         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11098         right MethodBuilder when applying attributes to the get and set accessors.
11099
11100 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11101
11102         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11103
11104 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11105
11106         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11107
11108 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11109
11110         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11111         changes that treat `yield' specially when present before `break'
11112         or `return' tokens.
11113
11114         * cs-tokenizer.cs: yield is no longer a keyword.
11115
11116 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11117
11118         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11119         setting for default constructors.
11120         For default constructors are almost every time set wrong Modifier. The
11121         generated IL code has been alright. But inside mcs this values was
11122         wrong and this was reason why several of my CLS Compliance tests
11123         failed.
11124
11125 2004-01-22  Martin Baulig  <martin@ximian.com>
11126
11127         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11128         not a QualifiedIdentifier.  This is what `type_name_expression'
11129         was previously doing.
11130         (type_name_expression): Removed; the code is now in
11131         `namespace_or_type_name'.
11132         (qualified_identifier): Removed, use `namespace_or_type_name'
11133         instead.
11134         (QualifiedIdentifier): Removed this class.      
11135
11136 2004-01-22  Martin Baulig  <martin@ximian.com>
11137
11138         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11139         not a string as alias name.
11140
11141 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11142
11143         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11144         #52730 bug, and instead compute correctly the need to use a
11145         temporary variable when requesting an address based on the
11146         static/instace modified of the field and the constructor.
11147  
11148 2004-01-21  Martin Baulig  <martin@ximian.com>
11149
11150         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11151         class and namespace before looking up aliases.  Fixes #52517.
11152
11153 2004-01-21  Martin Baulig  <martin@ximian.com>
11154
11155         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11156         assinged in a 'try'; fixes exception4.cs.
11157
11158 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11159         * class.cs : Implemented parameter-less constructor for TypeContainer
11160
11161         * decl.cs: Attributes are now stored here. New property OptAttributes
11162
11163         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11164
11165         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11166
11167 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11168
11169         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11170           (CSharpSignature): New method for indexer and property signature.
11171
11172 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11173
11174         * pending.cs (IsVirtualFilter): Faster implementation.
11175
11176 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11177
11178         * typemanager.cs: Avoid inclusion of same assembly more than once.
11179
11180 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11181
11182         * cs-parser.jay: Fixed problem where the last assembly attribute
11183           has been applied also to following declaration (class, struct, etc.)
11184           
11185 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11186
11187         * class.cs: Added error CS0538, CS0539 reporting.
11188         Fixed crash on Microsoft runtime when field type is void.
11189
11190         * cs-parser.jay: Added error CS0537 reporting.
11191
11192         * pending.cs: Added error CS0535 reporting.
11193         Improved error report for errors CS0536, CS0534.
11194
11195 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11196
11197         Merge a few bits from the Anonymous Method MCS tree.
11198
11199         * statement.cs (ToplevelBlock): New class for toplevel methods,
11200         will hold anonymous methods, lifted variables.
11201
11202         * cs-parser.jay: Create toplevel blocks for delegates and for
11203         regular blocks of code. 
11204
11205 2004-01-20  Martin Baulig  <martin@ximian.com>
11206
11207         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11208         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11209         and `NeedExplicitReturn'; added `IsLastStatement'.
11210         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11211         have a `ReturnLabel' or we're not unreachable.
11212
11213         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11214         child's reachability; don't just override ours with it.  Fixes
11215         #58058 (lluis's example).
11216         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11217         InFinally(), InLoop(), InSwitch() and
11218         BreakCrossesTryCatchBoundary() methods.
11219
11220         * statement.cs (Return): Do all error checking in Resolve().
11221         Unless we are the last statement in a top-level block, always
11222         create a return label and jump to it.
11223         (Break, Continue): Do all error checking in Resolve(); also make
11224         sure we aren't leaving a `finally'.
11225         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11226         statement in a top-level block.
11227         (Block.Flags): Added `IsDestructor'.
11228         (Block.IsDestructor): New public property.
11229
11230 2004-01-20  Martin Baulig  <martin@ximian.com>
11231
11232         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11233
11234 2004-01-20  Martin Baulig  <martin@ximian.com>
11235
11236         * statement.cs (Statement.ResolveUnreachable): New public method.
11237         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11238         (Block.Resolve): Resolve unreachable statements.
11239
11240 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11241
11242         * expression.cs: We need to fix the case where we do
11243         not have a temp variable here.
11244
11245         * assign.cs: Only expression compound assignments need
11246         temporary variables.
11247
11248 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11249
11250         * flowanalysis.cs: Reduce memory allocation in a few ways:
11251           - A block with no variables should not allocate a bit
11252             vector for itself.
11253           - A method with no out parameters does not need any tracking
11254             for assignment of the parameters, so we need not allocate
11255             any data for it.
11256           - The arrays:
11257                 public readonly Type[] VariableTypes;
11258                 public readonly string[] VariableNames;
11259             Are redundant. The data is already stored in the variable
11260             map, so we need not allocate another array for it.
11261           - We need to add alot of checks for if (params | locals) == null
11262             due to the first two changes.
11263
11264 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11267         implement IMemoryLocation, we store a copy on a local variable and
11268         take the address of it.  Patch from Benjamin Jemlich
11269
11270         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11271         to use a special "type_name_expression" rule which reduces the
11272         number of "QualifiedIdentifier" classes created, and instead
11273         directly creates MemberAccess expressions.
11274
11275 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11276
11277         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11278         that fixes #52853.  Null literal assignment to ValueType
11279
11280         * class.cs (MethodData.Emit): Instead of checking the name of the
11281         method to determine if its a destructor, create a new derived
11282         class from Method called Destructor, and test for that.  
11283
11284         * cs-parser.jay: Create a Destructor object instead of a Method.  
11285
11286         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11287
11288         Fixes: 52933
11289
11290 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11291
11292         * expression.cs (Binary.ResolveOperator): Perform an implicit
11293         conversion from MethodGroups to their delegate types on the
11294         Addition operation.
11295
11296         * delegate.cs: Introduce a new class DelegateCreation that is the
11297         base class for `NewDelegate' and `ImplicitDelegateCreation',
11298         factor some code in here.
11299
11300         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11301         conversion from MethodGroups to compatible delegate types. 
11302
11303         * ecore.cs (Expression.Resolve): Do not flag error 654
11304         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11305         we allow conversions from MethodGroups to delegate types now.
11306
11307         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11308         assignments in v2 either.
11309
11310 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11313         static read-only fields in ctors.
11314
11315         Applied patch from Benjamin Jemlich 
11316
11317         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11318
11319 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11320
11321         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11322         here to return true, as they can be used like this:
11323
11324                 (XXX) int.MEMBER ()
11325
11326         Fixed 49836 and all the other dups
11327
11328 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11329
11330         * driver.cs: Implement /win32res and /win32icon.
11331
11332 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * cs-parser.jay: Add a rule to improve error handling for the
11335         common mistake of placing modifiers after the type.
11336
11337 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11338
11339         * cs-parser.jay (interface_event_declaration): Catch
11340         initialization of events on interfaces, and report cs0068
11341
11342         * cs-parser.jay (interface_event_declaration): Catch
11343         initialization of events. 
11344
11345         * ecore.cs: Better report missing constructors.
11346
11347         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11348         the error reporting done in the wrong place.  Fix.
11349
11350         * expression.cs (Binary.ResolveOperator): Catch the 
11351         operator + (E x, E y) error earlier, and later allow for implicit
11352         conversions in operator +/- (E e, U x) from U to the underlying
11353         type of E.
11354
11355         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11356         52596, if the container class is abstract, the default constructor
11357         is protected otherwise its public (before, we were always public).
11358
11359         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11360         fixed statement.
11361
11362         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11363         Jemlich that fixes bug #52597, MCS was generating invalid code for
11364         idisposable structs.   Thanks to Ben for following up with this
11365         bug as well.
11366
11367 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11368
11369         * driver.cs: Allow assemblies without code to be generated, fixes
11370         52230.
11371
11372 2004-01-07  Nick Drochak <ndrochak@gol.com>
11373
11374         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11375
11376 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11377
11378         * cs-parser.jay: Add rules to improve error reporting if fields or
11379         methods are declared at the namespace level (error 116)
11380
11381         * Add rules to catch event add/remove
11382
11383 2004-01-04  David Sheldon <dave-mono@earth.li>
11384
11385   * expression.cs: Added matching ")" to error message for 
11386   CS0077
11387
11388 2004-01-03 Todd Berman <tberman@gentoo.org>
11389
11390         * ecore.cs, attribute.cs:
11391         Applying fix from #52429.
11392
11393 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11394
11395         * ecore.cs, expression.cs, statement.cs:
11396         Total rewrite of how we handle branching. We
11397         now handle complex boolean expressions with fewer
11398         jumps. As well if (x == 0) no longer emits a ceq.
11399
11400         if (x is Foo) is much faster now, because we generate
11401         better code.
11402
11403         Overall, we get a pretty big improvement on our benchmark
11404         tests. The code we generate is smaller and more readable.
11405
11406         I did a full two-stage bootstrap. The patch was reviewed
11407         by Martin and Miguel.
11408
11409 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11410
11411         * cs-parser.jay: Make primary_expression not take a QI.
11412         we dont need this because the member_access rule covers
11413         us here. So we replace the rule with just IDENTIFIER.
11414
11415         This has two good effects. First, we remove a s/r conflict.
11416         Second, we allocate many fewer QualifiedIdentifier objects.
11417
11418 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11419
11420         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11421         set the correct information via SRE. This prevents
11422         hanging on the MS runtime. Fixes #29374.
11423
11424 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11425
11426         * convert.cs: correctly handle conversions to value types
11427         from Enum and ValueType as unboxing conversions.
11428
11429         Fixes bug #52569. Patch by Benjamin Jemlich.
11430
11431 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11432
11433         * expression.cs (BetterConversion): Prefer int -> uint
11434         over int -> ulong (csc's behaviour). This fixed bug #52046.
11435
11436 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11437
11438         * decl.cs (MemberCache.FindMembers): now returns a
11439         MemberInfo [].
11440
11441         * typemanager.cs: In general, go with with ^^.
11442         (CopyNewMethods): take an IList.
11443         (RealMemberLookup): Only allocate an arraylist
11444         if we copy from two sets of methods.
11445
11446         This change basically does two things:
11447         1) Fewer array lists allocated due to CopyNewMethods.
11448         2) the explicit cast in MemberList costed ALOT.
11449
11450 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11451
11452         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11453         a hashtable to avoid needless string allocations when an identifier is
11454         used more than once (the common case).
11455
11456 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11457
11458         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11459         is broken, it will not return anything. So, we
11460         have to use the information we have in mcs to
11461         do the task.
11462
11463         * typemanager.cs: Add a cache for GetInterfaces,
11464         since this will now be used more often (due to ^^)
11465
11466         (GetExplicitInterfaces) New method that gets the
11467         declared, not effective, interfaces on a type
11468         builder (eg, if you have interface IFoo, interface
11469         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11470         { IBar }.
11471
11472         This patch makes MCS able to bootstrap itself on
11473         Windows again.
11474
11475 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11476
11477         * expression.cs: Remove the Nop's that Miguel put
11478         in by mistake.
11479
11480 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11481
11482         * report.cs, codegen.cs: Give the real stack trace to
11483         the error when an exception is thrown.
11484
11485 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11486
11487         * decl.cs: only allocate hashtables for ifaces if 
11488         it is an iface!
11489
11490 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11491
11492         * expression.cs: fix the error from cs0121-2.cs
11493         (a parent interface has two child interfaces that
11494         have a function with the same name and 0 params
11495         and the function is called through the parent).
11496
11497 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11498
11499         * class.cs, rootcontext.cs, typmanager.cs: do not
11500         leak pointers.
11501
11502 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11503
11504         * codegen.cs: remove stack for the ec flow branching.
11505         It is already a linked list, so no need.
11506
11507 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11508
11509         * Makefile: Allow custom profiler here.
11510
11511 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11512
11513         * typemanager.cs (LookupType):
11514           - Use a static char [], because split takes
11515             a param array for args, so it was allocating
11516             every time.
11517           - Do not store true in a hashtable, it boxes.
11518
11519 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11520
11521         * flowanalysis.cs: bytify common enums.
11522
11523 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11524
11525         * modifiers.cs: Add a new set of flags for the
11526         flags allowed on explicit interface impls.
11527         * cs-parser.jay: catch the use of modifiers in
11528         interfaces correctly.
11529         * class.cs: catch private void IFoo.Blah ().
11530
11531         All related to bug #50572.
11532
11533 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11534
11535         * decl.cs: Rewrite the consistant accessability checking.
11536         Accessability is not linear, it must be implemented in
11537         a tableish way. Fixes #49704.
11538
11539 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11540
11541         * expression.cs: Handle negation in a checked context.
11542         We must use subtraction from zero. Fixes #38674.
11543
11544 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11545
11546         * class.cs: Ignore static void main in DLLs.
11547         * rootcontext.cs: Handle the target type here,
11548         since we are have to access it from class.cs
11549         * driver.cs: account for the above.
11550
11551 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11552
11553         * report.cs: Give line numbers and files if available.
11554
11555 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11556
11557         * driver.cs: Implement /addmodule.
11558
11559         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11560         ModuleBuilders.
11561
11562 2003-12-20  Martin Baulig  <martin@ximian.com>
11563
11564         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11565         (FieldBase.IsAssigned): Removed this field.
11566         (FieldBase.SetAssigned): New public method.
11567         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11568
11569 2003-12-20  Martin Baulig  <martin@ximian.com>
11570
11571         * expression.cs (LocalVariableReference.DoResolve): Don't set
11572         `vi.Used' if we're called from DoResolveLValue().
11573
11574         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11575         returns the usage vector it just merged into the current one -
11576         pass this one to UsageWarning().
11577         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11578         of the `EmitContext', don't call this recursively on our children.
11579
11580 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11581
11582         * driver.cs: Implement /target:module.
11583
11584 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11585
11586         * support.cs (CharArrayHashtable): New helper class.
11587
11588         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11589         char arrays, not strings, so we can avoid creating a string in
11590         consume_identifier if the identifier is a keyword.
11591
11592 2003-12-16  Martin Baulig  <martin@ximian.com>
11593
11594         * statement.cs (LocalInfo.Assigned): Removed this property.
11595         (LocalInfo.Flags): Removed `Assigned'.
11596         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11597         and uses flow analysis.
11598         (Block.UsageWarning): Made this method private.
11599         (Block.Resolve): Call UsageWarning() if appropriate.
11600
11601         * expression.cs (LocalVariableReference.DoResolve): Always set
11602         LocalInfo.Used here.
11603
11604 2003-12-13  Martin Baulig  <martin@ximian.com>
11605
11606         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11607         any value here; we're now using flow analysis to figure out
11608         whether a statement/block returns a value.
11609
11610 2003-12-13  Martin Baulig  <martin@ximian.com>
11611
11612         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11613         working again.
11614         (FlowBranching.MergeFinally): Don't call
11615         `branching.CheckOutParameters()' here, this is called in
11616         MergeTopBlock().
11617         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11618         when adding the `finally' vector.       
11619
11620 2003-12-13  Martin Baulig  <martin@ximian.com>
11621
11622         * flowanalysis.cs
11623         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11624         actually work and also fix #48962.
11625
11626 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11627
11628         * decl.cs: Do not check System.Object for nested types,
11629         since we know it does not have any. Big bang for buck:
11630
11631         BEFORE:
11632            Run 1:   8.35 seconds
11633            Run 2:   8.32 seconds
11634            corlib:  17.99 seconds
11635         AFTER:
11636            Run 1:   8.17 seconds
11637            Run 2:   8.17 seconds
11638            corlib:  17.39 seconds
11639
11640 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11641
11642         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11643         time we are returning 0 members, so we save alot here.
11644
11645 2003-12-11  Martin Baulig  <martin@ximian.com>
11646
11647         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11648         `MergeChild()', also just take the `FlowBranching' as argument;
11649         call Merge() on it and return the result.
11650         (FlowBranching.Merge): We don't need to do anything if we just
11651         have one sibling.
11652
11653 2003-12-11  Martin Baulig  <martin@ximian.com>
11654
11655         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11656         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11657         Maurer for this idea.
11658
11659 2003-12-11  Martin Baulig  <martin@ximian.com>
11660
11661         * flowanalysis.cs (MergeResult): This class is now gone; we now
11662         use the `UsageVector' for this.  The reason for this is that if a
11663         branching just has one sibling, we don't need to "merge" them at
11664         all - that's the next step to do.
11665         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11666         `MergeResult'.
11667
11668 2003-12-11  Martin Baulig  <martin@ximian.com>
11669
11670         Reworked flow analyis and made it more precise and bug-free.  The
11671         most important change is that we're now using a special `Reachability'
11672         class instead of having "magic" meanings of `FlowReturns'.  I'll
11673         do some more cleanups and optimizations and also add some more
11674         documentation this week.
11675
11676         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11677         largely reworked this class.
11678         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11679         the new `Reachability' class instead of having "magic" values here.
11680         (FlowBranching): We're now using an instance of `Reachability'
11681         instead of having separate `Returns', `Breaks' etc. fields.
11682
11683         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11684         based on flow analysis; ignore the return value of block.Emit ().
11685
11686 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11687
11688         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11689         if they are private.
11690
11691 2003-12-09  Martin Baulig  <martin@ximian.com>
11692
11693         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11694         call them directly on the UsageVector.
11695
11696 2003-12-09  Martin Baulig  <martin@ximian.com>
11697
11698         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11699         Changed return type from `FlowReturns' to `Reachability'.
11700
11701 2003-12-09  Martin Baulig  <martin@ximian.com>
11702
11703         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11704         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11705         `Reachable' fields with a single `Reachability' one.
11706
11707 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11708
11709         * class.cs (FindMembers): Remove foreach's.
11710
11711         Bootstrap times:
11712
11713         BEFORE
11714                 Run 1:   8.74 seconds
11715                 Run 2:   8.71 seconds
11716
11717         AFTER
11718                 Run 1:   8.64 seconds
11719                 Run 2:   8.58 seconds
11720
11721
11722 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11723
11724         * cs-parser.jay:
11725         * gen-treedump.cs:
11726         * statement.cs:
11727         This patch does a few things:
11728                 1. EmptyStatement is now a singleton, so it is never reallocated.
11729                 2. All blah is EmptyStatement constructs have been changed to
11730                    blah == EmptyStatement.Value, which is much faster and valid
11731                    now that EmptyStatement is a singleton.
11732                 3. When resolving a block, rather than allocating a new array for
11733                    the non-empty statements, empty statements are replaced with
11734                    EmptyStatement.Value
11735                 4. Some recursive functions have been made non-recursive.
11736         Mainly the performance impact is from (3), however (1) and (2) are needed for
11737         this to work. (4) does not make a big difference in normal situations, however
11738         it makes the profile look saner.
11739
11740         Bootstrap times:
11741
11742         BEFORE
11743         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11744         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11745         Total memory allocated: 56397 KB
11746
11747         AFTER
11748         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11749         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11750         Total memory allocated: 55666 KB
11751
11752 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11753
11754         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11755         than the hashtable in a hashtable version
11756
11757         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11758         we always end up concating a string. This results in a huge perf
11759         loss, because many strings have to be tracked by the GC. In this
11760         patch, we first use a hashtable that works with two keys, so that
11761         the strings do not need to be concat'ed.
11762
11763         Bootstrap times:
11764         BEFORE
11765                 Run 1:   8.74 seconds
11766                 Run 2:   8.71 seconds
11767
11768         AFTER
11769                 Run 1:   8.65 seconds
11770                 Run 2:   8.56 seconds
11771
11772 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11773
11774         * Makefile: Add a new target `do-time' that does a quick and simple
11775         profile, leaving easy to parse output.
11776
11777 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11778
11779         * codegen.cs (Init): Create the dynamic assembly with 
11780         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11781
11782 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11783
11784         * support.cs: Make the PtrHashtable use only one
11785         instance of its comparer.
11786
11787 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11788
11789         * typemanager.cs: Fix lookup of GetNamespaces.
11790
11791 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * expression.cs: Removed redundant line.
11794
11795         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11796         ArrayLists, use for loops with bounds.  
11797
11798         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11799         arraylist.
11800
11801         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11802         arraylists, use for loop with bounds.
11803
11804         The above three changes give us a 0.071 second performance
11805         improvement out of 3.294 seconds down to 3.223.  On my machine
11806         the above changes reduced the memory usage by 1,387 KB during
11807         compiler bootstrap.
11808
11809         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11810         QualifiedIdentifiers.  Before we created a new string through
11811         concatenation, and mostly later on, the result would be
11812         manipulated by DecomposeQI through string manipulation.
11813
11814         This reduced the compiler memory usage for bootstrapping from
11815         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11816         compile times in 0.05 seconds.
11817
11818 2003-11-28  Dick Porter  <dick@ximian.com>
11819
11820         * support.cs: Do string compares with the Invariant culture.
11821
11822         * rootcontext.cs: 
11823         * gen-treedump.cs: 
11824         * expression.cs: 
11825         * driver.cs: 
11826         * decl.cs: 
11827         * codegen.cs: 
11828         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11829         the comparison is done with the Invariant culture.
11830
11831 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11832
11833         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11834         GetEnumerator method.
11835
11836         (ProbeCollectionType): Iterate starting at the most specific type
11837         upwards looking for a GetEnumerator
11838
11839         * expression.cs: Shift count can be up to 31 for int/uint and 63
11840         for long/ulong.
11841
11842 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11843
11844         * statement.cs (Block.LookupLabel): Also look for the label on the
11845         children blocks.  Use a hash table to keep track of visited
11846         nodes. 
11847
11848         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11849         we actually did transform the other operand, otherwise fall back
11850         to the common codepath that casts to long.
11851
11852         * cs-tokenizer.cs: Use the same code pattern as the int case.
11853         Maybe I should do the parsing myself, and avoid depending on the
11854         Parse routines to get this done.
11855
11856 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11857
11858         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11859         which fixes bug 51347.  This time test it.
11860
11861         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11862         attributes for example can not tell the difference between these.
11863         The difference was only a syntax feature of the language. 
11864
11865         * attribute.cs: Apply attributes to delegates.
11866
11867         * delegate.cs: Call the apply attributes method.
11868
11869 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11872         comparing 0 vs Byte.MinValue, not the value
11873
11874         (ImplicitConversionRequired): When reporting a conversion error,
11875         use error 31 to print out the constant error instead of the
11876         simpler 29.
11877
11878         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11879         which fixes bug 51347.
11880
11881 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11882
11883         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11884         which fixes the -warnaserror command line option.
11885
11886 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11887
11888         * cfold.cs (DoNumericPromotions): During constant folding of
11889         additions on UIntConstant, special case intconstants with
11890         IntConstants like we do on the expression binary operator. 
11891
11892 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * convert.cs (ImplicitReferenceConversion): We were missing a case
11895         (System.Enum are not value types or class types, so we need to
11896         classify them separatedly).
11897
11898         * driver.cs: We do not support error 2007.
11899
11900 2003-11-12 Jackson Harper <jackson@ximian.com>
11901
11902         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11903         system directory. Also use the full file name so users can
11904         libraries names mscorlib-o-tron.dll in a non system dir.
11905
11906 2003-11-10  Martin Baulig  <martin@ximian.com>
11907
11908         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11909         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11910         calling `ResolveType()' on them, directly assign their `Type'.
11911
11912 2003-11-08  Martin Baulig  <martin@ximian.com>
11913
11914         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11915         return value and the `out parent' parameter.
11916         (TypeContainer.DefineType): Moved the CS0644 check into
11917         GetClassBases().  Don't pass the interface types to the
11918         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11919         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11920
11921         * ecore.cs (TypeExpr.IsAttribute): New property.
11922         (TypeExpr.GetInterfaces): New method.
11923
11924         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11925         TypeExpr instead of a Type.
11926         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11927         (Interface.DefineType): Don't pass the interface types to the
11928         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11929         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11930
11931         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11932         instead of a `Type[]'.
11933         (TypeManager.RegisterBuilder): Likewise.
11934         (TypeManager.AddUserInterface): Likewise.
11935         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11936         `Type[]' and also return a `TypeExpr[]'.
11937         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11938
11939 2003-11-08  Martin Baulig  <martin@ximian.com>
11940
11941         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11942         Expression.     
11943
11944 2003-11-08  Martin Baulig  <martin@ximian.com>
11945
11946         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11947         TypeManager.ResolveExpressionTypes().
11948
11949         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11950         instead of an Expression.
11951         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11952         (TypeExpression): New public class; formerly known as `TypeExpr'.
11953
11954         * expression.cs (ComposedCast): Derive from TypeExpr.
11955
11956         * typemanager.cs (TypeManager.system_*_expr): These are now
11957         TypExpr's instead of Expression's.
11958         (TypeManager.ResolveExpressionTypes): New public static function;
11959         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11960         of them.        
11961
11962 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11963
11964         * expression.cs (New.DoResolve): Do not dereference value that
11965         might be a null return.
11966
11967         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11968         sure that the constant value has the right type.  Fixes an
11969         unreported bug, similar to 50425.
11970
11971         * const.cs (Const.LookupConstantValue): Call
11972         ImplicitStandardConversionExists before doing a conversion to
11973         avoid havng the TypeManager.ChangeType do conversions.
11974
11975         Reduced the number of casts used
11976
11977         (Const.ChangeType): New routine to enable reuse of the constant
11978         type changing code from statement.
11979
11980         * typemanager.cs (ChangeType): Move common initialization to
11981         static global variables.
11982
11983         Fixes #50425.
11984
11985         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11986         every value type to go through, even if it was void.  Fix that. 
11987
11988         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11989         character of the define, and the is_identifier_part_character for
11990         the rest of the string.
11991
11992 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11993
11994         * expression.cs (UnaryMutator.EmitCode): When I updated
11995         LocalVariableReference.DoResolve, I overdid it, and dropped an
11996         optimization done on local variable references.
11997
11998 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * ecore.cs: Convert the return from Ldlen into an int.
12001
12002 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12003
12004         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12005         the accessibility, this is a special case for toplevel non-public
12006         classes (internal for instance).
12007
12008 2003-10-20  Nick Drochak <ndrochak@gol.com>
12009
12010         * ecore.cs: Fix typo and build.  Needed another right paren.
12011
12012 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12013
12014         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12015         `internal' case regular and protected, but not allowing protected
12016         to be evaluated later.  Bug 49840
12017
12018 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12019
12020         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12021         to kb.Nlast, and not the kb.nFirst to isolate the switch
12022         statement.
12023
12024         Extract the underlying type, so enumerations of long/ulong are
12025         treated like long/ulong.
12026
12027 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12028
12029         * expression.cs (New): Overload the meaning of RequestedType to
12030         track the possible creation of the NewDelegate type, since
12031         DoResolve is invoked more than once for new constructors on field
12032         initialization.
12033
12034         See bugs: #48800 and #37014
12035
12036         * cs-parser.jay (declare_local_constants): Take an arraylist
12037         instead of a single constant.
12038
12039         (local_constant_declaration): It should take a
12040         constant_declarators, not a constant_declarator.  Fixes 49487
12041
12042         * convert.cs: Fix error report.
12043
12044 2003-10-13 Jackson Harper <jackson@ximian.com>
12045
12046         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12047         bug #49611
12048
12049 2003-10-09  Martin Baulig  <martin@ximian.com>
12050
12051         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12052         to the .ctor.
12053         (MethodCore.DoDefineParameters): Removed the TypeContainer
12054         argument; use the DeclSpace which was passed to the .ctor instead.
12055         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12056         TypeContainer; we only need a DeclSpace here.
12057
12058 2003-10-09  Martin Baulig  <martin@ximian.com>
12059
12060         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12061         to the .ctor.
12062         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12063         EmitContext's .ctor.    
12064
12065 2003-10-09  Martin Baulig  <martin@ximian.com>
12066
12067         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12068         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12069         AsAccessible(), moved them as well.
12070
12071         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12072
12073 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12074
12075         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12076
12077 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12078
12079         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12080         generation for >=, as spotted by Paolo, bug 48679.  
12081         Patch from David Waite.
12082
12083         * cs-tokenizer.cs: Add handling for #pragma.
12084
12085         * cs-parser.jay: Allow for both yield and yield return in the
12086         syntax.  The anti-cobolization of C# fight will go on!
12087
12088         * class.cs (TypeBuilder.DefineType): Catch error condition here
12089         (Parent.DefineType erroring out and returning null).
12090
12091         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12092         coping with enumerations variables, we were mistakenly processing
12093         them as a regular value type instead of built-in types.  Fixes the
12094         bug #48063
12095
12096         * typemanager.cs (IsBuiltinOrEnum): New method.
12097
12098 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * cs-parser.jay: Upgrade: yield now needs the return clause.
12101
12102 2003-09-19  Martin Baulig  <martin@ximian.com>
12103
12104         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12105         `MemberCache parent' argument.  Normally, an interface doesn't
12106         have a parent type except System.Object, but we use this in gmcs
12107         for generic type parameters.
12108
12109 2003-09-18  Martin Baulig  <martin@ximian.com>
12110
12111         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12112         on `type.IsInterface'; don't check whether the type has a parent
12113         to determine whether it's an interface.
12114
12115 2003-09-15  Martin Baulig  <martin@ximian.com>
12116
12117         * class.cs (TypeContainer.DefineType): Added an error flag to
12118         avoid reporting duplicate CS0146's ("class definition is
12119         circular.").
12120
12121         * driver.cs (Driver.MainDriver): Abort if
12122         RootContext.ResolveTree() reported any errors.
12123
12124 2003-09-07  Martin Baulig  <martin@ximian.com>
12125
12126         * report.cs (Error, Warning): Added overloaded versions which take
12127         a `params object[] args' and call String.Format().
12128
12129 2003-09-07  Martin Baulig  <martin@ximian.com>
12130
12131         * decl.cs (DeclSpace..ctor): Don't call
12132         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12133         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12134         (DeclSpace.RecordDecl): New method.
12135
12136         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12137
12138 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12139
12140         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12141         value attributes to be applied to ParameterBuilders.
12142
12143         * class.cs (MethodCore.LabelParameters): Make static and more
12144         generic so that it can be used from other places - like interface
12145         methods, for instance.
12146
12147         * interface.cs (Interface.Emit): Call LabelParameters before
12148         emitting attributes on the InterfaceMethod.
12149
12150 2003-08-26  Martin Baulig  <martin@ximian.com>
12151
12152         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12153         resolving aliases; fixes #47927.
12154
12155 2003-08-26  Martin Baulig  <martin@ximian.com>
12156
12157         * statement.cs (Using.DoResolve): This is internally emitting a
12158         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12159         do not always return.  Fixes #47681.
12160
12161 2003-08-26  Martin Baulig  <martin@ximian.com>
12162
12163         * decl.cs (MemberCore): Moved WarningNotHiding(),
12164         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12165         into MemberBase.
12166         (AdditionResult): Make this nested in DeclSpace.
12167         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12168         argument; call NamespaceEntry.Define() unless we're nested in a
12169         class or struct.
12170
12171         * namespace.cs (Namespace.DefineName): New public function.  This
12172         is called from DeclSpace's .ctor to add 
12173         (Namespace.Lookup): Include DeclSpaces in the lookup.
12174
12175         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12176
12177         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12178
12179 2003-08-25  Martin Baulig  <martin@ximian.com>
12180
12181         * convert.cs (Convert.ExplicitReferenceConversion): When
12182         converting from an interface type to a class, unbox if the target
12183         type is a struct type.  Fixes #47822.
12184
12185 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12186
12187         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12188         #47854.
12189
12190 2003-08-22  Martin Baulig  <martin@ximian.com>
12191
12192         * class.cs (TypeManager.DefineType): When defining a nested type,
12193         call DefineType() on our parent; fixes #47801.
12194
12195 2003-08-22  Martin Baulig  <martin@ximian.com>
12196
12197         * class.cs (MethodData.Define): While checking if a method is an
12198         interface implementation, improve the test a bit more to fix #47654.
12199
12200 2003-08-22  Martin Baulig  <martin@ximian.com>
12201
12202         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12203         correctly; fixes #47722.
12204
12205 2003-08-22  Martin Baulig  <martin@ximian.com>
12206
12207         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12208         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12209
12210         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12211
12212 2003-08-22  Martin Baulig  <martin@ximian.com>
12213
12214         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12215         can only be assigned in static constructors.  Fixes #47161.
12216
12217 2003-08-22  Martin Baulig  <martin@ximian.com>
12218
12219         Rewrote and improved the flow analysis code.
12220
12221         * flowbranching.cs (FlowBranching): Make this class abstract.
12222         (FlowBranching.CreateBranching): New static function to create a
12223         new flow branching.
12224         (FlowBranchingBlock, FlowBranchingException): New classes.
12225         (FlowBranching.UsageVector.Type): New public readonly field.
12226         (FlowBranching.UsageVector.Breaks): Removed the setter.
12227         (FlowBranching.UsageVector.Returns): Removed the setter.
12228         (FlowBranching.UsageVector): Added Break(), Return(),
12229         NeverReachable() and Throw() methods to modify the reachability.
12230         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12231         done by FlowBranching.Merge().
12232         (FlowBranching.UsageVector.MergeChild): New method; merges the
12233         merge result into the current vector.
12234         (FlowBranching.Merge): New abstract method to merge a branching.
12235
12236 2003-08-12  Martin Baulig  <martin@ximian.com>
12237
12238         * expression.cs (Indirection.CacheTemporaries): Create the
12239         LocalTemporary with the pointer type, not its element type.
12240
12241 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12242
12243         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12244         token was a keyword or not.
12245
12246         Add `error' options where an IDENTIFIER was expected;  Provide
12247         CheckToken and CheckIdentifierToken convenience error reporting
12248         functions. 
12249
12250         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12251
12252         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12253         NameSpaceEntry NameSpaceEntry.
12254
12255         (LookupInterfaceOrClass): Avoid creating a full qualified name
12256         from namespace and name: avoid doing lookups when we know the
12257         namespace is non-existant.   Use new Tree.LookupByNamespace which
12258         looks up DeclSpaces based on their namespace, name pair.
12259
12260         * driver.cs: Provide a new `parser verbose' to display the
12261         exception thrown during parsing.  This is turned off by default
12262         now, so the output of a failure from mcs is more graceful.
12263
12264         * namespace.cs: Track all the namespaces defined in a hashtable
12265         for quick lookup.
12266
12267         (IsNamespace): New method
12268
12269 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12270
12271         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12272         we know that we need to concatenate (full typename can never be
12273         null). 
12274
12275         * class.cs: ditto.
12276
12277         * statement.cs: Use a bitfield;  Do not initialize to null things
12278         which are done by the constructor by default.
12279
12280         * cs-parser.jay: bug fix, parameter was 4, not 3.
12281
12282         * expression.cs: Just use the property;
12283
12284         * statement.cs: No need for GetVariableInfo method.
12285
12286 2003-08-08  Martin Baulig  <martin@ximian.com>
12287
12288         * flowanalysis.cs (FlowReturns): This is now nested in the
12289         `FlowBranching' class.
12290         (MyBitVector): Moved this here from statement.cs.
12291         (FlowBranching.SiblingType): New enum type.
12292         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12293
12294 2003-08-07  Martin Baulig  <martin@ximian.com>
12295
12296         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12297         `FlowBranching' class and called `BranchingType'.
12298
12299 2003-08-07  Martin Baulig  <martin@ximian.com>
12300
12301         * flowanalysis.cs: Moved all the control flow analysis code into
12302         its own file.
12303
12304 2003-08-07  Martin Baulig  <martin@ximian.com>
12305
12306         * assign.cs (Assign.DoResolve): `target' must either be an
12307         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12308         #37319.
12309
12310 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12311
12312         * expression.cs (BinaryMethod): This kind of expression is created by the
12313         Binary class if it determines that the operator has to be handled
12314         by a method.
12315
12316         (BinaryDelegate): This kind of expression is created if we are
12317         dealing with a + or - operator on delegates.
12318
12319         (Binary): remove method, argumetns, and DelegateOperator: when
12320         dealing with methods, 
12321
12322         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12323
12324         * statement.cs (Block): use bitfields for the three extra booleans
12325         we had in use.   Remove unused topblock parameter.
12326
12327         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12328
12329         * assign.cs: Drop extra unneeded tests.
12330
12331 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12332
12333         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12334
12335         * statement.cs (Foreach): Use VariableStorage instead of
12336         LocalBuilders.   
12337
12338         * codegen.cs (VariableStorage): New class used by clients that
12339         require a variable stored: locals or fields for variables that
12340         need to live across yield.
12341
12342         Maybe provide a convenience api for EmitThis+EmitLoad?
12343
12344         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12345         these bad boys.
12346
12347 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12348
12349         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12350         RemapParameterLValue): New methods that are used to turn a
12351         precomputed FieldInfo into an expression like this:
12352
12353                 instance.FieldInfo
12354
12355         The idea is to use this instead of making LocalVariableReference
12356         have more than one meaning.
12357
12358         * cs-parser.jay: Add error production to BASE.
12359
12360         * ecore.cs: Deal with TypeManager.GetField returning null, which
12361         is now a valid return value.
12362
12363         (FieldExprNoAddress): New expression for Fields whose address can
12364         not be taken.
12365
12366         * expression.cs (LocalVariableReference): During the resolve
12367         phases, create new expressions if we are in a remapping context.
12368         Remove code that dealt with remapping here.
12369
12370         (ParameterReference): same.
12371
12372         (ProxyInstance): New expression, like the `This' expression, but
12373         it is born fully resolved.  We know what we are doing, so remove
12374         the errors that are targeted to user-provided uses of `this'.
12375
12376         * statement.cs (Foreach): our variable is now stored as an
12377         Expression;  During resolution, follow the protocol, dont just
12378         assume it will return this.
12379
12380 2003-08-06  Martin Baulig  <martin@ximian.com>
12381
12382         * support.cs (SeekableStreamReader.cs): New public class.
12383
12384         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12385         SeekableStreamReader instead of the normal StreamReader.
12386
12387 2003-08-04  Martin Baulig  <martin@ximian.com>
12388
12389         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12390         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12391         deambiguate casts and delegate invocations.
12392         (parenthesized_expression): Use the new tokens to ensure this is
12393         not a cast of method invocation.
12394
12395         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12396         when reading a `)' and Deambiguate_CloseParens () was previously
12397         called.
12398
12399         * expression.cs (ParenthesizedExpression): New class.  This is
12400         just used for the CS0075 test.
12401         (Binary.DoResolve): Check for CS0075.   
12402
12403 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12404
12405         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12406         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12407         reference comparison.
12408
12409         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12410         examine the ReturnType for equality - this is necessary in the
12411         cases of implicit and explicit operators whose signature also
12412         includes the return type.
12413
12414 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12415
12416         * namespace.cs: Cache the result of the namespace computation,
12417         instead of computing it every time.
12418
12419 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12420
12421         * decl.cs: Use a global arraylist that we reuse over invocations
12422         to avoid excesive memory consumption.  Reduces memory usage on an
12423         mcs compile by one meg (45 average).
12424
12425         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12426         private, work around that.
12427
12428 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * literal.cs (IntLiteral): Define Zero and One static literals. 
12431
12432         * cs-parser.jay (integer_literal): use static literals to reduce
12433         memory usage for the most used literals (0, 1 and -1).  211kb
12434         reduced in memory usage.
12435
12436         Replace all calls to `new ArrayList' with `new
12437         ArrayList(4)' which is a good average number for most allocations,
12438         and also requires only 16 bytes of memory for its buffer by
12439         default. 
12440
12441         This reduced MCS memory usage in seven megabytes for the RSS after
12442         bootstrapping.
12443
12444 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12445
12446         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12447         handle params methods the correct way by forming only one
12448         applicable set with params and normal methods in them. Earlier we
12449         were looking at params methods only if we found no normal methods
12450         which was not the correct thing to do.
12451
12452         (Invocation.BetterFunction): Take separate arguments indicating
12453         when candidate and the best method are params methods in their
12454         expanded form.
12455
12456         This fixes bugs #43367 and #46199.
12457
12458         * attribute.cs: Documentation updates.
12459
12460         (CheckAttribute): Rename to CheckAttributeTarget.
12461         (GetValidPlaces): Rename to GetValidTargets.
12462
12463         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12464         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12465
12466         Fixes bug #44468.
12467
12468 2003-07-28  Martin Baulig  <martin@ximian.com>
12469
12470         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12471         name when looking up the base class of a nested class.  Fixes #46977.
12472
12473 2003-07-26  Martin Baulig  <martin@ximian.com>
12474
12475         * expression.cs (Indexers.Indexer): New nested struct; contains
12476         getter, setter and the indexer's type.
12477         (Indexers.Properties): This is now an ArrayList of
12478         Indexers.Indexer's.
12479         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12480         indexer doesn't have any getters.
12481
12482         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12483         for embedded property and indexer assignments.
12484
12485 2003-07-26  Martin Baulig  <martin@ximian.com>
12486
12487         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12488         preprocessor directive is not the first non-whitespace character
12489         on a line.
12490
12491 2003-07-26  Martin Baulig  <martin@ximian.com>
12492
12493         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12494         namespace parsing, follow the spec more closely.
12495
12496         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12497         NamespaceEntry.Lookup().
12498
12499 2003-07-25  Martin Baulig  <martin@ximian.com>
12500
12501         * MethodCore.cs (OverridesSomething): New public field; it's set
12502         from TypeContainer.DefineMembers if this method overrides
12503         something (which doesn't need to be a method).  Fix #39462.
12504
12505 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12506
12507         * typemanager.cs (GetMembers): Ensure that the list of members is
12508         reversed. This keeps things in sync.
12509
12510         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12511         find an AttributeUsage attribute.
12512
12513         * expression.cs (Invocation.OverloadResolve): Perform the check
12514         which disallows Invoke to be directly called on a Delegate.
12515
12516         (Error_InvokeOnDelegate): Report error cs1533.
12517
12518 2003-07-25  Martin Baulig  <martin@ximian.com>
12519
12520         * expression.cs (Indexers.GetIndexersForType): Only look in the
12521         interface hierarchy if the requested type is already an
12522         interface.  Fixes #46788 while keeping #46502 fixed.
12523
12524 2003-07-25  Martin Baulig  <martin@ximian.com>
12525
12526         * class.cs (TypeContainer.DefineMembers): Check whether all
12527         readonly fields have been assigned and report warning CS0649 if
12528         not.
12529
12530         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12531         a valuetype.
12532
12533 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12534
12535         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12536         returned from GetMethods to make things consistent with the
12537         assumptions MCS makes about ordering of methods.
12538
12539         This should comprehensively fix bug #45127 and it does :-)
12540
12541         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12542         ordering is actually reverse.
12543
12544         * Clean up some debug messages I left lying around.
12545
12546         * interface.cs (Populate*): Get rid of code which emits attributes
12547         since the stage in which we emit attributes is the 'Emit' stage,
12548         not the define stage.
12549
12550         (Emit): Move attribute emission for interface members here.
12551
12552 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12553
12554         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12555         closely: we eliminate methods in base types when we have an
12556         applicable method in a top-level type.
12557
12558         Please see section 14.5.5.1 for an exact description of what goes
12559         on. 
12560
12561         This fixes bug #45127 and a host of other related to corlib compilation.
12562
12563         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12564         array is the method corresponding to the top-level type (this is
12565         because of the changes made to icall.c) so we change this
12566         accordingly.
12567
12568         (MethodGroupExpr.Name): This too.
12569
12570         * typemanager.cs (GetElementType): New method which does the right
12571         thing when compiling corlib. 
12572
12573         * everywhere: Make use of the above in the relevant places.
12574
12575 2003-07-22  Martin Baulig  <martin@ximian.com>
12576
12577         * cs-parser.jay (invocation_expression): Moved
12578         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12579         `cast_expression', but create a InvocationOrCast which later
12580         resolves to either an Invocation or a Cast.
12581
12582         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12583         method; call this before EmitStatement() to make sure that this
12584         expression can be used as a statement.
12585
12586         * expression.cs (InvocationOrCast): New class; resolves to either
12587         an Invocation or a Cast.
12588
12589         * statement.cs (StatementExpression): Call ResolveStatement() on
12590         the ExpressionStatement before emitting it.
12591
12592 2003-07-21  Martin Baulig  <martin@ximian.com>
12593
12594         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12595         `ref' and `out' attributes match; fixes #46220.
12596         (MemberAccess.ResolveMemberAccess): You can't reference a type
12597         through an expression; fixes #33180.
12598         (Indexers.GetIndexersForType): Don't return the indexers from
12599         interfaces the class implements; fixes #46502.
12600
12601 2003-07-21  Martin Baulig  <martin@ximian.com>
12602
12603         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12604         CS0661 checks; fixes bug #30442.
12605
12606 2003-07-21  Martin Baulig  <martin@ximian.com>
12607
12608         * decl.cs (AdditionResult): Added `Error'.
12609
12610         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12611
12612         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12613         makes cs0031.cs actually work.
12614
12615 2003-07-20  Martin Baulig  <martin@ximian.com>
12616
12617         * namespace.cs: Fixed that bug which caused a crash when compiling
12618         the debugger's GUI.
12619
12620 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * typemanager.cs (LookupTypeReflection): Never expose types which
12623         are NotPublic, NestedPrivate, NestedAssembly, or
12624         NestedFamANDAssem.  We used to return these, and later do a check
12625         that would report a meaningful error, but the problem is that we
12626         would not get the real match, if there was a name override.
12627
12628 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12629
12630         * namespace.cs (Namespace, Name): Do not compute the namespace
12631         name dynamically, compute it in the constructor.  This reduced
12632         memory usage by 1697 KB.
12633
12634         * driver.cs: Use --pause to pause at the end.
12635
12636 2003-07-17  Peter Williams  <peter@newton.cx>
12637
12638         * Makefile: Change the name of the test target so that it doesn't
12639         conflict with the recursive test target.
12640
12641 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12644         AddressOf): Do not use EmitThis, that was wrong, use the actual
12645         this pointer.
12646
12647 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12648
12649         * class.cs (MethodData.Define): While checking if a method is an
12650         interface implementation, improve the test: If we are not public
12651         (use new test here: use the computed MethodAttributes directly,
12652         instead of the parsed modifier flags) check if the `implementing'
12653         method comes from an interface or not.
12654
12655         * pending.cs (VerifyPendingMethods): Slightly better error
12656         message.
12657
12658         * makefile: add test target that does the mcs bootstrap.
12659
12660 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12661
12662         * interface.cs (Define): Do nothing here since there are no
12663         members to populate etc. Move the attribute emission out of here
12664         since this was just totally the wrong place to put it. Attribute
12665         application happens during the 'Emit' phase, not in the 'Define'
12666         phase.
12667
12668         (Emit): Add this method and move the attribute emission here
12669
12670         * rootcontext.cs (EmitCode): Call the Emit method on interface
12671         types too.
12672
12673 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12674
12675         * expression.cs (OverloadResolve): Report error only if Location
12676         is not 'Null' which means that there was a probe going on.
12677
12678 2003-07-14  Martin Baulig  <martin@ximian.com>
12679
12680         * expression.cs (ConditionalLogicalOperator): New public class to
12681         implement user defined conditional logical operators.
12682         This is section 14.11.2 in the spec and bug #40505.
12683
12684 2003-07-14  Martin Baulig  <martin@ximian.com>
12685
12686         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12687
12688 2003-07-14  Martin Baulig  <martin@ximian.com>
12689
12690         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12691
12692         * ecore.cs (IVariable.VerifyFixed): New interface method.
12693
12694         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12695         operator, check whether the variable is actually fixed.  Fixes bug
12696         #36055.  Set a variable definitely assigned when taking its
12697         address as required by the spec.
12698
12699         * statement.cs (LocalInfo.IsFixed): New field.
12700         (LocalInfo.MakePinned): Set `IsFixed' to true.
12701
12702 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12703
12704         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12705         for .ctors, ensure that we only ask for members declared in the
12706         attribute type (BindingFlags.DeclaredOnly).
12707
12708         Fixes bug #43632.
12709
12710         * expression.cs (Error_WrongNumArguments): Report error 1501
12711         correctly the way CSC does.
12712
12713 2003-07-13  Martin Baulig  <martin@ximian.com>
12714
12715         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12716         lookup on the fully qualified name, to make things like "X.X" work
12717         where "X.X" is a fully qualified type name, but we also have a
12718         namespace "X" in the using list.  Fixes #41975.
12719
12720 2003-07-13  Martin Baulig  <martin@ximian.com>
12721
12722         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12723         function. If we're a CompoundAssign, we need to create an embedded
12724         CompoundAssign, not an embedded Assign.
12725         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12726         Fixes #45854.
12727
12728 2003-07-13  Martin Baulig  <martin@ximian.com>
12729
12730         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12731         work to fix bug #46088.
12732
12733 2003-07-13  Ravi Pratap <ravi@ximian.com>
12734
12735         * class.cs (Operator.Emit): Do not emit attributes here - it is
12736         taken care of by the Method class that we delegate too. This takes
12737         care of bug #45876.
12738
12739 2003-07-10  Martin Baulig  <martin@ximian.com>
12740
12741         * expression.cs (TypeOfVoid): New class.
12742         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12743
12744 2003-07-10  Martin Baulig  <martin@ximian.com>
12745
12746         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12747         bug #35957.
12748
12749 2003-07-10  Martin Baulig  <martin@ximian.com>
12750
12751         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12752         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12753
12754         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12755
12756         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12757
12758 2003-07-10  Martin Baulig  <martin@ximian.com>
12759
12760         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12761         of decimal.  Fixes #42850.
12762
12763         NOTE: I also fixed the created byte blob, but this doesn't work on
12764         the MS runtime and csc never produces any byte blobs for decimal
12765         arrays.
12766
12767 2003-07-10  Martin Baulig  <martin@ximian.com>
12768
12769         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12770         structs; fixes #32068.
12771         (Block.AddChildVariableNames): Fixed #44302.
12772
12773 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12774
12775         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12776
12777 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12778
12779         * attribute.cs: And this test is onger needed.
12780
12781 2003-07-08  Martin Baulig  <martin@ximian.com>
12782
12783         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12784         inaccessible types.  Fixes #36313.
12785
12786         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12787
12788         * namespace.cs (NamespaceEntry): Create implicit entries for all
12789         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12790         implicit entries for N1.N2 and N1.
12791
12792 2003-07-08  Martin Baulig  <martin@ximian.com>
12793
12794         Rewrote the handling of namespaces to fix a lot of the issues
12795         wrt. `using' aliases etc.
12796
12797         * namespace.cs (Namespace): Splitted this class into a
12798         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12799
12800         * typemanager.cs (TypeManager.IsNamespace): Removed.
12801         (TypeManager.ComputeNamespaces): Only compute namespaces from
12802         loaded assemblies here, not the namespaces from the assembly we're
12803         currently compiling.
12804
12805 2003-07-08  Martin Baulig  <martin@ximian.com>
12806
12807         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12808
12809 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12812         already fixed it.  
12813
12814         I thought about the memory savings here, but LookupTypeReflection
12815         is used under already very constrained scenarios.  Compiling
12816         corlib or mcs only exposes one hit, so it would not really reduce
12817         any memory consumption.
12818
12819 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12820
12821         * typemanager.cs: fixes bug #45889 by only adding public types from
12822         other assemblies to the list of known types.
12823
12824 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12827         on the type we resolved.
12828
12829 2003-07-05  Martin Baulig  <martin@ximian.com>
12830
12831         * pending.cs (PendingImplementation.ParentImplements): Don't
12832         create the proxy if the parent is abstract.
12833
12834         * class.cs (TypeContainer.DefineIndexers): Process explicit
12835         interface implementations first.  Fixes #37714.
12836
12837 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12838
12839         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12840         defined recursively;  but since we modify the input parameters
12841         (left is set to `this' temporarily), we reset this value if the
12842         left_is_explicit is false, which gives the original semantics to
12843         the code.  
12844
12845         * literal.cs (NullPointer): new class used to represent a null
12846         literal in a pointer context.
12847
12848         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12849         type is a pointer, use a NullPointer object instead of a
12850         NullLiteral.   Closes 43687
12851
12852         (ExplicitConversion): Convert pointer values using
12853         the conv opcode to the proper type.
12854
12855         * ecore.cs (New): change ValueTypeVariable property into a method,
12856         that returns whether the valuetype is suitable for being used.
12857
12858         * expression.cs (Binary.DoNumericPromotions): Only return if we
12859         the int constant was a valid uint, and we can return both left and
12860         right as uints.  If not, we continue processing, to trigger the
12861         type conversion.  This fixes 39018.
12862
12863         * statement.cs (Block.EmitMeta): During constant resolution, set
12864         the CurrentBlock property on the emitcontext, so that we resolve
12865         constants propertly.
12866
12867 2003-07-02  Martin Baulig  <martin@ximian.com>
12868
12869         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12870         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12871
12872         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12873         than emitting it here.
12874
12875         * statement.cs: Fixed some more flow analysis bugs.
12876
12877 2003-07-02  Martin Baulig  <martin@ximian.com>
12878
12879         * class.cs (MethodData.Define): When implementing interface
12880         methods, set Final unless we're Virtual.
12881
12882         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12883         check work for interface methods.
12884
12885 2003-07-01  Martin Baulig  <martin@ximian.com>
12886
12887         * ecore.cs (EmitContext.This): Replaced this property with a
12888         GetThis() method which takes a Location argument.  This ensures
12889         that we get the correct error location for a CS0188.
12890
12891 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12892
12893         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12894         ImplicitStandardConversion.
12895
12896         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12897
12898 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12899
12900         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12901         optimization.
12902
12903 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12904
12905         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12906         constructors.
12907
12908         (MethodData.Define): Turn off initlocals for unsafe methods.
12909
12910 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12911
12912         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12913         complete;  Fixes #37521.
12914
12915         * delegate.cs: Use Modifiers.TypeAttr to compute the
12916         TypeAttributes, instead of rolling our own.  This makes the flags
12917         correct for the delegates.
12918
12919 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12920
12921         * class.cs (Constructor.Define): Set the private flag for static
12922         constructors as well.
12923
12924         * cs-parser.jay (statement_expression): Set the return value to
12925         null, to avoid a crash when we catch an error.
12926
12927 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * cs-parser.jay: Applied patch from Jackson that adds support for
12930         extern and unsafe modifiers to destructor declarations.
12931
12932         * expression.cs: Report error 21 if the user is trying to index a
12933         System.Array.
12934
12935         * driver.cs: Add an error message, suggested by the bug report.
12936
12937         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12938         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12939
12940 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * namespace.cs: Add some information to reduce FAQs.
12943
12944 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12945
12946         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12947         underlying enumeration types.  Fixes #43915.
12948
12949         * expression.cs: Treat ushort/short as legal values to be used in
12950         bitwise operations.
12951
12952 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12953
12954         * delegate.cs: transfer custom attributes for paramenters from
12955         the delegate declaration to Invoke and BeginInvoke.
12956
12957 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12958
12959         * attribute.cs: handle custom marshalers and emit marshal info
12960         for fields, too.
12961
12962 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12963
12964         * makefile.gnu: Added anonymous.cs to the compiler sources.
12965
12966 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12967
12968         * iterators.cs: Change the name of the proxy class to include two
12969         underscores.
12970
12971         * cs-parser.jay: Update grammar to include anonymous methods.
12972
12973         * anonymous.cs: new file.
12974
12975 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12976
12977         * class.cs (Field.Define): Add missing test for pointers and
12978         safety. 
12979
12980 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12981
12982         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12983         we use the stobj opcode.
12984
12985         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12986         since it wasn't the correct fix. 
12987
12988         It still is puzzling that we are required to use stobj for IntPtr
12989         which seems to be a ValueType.
12990
12991 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12992
12993         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12994         during regular simple name resolution.   Now, the trick is that
12995         instead of returning for processing the simplename, we do a
12996         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12997         contextual lookup type).   If a match is found, return that, if
12998         not, return for further composition.
12999
13000         This fixes long-standing 30485.
13001
13002         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13003         using the address to initialize an object, do an Stobj instead of
13004         using the regular Stelem.
13005
13006         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13007         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13008         Because if we are a BaseIndexerAccess that value will be true.
13009         Fixes 43643.
13010
13011         * statement.cs (GotoCase.Resolve): Return after reporting an
13012         error, do not attempt to continue. 
13013
13014         * expression.cs (PointerArithmetic.Emit): If our operand is a
13015         long, convert our constants to match the operand before
13016         multiplying.  Convert to I type before adding.   Fixes 43670.
13017
13018 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13019
13020         * enum.cs (ImplicitConversionExists) : Rename to
13021         ImplicitEnumConversionExists to remove ambiguity. 
13022
13023         * ecore.cs (NullCast): New type of cast expression class which
13024         basically is very similar to EmptyCast with the difference being
13025         it still is a constant since it is used only to cast a null to
13026         something else
13027         (eg. (string) null)
13028
13029         * convert.cs (ImplicitReferenceConversion): When casting a null
13030         literal, we return a NullCast.
13031
13032         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13033         should be around anymore.
13034
13035         The renaming (reported was slightly wrong). Corrections:
13036
13037         ConvertImplicitStandard -> ImplicitConversionStandard
13038         ConvertExplicitStandard -> ExplicitConversionStandard
13039
13040         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13041         before passing them in !
13042
13043         * convert.cs (ImplicitConversionStandard): When comparing for
13044         equal expr and target types, ensure that expr is not a
13045         NullLiteral.
13046
13047         In general, we must not be checking (expr_type ==
13048         target_type) in the top level conversion methods
13049         (ImplicitConversion, ExplicitConversion etc). This checking is
13050         done in the methods that they delegate to.
13051
13052 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13053
13054         * convert.cs: Move Error_CannotConvertType,
13055         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13056         ImplicitNumericConversion, ImplicitConversionExists,
13057         ImplicitUserConversionExists, StandardConversionExists,
13058         FindMostEncompassedType, FindMostSpecificSource,
13059         FindMostSpecificTarget, ImplicitUserConversion,
13060         ExplicitUserConversion, GetConversionOperators,
13061         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13062         TryImplicitIntConversion, Error_CannotConvertImplicit,
13063         ConvertImplicitRequired, ConvertNumericExplicit,
13064         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13065         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13066         its own file.
13067
13068         Perform the following renames:
13069
13070         StandardConversionExists -> ImplicitStandardConversionExists
13071         ConvertImplicit -> ImplicitConversion
13072         ConvertImplicitStandard -> ImplicitStandardConversion
13073         TryImplicitIntConversion -> ImplicitIntConversion
13074         ConvertImplicitRequired -> ImplicitConversionRequired
13075         ConvertNumericExplicit -> ExplicitNumericConversion
13076         ConvertReferenceExplicit -> ExplicitReferenceConversion
13077         ConvertExplicit -> ExplicitConversion
13078         ConvertExplicitStandard -> ExplicitStandardConversion
13079
13080 2003-05-19  Martin Baulig  <martin@ximian.com>
13081
13082         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13083         (TypeInfo): Added support for structs having structs as fields.
13084
13085         * ecore.cs (FieldExpr): Implement IVariable.
13086         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13087         VariableInfo for the field.
13088
13089 2003-05-18  Martin Baulig  <martin@ximian.com>
13090
13091         * expression.cs (This.DoResolve): Report a CS0027 if we're
13092         emitting a field initializer.
13093
13094 2003-05-18  Martin Baulig  <martin@ximian.com>
13095
13096         * expression.cs (This.ResolveBase): New public function.
13097         (This.DoResolve): Check for CS0188.
13098
13099         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13100         This.Resolve().
13101
13102         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13103         `instance_expression' to null if we don't have any non-static
13104         methods.
13105
13106 2003-05-18  Martin Baulig  <martin@ximian.com>
13107
13108         Reworked the way how local variables and parameters are handled by
13109         the flow analysis code.
13110
13111         * statement.cs (TypeInfo, VariableMap): New public classes.
13112         (VariableInfo): New public class.  This is now responsible for
13113         checking whether a variable has been assigned.  It is used for
13114         parameters and local variables.
13115         (Block.EmitMeta): Take the InternalParameters as argument; compute
13116         the layout of the flow vectors here.
13117         (Block.LocalMap, Block.ParameterMap): New public properties.
13118         (FlowBranching): The .ctor doesn't get the InternalParameters
13119         anymore since Block.EmitMeta() now computes the layout of the flow
13120         vector.
13121         (MyStructInfo): This class is now known as `StructInfo' and nested
13122         in `TypeInfo'; we don't access this directly anymore.
13123
13124         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13125         property and removed IsAssigned(), IsFieldAssigned(),
13126         SetAssigned() and SetFieldAssigned(); we now call them on the
13127         VariableInfo so we don't need to duplicate this code everywhere.
13128
13129         * expression.cs (ParameterReference): Added `Block block' argument
13130         to the .ctor.
13131         (LocalVariableReference, ParameterReference, This): The new
13132         VariableInfo class is now responsible for all the definite
13133         assignment stuff.
13134
13135         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13136         IsParameterAssigned, SetParameterAssigned): Removed.
13137
13138 2003-05-18  Martin Baulig  <martin@ximian.com>
13139
13140         * typemanager.cs (InitCoreTypes): Try calling
13141         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13142         the 3-args-version.  Corlib now also needs our `void_type'.
13143         (GetMethod): Added overloaded version which takes an optional
13144         `bool report_errors' to allow lookups of optional methods.
13145
13146 2003-05-12  Martin Baulig  <martin@ximian.com>
13147
13148         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13149         only used for locals and not for parameters.
13150
13151 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13152
13153         * support.cs (InternalParameters.ParameterType): Return the
13154         ExternalType of the parameter.
13155
13156         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13157         they were unused.
13158
13159 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13160
13161         * class.cs (MethodData.Define): Do not set the `newslot' on
13162         interface members, if they are also flagged as "override".
13163
13164         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13165         better code for ++i and i++.  This only works for static fields
13166         and local variables.
13167
13168         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13169         want to pull the DeclSpace out of the builder_to_declspace instead
13170         of the TypeBuilder (like in TypeContainer.FindMembers).
13171
13172         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13173         instead of LookupTypeContainer.  Fixes the crash on .NET for
13174         looking up interface members.
13175
13176         * const.cs: Create our own emit context during the Definition
13177         stage, so that constants are evaluated in the proper context, when
13178         a recursive definition happens.
13179
13180 2003-05-11  Martin Baulig  <martin@ximian.com>
13181
13182         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13183         new block for a switch section.
13184         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13185         the adding/lookup in the switch block.  Fixes #39828.
13186
13187 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13188
13189         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13190         functionality: I needed to convert the data after I had performed
13191         the add/sub operation into the operands type size.
13192
13193         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13194         pass the type for the box operation, otherwise the resulting
13195         object would have been of type object.
13196
13197         (BoxedCast): Add constructor to specify the type to box as.
13198
13199 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * iterators.cs: I was reusing the `count' variable inadvertently,
13202         take steps to not allow this to happen.
13203
13204 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13205
13206         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13207         by creating an array at the point where the params starts and
13208         putting all those arguments there, then adjusting the size of the
13209         array.
13210
13211 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13212
13213         * expression.cs (New.AddressOf): Implement interface
13214         IMemoryLocation.  This is used when the `new' operator is used in
13215         the context of an invocation to a method on a value type.
13216
13217         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13218         example. 
13219
13220         * namespace.cs: Also check the using aliases here.
13221
13222         * driver.cs: Move the test for using validity after the types have
13223         been entered, so we do a single pass that also includes the using
13224         aliases. 
13225
13226         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13227         in the regular case.   CreateSiblingForFinally is doing extra
13228         error checking.
13229
13230         * attribute.cs (GetAttributeArgumentExpression): Store the result
13231         on an out value, and use the return value to indicate failure
13232         instead of using null (which is a valid return for Constant.GetValue).
13233
13234         * statement.cs: Perform the analysis flow for the increment
13235         portion after the statement, because this will be the real flow of
13236         execution.  Fixes #42385
13237
13238         * codegen.cs (EmitContext.EmitArgument,
13239         EmitContext.EmitStoreArgument): New helper functions when the
13240         RemapToProxy flag is set.
13241
13242         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13243         function.
13244
13245         Add support for remapping parameters. 
13246
13247         * iterators.cs: Propagate parameter values;  Store parameter
13248         values in the proxy classes.
13249
13250 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13251
13252         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13253         need a proxy reference;  I do not know what I was thinking
13254
13255         * cs-parser.jay (constructor_initializer): catch another error,
13256         and display nice message.
13257
13258         (field_declaration): catch void field declaration
13259         to flag a better error. 
13260
13261         * class.cs (MemberBase.CheckBase): Report an error instead of a
13262         warning if a new protected member is declared in a struct. 
13263         (Field.Define): catch the error of readonly/volatile.
13264
13265         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13266
13267         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13268         volatile variable is taken
13269
13270 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13271
13272         * statement.cs (Fixed.Resolve): Report an error if we are not in
13273         an unsafe context.
13274
13275 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13276
13277         * typemanager.cs: reuse the code that handles type clashes for
13278         delegates and enumerations.
13279
13280         * class.cs (Report28): Always report.
13281
13282         * expression.cs (EncodeAsAttribute): Allow nulls here.
13283
13284 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13285
13286         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13287         the functionality for testing whether an expression is valid for
13288         an attribute here.  Also handle the case of arrays of elements
13289         being stored. 
13290
13291         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13292         encoding a linear array into an array of objects that are suitable
13293         to be passed to an CustomAttributeBuilder.
13294
13295         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13296
13297         * ecore.cs: (FieldExpr): Handle field remapping here.
13298
13299         * iteratators.cs: Pass the instance variable (if the method is an
13300         instance method) to the constructors, so we can access the field
13301         variables on the class.
13302
13303         TODO: Test this with structs.  I think the THIS variable on
13304         structs might have to be a pointer, and not a refenrece
13305
13306 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13307
13308         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13309         local variables to fields in a proxy class.
13310
13311         * iterators.cs (PopulateProxy): Rename our internal fields to
13312         <XXX>.  
13313         Create a <THIS> field if we are an instance method, so we can
13314         reference our parent container variables.
13315         (MapVariable): Called back from the EmitContext code to enter a
13316         new variable to field mapping into the proxy class (we just create
13317         a FieldBuilder).
13318
13319         * expression.cs
13320         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13321         for using the remapped locals to fields.
13322
13323         I placed the code here, because that gives the same semantics to
13324         local variables, and only changes the Emit code.
13325
13326         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13327         statements inside iterators.
13328         (VariableInfo): Add a FieldBuilder for the cases when we are
13329         remapping local variables to fields in a proxy class
13330
13331         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13332         current_block != null.
13333
13334         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13335         not cope with strings, as it has been moved to the
13336         TableSwitchEmit.  Fixed bug in switch generation.
13337
13338         * expression.cs (New.DoResolve): Provide more context for the user
13339         when reporting an error.
13340
13341         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13342         pointers. 
13343
13344         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13345         check the permissions for it.  Note than in a type-resolution
13346         context the check was already present in DeclSpace.ResolveType,
13347         but was missing from the MemberAccess.
13348
13349         (ArrayCreation.CheckIndices): warn if the user has
13350         more nested levels of expressions, but there are no more
13351         dimensions specified.  Avoids crash on bug 41906.
13352
13353 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13354
13355         * statement.cs (Block): replace Implicit bool, for a generic
13356         flags.   
13357         New flag: `Unchecked'.  This is used during the EmitMeta phase
13358         (which is out-of-line with the regular Resolve/Emit process for a
13359         statement, as this is done ahead of time, but still gets a chance
13360         to call constant resolve).
13361
13362         (Block.Flags): new enum for adding a new flag.
13363
13364         (Block.EmitMeta): track the state of unchecked.
13365
13366         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13367         to enable constant resolution to work there as well.
13368
13369 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13370
13371         * typemanager.cs (ienumerable_type): Also look up
13372         System.Collections.IEnumerable. 
13373
13374 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13375
13376         TODO: Test more than one conditional per method.
13377
13378         * class.cs (Indexer.Define): Report the location where the user is
13379         referencing the unsupported feature.
13380
13381         (MethodData): Overload the use of `conditionals' to
13382         minimize the creation of needless ArrayLists.   This saves roughly
13383         212kb on my machine.
13384
13385         (Method): Implement the new IIteratorContainer interface.
13386         (Method.SetYields): Implement the method by setting the ModFlags
13387         to contain METHOD_YIELDS.
13388
13389         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13390         which just got set to null.
13391
13392         * iterators.cs: New file.
13393
13394         (Yield, YieldBreak): New statements.
13395
13396         * statement.cs (Return.Resolve): Flag an error if we are used in
13397         an iterator method.
13398
13399         * codegen.cs (InIterator): New flag set if the code is being
13400         compiled in an iterator method.
13401
13402         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13403         internal modifier, and we just use it to avoid adding extra
13404         fields, as this is seldom used.  
13405
13406         * cs-parser.jay: Add yield_statement (yield and yield break).
13407
13408         * driver.cs: New flag -v2 to turn on version 2 features. 
13409
13410         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13411         hashtable when v2 is enabled.
13412
13413 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13414
13415         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13416         there is already a namespace defined with this name.
13417
13418         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13419         people upgraded their corlibs.
13420
13421         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13422         always use fully qualified types, no need to use the compiler
13423         front end.
13424
13425         (TypeManager.IsNamespace): Use binarysearch.
13426
13427         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13428         AddDelegate): I did not quite use the new IsValid API properly: I
13429         have to pass the short-name and the fullname.  I was passing only
13430         the basename instead of the fullname sometimes. 
13431
13432         (TypeContainer.DefineType): call NamespaceClash.
13433
13434         * interface.cs (Interface.DefineType): use NamespaceClash before
13435         defining the type.
13436
13437         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13438         defining the type.
13439
13440         * enum.cs: (Enum.DefineType): use NamespaceClash before
13441         defining the type.
13442
13443         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13444         speed increase.  First, use the negative_hits cache when we get a
13445         negative.  Second, add the type with its full original name
13446         instead of the new . and + encoded name (reflection uses + to
13447         separate type from a nested type).  Use LookupTypeReflection
13448         directly which bypasses the type->name hashtable (that we already
13449         know does not contain the type.
13450
13451         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13452         location/container type. 
13453
13454         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13455
13456 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13457
13458         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13459
13460         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13461         method is being referenced in the method group from a static
13462         context, and report error 120 if so.
13463
13464         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13465         Error118. 
13466
13467         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13468         is created, we create the A namespace).
13469
13470         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13471         Fixes #41591
13472
13473 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13474
13475         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13476         invocation to ModuleBuilder.GetType with the same values will
13477         return a new type instance, so we need to cache its return
13478         values. 
13479
13480         * expression.cs (Binary.ResolveOperator): Only allow the compare
13481         operators on enums if they are of the same type.
13482
13483         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13484         types of ValueType on their own case.  Before we were giving them
13485         the same treatment as objects.
13486
13487         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13488         fullname.  Short name is used to compare against container name.
13489         Fullname is used to check against defined namespace names.
13490
13491         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13492         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13493
13494         (Method.CheckBase): Call parent.
13495         (MemberBase.CheckBase): Check for protected members on sealed
13496         classes.
13497         (PropertyBase.CheckBase): Call parent.
13498         (Field.Define): Call parent.
13499
13500         * report.cs: Negative error codes are now mapped to 8000 - code,
13501         so that the display is render more nicely.
13502
13503         * typemanager.cs: Do not use try/catch, instead report a regular
13504         error. 
13505
13506         (GetPointerType, GetReferenceType): These methods provide
13507         mechanisms to obtain the T* and T& from a T.  We had the code
13508         previously scattered around the code base, and it also used
13509         TypeManager.LookupType that would go through plenty of caches.
13510         This one goes directly to the type source.
13511
13512         In some places we did the Type.GetType followed by
13513         ModuleBuilder.GetType, but not in others, so this unifies the
13514         processing as well.
13515
13516         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13517         statements now that we have namespace information.
13518
13519         * typemanager.cs (IsNamespace): New method, returns whether the
13520         string presented is a namespace or not.
13521
13522         (ComputeNamespaces): New public entry point, computes the list of
13523         available namespaces, using the GetNamespaces API call in Mono, or
13524         the slower version in MS.NET.   
13525
13526         Now before we start the semantic analysis phase, we have a
13527         complete list of namespaces including everything that the user has
13528         provided.
13529
13530         Deleted old code to cache namespaces in .nsc files.
13531
13532 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13535         class/struct location definition Location for the implicit
13536         constructor location.
13537
13538         (Operator.Define): Use the location of the operator for the
13539         implicit Method definition.
13540
13541         (Constructor.Emit): use the constructor location for the implicit
13542         base initializer constructor.
13543
13544         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13545         and the Expression class now contains two new methods:
13546
13547         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13548         isolate type lookup from the rest of the resolution process.
13549
13550         Since we use Expressions to hold type definitions due to the way
13551         we parse the input we have historically overloaded Resolve to
13552         perform the Type lookups if a special flag is passed.  Now this is
13553         eliminated and two methods take their place. 
13554
13555         The differences in the two methods between xStep and xTerminal is
13556         that xStep is involved in our current lookup system that uses
13557         SimpleNames to compose a name, while xTerminal is used just to
13558         catch the case where the simplename lookup failed.
13559
13560 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13561
13562         * expression.cs (ResolveMemberAccess): Remove redundant code.
13563         TypeExpr expressions are always born fully resolved.
13564
13565         * interface.cs (PopulateMethod): Do not lookup the types twice.
13566         We were doing it once during SemanticAnalysis and once during
13567         PopulateMethod.
13568
13569         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13570         in local variable type definitions, were being returned as a
13571         SimpleName (we decomposed everything into a string), that is
13572         because primary_expression was being used instead of a type in the
13573         grammar (reduce/reduce conflicts).
13574
13575         The part that was wrong is that we converted the expression into a
13576         string (an oversimplification in one hand, compounded with primary
13577         expressions doing string concatenation).
13578
13579         So things like:
13580
13581         A.B.C [] x;
13582
13583         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13584         using clauses from working on this particular context.  And a type
13585         was being matched directly against "A.B.C[]".
13586
13587         We now use the correct approach, and allow for ComposedCast to be
13588         part of the unary expression.  So the "A.B.C []" become a composed
13589         cast of "A.B.C" (as a nested group of MemberAccess with a
13590         SimpleName at the end) plus the rank composition "[]". 
13591
13592         Also fixes 35567
13593
13594 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13595
13596         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13597         for the access level checking.
13598
13599         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13600         `TypeContainer container', because I kept getting confused when I
13601         was debugging this code.
13602
13603         * expression.cs (Indexers): Instead of tracking getters/setters,
13604         we now track them in parallel.  We create one arraylist less, but
13605         most importantly it is possible now for the LValue code to find a
13606         matching get for a set.
13607
13608         (IndexerAccess.DoResolveLValue): Update the code.
13609         GetIndexersForType has been modified already to extract all the
13610         indexers from a type.  The code assumed it did not.
13611
13612         Also make the code set the correct return type for the indexer.
13613         This was fixed a long time ago for properties, but was missing for
13614         indexers.  It used to be void_type.
13615
13616         (Binary.Emit): Test first for doubles instead of
13617         floats, as they are more common.
13618
13619         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13620         when dealing with floats and the <=, >= operators.  This fixes bug
13621         #39314 
13622
13623         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13624         to load the array value by emitting a load on the foreach variable
13625         type.  This was incorrect.  
13626
13627         We now emit the code to load an element using the the array
13628         variable type, and then we emit the conversion operator.
13629
13630         Fixed #40176
13631
13632 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13633
13634         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13635
13636 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13637
13638         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13639         test for protection before we test for signatures. 
13640
13641         (MethodSignature.ToString): implement.
13642
13643         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13644         to the case where we reduced into a LongConstant.
13645
13646         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13647         depend on whether the information is acurrate, because the
13648         Microsoft runtime will always claim that the array type is public,
13649         regardless of the real state.
13650
13651         If the type is a pointer, another problem happens: the type is
13652         reported as non-public in Microsoft.  
13653
13654         In both cases we have to call CheckAccessLevel recursively with
13655         the underlying type as the argument to be tested.
13656
13657 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13658
13659         * assign.cs (Assign.Emit): If we are dealing with a compound
13660         assignment expression, we should use the code path that stores the
13661         intermediate result in a temporary value.  This fixes #40903.
13662
13663         *expression.cs (Indirection.ToString): Provide ToString method for
13664         debugging. 
13665
13666 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13667
13668         * class.cs: Null out fields holding references to Block objects so
13669         they can be garbage collected.
13670
13671         * expression.cs (OverloadResolve): Remove unused local.
13672
13673 2003-04-07  Martin Baulig  <martin@ximian.com>
13674
13675         * codegen.cs (EmitContext.CurrentFile): New public field.
13676         (EmitContext.Mark): Use the CurrentFile to check whether the
13677         location is in the correct file.
13678         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13679
13680 2003-04-07  Martin Baulig  <martin@ximian.com>
13681
13682         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13683
13684         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13685         location.  [FIXME: The location argument which gets passed to this
13686         method is sometimes wrong!]
13687
13688 2003-04-07  Nick Drochak <ndrochak@gol.com>
13689
13690         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13691
13692 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * expression.cs (Indirection.EmitAssign): We were using the
13695         temporary, but returning immediately instead of continuing the
13696         EmitAssing flow.
13697
13698 2003-04-06  Martin Baulig  <martin@ximian.com>
13699
13700         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13701         if it's a nested child, but also deriving from the outer class.
13702         See test 190.cs.
13703
13704         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13705         nested child, but also deriving from the outer class.  See
13706         test-190.cs.
13707         (FilterWithClosure): We may access private members of the outer
13708         class if we're a nested child and deriving from the outer class.
13709         (RealMemberLookup): Only set `closure_private_ok' if the
13710         `original_bf' contained BindingFlags.NonPublic.
13711
13712 2003-04-05  Martin Baulig  <martin@ximian.com>
13713
13714         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13715
13716 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13717
13718         * class.cs (Event.Define): Do not allow abstract events to have
13719         initializers. 
13720
13721 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13722
13723         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13724         block in event declarations.
13725
13726         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13727         value type, get its address.
13728
13729         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13730         leaving a class on the stack instead of a boolean value (int
13731         0/1).  Change the code so we compare against null, and then the
13732         result against zero.
13733
13734         * class.cs (TypeContainer.GetClassBases): We were checking for the
13735         parent class being sealed too late.
13736
13737         * expression.cs (Binary.Emit): For <= and >= when dealing with
13738         floating point values, use cgt.un and clt.un instead of cgt and
13739         clt alone.
13740
13741 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13742
13743         * statement.cs: Apply the same optimization as MS: skip the 
13744         GetEnumerator returning an IEnumerator, and use the one returning a 
13745         CharEnumerator instead. This allows us to avoid the try-finally block 
13746         and the boxing.
13747
13748 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13749
13750         * cs-parser.jay: Attributes cannot be applied to
13751                          namespaces. Fixes #40473
13752
13753 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13754
13755         * class.cs:
13756         (Add*): check if the name is valid using the full name for constants,
13757         fields, properties and events.
13758
13759 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13760
13761         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13762         char constants to be part of the enumeration.
13763
13764         * expression.cs (Conditional.DoResolve): Add support for operator
13765         true. Implements the missing functionality from 14.12
13766
13767         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13768         operator true/false as required by the spec.
13769
13770         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13771         implicit conversion to boolean.
13772
13773         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13774         also one where the type implements `operator true'. 
13775
13776         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13777         get an expression that will invoke operator true based on an
13778         expression.  
13779
13780         (GetConversionOperators): Removed the hack that called op_True
13781         here.  
13782
13783         (Expression.ResolveBoolean): Move this from Statement.
13784
13785 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13786
13787         * ecore.cs (FieldExpr): do not allow initialization of initonly
13788         fields on derived classes
13789
13790 2003-03-13  Martin Baulig  <martin@ximian.com>
13791
13792         * statement.cs (Block.Emit): Call ig.BeginScope() and
13793         ig.EndScope() when compiling with debugging info; call
13794         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13795
13796 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13797
13798         * expression.cs (Indexers): Do not construct immediately, allow
13799         for new members to be appended as we go.  Fixes 38143
13800
13801 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13802
13803         * expression.cs: save/restore context when resolving an unchecked
13804         expression.
13805
13806 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * cfold.cs: Catch division by zero in modulus operator during
13809         constant folding.
13810
13811 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * interface.cs (Interface.DefineMembers): Avoid defining members
13814         twice. 
13815
13816 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13817
13818         * driver.cs: handle the +/- options for -noconfig
13819
13820         * statement.cs (Unckeched.Resolve): Also track the state of
13821         unchecked in the Resolve phase.
13822
13823 2003-02-27  Martin Baulig  <martin@ximian.com>
13824
13825         * ecore.cs (Expression.MemberLookup): Don't create a
13826         MethodGroupExpr for something which is not a method.  Fixes #38291.
13827
13828 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13829
13830         * class.cs (MemberBase.CheckParameters): Also check that the type
13831         is unmanaged if it is a pointer.
13832
13833         * expression.cs (SizeOf.Resolve): Add location information.
13834
13835         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13836         a managed type is declared.
13837
13838         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13839         parameter modifiers as well.  Fixes bug 38606
13840
13841         * class.cs: Very sad.  Am backing out the speed up changes
13842         introduced by the ArrayList -> Array in the TypeContainer, as they
13843         were not actually that much faster, and introduced a bug (no error
13844         reports on duplicated methods).
13845
13846         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13847         source first, this will guarantee that we have a valid expression
13848         before calling in lower levels functions that will require a
13849         resolved object.  Then use this original_source in the
13850         target.ResolveLValue instead of the original source that was
13851         passed to us.
13852
13853         Another change.  Use target.Resolve instead of LValueResolve.
13854         Although we are resolving for LValues, we will let the Assign code
13855         take care of that (it will be called again from Resolve).  This
13856         basically allows code like this:
13857
13858         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13859         class Y { void A (X x) { x [0] += o; }
13860
13861         The problem was that the indexer was trying to resolve for
13862         set_Item (idx, object o) and never finding one.  The real set_Item
13863         was set_Item (idx, X).  By delaying the process we get the right
13864         semantics. 
13865
13866         Fixes bug 36505
13867
13868 2003-02-23  Martin Baulig  <martin@ximian.com>
13869
13870         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13871         while calling DoEmit ().
13872
13873         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13874         source files; if you use the #line directive inside a method, the
13875         compiler stops emitting line numbers for the debugger until it
13876         reaches the end of the method or another #line directive which
13877         restores the original file.
13878
13879 2003-02-23  Martin Baulig  <martin@ximian.com>
13880
13881         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13882
13883 2003-02-23  Martin Baulig  <martin@ximian.com>
13884
13885         * statement.cs (Block.AddChildVariableNames): We need to call this
13886         recursively, not just for our immediate children.
13887
13888 2003-02-23  Martin Baulig  <martin@ximian.com>
13889
13890         * class.cs (Event.Define): Always make the field private, like csc does.
13891
13892         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13893         actually work, fixes bug #37521.
13894
13895 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13896
13897         * delegate.cs: When creating the various temporary "Parameters"
13898         classes, make sure that we call the ComputeAndDefineParameterTypes
13899         on those new parameters (just like we do with the formal ones), to
13900         allow them to be resolved in the context of the DeclSpace.
13901
13902         This fixes the bug that Dick observed in Bugzilla #38530.
13903
13904 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13905
13906         * expression.cs (ResolveMemberAccess): When resolving a constant,
13907         do not attempt to pull a constant if the value was not able to
13908         generate a valid constant.
13909
13910         * const.cs (LookupConstantValue): Do not report more errors than required.
13911
13912 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13913
13914         * expression.cs: fixes bug #38328.
13915
13916 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13917
13918         * class.cs: Changed all the various members that can be part of a
13919         class from being an ArrayList to be an Array of the right type.
13920         During the DefineType type_list, interface_list, delegate_list and
13921         enum_list are turned into types, interfaces, delegates and enums
13922         arrays.  
13923
13924         And during the member population, indexer_list, event_list,
13925         constant_list, field_list, instance_constructor_list, method_list,
13926         operator_list and property_list are turned into their real arrays.
13927
13928         Although we could probably perform this operation earlier, for
13929         good error reporting we need to keep the lists and remove the
13930         lists for longer than required.
13931
13932         This optimization was triggered by Paolo profiling the compiler
13933         speed on the output of `gen-sample-program.pl' perl script. 
13934
13935         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13936         not crash in methods like MemberLookupFailed that use this field.  
13937
13938         This problem arises when the compiler fails to resolve a type
13939         during interface type definition for example.
13940
13941 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13944         inherit from System.Object, so we have to stop at null, not only
13945         when reaching System.Object.
13946
13947 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13948
13949         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13950         DeclaredOnly because the parent indexer might have had a different
13951         name, but did not loop until the top of the hierarchy was reached.
13952
13953         The problem this one fixes is 35492: when a class implemented an
13954         indexer from an interface, we were getting the interface method
13955         (which was abstract) and we were flagging an error (can not invoke
13956         abstract method).
13957
13958         This also keeps bug 33089 functioning, and test-148 functioning.
13959
13960         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13961         out if a method is special is to see if it is declared in a
13962         property or event, or whether it is one of the predefined operator
13963         names.   This should fix correctly #36804.
13964
13965 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13966
13967         The goal here is to remove the dependency on EmptyCast.Peel ().
13968         Killing it completely.
13969
13970         The problem is that currently in a number of places where
13971         constants are expected, we have to "probe" for an EmptyCast, and
13972         Peel, which is not the correct thing to do, as this will be
13973         repetitive and will likely lead to errors. 
13974
13975         The idea is to remove any EmptyCasts that are used in casts that
13976         can be reduced to constants, so we only have to cope with
13977         constants. 
13978
13979         This bug hunt was triggered by Bug 37363 and the desire to remove
13980         the duplicate pattern where we were "peeling" emptycasts to check
13981         whether they were constants.  Now constants will always be
13982         constants.
13983
13984         * ecore.cs: Use an enumconstant here instead of wrapping with
13985         EmptyCast.  
13986
13987         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13988         throwing me off.  By handling this we can get rid of a few hacks.
13989
13990         * statement.cs (Switch): Removed Peel() code.
13991
13992 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13993
13994         * class.cs: Location information for error 508
13995
13996         * expression.cs (New.DoResolve): Add a guard against double
13997         resolution of an expression.  
13998
13999         The New DoResolve might be called twice when initializing field
14000         expressions (see EmitFieldInitializers, the call to
14001         GetInitializerExpression will perform a resolve on the expression,
14002         and later the assign will trigger another resolution
14003
14004         This leads to bugs (#37014)
14005
14006         * delegate.cs: The signature for EndInvoke should contain any ref
14007         or out parameters as well.  We were not doing this in the past. 
14008
14009         * class.cs (Field.Define): Do not overwrite the type definition
14010         inside the `volatile' group.  Turns out that volatile enumerations
14011         were changing the type here to perform a validity test, which
14012         broke conversions. 
14013
14014 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14015
14016         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14017         and structs, we do not want to load the instance variable
14018
14019         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14020         enum_type has to be handled like an object reference (implicit
14021         conversions exists from this to object), but the regular IsClass
14022         and IsValueType tests will never return true for this one.
14023
14024         Also we use TypeManager.IsValueType instead of type.IsValueType,
14025         just for consistency with the rest of the code (this is only
14026         needed if we ever use the construct exposed by test-180.cs inside
14027         corlib, which we dont today).
14028
14029 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14030
14031         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14032         just InternalCall.
14033
14034 2003-02-09  Martin Baulig  <martin@ximian.com>
14035
14036         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14037         (Namespace.DefineNamespaces): New static public method; this is
14038         called when we're compiling with debugging to add all namespaces
14039         to the symbol file.
14040
14041         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14042         pass it to the Namespace's .ctor.
14043
14044         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14045         and MethodBase arguments; pass the namespace ID to the symwriter;
14046         pass the MethodBase instead of the token to the symwriter.
14047         (SymbolWriter.DefineNamespace): New method to add a namespace to
14048         the symbol file.
14049
14050 2003-02-09  Martin Baulig  <martin@ximian.com>
14051
14052         * symbolwriter.cs: New file.  This is a wrapper around
14053         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14054         methods here in near future.
14055
14056 2003-02-09  Martin Baulig  <martin@ximian.com>
14057
14058         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14059         ILGenerator.MarkSequencePoint() which are actually used by the
14060         symbol writer.
14061
14062 2003-02-09  Martin Baulig  <martin@ximian.com>
14063
14064         * location.cs (SourceFile): New public sealed class.  This
14065         contains the name and an index which is used in the location's token.
14066         (Location): Reserve an appropriate number of bits in the token for
14067         the source file instead of walking over that list, this gives us a
14068         really huge performance improvement when compiling with debugging.
14069
14070         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14071         `SourceFile' argument instead of a string.
14072         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14073         but don't parse/tokenize here, we need to generate the list of all
14074         source files before we do that.
14075         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14076         the files.
14077
14078         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14079         instead of a string.
14080
14081         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14082         of a string.
14083
14084 2003-02-09  Martin Baulig  <martin@ximian.com>
14085
14086         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14087         filename on `#line default'.
14088
14089 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14090
14091         * statement.cs: don't clear the pinned var when the fixed statement
14092         returns from the method (fixes bug#37752).
14093
14094 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14095
14096         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14097         to IsValueType.
14098
14099 2003-02-07  Martin Baulig  <martin@ximian.com>
14100
14101         * driver.cs: Removed the `--debug-args' command line argument.
14102
14103         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14104         automatically by the AsssemblyBuilder.
14105         (CodeGen.InitializeSymbolWriter): We don't need to call any
14106         initialization function on the symbol writer anymore.  This method
14107         doesn't take any arguments.
14108
14109 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14112         from referenced assemblies as well.
14113
14114 2003-02-02  Martin Baulig  <martin@ximian.com>
14115
14116         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14117
14118 2003-02-02  Martin Baulig  <martin@ximian.com>
14119
14120         * class.cs (Constructor.Emit): Open the symbol writer before
14121         emitting the constructor initializer.
14122         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14123         single-stepping through constructor initializers.
14124
14125 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14126
14127         * class.cs: Handle error 549: do not allow virtual methods in
14128         sealed classes. 
14129
14130 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14131
14132         * decl.cs: Check access levels when resolving types
14133
14134 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14135
14136         * statement.cs: Add parameters and locals set in catch blocks that might 
14137         return to set vector
14138
14139 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14140
14141         * class.cs (Operator): Set the SpecialName flags for operators.
14142
14143         * expression.cs (Invocation.DoResolve): Only block calls to
14144         accessors and operators on SpecialName methods.
14145
14146         (Cast.TryReduce): Handle conversions from char constants.
14147
14148
14149 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14150
14151         * statement.cs: small memory and time optimization in FlowBranching.
14152
14153 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14154
14155         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14156         problem that the last fix but in the other sid (Set).
14157
14158         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14159         access when there is no indexer in the hierarchy.
14160
14161 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14162
14163         * class.cs: Combine some if statements.
14164
14165 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14166
14167         * driver.cs: fixed bug #37187.
14168
14169 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14170
14171         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14172         any indexer, it's needed to build a list with all the indexers in the
14173         hierarchy (AllGetters), else we have problems. Fixes #35653.
14174
14175 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14176
14177         * class.cs (MethodData.Define): It is wrong for an interface
14178         implementation to be static in both cases: explicit and implicit.
14179         We were only handling this in one case.
14180
14181         Improve the if situation there to not have negations.
14182
14183         * class.cs (Field.Define): Turns out that we do not need to check
14184         the unsafe bit on field definition, only on usage.  Remove the test.
14185
14186 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14187
14188         * driver.cs: use assembly.Location instead of Codebase (the latest
14189         patch made mcs fail when using MS assemblies).
14190
14191 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14192
14193         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14194         get the path to *corlib.dll.
14195
14196 2003-01-21  Nick Drochak <ndrochak@gol.com>
14197
14198         * cs-tokenizer.cs:
14199         * pending.cs:
14200         * typemanager.cs: Remove compiler warnings
14201
14202 2003-01-20  Duncan Mak  <duncan@ximian.com>
14203
14204         * AssemblyInfo.cs: Bump the version number to 0.19.
14205
14206 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14207
14208         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14209
14210 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14211
14212         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14213
14214 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14215
14216         * cs-parser.jay: Small fix: we were not comparing the constructor
14217         name correctly.   Thanks to Zoltan for the initial pointer.
14218
14219 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14220
14221         * cs-tokenizer.cs: Set file name when specified with #line
14222
14223 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14224
14225         * cs-parser.jay: Only perform the constructor checks here if we
14226         are named like the class;  This will help provider a better
14227         error.  The constructor path is taken when a type definition is
14228         not found, but most likely the user forgot to add the type, so
14229         report that rather than the constructor error.
14230
14231 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14232
14233         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14234         allocations.
14235
14236 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14237
14238         * cs-parser.jay: Add cleanup call.
14239
14240 2003-01-13  Duncan Mak  <duncan@ximian.com>
14241
14242         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14243         consistent with other methods.
14244
14245 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14246
14247         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14248
14249 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14250
14251         * attribute.cs: only set GuidAttr to true when we have a
14252         GuidAttribute.
14253
14254 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14255
14256         * ecore.cs:
14257         * expression.cs:
14258         * typemanager.cs: fixes to allow mcs compile corlib with the new
14259         Type.IsSubclassOf fix.
14260
14261 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14262
14263         * expression.cs (LocalVariableReference.DoResolve): Classify a
14264         constant as a value, not as a variable.   Also, set the type for
14265         the variable.
14266
14267         * cs-parser.jay (fixed_statement): take a type instead of a
14268         pointer_type, so we can produce a better error message later.
14269
14270         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14271         as an error.  
14272
14273         (For.DoEmit): Make inifinite loops have a
14274         non-conditional branch back.
14275
14276         (Fixed.DoEmit): First populate the pinned variables, then emit the
14277         statement, then clear the variables.  Before I was emitting the
14278         code once for each fixed piece.
14279
14280
14281 2003-01-08  Martin Baulig  <martin@ximian.com>
14282
14283         * statement.cs (FlowBranching.MergeChild): A break in a
14284         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14285
14286 2003-01-08  Martin Baulig  <martin@ximian.com>
14287
14288         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14289         lives in the same number space than `param_map'.  Fixes #36154.
14290
14291 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14292
14293         * cs-parser.jay (constructor_declaration): Set the
14294         Constructor.ModFlags before probing for it.  This makes the
14295         compiler report 514, 515 and 132 (the code was there, but got
14296         broken). 
14297
14298         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14299         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14300         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14301
14302 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14303
14304         * enum.cs: create the enum static fields using the enum type.
14305
14306 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14307
14308         * class.cs: don't try to create the ParamBuilder for the return
14309         type if it's not needed (and handle it breaking for the ms runtime
14310         anyway).
14311
14312 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14313
14314         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14315
14316 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14317
14318         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14319         the command.   This showed up while compiling the JANET source
14320         code, which used \r as its only newline separator.
14321
14322 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14323
14324         * class.cs (Method.Define): If we are an operator (because it
14325         reuses our code), then set the SpecialName and HideBySig.  #36128
14326
14327 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14328
14329         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14330         exception, report error 120 `object reference required'.
14331
14332         * driver.cs: Add --pause option, used during to measure the size
14333         of the process as it goes with --timestamp.
14334
14335         * expression.cs (Invocation.DoResolve): Do not allow methods with
14336         SpecialName to be invoked.
14337
14338 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14339
14340         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14341         number before adding it.
14342
14343 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14344
14345         * ecore.cs (StandardImplicitConversion): When in an unsafe
14346         context, we allow conversion between void * to any other pointer
14347         type. This fixes bug #35973.
14348
14349 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14350
14351         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14352         is not thrown when extensionless outputs are used 
14353
14354 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14355
14356         * rootcontext.cs: fixed compilation of corlib.
14357
14358 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14359
14360         * attribute.cs (Attributes.Contains): Add new method.
14361
14362         * class.cs (MethodCore.LabelParameters): if the parameter is an
14363         `out' parameter, check that no attribute `[In]' has been passed.
14364
14365         * enum.cs: Handle the `value__' name in an enumeration.
14366
14367 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14368
14369         * decl.cs: Added special case to allow overrides on "protected
14370         internal" methods
14371
14372 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14373
14374         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14375         since it makes much more sense.
14376
14377         (Attributes.ctor): Don't require a Location parameter.
14378
14379         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14380
14381         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14382         since we already have that information per attribute.
14383
14384         * everywhere : make appropriate changes.
14385
14386         * class.cs (LabelParameters): Write the code which actually
14387         applies attributes to the return type. We can't do this on the MS
14388         .NET runtime so we flag a warning in the case an exception is
14389         thrown.
14390
14391 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * const.cs: Handle implicit null conversions here too.
14394
14395 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14396
14397         * class.cs (MethodCore.LabelParameters): Remove the extra
14398         Type [] parameter since it is completely unnecessary. Instead
14399         pass in the method's attributes so that we can extract
14400         the "return" attribute.
14401
14402 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14403
14404         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14405         of ignoring it and letting the compile continue.
14406
14407         * typemanager.cs (ChangeType): use an extra argument to return an
14408         error condition instead of throwing an exception.
14409
14410 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14411
14412         * expression.cs (Unary.TryReduce): mimic the code for the regular
14413         code path.  Perform an implicit cast in the cases where we can
14414         implicitly convert to one of the integral types, and then reduce
14415         based on that constant.   This fixes bug #35483.
14416
14417 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14418
14419         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14420
14421 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14422
14423         * namespace.cs: fixed bug #35489.
14424
14425 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14426
14427         * class.cs: Remove some dead code.
14428
14429         * cs-parser.jay: Estimate the number of methods needed
14430         (RootContext.MethodCount);
14431
14432         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14433         numbers instead of StringBuilders.
14434
14435         * support.cs (PtrHashtable): Add constructor with initial size;
14436         We can now reduce reallocations of the method table.
14437
14438 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14439
14440         * attribute.cs (ApplyAttributes): Keep track of the emitted
14441         attributes on a per-target basis. This fixes bug #35413.
14442
14443 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14444
14445         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14446         default to the Windows 1252 encoding.
14447
14448         (UnixParseOption): Support version, thanks to Alp for the missing
14449         pointer. 
14450
14451         * AssemblyInfo.cs: Add nice assembly information.
14452
14453         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14454         (bug 35169).
14455
14456         * cs-parser.jay: Allow a trailing comma before the close bracked
14457         in the attribute_section production.
14458
14459         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14460         address of the instance was being taken, I will take this out,
14461         because we take the address of the object immediately here.
14462
14463 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14464
14465         * typemanager.cs (AreMultipleAllowed): Take care of the most
14466         obvious case where attribute type is not in the current assembly -
14467         stupid me ;-)
14468
14469 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14472         definitions, instead of doing that afterwards.  
14473
14474         Also we use a nice little hack, depending on the constructor, we
14475         know if we are a "composed" name or a simple name.  Hence, we
14476         avoid the IndexOf test, and we avoid 
14477
14478         * codegen.cs: Add code to assist in a bug reporter to track down
14479         the source of a compiler crash. 
14480
14481 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14482
14483         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14484         types have been emitted for a given element and flag an error
14485         if something which does not have AllowMultiple set is used more
14486         than once.
14487
14488         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14489         attribute types and their corresponding AllowMultiple properties
14490
14491         (AreMultipleAllowed): Check the property for a given type.
14492
14493         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14494         property in the case we have a TypeContainer.
14495
14496         (Attributes.AddAttribute): Detect duplicates and just skip on
14497         adding them. This trivial fix catches a pretty gross error in our
14498         attribute emission - global attributes were being emitted twice!
14499
14500         Bugzilla bug #33187 is now fixed.
14501
14502 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14503
14504         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14505         instead of pp_and).
14506
14507         * expression.cs (Binary.ResolveOperator): I can only use the
14508         Concat (string, string, string) and Concat (string, string,
14509         string, string) if the child is actually a concatenation of
14510         strings. 
14511
14512 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14513
14514         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14515         context where we need a 2-character lookahead.
14516
14517         * pending.cs (PendingImplementation): Rework so we can keep track
14518         of interface types all the time, and flag those which were
14519         implemented by parents as optional.
14520
14521 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * expression.cs (Binary.ResolveOperator): Use
14524         String.Concat(string,string,string) or
14525         String.Concat(string,string,string,string) when possible. 
14526
14527         * typemanager: More helper methods.
14528
14529
14530 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14531
14532         * pending.cs: remove the bogus return from GetMissingInterfaces()
14533         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14534
14535 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14536
14537         * namespace.cs: avoid duplicated 'using xxx' being added to
14538         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14539         when we get more than one 'using' statement for the same namespace.
14540         Report a CS0105 warning for it.
14541
14542 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14543
14544         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14545         of calling getChar/putback, uses internal knowledge of it.    
14546
14547         (xtoken): Reorder tokenizer so most common patterns are checked
14548         first.  This reduces the compilation time in another 5% (from 8.11s
14549         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14550
14551         The parsing time is 22% of the compilation in mcs, and from that
14552         64% is spent on the tokenization process.  
14553
14554         I tried using a binary search for keywords, but this is slower
14555         than the hashtable.  Another option would be to do a couple of
14556         things:
14557
14558                 * Not use a StringBuilder, instead use an array of chars,
14559                   with a set value.  Notice that this way we could catch
14560                   the 645 error without having to do it *afterwards*.
14561
14562                 * We could write a hand-parser to avoid the hashtable
14563                   compares altogether.
14564
14565         The identifier consumption process takes 37% of the tokenization
14566         time.  Another 15% is spent on is_number.  56% of the time spent
14567         on is_number is spent on Int64.Parse:
14568
14569                 * We could probably choose based on the string length to
14570                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14571                   computations. 
14572
14573         Another 3% is spend on wrapping `xtoken' in the `token' function.
14574
14575         Handle 0xa0 as whitespace (#34752)
14576
14577 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14578
14579         * typemanager.cs (IsCLRType): New routine to tell whether a type
14580         is one of the builtin types.  
14581
14582         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14583         typecode in more places instead of doing pointer comparissions.
14584         We could leverage some knowledge about the way the typecodes are
14585         laid out.
14586
14587         New code to cache namespaces in assemblies, it is currently not
14588         invoked, to be used soon.
14589
14590         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14591
14592         * expression.cs (Binary.ResolveOperator): specially handle
14593         strings, and do not perform user-defined operator overloading for
14594         built-in types.
14595
14596 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14599         internalcall as it is a pretty simple operation;  Avoid whenever
14600         possible to call Char.IsLetter.
14601
14602         (consume_identifier): Cut by half the number of
14603         hashtable calls by merging the is_keyword and GetKeyword behavior.
14604
14605         Do not short-circuit, because if we do, we
14606         report errors (ie, #if false && true would produce an invalid
14607         directive error);
14608
14609
14610 2002-11-24  Martin Baulig  <martin@ximian.com>
14611
14612         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14613         check constant ranges and report a CS0221.  Fixes #33186.
14614
14615 2002-11-24  Martin Baulig  <martin@ximian.com>
14616
14617         * cs-parser.jay: Make this work for uninitialized variable
14618         declarations in the `for' initializer.  Fixes #32416.
14619
14620 2002-11-24  Martin Baulig  <martin@ximian.com>
14621
14622         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14623         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14624
14625 2002-11-24  Martin Baulig  <martin@ximian.com>
14626
14627         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14628         argument; if true, we also check for user-defined conversions.
14629         This is only needed if both arguments are of a user-defined type.
14630         Fixes #30443, added test-175.cs.
14631         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14632
14633         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14634
14635 2002-11-24  Martin Baulig  <martin@ximian.com>
14636
14637         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14638         function to get the store opcode.
14639         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14640         only emit the Ldelema if the store opcode is Stobj.  You must run
14641         both test-34 and test-167 to test this.  Fixes #34529.
14642
14643 2002-11-23  Martin Baulig  <martin@ximian.com>
14644
14645         * ecore.cs (Expression.MemberLookup): Added additional
14646         `qualifier_type' argument which is used when we're being called
14647         from MemberAccess.DoResolve() and null if we're called from a
14648         SimpleName lookup.
14649         (Expression.MemberLookupFailed): New method to report errors; this
14650         does the CS1540 check and reports the correct error message.
14651
14652         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14653         argument for the CS1540 check and redone the way how we're dealing
14654         with private members.  See the comment in the source code for details.
14655         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14656         `closure_start_type' to `closure_qualifier_type' and check whether
14657         it's not null.  It was not this filter being broken, it was just
14658         being called with the wrong arguments.
14659
14660         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14661         and pass it the correct `qualifier_type'; this also does the error
14662         handling for us.
14663
14664 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14665
14666         * expression.cs (Invocation.EmitParams): If the we are dealing
14667         with a non-built-in value type, load its address as well.
14668
14669         (ArrayCreation): Use a a pretty constant instead
14670         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14671         static initializers.  
14672
14673         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14674         because they are not really value types, just glorified integers. 
14675
14676         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14677
14678         * ecore.cs: Remove redundant code for enumerations, make them use
14679         the same code path as everything else, fixes the casting issue
14680         with enumerations in Windows.Forms.
14681
14682         * attribute.cs: Do only cast to string if it is a string, the
14683         validation happens later.
14684
14685         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14686         people upgrade their corlibs.
14687
14688         * ecore.cs: Oops, enumerations were not following the entire code path
14689
14690 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14691
14692         * typemanager.cs (FilterWithClosure): Commented out the test for
14693         1540 in typemanager.cs, as it has problems when accessing
14694         protected methods from a parent class (see test-174.cs). 
14695
14696         * attribute.cs (Attribute.ValidateGuid): new method.
14697         (Attribute.Resolve): Use above.
14698
14699 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14700
14701         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14702
14703         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14704         handling for enumerations, as we only needed the TypeContainer
14705         functionality to begin with (this is required for the fix below to
14706         work for enums that reference constants in a container class for
14707         example). 
14708
14709         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14710
14711         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14712         a valid TypeBuilder to perform lookups on.o
14713
14714         * class.cs (InheritableMemberSignatureCompare): Use true in the
14715         call to GetGetMethod and GetSetMethod, because we are comparing
14716         the signature, and we need to get the methods *even* if they are
14717         private. 
14718
14719         (PropertyBase.CheckBase): ditto.
14720
14721         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14722         GotoCase.Resolve): Use Peel on EmpytCasts.
14723
14724         * ecore.cs (EmptyCast): drop child, add Peel method.
14725
14726 2002-11-17  Martin Baulig  <martin@ximian.com>
14727
14728         * ecore.cs (EmptyCast.Child): New public property.
14729
14730         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14731         label resolved to an EmptyCast.  Fixes #34162.
14732         (GotoCase.Resolve): Likewise.
14733         (Block.EmitMeta): Likewise.
14734
14735 2002-11-17  Martin Baulig  <martin@ximian.com>
14736
14737         * expression.cs (Invocation.BetterConversion): Prefer int over
14738         uint; short over ushort; long over ulong for integer literals.
14739         Use ImplicitConversionExists instead of StandardConversionExists
14740         since we also need to check for user-defined implicit conversions.
14741         Fixes #34165.  Added test-173.cs.
14742
14743 2002-11-16  Martin Baulig  <martin@ximian.com>
14744
14745         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14746         with the `true' and `false' literals.  Fixes #33151.
14747
14748 2002-11-16  Martin Baulig  <martin@ximian.com>
14749
14750         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14751         October 22nd; don't do the cs1540 check for static members.
14752
14753         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14754         now using our own filter here and doing the cs1540 check again.
14755
14756 2002-11-16  Martin Baulig  <martin@ximian.com>
14757
14758         * support.cs (InternalParameters): Don't crash if we don't have
14759         any fixed parameters.  Fixes #33532.
14760
14761 2002-11-16  Martin Baulig  <martin@ximian.com>
14762
14763         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14764         when looking up static methods to make this work on Windows.
14765         Fixes #33773.
14766
14767 2002-11-16  Martin Baulig  <martin@ximian.com>
14768
14769         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14770         a setter rather than using PropertyInfo.CanWrite.
14771
14772 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14773
14774         * class.cs: Allow acces to block member by subclasses. Fixes build
14775         breaker.
14776
14777 2002-11-14  Martin Baulig  <martin@ximian.com>
14778
14779         * class.cs (Constructor.Emit): Added the extern/block check.
14780         Fixes bug #33678.
14781
14782 2002-11-14  Martin Baulig  <martin@ximian.com>
14783
14784         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14785         iteration while looking for indexers, this is needed because the
14786         indexer may have a different name in our base classes.  Fixed the
14787         error reporting (no indexers at all, not get accessor, no
14788         overloaded match).  Fixes bug #33089.
14789         (IndexerAccess.DoResolveLValue): Likewise.
14790
14791 2002-11-14  Martin Baulig  <martin@ximian.com>
14792
14793         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14794         indexers.  Fixes the first part of bug #33089.
14795         (MethodSignature.InheritableMemberSignatureCompare): Added support
14796         for properties.
14797
14798 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14799
14800         * attribute.cs (Attribute.Resolve): Catch the
14801         NullReferenceException and report it since it isn't supposed to
14802         happen. 
14803
14804 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14805
14806         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14807         LogicalOr and LogicalAnd that can benefit from recursively
14808         handling EmitBranchable.  The code now should be nice for Paolo.
14809
14810 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14811
14812         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14813         the Type lookups, as we perform quite a number of lookups on
14814         non-Types.  This can be removed once we can deterministically tell
14815         whether we have a type or a namespace in advance.
14816
14817         But this might require special hacks from our corlib.
14818
14819         * TODO: updated.
14820
14821         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14822         and double which avoids a conversion from an integer to a double.
14823
14824         * expression.cs: tiny optimization, avoid calling IsConstant,
14825         because it effectively performs the lookup twice.
14826
14827 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14828
14829         But a bogus return here to keep the semantics of the old code
14830         until the Mono runtime is fixed.
14831
14832         * pending.cs (GetMissingInterfaces): New method used to remove all
14833         the interfaces that are already implemented by our parent
14834         classes from the list of pending methods. 
14835
14836         * interface.cs: Add checks for calls after ResolveTypeExpr.
14837
14838 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * class.cs (Class.Emit): Report warning 67: event not used if the
14841         warning level is beyond 3.
14842
14843         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14844         being a NullLiteral.
14845
14846         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14847         specifiers. 
14848
14849         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14850         path that might fail if a type can not be resolved.
14851
14852         * expression.cs (Binary.Emit): Emit unsigned versions of the
14853         operators. 
14854
14855         * driver.cs: use error 5.
14856
14857 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14858
14859         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14860
14861 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * cs-parser.jay (switch_section): A beautiful patch from Martin
14864         Baulig that fixed 33094.
14865
14866 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14867
14868         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14869         Check whether the base is abstract and report an error if so.
14870
14871         * expression.cs (IndexerAccess.DoResolveLValue,
14872         IndexerAccess.DoResolve): ditto. 
14873
14874         (Invocation.DoResolve): ditto.
14875
14876         (Invocation.FullMethodDesc): Improve the report string.
14877
14878         * statement.cs (Block): Eliminate IsVariableDefined as it is
14879         basically just a wrapper for GetVariableInfo.
14880
14881         * ecore.cs (SimpleName): Use new 
14882
14883         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14884         type, as we return the actual parameter ref/unref state on a
14885         different call.
14886
14887 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * support.cs: Return proper flags REF/OUT fixing the previous
14890         commit.  
14891
14892         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14893         not used to mean `ref' but `ref or out' in ParameterReference
14894
14895         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14896         full type signature instead of calling TypeManger.CSharpName
14897         ourselves. 
14898
14899         * support.cs (InternalParameters.ParameterDesc): Do not compare
14900         directly to the modflags, because REF/OUT will actually be bitsets
14901         if set. 
14902
14903         * delegate.cs (VerifyMethod): Check also the modifiers.
14904
14905         * cs-tokenizer.cs: Fix bug where floating point values with an
14906         exponent where a sign was missing was ignored.
14907
14908         * driver.cs: Allow multiple assemblies to be specified in a single
14909         /r: argument
14910
14911 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14912
14913         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14914         because identifiers after a parenthesis would end up in this kind
14915         of production, and we needed to desamiguate it for having casts
14916         like:
14917
14918                 (UserDefinedType *) xxx
14919
14920 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14921
14922         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14923         we should set on the Bindingflags.NonPublic, but not turn on
14924         private_ok.  private_ok controls whether a Private member is
14925         returned (this is chekced on the filter routine), while the
14926         BindingFlags.NonPublic just controls whether private/protected
14927         will be allowed.   This fixes the problem part of the problem of
14928         private properties being allowed to be used in derived classes.
14929
14930         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14931         so we can call the children DoResolveLValue method (this will
14932         properly signal errors on lvalue assignments to base properties)
14933
14934         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14935         getter are null, and we have a property info, we know that this
14936         happened because the lookup failed, so we report an error 122 for
14937         protection level violation.
14938
14939         We also silently return if setter and getter are null in the
14940         resolve functions, this condition only happens if we have flagged
14941         the error before.  This is the other half of the problem. 
14942
14943         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14944         not have accessibility information, that is why we were returning
14945         true in the filter function in typemanager.cs.
14946
14947         To properly report 122 (property is inaccessible because of its
14948         protection level) correctly, we report this error in ResolveAccess
14949         by failing if both the setter and the getter are lacking (ie, the
14950         lookup failed). 
14951
14952         DoResolve and DoLResolve have been modified to check for both
14953         setter/getter being null and returning silently, the reason being
14954         that I did not want to put the knowledge about this error in upper
14955         layers, like:
14956
14957         int old = Report.Errors;
14958         x = new PropertyExpr (...);
14959         if (old != Report.Errors)
14960                 return null;
14961         else
14962                 return x;
14963
14964         So the property expr is returned, but it is invalid, so the error
14965         will be flagged during the resolve process. 
14966
14967         * class.cs: Remove InheritablePropertySignatureCompare from the
14968         class, as we no longer depend on the property signature to compute
14969         whether it is possible to implement a method or not.
14970
14971         The reason is that calling PropertyInfo.GetGetMethod will return
14972         null (in .NET, in Mono it works, and we should change this), in
14973         cases where the Get Method does not exist in that particular
14974         class.
14975
14976         So this code:
14977
14978         class X { public virtual int A { get { return 1; } } }
14979         class Y : X { }
14980         class Z : Y { public override int A { get { return 2; } } }
14981
14982         Would fail in Z because the parent (Y) would not have the property
14983         defined.  So we avoid this completely now (because the alternative
14984         fix was ugly and slow), and we now depend exclusively on the
14985         method names.
14986
14987         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14988         reference method, instead of using the property.
14989
14990         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14991         routines are gone now.
14992
14993         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14994         names, they were incorrectly named.
14995
14996         * cs-tokenizer.cs: Return are more gentle token on failure. 
14997
14998         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14999         had an out-of-sync index variable, which caused it to remove from
15000         the list of pending methods the wrong method sometimes.
15001
15002 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15005         CanWrite, because those refer to this particular instance of the
15006         property, and do not take into account the fact that we can
15007         override single members of a property.
15008
15009         Constructor requires an EmitContext.  The resolution process does
15010         not happen here, but we need to compute the accessors before,
15011         because the resolution does not always happen for properties.
15012
15013         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15014         subclass, before we did not update this flag, but we did update
15015         bindingflags. 
15016
15017         (GetAccessors): Drop this routine, as it did not work in the
15018         presence of partially overwritten set/get methods. 
15019
15020         Notice that this broke the cs1540 detection, but that will require
15021         more thinking. 
15022
15023 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15024
15025         * class.cs:
15026         * codegen.cs:
15027         * driver.cs: issue a warning instead of an error if we don't support
15028         debugging for the platform. Also ignore a couple of errors that may
15029         arise when trying to write the symbols. Undo my previous patch.
15030
15031 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15032
15033         * driver.cs: ignore /debug switch except for Unix platforms.
15034
15035 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15036
15037         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15038
15039 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * driver.cs: Do not make mcs-debug conditional, so we do not break
15042         builds that use it.
15043
15044         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15045         review this patch.  But basically after all the children variables
15046         have been merged, the value of "Breaks" was not being set to
15047         new_breaks for Switch blocks.  I think that it should be set after
15048         it has executed.  Currently I set this to the value of new_breaks,
15049         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15050         conservative, but I do not understand this code very well.
15051
15052         I did not break anything in the build, so that is good ;-)
15053
15054         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15055
15056 2002-10-20  Mark Crichton  <crichton@gimp.org>
15057
15058         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15059
15060 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15061
15062         * cfold.cs: Fixed compile blocker.
15063
15064 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15065
15066         * driver.cs: I was chekcing the key, not the file.
15067
15068 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15069
15070         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15071         message that we were generating - we just need to silently return
15072         a null.
15073
15074 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * class.cs (Event.Define): Change my previous commit, as this
15077         breaks the debugger.  This is a temporary hack, as it seems like
15078         the compiler is generating events incorrectly to begin with.
15079
15080         * expression.cs (Binary.ResolveOperator): Added support for 
15081         "U operator - (E x, E y)"
15082
15083         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15084         y)".
15085
15086         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15087         init-only variables, but this path did not take into account that
15088         there might be also instance readonly variables.  Correct this
15089         problem. 
15090
15091         This fixes bug 32253
15092
15093         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15094         delegates as well.
15095
15096         * driver.cs: Change the extension for modules to `netmodule'
15097
15098         * cs-parser.jay: Improved slightly the location tracking for
15099         the debugger symbols.
15100
15101         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15102         modifiers that were specified instead of the hardcoded value
15103         (FamAndAssem).  This was basically ignoring the static modifier,
15104         and others.  Fixes 32429.
15105
15106         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15107         fixed a bug in the process (32476)
15108
15109         * expression.cs (ArrayAccess.EmitAssign): Patch from
15110         hwang_rob@yahoo.ca that fixes bug 31834.3
15111
15112 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * driver.cs: Make the module extension .netmodule.
15115
15116 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15117
15118         * driver.cs: Report an error if the resource file is not found
15119         instead of crashing.
15120
15121         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15122         false, like Emit does.
15123
15124 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15125
15126         * typemanager.cs: Remove unused private member.  Also reported mcs
15127         bug to report this as a warning like csc.
15128
15129 2002-10-15  Martin Baulig  <martin@gnome.org>
15130
15131         * statement.cs (Statement.Emit): Made this a virtual method; emits
15132         the line number info and calls DoEmit().
15133         (Statement.DoEmit): New protected abstract method, formerly knows
15134         as Statement.Emit().
15135
15136         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15137
15138 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15141         have fixed a remaining problem: not every AddXXXX was adding a
15142         fully qualified name.  
15143
15144         Now everyone registers a fully qualified name in the DeclSpace as
15145         being defined instead of the partial name.  
15146
15147         Downsides: we are slower than we need to be due to the excess
15148         copies and the names being registered this way.  
15149
15150         The reason for this is that we currently depend (on the corlib
15151         bootstrap for instance) that types are fully qualified, because
15152         we dump all the types in the namespace, and we should really have
15153         types inserted into the proper namespace, so we can only store the
15154         basenames in the defined_names array.
15155
15156 2002-10-10  Martin Baulig  <martin@gnome.org>
15157
15158         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15159         from bug #31834, see the bug report for a testcase which is
15160         miscompiled.
15161
15162 2002-10-10  Martin Baulig  <martin@gnome.org>
15163
15164         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15165         flow analysis code for this.
15166
15167         * statement.cs (Do, While, For): Tell the flow analysis code about
15168         infinite loops.
15169         (FlowBranching.UsageVector): Added support for infinite loops.
15170         (Block.Resolve): Moved the dead code elimination here and use flow
15171         analysis to do it.
15172
15173 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * class.cs (Field.Define): Catch cycles on struct type
15176         definitions. 
15177
15178         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15179         fields if the fields are static.  We only need to check instance
15180         fields. 
15181
15182         * expression.cs (As.DoResolve): Test for reference type.
15183
15184         * statement.cs (Using.ResolveExpression): Use
15185         ConvertImplicitRequired, not ConvertImplicit which reports an
15186         error on failture
15187         (Using.ResolveLocalVariableDecls): ditto.
15188
15189         * expression.cs (Binary.ResolveOperator): Report errors in a few
15190         places where we had to.
15191
15192         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15193
15194 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * expression.cs: Use StoreFromPtr instead of extracting the type
15197         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15198
15199         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15200         an enumeration value to a System.Enum, but System.Enum is not a
15201         value type, but an class type, so we need to box.
15202
15203         (Expression.ConvertExplicit): One codepath could return
15204         errors but not flag them.  Fix this.  Fixes #31853
15205
15206         * parameter.cs (Resolve): Do not allow void as a parameter type.
15207
15208 2002-10-06  Martin Baulig  <martin@gnome.org>
15209
15210         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15211         if it's a class type and not a struct.  Fixes #31815.
15212
15213 2002-10-06  Martin Baulig  <martin@gnome.org>
15214
15215         * statement.cs: Reworked the flow analysis code a bit to make it
15216         usable for dead code elimination.
15217
15218 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15219
15220         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15221
15222 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15225         to fix the test 165, will investigate deeper.
15226
15227 2002-10-04  Martin Baulig  <martin@gnome.org>
15228
15229         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15230         finally blocks actually work.
15231         (Try.Resolve): We don't need to create a sibling for `finally' if
15232         there is no finally block.
15233
15234 2002-10-04  Martin Baulig  <martin@gnome.org>
15235
15236         * class.cs (Constructor.Define): The default accessibility for a
15237         non-default constructor is private, not public.
15238
15239 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * class.cs (Constructor): Make AllowedModifiers public, add
15242         EXTERN.
15243
15244         * cs-parser.jay: Perform the modifiers test here, as the
15245         constructor for the Constructor class usually receives a zero
15246         because of the way we create it (first we create, later we
15247         customize, and we were never checking the modifiers).
15248
15249         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15250         is a version of LookupTypeReflection that includes the type-name
15251         cache.  This can be used as a fast path for functions that know
15252         the fully qualified name and are only calling into *.GetType() to
15253         obtain a composed type.
15254
15255         This is also used by TypeManager.LookupType during its type
15256         composition.
15257
15258         (LookupType): We now also track the real type name, as sometimes
15259         we can get a quey for the real type name from things like
15260         ComposedCast.  This fixes bug 31422.
15261
15262         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15263         complete type fullname, it does not have to go through the type
15264         resolution system to obtain the composed version of the type (for
15265         obtaining arrays or pointers).
15266
15267         (Conditional.Emit): Use the EmitBoolExpression to
15268         generate nicer code, as requested by Paolo.
15269
15270         (ArrayCreation.CheckIndices): Use the patch from
15271         hwang_rob@yahoo.ca to validate the array initializers. 
15272
15273 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * class.cs (ConstructorInitializer.Emit): simplify code by using
15276         Invocation.EmitCall, and at the same time, fix the bugs in calling
15277         parent constructors that took variable arguments. 
15278
15279         * ecore.cs (Expression.ConvertNumericExplicit,
15280         Expression.ImplicitNumericConversion): Remove the code that
15281         manually wrapped decimal (InternalTypeConstructor call is now gone
15282         as well).
15283
15284         * expression.cs (Cast.TryReduce): Also handle decimal types when
15285         trying to perform a constant fold on the type.
15286
15287         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15288
15289         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15290         that only turned off an error report, and did nothing else. 
15291
15292 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * driver.cs: Handle and ignore /fullpaths
15295
15296 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * expression.cs (Binary.ResolveOperator): Catch the case where
15299         DoNumericPromotions returns true, 
15300
15301         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15302
15303 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15304
15305         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15306         report error 70.
15307
15308 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15309
15310         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15311         conversion exists, but it is also required that the conversion be
15312         performed.  This manifested in "(Type64Enum) 2".  
15313
15314         * class.cs (TypeManager.AddMethod): The fix is not to change
15315         AddEnum, because that one was using a fully qualified name (every
15316         DeclSpace derivative does), but to change the AddMethod routine
15317         that was using an un-namespaced name.  This now correctly reports
15318         the duplicated name.
15319
15320         Revert patch until I can properly fix it.  The issue
15321         is that we have a shared Type space across all namespaces
15322         currently, which is wrong.
15323
15324         Options include making the Namespace a DeclSpace, and merge
15325         current_namespace/current_container in the parser.
15326
15327 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15328
15329         * cs-parser.jay: Improve error reporting when we get a different
15330         kind of expression in local_variable_type and
15331         local_variable_pointer_type. 
15332
15333         Propagate this to avoid missleading errors being reported.
15334
15335         * ecore.cs (ImplicitReferenceConversion): treat
15336         TypeManager.value_type as a target just like object_type.   As
15337         code like this:
15338
15339         ValueType v = 1;
15340
15341         Is valid, and needs to result in the int 1 being boxed before it
15342         is assigned to the value type v.
15343
15344         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15345         to validate the enumeration name.
15346
15347         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15348         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15349         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15350
15351         * ecore.cs (TryImplicitIntConversion): When doing an
15352         implicit-enumeration-conversion, check if the type is 64-bits and
15353         perform a conversion before passing to EnumConstant.
15354
15355 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15356
15357         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15358         report ambiguous type references.  Unlike the MS version, we
15359         report what the ambiguity is.   Innovation at work ;-)
15360
15361         (DeclSpace.FindType): Require a location argument to
15362         display when we display an ambiguous error.
15363
15364         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15365
15366         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15367
15368         * expression.cs (EmitDynamicInitializers): Apply patch from
15369         hwang_rob@yahoo.ca that fixes the order in which we emit our
15370         initializers. 
15371
15372 2002-09-21  Martin Baulig  <martin@gnome.org>
15373
15374         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15375         delegate takes no arguments.
15376
15377 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15378
15379         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15380         from integers.
15381
15382         * expression.cs: Extract the underlying type.
15383
15384         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15385
15386         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15387
15388 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15389
15390         * class.cs (TypeContainer.DefineType): We can not use the nice
15391         PackingSize with the size set to 1 DefineType method, because it
15392         will not allow us to define the interfaces that the struct
15393         implements.
15394
15395         This completes the fixing of bug 27287
15396
15397         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15398         means also structs.  This fixes part of the problem. 
15399         (Expresion.ImplicitReferenceConversionExists): ditto.
15400
15401         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15402         error if there were no errors reported during the type lookup
15403         process, to avoid duplicates or redundant errors.  Without this
15404         you would get an ambiguous errors plus a type not found.  We have
15405         beaten the user enough with the first error.  
15406
15407         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15408         reference. 
15409
15410         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15411         during the resolution process, stop the lookup, this avoids
15412         repeated error reports (same error twice).
15413
15414         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15415
15416         * typemanager.cs (LookupType): Redo the type lookup code to match
15417         the needs of System.Reflection.  
15418
15419         The issue is that System.Reflection requires references to nested
15420         types to begin with a "+" sign instead of a dot.  So toplevel
15421         types look like: "NameSpace.TopLevelClass", and nested ones look
15422         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15423         levels. 
15424
15425 2002-09-19  Martin Baulig  <martin@gnome.org>
15426
15427         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15428         says that a method always returns or always throws an exception,
15429         don't report the CS0161.
15430
15431         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15432         set `Returns = new_returns'.
15433
15434 2002-09-19  Martin Baulig  <martin@gnome.org>
15435
15436         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15437         to an enum constant, check for a CS0176.
15438
15439 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15440
15441         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15442         for operators that must be in pairs and report errors.
15443
15444         * ecore.cs (SimpleName.DoResolveType): During the initial type
15445         resolution process, when we define types recursively, we must
15446         check first for types in our current scope before we perform
15447         lookups in the enclosing scopes.
15448
15449         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15450
15451         (Invocation.VerifyArgumentsCompat): Call
15452         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15453         I thought we were supposed to always call this, but there are a
15454         few places in the code where we dont do it.
15455
15456 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15457
15458         * driver.cs: Add support in -linkres and -resource to specify the
15459         name of the identifier.
15460
15461 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * ecore.cs (StandardConversionExists): Sync with the conversion
15464         code: allow anything-* to void* conversions.
15465
15466         (FindMostSpecificSource): Use an Expression argument
15467         instead of a Type, because we might be handed over a Literal which
15468         gets a few more implicit conversions that plain types do not.  So
15469         this information was being lost.
15470
15471         Also, we drop the temporary type-holder expression when not
15472         required.
15473
15474 2002-09-17  Martin Baulig  <martin@gnome.org>
15475
15476         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15477         this is an explicit interface implementation.
15478
15479 2002-09-17  Martin Baulig  <martin@gnome.org>
15480
15481         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15482         different `IndexerName' attributes.
15483
15484         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15485         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15486         virtual CommonResolve().
15487
15488 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15489
15490         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15491         and convert that to the UnderlyingType.
15492
15493         * statement.cs (Foreach.Resolve): Indexers are just like variables
15494         or PropertyAccesses.
15495
15496         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15497         inside quoted strings, we were not doing this before.
15498
15499 2002-09-16  Martin Baulig  <martin@gnome.org>
15500
15501         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15502         resolve it.  This is needed for the definite assignment check of the
15503         instance expression, fixes bug #29846.
15504         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15505
15506 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15507
15508         * parameter.cs: Fix compile error.  Cannot reference static member
15509         from an instance object.  Is this an mcs bug?
15510
15511 2002-09-14  Martin Baulig  <martin@gnome.org>
15512
15513         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15514         multiple times.  Fixes bug #30295, added test-166.cs.
15515
15516 2002-09-14  Martin Baulig  <martin@gnome.org>
15517
15518         * statement.cs (Block.Emit): Don't emit unreachable code.
15519         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15520         `break' statements.
15521         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15522
15523 2002-09-14  Martin Baulig  <martin@gnome.org>
15524
15525         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15526         is set.
15527
15528 2002-09-14  Martin Baulig  <martin@gnome.org>
15529
15530         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15531         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15532         be false on the ms runtime.
15533
15534 2002-09-13  Martin Baulig  <martin@gnome.org>
15535
15536         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15537         the CS0038 error message.
15538
15539 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15542         constant inside, return it.
15543
15544 2002-09-12  Martin Baulig  <martin@gnome.org>
15545
15546         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15547         implicit conversion can be done between enum types.
15548
15549         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15550         check whether an implicit conversion to the current enum's UnderlyingType
15551         exists and report an error if not.
15552
15553         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15554         without debugging support.
15555
15556         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15557         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15558
15559 2002-09-12  Martin Baulig  <martin@gnome.org>
15560
15561         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15562
15563         * ecore.cs (IMemberExpr.DeclaringType): New property.
15564         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15565         nonstatic member of an outer type (CS0038).
15566
15567 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * driver.cs: Activate the using-error detector at warning level
15570         4 (at least for MS-compatible APIs).
15571
15572         * namespace.cs (VerifyUsing): Small buglett fix.
15573
15574         * pending.cs (PendingImplementation): pass the container pointer. 
15575
15576         * interface.cs (GetMethods): Allow for recursive definition.  Long
15577         term, I would like to move every type to support recursive
15578         definitions, not the current ordering mechanism that we have right
15579         now.
15580
15581         The situation is this: Attributes are handled before interfaces,
15582         so we can apply attributes to interfaces.  But some attributes
15583         implement interfaces, we will now handle the simple cases
15584         (recursive definitions will just get an error).  
15585
15586         * parameter.cs: Only invalidate types at the end if we fail to
15587         lookup all types.  
15588
15589 2002-09-09  Martin Baulig  <martin@gnome.org>
15590
15591         * ecore.cs (PropertyExpr.Emit): Also check for
15592         TypeManager.system_int_array_get_length so this'll also work when
15593         compiling corlib.  Fixes #30003.
15594
15595 2002-09-09  Martin Baulig  <martin@gnome.org>
15596
15597         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15598         and throw an exception if we can't get the type's size.  Fixed #30040,
15599         added test-165.cs.
15600
15601 2002-09-09  Martin Baulig  <martin@gnome.org>
15602
15603         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15604
15605         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15606         context.  Fixes bug #30027.
15607
15608         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15609         virtual functions.  Fixes bug #30043, added test-164.cs.
15610
15611 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15612
15613         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15614
15615 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15616
15617         * driver.cs: Use an object to get the windows codepage since it's not a
15618         static property.
15619
15620 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * statement.cs (For.Emit): for infinite loops (test == null)
15623         return whether there is a break inside, not always "true".
15624
15625         * namespace.cs (UsingEntry): New struct to hold the name of the
15626         using definition, the location where it is defined, and whether it
15627         has been used in a successful type lookup.
15628
15629         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15630         strings.
15631
15632         * decl.cs: ditto.
15633
15634 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15635
15636         * attribute.cs : Fix incorrect code which relied on catching
15637         a NullReferenceException to detect a null being passed in
15638         where an object was expected.
15639
15640 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * statement.cs (Try): flag the catch variable as assigned
15643
15644         * expression.cs (Cast): Simplified by using ResolveType instead of
15645         manually resolving.
15646
15647         * statement.cs (Catch): Fix bug by using ResolveType.
15648
15649 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15650
15651         * expression.cs (BetterConversion): Special case for when we have
15652         a NullLiteral as the argument and we have to choose between string
15653         and object types - we choose string the way csc does.
15654
15655         * attribute.cs (Attribute.Resolve): Catch the
15656         NullReferenceException and report error #182 since the Mono
15657         runtime no more has the bug and having this exception raised means
15658         we tried to select a constructor which takes an object and is
15659         passed a null.
15660
15661 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15662
15663         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15664         message (1502, 1503) when we can't locate a method after overload
15665         resolution. This is much more informative and closes the bug
15666         Miguel reported.
15667
15668         * interface.cs (PopulateMethod): Return if there are no argument
15669         types. Fixes a NullReferenceException bug.
15670
15671         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15672         expressions too. Previously we were checking only in one place for
15673         positional arguments leaving out named arguments.
15674
15675         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15676         type to the enum type is not allowed. Remove code corresponding to
15677         that.
15678
15679         (ConvertNumericExplicit): Allow explicit conversions from
15680         the underlying type to enum type. This precisely follows the spec
15681         and closes a bug filed by Gonzalo.
15682
15683 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15684
15685         * compiler.csproj:
15686         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15687
15688 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15689
15690         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15691         it was important that we stored the right value after the
15692         reduction in `converted'.
15693
15694 2002-09-04  Martin Baulig  <martin@gnome.org>
15695
15696         * location.cs (Location.SymbolDocument): Use full pathnames for the
15697         source files.
15698
15699 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15700
15701         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15702         of the expression resolve mechanism, because that will catch the
15703         SimpleName error failures.
15704
15705         (Conditional): If we can not resolve the
15706         expression, return, do not crash.
15707
15708 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15709
15710         * cs-tokenizer.cs:
15711         (location): display token name instead of its number.
15712
15713 2002-08-28  Martin Baulig  <martin@gnome.org>
15714
15715         * expression.cs (Binary.ResolveOperator): Don't silently return
15716         but return an error if an operator cannot be applied between two
15717         enum types.
15718
15719 2002-08-28  Martin Baulig  <martin@gnome.org>
15720
15721         * class.cs (Constructor.Define): Set the permission attributes
15722         correctly instead of making all constructors public.
15723
15724 2002-08-28  Martin Baulig  <martin@gnome.org>
15725
15726         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15727         for private members before reporting a CS0103; if we find anything,
15728         it's a CS0122.
15729
15730 2002-08-28  Martin Baulig  <martin@gnome.org>
15731
15732         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15733         to check whether `closure_start_type == closure_invocation_type',
15734         we also need to check whether `m.DeclaringType == closure_invocation_type'
15735         before bypassing the permission checks.  We might be accessing
15736         protected/private members from the base class.
15737         (TypeManager.RealMemberLookup): Only set private_ok if private
15738         members were requested via BindingFlags.NonPublic.
15739
15740         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15741
15742         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15743         MethodGroupExpr.IsExplicitImpl if appropriate.
15744         (Invocation.DoResolve): Don't report the CS0120 for explicit
15745         interface implementations.
15746
15747 2002-08-27  Martin Baulig  <martin@gnome.org>
15748
15749         * expression.cs (Invocation.DoResolve): If this is a static
15750         method and we don't have an InstanceExpression, we must report
15751         a CS0120.
15752
15753 2002-08-25  Martin Baulig  <martin@gnome.org>
15754
15755         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15756         `==' between a valuetype and an object.
15757
15758 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15759
15760         * ecore.cs (TypeExpr): Provide a ToString method.
15761
15762 2002-08-24  Martin Baulig  <martin@gnome.org>
15763
15764         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15765         now called proggie.dbg and it's a binary file.
15766
15767 2002-08-23  Martin Baulig  <martin@gnome.org>
15768
15769         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15770
15771 2002-08-23  Martin Baulig  <martin@gnome.org>
15772
15773         * struct.cs (MyStructInfo.ctor): Make this work with empty
15774         structs; it's not allowed to use foreach() on null.
15775
15776 2002-08-23  Martin Baulig  <martin@gnome.org>
15777
15778         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15779         writer the full pathname of the generated assembly.
15780
15781 2002-08-23  Martin Baulig  <martin@gnome.org>
15782
15783         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15784         A `finally' block never returns or breaks; improved handling of
15785         unreachable code.
15786
15787 2002-08-23  Martin Baulig  <martin@gnome.org>
15788
15789         * statement.cs (Throw.Resolve): Allow `throw null'.
15790
15791 2002-08-23  Martin Baulig  <martin@gnome.org>
15792
15793         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15794         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15795         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15796         MemberLookup would return a wrong event if this is an explicit
15797         interface implementation and the class has an event with the same
15798         name.
15799
15800 2002-08-23  Martin Baulig  <martin@gnome.org>
15801
15802         * statement.cs (Block.AddChildVariableNames): New public method.
15803         (Block.AddChildVariableName): Likewise.
15804         (Block.IsVariableNameUsedInChildBlock): Likewise.
15805         (Block.AddVariable): Check whether a variable name has already
15806         been used in a child block.
15807
15808         * cs-parser.jay (declare_local_variables): Mark all variable names
15809         from the current block as being used in a child block in the
15810         implicit block.
15811
15812 2002-08-23  Martin Baulig  <martin@gnome.org>
15813
15814         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15815         find the symbol writer.
15816
15817         * driver.cs: csc also allows the arguments to /define being
15818         separated by commas, not only by semicolons.
15819
15820 2002-08-23  Martin Baulig  <martin@gnome.org>
15821
15822         * interface.cs (Interface.GetMembers): Added static check for events.
15823
15824 2002-08-15  Martin Baulig  <martin@gnome.org>
15825
15826         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15827         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15828
15829         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15830         why the MethodData.EmitDestructor() change was necessary.
15831
15832 2002-08-20  Martin Baulig  <martin@gnome.org>
15833
15834         * class.cs (TypeContainer.FindMembers): Added static check for events.
15835
15836         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15837
15838         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15839         use Type.GetEvents(), not Type.FindMembers().
15840
15841 2002-08-20  Martin Baulig  <martin@gnome.org>
15842
15843         * decl.cs (MemberCache): Added a special method cache which will
15844         be used for method-only searched.  This ensures that a method
15845         search will return a MethodInfo with the correct ReflectedType for
15846         inherited methods.      
15847
15848 2002-08-20  Martin Baulig  <martin@gnome.org>
15849
15850         * decl.cs (DeclSpace.FindMembers): Made this public.
15851
15852 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15853
15854         * delegate.cs: fixed build on windows.
15855         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15856
15857 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15858
15859         * ecore.cs (StandardConversionExists): Return a false
15860         if we are trying to convert the void type to anything else
15861         since that is not allowed.
15862
15863         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15864         we flag error 70 in the event an event is trying to be accessed
15865         directly from outside the declaring type.
15866
15867 2002-08-20  Martin Baulig  <martin@gnome.org>
15868
15869         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15870         MemberCache from typemanager.cs to decl.cs.
15871
15872 2002-08-19  Martin Baulig  <martin@gnome.org>
15873
15874         * class.cs (TypeContainer): Implement IMemberContainer.
15875         (TypeContainer.DefineMembers): Create the MemberCache.
15876         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15877         return public members if BindingFlags.Public was given, check
15878         whether members are static.
15879
15880 2002-08-16  Martin Baulig  <martin@gnome.org>
15881
15882         * decl.cs (DeclSpace.Define): Splitted this in Define and
15883         DefineMembers.  DefineMembers is called first and initializes the
15884         MemberCache.
15885
15886         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15887         DefineMembers() on all our DeclSpaces.
15888
15889         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15890         but call DefineMembers() on all nested interfaces.  We call their
15891         Define() in our new Define() function.
15892
15893         * interface.cs (Interface): Implement IMemberContainer.
15894         (Interface.Define): Moved all code except the attribute stuf to
15895         DefineMembers().
15896         (Interface.DefineMembers): Initialize the member cache.
15897
15898         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15899         need this anymore since we can use MemberCache.FindMembers directly.
15900
15901 2002-08-19  Martin Baulig  <martin@gnome.org>
15902
15903         * typemanager.cs (MemberCache): When creating the cache for an
15904         interface type, add all inherited members.
15905         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15906         to `out bool used_cache' and documented it.
15907         (TypeManager.MemberLookup): If we already used the cache in the first
15908         iteration, we don't need to do the interfaces check.
15909
15910 2002-08-19  Martin Baulig  <martin@gnome.org>
15911
15912         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15913         here from IMemberFinder and don't implement this interface anymore.
15914         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15915
15916         * typemanager.cs (IMemberFinder): This interface is now only used by
15917         classes which actually support the member cache.
15918         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15919         since we only put DeclSpaces into this Hashtable.
15920         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15921         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15922
15923 2002-08-16  Martin Baulig  <martin@gnome.org>
15924
15925         * typemanager.cs (ICachingMemberFinder): Removed.
15926         (IMemberFinder.MemberCache): New property.
15927         (TypeManager.FindMembers): Merged this with RealFindMembers().
15928         This function will never be called from TypeManager.MemberLookup()
15929         so we can't use the cache here, just the IMemberFinder.
15930         (TypeManager.MemberLookup_FindMembers): Check whether the
15931         IMemberFinder has a MemberCache and call the cache's FindMembers
15932         function.
15933         (MemberCache): Rewrote larger parts of this yet another time and
15934         cleaned it up a bit.
15935
15936 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15937
15938         * driver.cs (LoadArgs): Support quoting.
15939
15940         (Usage): Show the CSC-like command line arguments.
15941
15942         Improved a few error messages.
15943
15944 2002-08-15  Martin Baulig  <martin@gnome.org>
15945
15946         * typemanager.cs (IMemberContainer.Type): New property.
15947         (IMemberContainer.IsInterface): New property.
15948
15949         The following changes are conditional to BROKEN_RUNTIME, which is
15950         defined at the top of the file.
15951
15952         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15953         class'es members, but add all members from TypeHandle.ObjectType
15954         if we're an interface.
15955         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15956         is the current type.
15957         (MemberCache.CacheEntry.Container): Removed this field.
15958         (TypeHandle.GetMembers): Include inherited members.
15959
15960 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15961
15962         * typemanager.cs: fixed compilation and added a comment on a field that
15963         is never used.
15964
15965 2002-08-15  Martin Baulig  <martin@gnome.org>
15966
15967         * class.cs (ConstructorInitializer.Resolve): In the
15968         Expression.MemberLookup call, use the queried_type as
15969         invocation_type.
15970
15971         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15972         declared' attribute, it's always true.
15973         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15974         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15975         temporary wrapper for FindMembers which tells MemberLookup whether
15976         members from the base classes are included in the return value.
15977         This will go away soon.
15978         (TypeManager.MemberLookup): Use this temporary hack here; once the
15979         new MemberCache is completed, we don't need to do the DeclaredOnly
15980         looping here anymore since the MemberCache will take care of this.
15981         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15982         (MemberCache): When creating the MemberCache for a class, get
15983         members from the current class and all its base classes.
15984         (MemberCache.CacheEntry.Container): New field.  This is a
15985         temporary hack until the Mono runtime is fixed to distinguish
15986         between ReflectedType and DeclaringType.  It allows us to use MCS
15987         with both the MS runtime and the unfixed Mono runtime without
15988         problems and without accecting performance.
15989         (MemberCache.SearchMembers): The DeclaredOnly looping from
15990         TypeManager.MemberLookup is now done here.      
15991
15992 2002-08-14  Martin Baulig  <martin@gnome.org>
15993
15994         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15995         Type.GetFields on dynamic types but get the fields from the
15996         corresponding TypeContainer.
15997         (MyStructInfo.GetStructInfo): Added check for enum types.
15998
15999         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16000         (MemberList.SyncRoot): Implemented.
16001         (TypeManager.FilterWithClosure): No need to check permissions if
16002         closure_start_type == closure_invocation_type, don't crash if
16003         closure_invocation_type is null.
16004
16005 2002-08-13  Martin Baulig  <martin@gnome.org>
16006
16007         Rewrote TypeContainer.FindMembers to use a member cache.  This
16008         gives us a speed increase of about 35% for the self-hosting MCS
16009         build and of about 15-20% for the class libs (both on GNU/Linux).
16010
16011         * report.cs (Timer): New class to get enhanced profiling.  This
16012         whole class is "TIMER" conditional since it remarkably slows down
16013         compilation speed.
16014
16015         * class.cs (MemberList): New class.  This is an IList wrapper
16016         which we're now using instead of passing MemberInfo[]'s around to
16017         avoid copying this array unnecessarily.
16018         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16019         (ICachingMemberFinder, IMemberContainer): New interface.
16020         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16021         has already been checked, otherwise use it for the name comparision.
16022         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16023         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16024         if possible.  Returns a MemberList, not a MemberInfo [].
16025         (TypeHandle): New class, implements IMemberContainer.  We create
16026         one instance of this class per type, it contains a MemberCache
16027         which is used to do the member lookups.
16028         (MemberCache): New class.  Each instance of this class contains
16029         all members of a type and a name-based hash table.
16030         (MemberCache.FindMembers): This is our new member lookup
16031         function.  First, it looks up all members of the requested name in
16032         the hash table.  Then, it walks this list and sorts out all
16033         applicable members and returns them.
16034
16035 2002-08-13  Martin Baulig  <martin@gnome.org>
16036
16037         In addition to a nice code cleanup, this gives us a performance
16038         increase of about 1.4% on GNU/Linux - not much, but it's already
16039         half a second for the self-hosting MCS compilation.
16040
16041         * typemanager.cs (IMemberFinder): New interface.  It is used by
16042         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16043         Enum, Delegate or Interface.
16044         (TypeManager.finder_to_member_finder): New PtrHashtable.
16045         (TypeManager.finder_to_container): Removed.
16046         (TypeManager.finder_to_delegate): Removed.
16047         (TypeManager.finder_to_interface): Removed.
16048         (TypeManager.finder_to_enum): Removed.
16049
16050         * interface.cs (Interface): Implement IMemberFinder.
16051
16052         * delegate.cs (Delegate): Implement IMemberFinder.
16053
16054         * enum.cs (Enum): Implement IMemberFinder.
16055
16056         * class.cs (TypeContainer): Implement IMemberFinder.
16057
16058 2002-08-12  Martin Baulig  <martin@gnome.org>
16059
16060         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16061
16062 2002-08-12  Martin Baulig  <martin@gnome.org>
16063
16064         * ecore.cs (ITypeExpression): New interface for expressions which
16065         resolve to a type.
16066         (TypeExpression): Renamed to TypeLookupExpression.
16067         (Expression.DoResolve): If we're doing a types-only lookup, the
16068         expression must implement the ITypeExpression interface and we
16069         call DoResolveType() on it.
16070         (SimpleName): Implement the new ITypeExpression interface.
16071         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16072         hack, the situation that we're only looking up types can't happen
16073         anymore when this method is called.  Moved the type lookup code to
16074         DoResolveType() and call it.
16075         (SimpleName.DoResolveType): This ITypeExpression interface method
16076         is now doing the types-only lookup.
16077         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16078         (ResolveFlags): Added MaskExprClass.
16079
16080         * expression.cs (MemberAccess): Implement the ITypeExpression
16081         interface.
16082         (MemberAccess.DoResolve): Added support for a types-only lookup
16083         when we're called via ITypeExpression.DoResolveType().
16084         (ComposedCast): Implement the ITypeExpression interface.
16085
16086         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16087         Expression.Resolve() with ResolveFlags.Type instead.
16088
16089 2002-08-12  Martin Baulig  <martin@gnome.org>
16090
16091         * interface.cs (Interface.Define): Apply attributes.
16092
16093         * attribute.cs (Attribute.ApplyAttributes): Added support for
16094         interface attributes.
16095
16096 2002-08-11  Martin Baulig  <martin@gnome.org>
16097
16098         * statement.cs (Block.Emit): Only check the "this" variable if we
16099         do not always throw an exception.
16100
16101         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16102         whether the property has a set accessor.
16103
16104 2002-08-11  Martin Baulig  <martin@gnome.org>
16105
16106         Added control flow analysis support for structs.
16107
16108         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16109         with control flow analysis turned off.
16110         (IVariable): New interface.
16111         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16112         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16113         (FieldExpr.DoResolve): Resolve the instance expression with flow
16114         analysis turned off and do the definite assignment check after the
16115         resolving when we know what the expression will resolve to.
16116
16117         * expression.cs (LocalVariableReference, ParameterReference):
16118         Implement the new IVariable interface, only call the flow analysis
16119         code if ec.DoFlowAnalysis is true.
16120         (This): Added constructor which takes a Block argument.  Implement
16121         the new IVariable interface.
16122         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16123         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16124         This does the definite assignment checks for struct members.
16125
16126         * class.cs (Constructor.Emit): If this is a non-static `struct'
16127         constructor which doesn't have any initializer, call
16128         Block.AddThisVariable() to tell the flow analysis code that all
16129         struct elements must be initialized before control returns from
16130         the constructor.
16131
16132         * statement.cs (MyStructInfo): New public class.
16133         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16134         argument to this indexer.  If non-zero, check an individual struct
16135         member, not the whole struct.
16136         (FlowBranching.CheckOutParameters): Check struct members.
16137         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16138         overloaded versions of these methods which take an additional
16139         `int field_idx' argument to check struct members.
16140         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16141         overloaded versions of these methods which take an additional
16142         `string field_name' argument to check struct member.s
16143         (VariableInfo): Implement the IVariable interface.
16144         (VariableInfo.StructInfo): New public property.  Returns the
16145         MyStructInfo instance of the variable if it's a struct or null.
16146         (Block.AddThisVariable): New public method.  This is called from
16147         Constructor.Emit() for non-static `struct' constructor which do
16148         not have any initializer.  It creates a special variable for the
16149         "this" instance variable which will be checked by the flow
16150         analysis code to ensure that all of the struct's fields are
16151         initialized before control returns from the constructor.
16152         (UsageVector): Added support for struct members.  If a
16153         variable/parameter is a struct with N members, we reserve a slot
16154         in the usage vector for each member.  A struct is considered fully
16155         initialized if either the struct itself (slot 0) or all its
16156         members are initialized.
16157
16158 2002-08-08  Martin Baulig  <martin@gnome.org>
16159
16160         * driver.cs (Driver.MainDriver): Only report an error CS5001
16161         if there were no compilation errors.
16162
16163         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16164         `UnsafeContext' property to determine whether the parent is in
16165         unsafe context rather than checking the parent's ModFlags:
16166         classes nested in an unsafe class are unsafe as well.
16167
16168 2002-08-08  Martin Baulig  <martin@gnome.org>
16169
16170         * statement.cs (UsageVector.MergeChildren): Distinguish between
16171         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16172         we return.  Added test17() and test18() to test-154.cs.
16173
16174 2002-08-08  Martin Baulig  <martin@gnome.org>
16175
16176         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16177         Family access, make sure the invoking type isn't a subclass of the
16178         queried type (that'd be a CS1540).
16179
16180         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16181         this method which takes an additional `Type invocation_type'.
16182
16183         * expression.cs (BaseAccess.DoResolve): Use the base type as
16184         invocation and query type.
16185         (MemberAccess.DoResolve): If the lookup failed and we're about to
16186         report a CS0122, try a lookup with the ec.ContainerType - if this
16187         succeeds, we must report a CS1540.
16188
16189 2002-08-08  Martin Baulig  <martin@gnome.org>
16190
16191         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16192         (MethodGroupExpr): Implement the IMemberExpr interface.
16193
16194         * expression (MemberAccess.ResolveMemberAccess): No need to have
16195         any special code for MethodGroupExprs anymore, they're now
16196         IMemberExprs.   
16197
16198 2002-08-08  Martin Baulig  <martin@gnome.org>
16199
16200         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16201         Family, FamANDAssem and FamORAssem permissions.
16202         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16203
16204 2002-08-08  Martin Baulig  <martin@gnome.org>
16205
16206         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16207         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16208         or loop block.
16209
16210 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16211
16212         * driver.cs: implemented /resource option to embed managed resources.
16213
16214 2002-08-07  Martin Baulig  <martin@gnome.org>
16215
16216         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16217         (FieldBase.HasFieldInitializer): New public property.
16218         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16219         returns the field initializer and makes sure it is only resolved once.
16220         (TypeContainer.EmitFieldInitializers): Call
16221         FieldBase.GetInitializerExpression to get the initializer, this ensures
16222         that it isn't resolved multiple times.
16223
16224         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16225         the resolving process (SimpleName/MemberLookup) that we're currently
16226         emitting a field initializer (which must not access any instance members,
16227         this is an error CS0236).
16228
16229         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16230         argument, if the `IsFieldInitializer' flag is set, we must report and
16231         error CS0236 and not an error CS0120.   
16232
16233 2002-08-07  Martin Baulig  <martin@gnome.org>
16234
16235         * ecore.cs (IMemberExpr): New public interface.
16236         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16237         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16238         if the expression is an IMemberExpr.
16239
16240         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16241         to be null, implicitly default to `this' if we're non-static in
16242         this case.  Simplified the code a lot by using the new IMemberExpr
16243         interface.  Also fixed bug #28176 here.
16244
16245 2002-08-06  Martin Baulig  <martin@gnome.org>
16246
16247         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16248         ParameterReferences during semantic analysis so that we can do a
16249         type-only search when resolving Cast, TypeOf and SizeOf.
16250         (block): Pass the `current_local_parameters' to the Block's
16251         constructor.
16252
16253         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16254         argument to the constructor.
16255         (ConstructorInitializer.Resolve): Create a temporary implicit
16256         block with the parameters.
16257
16258         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16259         references here if we aren't doing a type-only search.
16260
16261         * statement.cs (Block): Added constructor which takes a
16262         `Parameters parameters' argument.
16263         (Block.Parameters): New public property.
16264
16265         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16266         to `Parameters' and made it public readonly.
16267
16268 2002-08-06  Martin Baulig  <martin@gnome.org>
16269
16270         * ecore.cs (Expression.Warning): Made this public as well.
16271
16272         * report.cs (Report.Debug): Print the contents of collections.
16273
16274 2002-08-06  Martin Baulig  <martin@gnome.org>
16275
16276         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16277         used to tell Resolve() which kinds of expressions it may return.
16278         (Expression.Resolve): Added overloaded version of this method which
16279         takes a `ResolveFlags flags' argument.  This can be used to tell
16280         Resolve() which kinds of expressions it may return.  Reports a
16281         CS0118 on error.
16282         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16283         ResolveFlags.SimpleName.
16284         (Expression.Error118): Added overloaded version of this method which
16285         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16286         which kinds of expressions are allowed.
16287
16288         * expression.cs (Argument.ResolveMethodGroup): New public method.
16289         Resolves an argument, but allows a MethodGroup to be returned.
16290         This is used when invoking a delegate.
16291
16292         * TODO: Updated a bit.
16293
16294 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16295
16296         Fixed compilation with csc.
16297
16298         * ecore.cs: Expression.Error made public. Is this correct? Should
16299         Warning be made public too?
16300
16301         * expression.cs: use ea.Location instead of ea.loc.
16302         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16303
16304 2002-08-06  Martin Baulig  <martin@gnome.org>
16305
16306         * ecore.cs (Expression.loc): Moved the location here instead of
16307         duplicating it in all derived classes.
16308         (Expression.Location): New public property.
16309         (Expression.Error, Expression.Warning): Made them non-static and
16310         removed the location argument.
16311         (Expression.Warning): Added overloaded version which takes an
16312         `int level' argument.
16313         (Expression.Error118): Make this non-static and removed the
16314         expression and location arguments.
16315         (TypeExpr): Added location argument to the constructor.
16316
16317         * expression.cs (StaticCallExpr): Added location argument to
16318         the constructor.
16319         (Indirection, PointerArithmetic): Likewise.
16320         (CheckedExpr, UnCheckedExpr): Likewise.
16321         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16322         (StringPtr): Likewise.
16323
16324
16325 2002-08-05  Martin Baulig  <martin@gnome.org>
16326
16327         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16328
16329         * assign.cs (Assign.DoResolve): Check whether the source
16330         expression is a value or variable.
16331
16332         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16333         while resolving the corresponding blocks.
16334
16335         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16336         an error, don't silently return null.
16337
16338         * statement.cs (Block.AddVariable): Do the error reporting here
16339         and distinguish between CS0128 and CS0136.
16340         (Block.DoResolve): Report all unused labels (warning CS0164).
16341         (LabeledStatement): Pass the location to the constructor.
16342         (LabeledStatement.HasBeenReferenced): New property.
16343         (LabeledStatement.Resolve): Set it to true here.
16344
16345         * statement.cs (Return.Emit): Return success even after reporting
16346         a type mismatch error (CS0126 or CS0127), this is what csc does and
16347         it avoids confusing the users with any consecutive errors.
16348
16349 2002-08-05  Martin Baulig  <martin@gnome.org>
16350
16351         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16352
16353         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16354
16355         * expression.cs (MemberAccess.DoResolve): Silently return if an
16356         error has already been reported.
16357
16358         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16359         error has already been reported.
16360
16361 2002-08-05  Martin Baulig  <martin@gnome.org>
16362
16363         * statement.cs (UsageVector): Only initialize the `parameters'
16364         vector if we actually have any "out" parameters.
16365
16366 2002-08-05  Martin Baulig  <martin@gnome.org>
16367
16368         * expression.cs (Binary.ResolveOperator): When combining delegates,
16369         they must have the same type.
16370
16371 2002-08-05  Martin Baulig  <martin@gnome.org>
16372
16373         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16374         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16375         work with the ms runtime and we also don't need it: if we're a
16376         PropertyBuilder and not in the `indexer_arguments' hash, then we
16377         are a property and not an indexer.
16378
16379         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16380         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16381         since the latter one doesn't work with the ms runtime.
16382
16383 2002-08-03  Martin Baulig  <martin@gnome.org>
16384
16385         Fixed bugs #27998 and #22735.
16386
16387         * class.cs (Method.IsOperator): New public field.
16388         (Method.CheckBase): Report CS0111 if there's already a method
16389         with the same parameters in the current class.  Report CS0508 when
16390         attempting to change the return type of an inherited method.
16391         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16392         and it's not marked abstract or extern.
16393         (PropertyBase): New abstract base class for Property and Indexer.
16394         (PropertyBase.CheckBase): Moved here from Property and made it work
16395         for indexers.
16396         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16397         the same so we can reuse it there.
16398         (Property, Indexer): Derive from PropertyBase.
16399         (MethodSignature.inheritable_property_signature_filter): New delegate
16400         to find properties and indexers.
16401
16402         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16403         argument and improved error reporting.
16404
16405         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16406         EmptyReadOnlyParameters and made it a property.
16407
16408         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16409         version of this method which takes a `PropertyInfo indexer'.
16410         (TypeManager.RegisterIndexer): New method.
16411
16412         * class.cs: Added myself as author of this file :-)
16413
16414 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16415
16416         * class.cs: fixed compilation on windoze.
16417
16418 2002-08-03  Martin Baulig  <martin@gnome.org>
16419
16420         * interface.cs (Interface.GetInterfaceBases): Check whether all
16421         base interfaces are at least as accessible than the current one.
16422
16423         * class.cs (TypeContainer.GetClassBases): Check whether base types
16424         are at least as accessible than the current type.
16425         (TypeContainer.AsAccessible): Implemented and made non-static.
16426         (MemberBase.CheckParameters): Report errors if the accessibility
16427         checks fail.
16428
16429         * delegate.cs (Delegate.Delegate): The default visibility is
16430         internal for top-level types and private for nested types.
16431         (Delegate.Define): Report errors if the accessibility checks fail.
16432
16433         * enum.cs (Enum.Enum): The default visibility is internal for
16434         top-level types and private for nested types.
16435         (Enum.DefineType): Compute the correct visibility.
16436
16437         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16438         function which takes a `bool is_toplevel' instead of a TypeContainer.
16439
16440         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16441         builtin type.
16442
16443 2002-08-02  Martin Baulig  <martin@gnome.org>
16444
16445         * expression.cs (LocalVariableReferenc): Added constructor which
16446         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16447         (LocalVariableReference.IsReadOnly): New property.
16448         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16449         variable is readonly, use our own readonly flag to do this; you can
16450         use the new constructor to get a writable reference to a read-only
16451         variable.
16452
16453         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16454         reference to the local variable.
16455
16456 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * rootcontext.cs (ResolveCore): Also include System.Exception
16459
16460         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16461         we reach an EmptyStatement.
16462
16463         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16464         is also fine.
16465
16466         * expression.cs (Binary.ResolveOperator): Check error result in
16467         two places.
16468
16469         use brtrue/brfalse directly and avoid compares to null.
16470
16471 2002-08-02  Martin Baulig  <martin@gnome.org>
16472
16473         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16474         Fixes bug #28407, added test-155.cs.
16475
16476 2002-08-01  Martin Baulig  <martin@gnome.org>
16477
16478         * class.cs (Event.EmitDefaultMethod): Make this work with static
16479         events.  Fixes #28311, added verify-3.cs.
16480
16481 2002-08-01  Martin Baulig  <martin@gnome.org>
16482
16483         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16484         `is_disposable' fields.
16485         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16486         `hm.is_disposable' if we're using the collection pattern.
16487         (Foreach.EmitCollectionForeach): Use the correct type for the
16488         enumerator's local variable, only emit the try/finally block if
16489         necessary (fixes #27713).
16490
16491 2002-08-01  Martin Baulig  <martin@gnome.org>
16492
16493         * ecore.cs (Expression.report118): Renamed to Error118 and made
16494         it public static.
16495
16496         * statement.cs (Throw.Resolve): Check whether the expression is of
16497         the correct type (CS0118) and whether the type derives from
16498         System.Exception (CS0155).
16499         (Catch.Resolve): New method.  Do the type lookup here and check
16500         whether it derives from System.Exception (CS0155).
16501         (Catch.CatchType, Catch.IsGeneral): New public properties.
16502
16503         * typemanager.cs (TypeManager.exception_type): Added.
16504
16505 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16506
16507         * driver.cs: Updated About function.
16508
16509 2002-07-31  Martin Baulig  <martin@gnome.org>
16510
16511         Implemented Control Flow Analysis.
16512
16513         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16514         (EmitContext.CurrentBranching): Added.
16515         (EmitContext.StartFlowBranching): Added.
16516         (EmitContext.EndFlowBranching): Added.
16517         (EmitContext.KillFlowBranching): Added.
16518         (EmitContext.IsVariableAssigned): Added.
16519         (EmitContext.SetVariableAssigned): Added.
16520         (EmitContext.IsParameterAssigned): Added.
16521         (EmitContext.SetParameterAssigned): Added.
16522         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16523         Added control flow analysis stuff here.
16524
16525         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16526         resolve the expression as lvalue.
16527         (LocalVariableReference.DoResolve): Check whether the variable has
16528         already been assigned.
16529         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16530         the parameter as assigned here.
16531         (ParameterReference.DoResolve): Check whether the parameter has already
16532         been assigned.
16533         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16534         expression as lvalue.
16535
16536         * statement.cs (FlowBranching): New class for the flow analysis code.
16537         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16538         (LabeledStatement.IsDefined): New public property.
16539         (LabeledStatement.AddUsageVector): New public method to tell flow
16540         analyis that the label may be reached via a forward jump.
16541         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16542         flow analysis.
16543         (VariableInfo.Number): New public field.  This is used by flow analysis
16544         to number all locals of a block.
16545         (Block.CountVariables): New public property.  This is the number of
16546         local variables in this block (including the locals from all parent
16547         blocks).
16548         (Block.EmitMeta): Number all the variables.
16549
16550         * statement.cs: Added flow analysis support to all classes.
16551
16552 2002-07-31  Martin Baulig  <martin@gnome.org>
16553
16554         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16555         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16556         then use this argument.
16557
16558         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16559
16560         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16561         use this to specify /define options.
16562
16563 2002-07-29  Martin Baulig  <martin@gnome.org>
16564
16565         * statement.cs (Fixed): Moved all code that does variable lookups
16566         and resolvings from Emit to Resolve.
16567
16568         * statement.cs (For): Moved all code that does variable lookups
16569         and resolvings from Emit to Resolve.
16570
16571         * statement.cs (Using): Moved all code that does variable lookups
16572         and resolvings from Emit to Resolve.
16573
16574 2002-07-29  Martin Baulig  <martin@gnome.org>
16575
16576         * attribute.cs (Attribute.Resolve): Explicitly catch a
16577         System.NullReferenceException when creating the
16578         CustromAttributeBuilder and report a different warning message.
16579
16580 2002-07-29  Martin Baulig  <martin@gnome.org>
16581
16582         * support.cs (ParameterData.ParameterName): Added method to
16583         get the name of a parameter.
16584
16585         * typemanager.cs (TypeManager.IsValueType): New public method.
16586
16587 2002-07-29  Martin Baulig  <martin@gnome.org>
16588
16589         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16590         is a flag which specifies that it's either ref or out.
16591         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16592         the out parameter to `out Parameter.Modifier mod', also set the
16593         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16594
16595         * support.cs (InternalParameters.ParameterModifier): Distinguish
16596         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16597         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16598
16599         * expression.cs (Argument.GetParameterModifier): Distinguish
16600         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16601         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16602
16603 2002-07-29  Martin Baulig  <martin@gnome.org>
16604
16605         * expression.cs (ParameterReference.ParameterReference): Added
16606         `Location loc' argument to the constructor.
16607
16608         * cs-parser.jay: Pass location to ParameterReference.
16609
16610 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16611
16612         * statement.cs (Try): Initialize the location.
16613
16614         * cs-parser.jay: pass location to Try.
16615
16616         * expression.cs (Unary.Reduce): Change the prototype to return
16617         whether a constant fold could be performed or not.  The result is
16618         returned in an out parameters.  In the case of Indirection and
16619         AddressOf, we want to perform the full tests.
16620
16621 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16622
16623         * statement.cs (Statement.Emit): Flag dead code.
16624
16625 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16626
16627         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16628
16629 2002-07-27  Martin Baulig  <martin@gnome.org>
16630
16631         * class.cs (MethodData.Define): Put back call to
16632         TypeManager.AddMethod(), accidentally commented this out.
16633
16634         * report.cs (Debug): New public method to print debugging information,
16635         this is `[Conditional ("DEBUG")]'.
16636
16637 2002-07-26  Martin Baulig  <martin@gnome.org>
16638
16639         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16640         (switch_statement): Push the current_block to the switch_stack and
16641         pop it again when we're done with the switch.
16642         (switch_section): The new block is a child of the current_block.
16643         Fixes bug #24007, added test-152.cs.
16644
16645 2002-07-27  Martin Baulig  <martin@gnome.org>
16646
16647         * expression.cs (Invocation.EmitArguments): When calling a varargs
16648         function with only its fixed arguments, we need to pass an empty
16649         array.
16650
16651 2002-07-27  Martin Baulig  <martin@gnome.org>
16652
16653         Mono 0.13 has been released.
16654
16655 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16656
16657         * driver.cs: Rename --resource to --linkres, because that is what
16658         we do currently, we dont support --resource yet.
16659
16660         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16661
16662 2002-07-25  Martin Baulig  <martin@gnome.org>
16663
16664         * class.cs (MethodData): New public class.  This is a `method builder'
16665         class for a method or one accessor of a Property/Indexer/Event.
16666         (MethodData.GetMethodFlags): Moved here from MemberBase.
16667         (MethodData.ApplyAttributes): Likewise.
16668         (MethodData.ApplyObsoleteAttribute): Likewise.
16669         (MethodData.ApplyConditionalAttribute): Likewise.
16670         (MethodData.ApplyDllImportAttribute): Likewise.
16671         (MethodData.CheckAbstractAndExternal): Likewise.
16672         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16673         (MethodData.Emit): Formerly known as Method.Emit().
16674         (MemberBase): Moved everything which was specific to a single
16675         accessor/method to MethodData.
16676         (Method): Create a new MethodData and call Define() and Emit() on it.
16677         (Property, Indexer, Event): Create a new MethodData objects for each
16678         accessor and call Define() and Emit() on them.
16679
16680 2002-07-25  Martin Baulig  <martin@gnome.org>
16681
16682         Made MethodCore derive from MemberBase to reuse the code from there.
16683         MemberBase now also checks for attributes.
16684
16685         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16686         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16687         as virtual.
16688         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16689         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16690         (MemberBase.ApplyAttributes): New virtual method; applies the
16691         attributes to a method or accessor.
16692         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16693         (MemberBase.ApplyConditionalAttribute): Likewise.
16694         (MemberBase.ApplyDllImportAttribute): Likewise.
16695         (MemberBase.CheckAbstractAndExternal): Likewise.
16696         (MethodCore.ParameterTypes): This is now a property instead of a
16697         method, it's initialized from DoDefineParameters().
16698         (MethodCore.ParameterInfo): Removed the set accessor.
16699         (MethodCore.DoDefineParameters): New protected virtual method to
16700         initialize ParameterTypes and ParameterInfo.
16701         (Method.GetReturnType): We can now simply return the MemberType.
16702         (Method.GetMethodFlags): Override the MemberBase version and add
16703         the conditional flags.
16704         (Method.CheckBase): Moved some code from Define() here, call
16705         DoDefineParameters() here.
16706         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16707         here to avoid some larger code duplication.
16708         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16709         ensure that abstract and external accessors don't declare a body.
16710
16711         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16712         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16713         lookup in the attribute's parent classes, so we need to abort as soon
16714         as we found the first match.
16715         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16716         the attribute has no arguments.
16717
16718         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16719         of a Method.
16720
16721 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16722
16723         * cs-parser.jay: reverted previous patch.
16724
16725 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16726
16727         * cs-parser.jay: fixed bug #22119.
16728
16729 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16730
16731         * attribute.cs: fixed compilation. The error was:
16732         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16733         be assigned to before control leaves the current method."
16734         [FIXME:  Filed as bug #28186: MCS must report this error.]
16735
16736 2002-07-25  Martin Baulig  <martin@gnome.org>
16737
16738         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16739         method to pull the condition name ouf of a Conditional attribute.
16740         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16741         the obsolete message and error flag out of an Obsolete attribute.
16742
16743         * class.cs (Method.GetMethodFlags): New public method to get the
16744         TypeManager.MethodFlags for this method.
16745         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16746         private methods.
16747         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16748         if we're overriding a virtual function, set the new private variable
16749         `parent_method'; call the new TypeManager.AddMethod().
16750
16751         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16752         the MethodBuilder and the Method in a PtrHashtable.
16753         (TypeManager.builder_to_method): Added for this purpose.
16754         (TypeManager.MethodFlags): Added IsObsoleteError.
16755         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16756         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16757         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16758         the message from the attribute.
16759
16760 2002-07-24  Martin Baulig  <martin@gnome.org>
16761
16762         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16763         preprocessor directives, ensure that the argument to #define/#undef is
16764         exactly one identifier and that it's actually an identifier.
16765
16766         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16767         did not work ....
16768
16769 2002-07-24  Martin Baulig  <martin@gnome.org>
16770
16771         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16772         initialize it to TypeManager.object_type in the constructor.
16773         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16774         of the `hm.get_current' method if we're using the collection pattern.
16775         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16776         for the explicit conversion to make it work when we're using the collection
16777         pattern and the `Current' property has a different return type than `object'.
16778         Fixes #27713.
16779
16780 2002-07-24  Martin Baulig  <martin@gnome.org>
16781
16782         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16783         does not match, but don't report any errors.  This method is called in
16784         order for all methods in a MethodGroupExpr until a matching method is
16785         found, so we don't want to bail out if the first method doesn't match.
16786         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16787         matches, report the 123.  Fixes #28070.
16788
16789 2002-07-24  Martin Baulig  <martin@gnome.org>
16790
16791         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16792         TypeManager.TypeToCoreType() to the top of the method so the
16793         following equality checks will work.  Fixes #28107.
16794
16795 2002-07-24  Martin Baulig  <martin@gnome.org>
16796
16797         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16798         operand is of type uint, and the other operand is of type sbyte,
16799         short or int, the operands are converted to type long." -
16800         Actually do what this comment already told us.  Fixes bug #28106,
16801         added test-150.cs.
16802
16803 2002-07-24  Martin Baulig  <martin@gnome.org>
16804
16805         * class.cs (MethodBase): New abstract class.  This is now a base
16806         class for Property, Indexer and Event to avoid some code duplication
16807         in their Define() and DefineMethods() methods.
16808         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16809         generic methods for Define() and DefineMethods().
16810         (FieldBase): Derive from MemberBase, not MemberCore.
16811         (Property): Derive from MemberBase, not MemberCore.
16812         (Property.DefineMethod): Moved all the code from this method to the
16813         new MethodBase.DefineAccessor(), just call it with appropriate
16814         argumetnts.
16815         (Property.Define): Call the new Property.DoDefine(), this does some
16816         sanity checks and we don't need to duplicate the code everywhere.
16817         (Event): Derive from MemberBase, not MemberCore.
16818         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16819         accessors, this will also make them work with interface events.
16820         (Indexer): Derive from MemberBase, not MemberCore.
16821         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16822         (Indexer.Define): Use the new MethodBase functions.
16823
16824         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16825         argument to the constructor.
16826         (Interface.FindMembers): Added support for interface events.
16827         (Interface.PopluateEvent): Implemented.
16828
16829         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16830
16831 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16832
16833         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16834         but this is required to check for a method name being the same as
16835         the containing class.  
16836
16837         Handle this now.
16838
16839 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16840
16841         * interface.cs: initialize variable.
16842
16843 2002-07-23  Martin Baulig  <martin@gnome.org>
16844
16845         Implemented the IndexerName attribute in interfaces.
16846
16847         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16848         name if this is an explicit interface implementation.
16849         (Indexer.InterfaceIndexerName): New public variable.  If we're
16850         implementing an interface indexer, this is the IndexerName in that
16851         interface.  Otherwise, it's the IndexerName.
16852         (Indexer.DefineMethod): If we're implementing interface indexer,
16853         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16854         and Pending.ImplementIndexer methods.
16855         (Indexer.Define): Also define the PropertyBuilder if we're
16856         implementing an interface indexer and this is neither an explicit
16857         interface implementation nor do the IndexerName match the one in
16858         the interface.
16859
16860         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16861         If a method is defined here, then we always need to create a proxy
16862         for it.  This is used when implementing interface indexers.
16863         (Pending.IsInterfaceIndexer): New public method.
16864         (Pending.ImplementIndexer): New public method.
16865         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16866         This is used when implementing interface indexers to define a proxy
16867         if necessary.
16868         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16869         define a proxy if necessary.
16870
16871         * interface.cs (Interface.IndexerName): New public variable.
16872         (Interface.PopulateIndexer): Set the IndexerName.
16873         (Interface.DefineIndexers): New private method.  Populate all the
16874         indexers and make sure their IndexerNames match.
16875
16876         * typemanager.cs (IndexerPropertyName): Added support for interface
16877         indexers.
16878
16879 2002-07-22  Martin Baulig  <martin@gnome.org>
16880
16881         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16882         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16883         ret if HasReturnLabel.
16884         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16885         variables.
16886
16887         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16888         and set the ec.LoopBeginTryCatchLevel.
16889         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16890         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16891         the current ec.TryCatchLevel, the branch goes out of an exception
16892         block.  In this case, we need to use Leave and not Br.
16893
16894 2002-07-22  Martin Baulig  <martin@gnome.org>
16895
16896         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16897         block unless the block does not always return or it is contained in
16898         another try { ... } catch { ... } block.  Fixes bug #26506.
16899         Added verify-1.cs to the test suite.
16900
16901 2002-07-22  Martin Baulig  <martin@gnome.org>
16902
16903         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16904         then we do not always return.  Fixes bug #24985.
16905
16906 2002-07-22  Martin Baulig  <martin@gnome.org>
16907
16908         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16909         lookup on a per-class level; ie. walk up the class hierarchy until we
16910         found at least one applicable method, then choose the best among them.
16911         Fixes bug #24463 and test-29.cs.
16912
16913 2002-07-22  Martin Baulig  <martin@gnome.org>
16914
16915         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16916         return types of the methods.  The return type is not part of the
16917         signature and we must not check it to make the `new' modifier work.
16918         Fixes bug #27999, also added test-147.cs.
16919         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16920
16921         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16922         on the method's return type.
16923
16924 2002-07-21  Martin Baulig  <martin@gnome.org>
16925
16926         * assign.cs: Make this work if the rightmost source is a constant and
16927         we need to do an implicit type conversion.  Also adding a few more tests
16928         to test-38.cs which should have caught this.
16929
16930         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16931         target in the makefile for this.  The makefile.gnu is primarily intended
16932         for end-users who don't want to debug the compiler.
16933
16934 2002-07-21  Martin Baulig  <martin@gnome.org>
16935
16936         * assign.cs: Improved the Assign class so it can now handle embedded
16937         assignments (X = Y = Z = something).  As a side-effect this'll now also
16938         consume less local variables.  test-38.cs now passes with MCS, added
16939         a few new test cases to that test.
16940
16941 2002-07-20  Martin Baulig  <martin@gnome.org>
16942
16943         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16944         instructions.  Fixes bug #27977, also added test-146.cs.
16945
16946 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16947
16948         * cs-tokenizer.cs: fixed getHex ().
16949
16950 2002-07-19  Martin Baulig  <martin@gnome.org>
16951
16952         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16953         not Type.GetType() to lookup the array type.  This is needed when
16954         we're constructing an array of a user-defined type.
16955         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16956         single-dimensional arrays, but also for single-dimensial arrays of
16957         type decimal.
16958
16959 2002-07-19  Martin Baulig  <martin@gnome.org>
16960
16961         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16962         this function is called, it's not allowed to share LocalBuilders
16963         among ILGenerators.
16964
16965 2002-07-19  Martin Baulig  <martin@gnome.org>
16966
16967         * expression.cs (Argument.Resolve): Report an error 118 when trying
16968         to pass a type as argument.
16969
16970 2002-07-18  Martin Baulig  <martin@gnome.org>
16971
16972         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16973         Conv_R_Un for the signed `long' type.
16974
16975 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16976
16977         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16978         `expr' for the temporary result, as that will fail if we do
16979         multiple resolves on the same expression.
16980
16981 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16982
16983         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16984         ec.TypeContainer for looking up aliases. 
16985
16986         * class.cs (TypeContainer): Remove LookupAlias from here.
16987
16988         * decl.cs (DeclSpace); Move here.
16989
16990 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * class.cs (FindMembers): Only call filter if the constructor
16993         bulider is not null.
16994
16995         Also handle delegates in `NestedTypes' now.  Now we will perform
16996         type lookups using the standard resolution process.  This also
16997         fixes a bug.
16998
16999         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17000         This uses Expressions (the limited kind that can be parsed by the
17001         tree) instead of strings.
17002
17003         * expression.cs (ComposedCast.ToString): Implement, used to flag
17004         errors since now we have to render expressions.
17005
17006         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17007         FormArrayType. 
17008
17009         * ecore.cs (SimpleName.ToString): ditto.
17010
17011         * cs-parser.jay: Instead of using strings to assemble types, use
17012         Expressions to assemble the type (using SimpleName, ComposedCast,
17013         MemberAccess).  This should fix the type lookups in declarations,
17014         because we were using a different code path for this.
17015
17016         * statement.cs (Block.Resolve): Continue processing statements
17017         even when there is an error.
17018
17019 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * class.cs (Event.Define): Also remove the `remove' method from
17022         the list of pending items.
17023
17024         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17025         generate more compact code. 
17026
17027 2002-07-17  Martin Baulig  <martin@gnome.org>
17028
17029         * const.cs (Const.LookupConstantValue): Add support for constant
17030         `unchecked' and `checked' expressions.
17031         Also adding test case test-140.cs for this.
17032
17033 2002-07-17  Martin Baulig  <martin@gnome.org>
17034
17035         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17036         check whether mi.ReturnType implements the IEnumerator interface; the
17037         `==' and the IsAssignableFrom() will fail in this situation.
17038
17039 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17040
17041         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17042         here too.
17043
17044 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17045
17046         * expression.cs: fixed bug #27811.
17047
17048 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17051         Molaro: when we are a ref, the value already contains a pointer
17052         value, do not take the address of it.
17053
17054 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17055         * removed mb-parser.jay and mb-tokenizer.cs
17056
17057 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17058
17059         * expression.cs: check against the building corlib void type.
17060
17061 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17062
17063         * ecore.cs: fix for valuetype static readonly fields: when 
17064         initializing them, we need their address, not the address of a copy.
17065
17066 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17067
17068         * typemanager.cs: register also enum_type in corlib.
17069
17070 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17071
17072         * class.cs: allow calling this (but not base) initializers in structs.
17073
17074 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17075
17076         * ecore.cs: make sure we compare against the building base types
17077         in GetTypeSize ().
17078
17079 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17080
17081         * typemanager.cs: fix TypeToCoreType() to handle void and object
17082         (corlib gets no more typerefs after this change).
17083
17084 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * expression.cs (ArrayCreation.EmitArrayArguments): use
17087         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17088
17089         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17090         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17091         array indexes, the runtime actually forbids them.
17092
17093         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17094         for array arguments here.
17095
17096         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17097         instead of the default for ValueTypes.
17098
17099         (New.DoEmit): Use IsValueType instead of
17100         IsSubclassOf (value_type)
17101         (New.DoResolve): ditto.
17102         (Invocation.EmitCall): ditto.
17103
17104         * assign.cs (Assign): ditto.
17105
17106         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17107         Statements *are* currently doing part of their resolution during
17108         Emit.  
17109
17110         Expressions do always resolve during resolve, but statements are
17111         only required to propagate resolution to their children.
17112
17113 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17114
17115         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17116
17117         (LoadAssembly): Do not add the dll if it is already specified
17118
17119         (MainDriver): Add the System directory to the link path at the end,
17120         after all the other -L arguments. 
17121
17122         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17123         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17124         ldelem.u1) and using the opposite for sbytes.
17125
17126         This fixes Digger, and we can finally run it.
17127
17128         * driver.cs (UnixParseOption): Move the option parsing here.  
17129         (CSCParseOption): Implement CSC-like parsing of options.
17130
17131         We now support both modes of operation, the old Unix way, and the
17132         new CSC-like way.  This should help those who wanted to make cross
17133         platform makefiles.
17134
17135         The only thing broken is that /r:, /reference: and /lib: are not
17136         implemented, because I want to make those have the same semantics
17137         as the CSC compiler has, and kill once and for all the confussion
17138         around this.   Will be doing this tomorrow.
17139
17140         * statement.cs (Unsafe.Resolve): The state is checked during
17141         resolve, not emit, so we have to set the flags for IsUnsfe here.
17142
17143 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17144
17145         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17146         not catch the Error_ObjectRefRequired in SimpleName (as it is
17147         possible to have a class/instance variable name that later gets
17148         deambiguated), we have to check this here.      
17149
17150 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17151
17152         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17153         make static and put into Expression.
17154
17155         (Event.Define): Register the private field of the event with the 
17156         TypeManager so that GetFieldFromEvent can get at it.
17157
17158         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17159         keep track of the private field associated with an event which
17160         has no accessors.
17161
17162         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17163         private field.
17164
17165         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17166
17167 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17168
17169         * expression.cs (Binary.EmitBranchable): this routine emits the
17170         Binary expression in a branchable context.  This basically means:
17171         we need to branch somewhere, not just get the value on the stack.
17172
17173         This works together with Statement.EmitBoolExpression.
17174
17175         * statement.cs (Statement.EmitBoolExpression): Use
17176         EmitBranchable. 
17177
17178 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * statement.cs (For): Reduce the number of jumps in loops.
17181
17182         (For): Implement loop inversion for the For statement.
17183
17184         (Break): We can be breaking out of a Try/Catch controlled section
17185         (foreach might have an implicit try/catch clause), so we need to
17186         use Leave instead of Br.
17187
17188         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17189         now).  If the instace expression supports IMemoryLocation, we use
17190         the AddressOf method from the IMemoryLocation to extract the
17191         address instead of emitting the instance.
17192
17193         This showed up with `This', as we were emitting the instance
17194         always (Emit) instead of the Address of This.  Particularly
17195         interesting when This is a value type, as we dont want the Emit
17196         effect (which was to load the object).
17197
17198 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17199
17200         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17201
17202         * statement.cs (Checked): Set the CheckedState during the resolve
17203         process too, as the ConvCast operations track the checked state on
17204         the resolve process, and not emit.
17205
17206         * cs-parser.jay (namespace_member_declaration): Flag that we have
17207         found a declaration when we do.  This is used to flag error 1529
17208
17209         * driver.cs: Report ok when we display the help only.
17210
17211 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17212
17213         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17214
17215 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * cs-tokenizer.cs (define): We also have to track locally the
17218         defines.  AllDefines is just used for the Conditional Attribute,
17219         but we also need the local defines for the current source code. 
17220
17221 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * statement.cs (While, For, Do): These loops can exit through a
17224         Break statement, use this information to tell whether the
17225         statement is the last piece of code.
17226
17227         (Break): Flag that we break.
17228
17229         * codegen.cs (EmitContexts): New `Breaks' state variable.
17230
17231 2002-07-03  Martin Baulig  <martin@gnome.org>
17232
17233         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17234         modifiers in method declarations in structs.  Otherwise, you won't
17235         be able to override things like Object.Equals().
17236
17237 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17238
17239         * class.cs (Method, Property, Indexer): Do not allow the public
17240         modifier to be used in explicit interface implementations.
17241
17242         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17243         override modifiers in method declarations in structs
17244
17245 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17246
17247         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17248         integer or real overflow, report an error
17249
17250 2002-07-02  Martin Baulig  <martin@gnome.org>
17251
17252         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17253         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17254         to tell the runtime about our newly created System.Object and
17255         System.ValueType types.
17256
17257 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17258
17259         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17260         struct instead of Ldarg/Starg.
17261
17262 2002-07-02  Martin Baulig  <martin@gnome.org>
17263
17264         * expression.cs (Indirection.Indirection): Call
17265         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17266
17267 2002-07-02  Martin Baulig  <martin@gnome.org>
17268
17269         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17270         ValueType, call TypeManager.TypeToCoreType() on it.
17271         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17272         the OpCodes.Newarr argument.
17273
17274 2002-07-02  Martin Baulig  <martin@gnome.org>
17275
17276         * expression.cs (Invocation.EmitCall): When compiling corlib,
17277         replace all calls to the system's System.Array type to calls to
17278         the newly created one.
17279
17280         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17281         System.Array methods.
17282         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17283         from the system's System.Array type which must be replaced.
17284
17285 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17286
17287         * typemanager.cs: load unverifiable_code_ctor so we can build
17288         corlib using the correct type. Avoid using GetTypeCode() with
17289         TypeBuilders.
17290         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17291         TypeManager.object_type to allow building corlib.
17292
17293 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17294
17295         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17296
17297 2002-07-01  Martin Baulig  <martin@gnome.org>
17298
17299         * class.cs: Make the last change actually work, we need to check
17300         whether `ifaces != null' to avoid a crash.
17301
17302 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17303
17304         * class.cs: when we build structs without fields that implement
17305         interfaces, we need to add the interfaces separately, since there is
17306         no API to both set the size and add the interfaces at type creation
17307         time.
17308
17309 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17310
17311         * expression.cs: the dimension arguments to the array constructors
17312         need to be converted if they are a long.
17313
17314 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17315
17316         * class.cs: don't emit ldarg.0 if there is no parent constructor
17317         (fixes showstopper for corlib).
17318
17319 2002-06-29  Martin Baulig  <martin@gnome.org>
17320
17321         MCS now compiles corlib on GNU/Linux :-)
17322
17323         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17324         ie. check for MethodImplOptions.InternalCall.
17325
17326         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17327         and TypeManager.attribute_type are null, so we must explicitly check
17328         whether parent is not null to find out whether it's an attribute type.
17329         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17330         and SetBuilder, not only if the property is neither abstract nor external.
17331         This is necessary to set the MethodImplOptions on the accessor methods.
17332         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17333         SetBuilder, see Property.Emit().
17334
17335         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17336         populate "System.Object", "System.ValueType" and "System.Attribute" since
17337         they've already been populated from BootCorlib_PopulateCoreTypes().
17338
17339 2002-06-29  Martin Baulig  <martin@gnome.org>
17340
17341         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17342         is the NullLiteral, we also need to make sure that target_type is not
17343         an enum type.   
17344
17345 2002-06-29  Martin Baulig  <martin@gnome.org>
17346
17347         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17348         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17349         before calling BootstrapCorlib_ResolveDelegate ().
17350
17351 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17352
17353         * statement.cs: fixed build-breaker. All tests passed ok.
17354
17355 2002-06-27  Martin Baulig  <martin@gnome.org>
17356
17357         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17358         for System.Decimal when compiling corlib.
17359
17360 2002-06-27  Martin Baulig  <martin@gnome.org>
17361
17362         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17363         switch blocks which contain nothing but a default clause.
17364
17365 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17366
17367        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17368
17369 2002-06-27  Martin Baulig  <martin@gnome.org>
17370
17371         * ecore.cs (PropertyExpr.PropertyExpr): Call
17372         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17373
17374         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17375         is already a TypeBuilder.
17376
17377 2002-06-27  Martin Baulig  <martin@gnome.org>
17378
17379         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17380         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17381         the "from an array-type to System.Array" case.  This makes it work
17382         when compiling corlib.
17383
17384 2002-06-27  Martin Baulig  <martin@gnome.org>
17385
17386         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17387         non-static PropertyExpr, set its InstanceExpression.  This makes
17388         the `ICollection.Count' property work in System/Array.cs.
17389
17390 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17391
17392         * driver.cs: Made error handling more consistent.  Errors now
17393         tracked by Report class, so many methods which used to return int
17394         now return void.  Main() now prints success/failure and 
17395         errors/warnings message.
17396
17397         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17398         the magic number return values (123 and 124).  Now, if the
17399         expected error occurs, the compiler exits with success (exit value
17400         0).  If the compilation completes without seeing that particular
17401         error, the compiler exits with failure (exit value 1).  The
17402         makefile in mcs/errors has been changed to handle the new behaviour.
17403
17404         * report.cs: Made 'expected error' number a property and renamed
17405         it from 'Probe' to 'ExpectedError'.
17406
17407         * genericparser.cs: Removed error handling support, since it is
17408         now all done by Report class.
17409
17410         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17411         class, so parse() no longer returns an int.
17412
17413         * namespace.cs: Use Report.Error instead of GenericParser.error
17414
17415 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17416
17417         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17418         TypeContainer.AddOperator): At the front of the list put the
17419         explicit implementations, so they get resolved/defined first. 
17420
17421 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17422
17423         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17424         interface type is implemented by this TypeContainer.  Used during
17425         explicit interface implementation.
17426
17427         (Property.Define, Indexer.Define, Method.Define): Validate that
17428         the given interface in the explicit implementation is one of the
17429         base classes for the containing type.
17430
17431         Also if we are explicitly implementing an interface, but there is
17432         no match in the pending implementation table, report an error.
17433
17434         (Property.Define): Only define the property if we are
17435         not explicitly implementing a property from an interface.  Use the
17436         correct name also for those properties (the same CSC uses,
17437         although that is really not needed).
17438
17439         (Property.Emit): Do not emit attributes for explicitly implemented
17440         properties, as there is no TypeBuilder.
17441
17442         (Indexer.Emit): ditto.
17443
17444         Hiding then means that we do not really *implement* a pending
17445         implementation, which makes code fail.
17446
17447 2002-06-22  Martin Baulig  <martin@gnome.org>
17448
17449         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17450         the return value of Object.GetType().  [FIXME: we need to do this whenever
17451         we get a type back from the reflection library].
17452
17453 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17454
17455         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17456
17457 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17458
17459         * attribute.cs: Return null if we can not look up the type.
17460
17461         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17462         the interface types found.
17463
17464         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17465         interface types found.
17466
17467         * typemanager.cs (GetInterfaces): Make this routine returns alll
17468         the interfaces and work around the lame differences between
17469         System.Type and System.Reflection.Emit.TypeBuilder in the results
17470         result for GetInterfaces.
17471
17472         (ExpandInterfaces): Given an array of interface types, expand and
17473         eliminate repeated ocurrences of an interface.  This expands in
17474         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17475         be IA, IB, IC.
17476
17477 2002-06-21  Martin Baulig  <martin@gnome.org>
17478
17479         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17480         on System.Enum.
17481
17482 2002-06-21  Martin Baulig  <martin@gnome.org>
17483
17484         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17485         and called with one of the core types, return the corresponding typebuilder for
17486         that type.
17487
17488         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17489         element type.
17490
17491 2002-06-21  Martin Baulig  <martin@gnome.org>
17492
17493         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17494         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17495         (Expression.ConvertReferenceExplicit): Likewise.
17496
17497         * expression.cs (ElementAccess.DoResolve): Likewise.
17498         (ElementAccess.DoResolveLValue): Likewise.
17499
17500 2002-06-10  Martin Baulig  <martin@gnome.org>
17501
17502         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17503         add the "value" parameter to the parameter list.
17504
17505         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17506         to our caller.
17507
17508 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17509
17510         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17511         the argument to an int, uint, long or ulong, per the spec.  Also
17512         catch negative constants in array creation.
17513
17514 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17515
17516         * class.cs: do not allow the same interface to appear twice in
17517         the definition list.
17518
17519 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17520
17521         * ecore.cs: don't use ldlen with System.Array.
17522
17523 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17524
17525         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17526
17527 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17528
17529         * modifiers.cs: produce correct field attributes for protected
17530         internal. Easy fix so miguel can work on ther harder stuff:-)
17531
17532 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * pending.cs: New file.  Move the code from class.cs here.
17535         Support clearning the pending flag for all methods (when not doing
17536         explicit interface implementation).
17537
17538 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17539
17540         * rootcontext.cs: added a couple more types needed to bootstrap.
17541
17542 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17545         constructor in the type, instead of any constructor in the type
17546         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17547         a bug in the Mono runtime when applying the params attribute). 
17548
17549 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17550         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17551
17552 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17553
17554         * expression.cs (Unary.ResolveOperator): Use TypeManager
17555         to resolve the type.
17556
17557 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17558
17559         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17560         attached.
17561
17562         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17563         with each member too.
17564
17565         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17566         field builders too - this takes care of the enum member case.
17567
17568 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17569
17570         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17571         address-of operator on both value types and pointers.
17572
17573 2002-06-10  Martin Baulig  <martin@gnome.org>
17574
17575         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17576         PropertyBuilder to the `property_builders' list.
17577
17578         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17579         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17580         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17581         find any indexers which are inherited from an interface.
17582
17583 2002-06-09  Martin Baulig  <martin@gnome.org>
17584
17585         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17586         the same type as the constant if necessary.  There's also a test-130.cs
17587         for this.
17588
17589         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17590
17591         * typemanager.cs (TypeManager.ChangeType): Previously known as
17592         Enum.ChangeEnumType().
17593
17594 2002-06-09  Martin Baulig  <martin@gnome.org>
17595
17596         * expression.cs (Cast.TryReduce): Added support for consts.
17597
17598 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17599
17600         * class.cs (Accessor): Hold attributes information so we can pass
17601         it along.
17602
17603         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17604         Modify to pass in attributes attached to the methods.
17605
17606         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17607
17608         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17609         to handle the Accessor kind :-)
17610
17611         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17612
17613 2002-06-08  Martin Baulig  <martin@gnome.org>
17614
17615         * expression.cs (Unary.TryReduceNegative): Added support for
17616         ULongConstants.
17617
17618 2002-06-08  Martin Baulig  <martin@gnome.org>
17619
17620         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17621         name can't be found in the `defined_names' - the caller will do a
17622         MemberLookup in this case and thus find methods in System.Enum
17623         such as Enum.IsDefined().
17624
17625 2002-06-08  Martin Baulig  <martin@gnome.org>
17626
17627         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17628         Convert.ChangeType() which works with TypeBuilder created types.
17629         (Enum.LookupEnumValue, Enum.Define): Use it here.
17630
17631         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17632         `TypeBuilder.BaseType != null' check.
17633         (TypeContainer.FindMembers): Only lookup parent members if we
17634         actually have a parent.
17635         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17636         (ConstructorInitializer.Resolve): Likewise.
17637
17638         * interface.cs (Interface.FindMembers): Added
17639         `TypeBuilder.BaseType != null' check.
17640
17641         * rootcontext.cs (RootContext.ResolveCore): Added
17642         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17643         classes_second_stage.
17644
17645         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17646         debug_type and trace_type when compiling with --nostdlib.       
17647
17648 2002-06-07  Martin Baulig  <martin@gnome.org>
17649
17650         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17651         (AddField): Set it to true when adding a non-static field.
17652         (DefineType): Use `have_nonstatic_fields' to find out whether we
17653         have non-static fields, not `Fields != null'.
17654
17655 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17658         dereferencing a null on the static-field code path)
17659
17660 2002-05-30  Martin Baulig  <martin@gnome.org>
17661
17662         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17663         to take command line arguments.  Use reflection to call the new
17664         custom `Initialize' function on the symbol writer and pass it the
17665         command line arguments.
17666
17667         * driver.cs (--debug-args): New command line argument to pass command
17668         line arguments to the symbol writer.
17669
17670 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17671
17672         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17673         the target type for indexers and properties.  Thanks to Joe for
17674         catching this.
17675
17676 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17677
17678         * typemanager.cs (MethodFlags): returns the method flags
17679         (Obsolete/ShouldIgnore) that control warning emission and whether
17680         the invocation should be made, or ignored. 
17681
17682         * expression.cs (Invocation.Emit): Remove previous hack, we should
17683         not do this on matching a base type, we should do this based on an attribute
17684
17685         Only emit calls to System.Diagnostics.Debug and
17686         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17687         on the command line.
17688
17689         * rootcontext.cs: Global settings for tracing and debugging.
17690
17691         * cs-tokenizer.cs (define): New utility function to track
17692         defines.   Set the global settings for TRACE and DEBUG if found.
17693
17694 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17695
17696         * interface.cs (Populate*): Pass in the TypeContainer as well as
17697         the DeclSpace as parameters so that we can create EmitContexts and
17698         then use that to apply attributes etc.
17699
17700         (PopulateMethod, PopulateEvent, PopulateProperty)
17701         (PopulateIndexer): Apply attributes everywhere.
17702
17703         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17704         etc.
17705
17706         (ApplyAttributes): Update accordingly.
17707
17708         We now apply interface attributes for all members too.
17709
17710 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17711
17712         * class.cs (Indexer.Define); Correctly check if we are explicit
17713         implementation (instead of checking the Name for a ".", we
17714         directly look up if the InterfaceType was specified).
17715
17716         Delay the creation of the PropertyBuilder.
17717
17718         Only create the PropertyBuilder if we are not an explicit
17719         interface implementation.   This means that explicit interface
17720         implementation members do not participate in regular function
17721         lookups, and hence fixes another major ambiguity problem in
17722         overload resolution (that was the visible effect).
17723
17724         (DefineMethod): Return whether we are doing an interface
17725         implementation. 
17726
17727         * typemanager.cs: Temporary hack until we get attributes in
17728         interfaces (Ravi is working on that) and we get IndexerName
17729         support in interfaces.
17730
17731         * interface.cs: Register the indexers as properties.
17732
17733         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17734         warning, I have verified that this is a bug in the .NET runtime
17735         (JavaScript suffers of the same problem).
17736
17737         * typemanager.cs (MemberLookup): When looking up members for
17738         interfaces, the parent of an interface is the implicit
17739         System.Object (so we succeed in searches of Object methods in an
17740         interface method invocation.  Example:  IEnumerable x;  x.ToString
17741         ()) 
17742
17743 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * class.cs (Event): Events should also register if they do
17746         implement the methods that an interface requires.
17747
17748         * typemanager.cs (MemberLookup); use the new GetInterfaces
17749         method. 
17750
17751         (GetInterfaces): The code used to lookup interfaces for a type is
17752         used in more than one place, factor it here. 
17753
17754         * driver.cs: Track the errors at the bottom of the file, we kept
17755         on going.
17756
17757         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17758         instance if the method we are calling is static!
17759
17760 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17761
17762         * attribute.cs (ApplyAttributes): Make this function filter out
17763         the IndexerName attribute (as that attribute in reality is never
17764         applied) and return the string constant for the IndexerName
17765         attribute. 
17766
17767         * class.cs (TypeContainer.Emit): Validate that all the indexers
17768         have the same IndexerName attribute, and if so, set the
17769         DefaultName attribute on the class. 
17770
17771         * typemanager.cs: The return value might contain other stuff (not
17772         only methods).  For instance, consider a method with an "Item"
17773         property and an Item method.
17774
17775         * class.cs: If there is a problem with the parameter types,
17776         return. 
17777
17778 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17779
17780         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17781         looks at user defined conversion after making a call to 
17782         StandardConversionExists - we need this for overload resolution.
17783
17784         * expression.cs : Update accordingly the various method calls.
17785
17786         This fixes 2 bugs filed against implicit user defined conversions 
17787
17788 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * statement.cs: Track the result of the assignment.
17791
17792 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17793
17794         * expression.cs (MemberAccess): Improved error reporting for
17795         inaccessible members.
17796
17797 2002-05-22  Martin Baulig  <martin@gnome.org>
17798
17799         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17800         itself with debugging support.
17801
17802 2002-05-22  Martin Baulig  <martin@gnome.org>
17803
17804         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17805         Removed, this isn't needed anymore.
17806
17807 2002-05-20  Martin Baulig  <martin@gnome.org>
17808
17809         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17810         be underlying type for an enum.
17811
17812 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17813
17814         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17815         that splits out the loading of just the core types.
17816
17817         * rootcontext.cs (ResolveCore): Split the struct resolution in
17818         two, so we can load the enumeration underlying types before any
17819         enums are used.
17820
17821         * expression.cs (Is): Bandaid until we fix properly Switch (see
17822         bug #24985 for details).
17823
17824         * typemanager.cs (ImplementsInterface): The hashtable will contain
17825         a null if there are no interfaces implemented.
17826
17827 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * cs-parser.jay (indexer_declarator): It is fine to have array
17830         parameters
17831
17832 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * typemanager.cs: (RegisterBuilder): New function used to register
17835         TypeBuilders that implement interfaces.  Since
17836         TypeBuilder.GetInterfaces (as usual) does not work with lame
17837         Reflection.Emit. 
17838         (AddUserType): register interfaces.
17839
17840         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17841         dealing with TypeBuilder.  Also, arrays are showing up as
17842         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17843         methods can not be invoked on them!
17844
17845         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17846         (ImplicitReferenceConversionExists): Split out from
17847         StandardConversionExists. 
17848
17849         * expression.cs (As): We were only implementing one of the three
17850         cases for the as operator.  We now implement them all.
17851         (Is): Implement the various other cases for Is as well.
17852
17853         * typemanager.cs (CACHE): New define used to control if we want or
17854         not the FindMembers cache.  Seems to have a negative impact on
17855         performance currently
17856
17857         (MemberLookup): Nested types have full acess to
17858         enclosing type members
17859
17860         Remove code that coped with instance/static returns for events, we
17861         now catch this in RealFindMembers.
17862
17863         (RealFindMembers): only perform static lookup if the instance
17864         lookup did not return a type or an event.  
17865
17866 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17867
17868         * assign.cs (CompoundAssign): We pass more semantic information
17869         now to Compound Assignments than we did before: now we have all
17870         the information at hand, and now we resolve the target *before* we
17871         do the expression expansion, which allows the "CacheValue" method
17872         to have the effect we intended (before, a [x] += 1 would generate
17873         two differen ArrayAccess expressions from the ElementAccess,
17874         during the resolution process).
17875
17876         (CompoundAssign.DoResolve): Resolve target and original_source here.
17877
17878 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17879
17880         * expression.cs (ArrayAccess): dropped debugging information. 
17881
17882         * typemanager.cs: Small bug fix: I was always returning i_members,
17883         instead of one of i_members or s_members (depending on which had
17884         the content).
17885
17886         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17887         method is invoked before any code generation takes place, and it
17888         is a mechanism to inform that the expression will be invoked more
17889         than once, and that the method should use temporary values to
17890         avoid having side effects
17891
17892         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17893
17894         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17895         implementation.
17896
17897         * expression.cs (Indirection, ArrayAccess): Add support for
17898         CacheTemporaries in these two bad boys. 
17899
17900         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17901         ldobj or ldind_ref.  
17902         (StoreFromPtr): Handle stobj as well.
17903
17904         * expression.cs (UnaryMutator): Share more code.
17905
17906         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17907         down: I was not tracking the Filter function as well, which
17908         was affecting the results of the cache.
17909
17910 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * attribute.cs: Remove the hack to handle the CharSet property on
17913         StructLayouts. 
17914
17915 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17916
17917         * attribute.cs (DoResolve): More uglyness, we now only try to
17918         resolve the attribute partially, to extract the CharSet
17919         information (only if we are a StructLayout attribute).  Otherwise 
17920
17921         (GetExtraTypeInfo): Add some code to conditionally kill in the
17922         future this.   I am more and more convinced that the .NET
17923         framework has special code to handle the attribute setting on
17924         certain elements.
17925
17926         * expression.cs (IsParamsMethodApplicable): Revert my previous
17927         foreach change here, it was wrong.
17928
17929 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17930
17931         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17932         (pp_expr): do not abort on unknown input, just return.
17933         (eval): abort if there are pending chars.
17934
17935         * attribute.cs (Attribute.Resolve): Positional parameters are
17936         optional.  Deal with that case.
17937
17938         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17939         the Ansi/Unicode/Auto information for the type.
17940
17941         (TypeContainer.DefineType): instantiate the EmitContext here, as
17942         we will be using it during the type definition (to resolve
17943         attributes) and during the emit phase.
17944
17945         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17946         to pull type information out of the attributes
17947
17948         (Attribute.Resolve): track the constructor builder, and allow for
17949         multiple invocations (structs and classes will use this).
17950
17951         * ecore.cs (MemberLookupFinal): new version with all the
17952         parameters customizable.
17953
17954         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17955         constructors.  Return if the result value is null (as the error
17956         would have been flagged already by MemberLookupFinal)
17957
17958         Do not allow instances of abstract classes or interfaces to be
17959         created.
17960
17961         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17962         We have to compare the assembly property here when dealing with
17963         FamANDAssem and Assembly access modifiers, because we might be
17964         creating an assembly from *modules* (that means that we are not
17965         getting TypeBuilders for types defined in other modules that are
17966         part of this assembly).
17967
17968         (Method.Emit): If the method is marked abstract and has a body,
17969         emit an error. 
17970
17971         (TypeContainer.DefineMembers): If both the defined member and the
17972         parent name match are methods, then do not emit any warnings: let
17973         the Method.Define routine take care of flagging warnings.  But if
17974         there is a mismatch (method overrides something else, or method is
17975         overriwritten by something, then emit warning).
17976
17977         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17978         set to null, this means `do not check for the return type on the
17979         signature'. 
17980
17981         (Method.Define): set the return type for the method signature to
17982         null, so that we get methods with the same name and parameters and
17983         different return types.  This is used to flag warning 114 (you are
17984         hiding a method, and you probably want to use the new/override
17985         keywords instead).
17986
17987         * typemanager.cs (MemberLookup): Implemented proper access
17988         control, closing a long standing set of bug reports.  The problem
17989         was that the Framework only has two bits: Public and NonPublic,
17990         and NonPublic includes private and protected methods, but we need
17991         to enforce the FamANDAssem, FamOrAssem and Family. 
17992
17993 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17994
17995         * statement.cs (GotoCase): Return true: Ammounts to giving up
17996         knowledge on whether we return or not, and letting the other case
17997         be responsible for it.
17998
17999 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18000
18001         * driver.cs: Do not load directories for each file processed, only
18002         do it if there is a pattern.
18003
18004         * ecore.cs: Report readonly assigns here as well, as we might have
18005         been resolved only by MemberAccess.
18006
18007         (SimpleName.SimpleNameResolve): Also be useful for LValue
18008         resolution.   We need this to propagate assign to local readonly variables
18009
18010         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18011         do not want to reuse potential criteria memory.
18012
18013         * class.cs (MyEventBuilder): Set reflected_type;
18014
18015         * ecore.cs (Constantify): Added support for constifying bools.
18016
18017         (RootContext.LookupType): Added a cache for values looked up in
18018         the declaration space.
18019
18020         * typemanager.cs (FindMembers): Now is a front-end to
18021         RealFindMembers, and provides a two-level hashtable-based cache to
18022         the request.  
18023
18024         15% performance improvement: from 22.5 to 19.2 seconds.
18025
18026         * expression.cs (IsParamsMethodApplicable): use foreach.
18027         (Invocation.DoResolve): ditto.
18028         (New.DoResolve): ditto.
18029         (ArrayCreation.DoResolve): ditto.
18030
18031         * ecore.cs (FindMostEncompassingType): use foreach.
18032
18033         * delegate.cs (NewDelegate.DoResolve): Use foreach
18034
18035         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18036         (RemoveMethods): use foreach.
18037
18038         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18039         nested foreach statements instead of for, and also break out of
18040         the inner loop once a match is found.
18041
18042         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18043
18044 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18045
18046         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18047         we actually unwrap the expression to allow for extra information
18048         to be extracted. 
18049
18050         * expression.cs: Use Shr_Un on unsigned operations. 
18051
18052 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18053
18054         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18055         applicable operators was not being considered correctly. This closes
18056         the bug Miguel reported.
18057
18058 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18059
18060         * attribute.cs: check that the type derives from System.Attribute
18061         and report the correct error in that case (moved the duplicate code to
18062         its own method, too).
18063
18064 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18065
18066         * attribute.cs: lookup attribute type name as the spec says: first the
18067         bare attribute name and then name + "Attribute" (nant compiles with
18068         mcs after this fix).
18069
18070 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18073         Because of the way we parse things, we should try to see if a
18074         UIntConstant can fit in an integer.
18075
18076 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18077
18078         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18079         when we are in an explicit context.
18080
18081         (ConvertReferenceExplicit): When converting from Iface type S to Class
18082         T make sure the rules are implemented as an OR.
18083
18084         * parameter.cs (ParameterType): Make it a property for now although the
18085         purpose really isn't anything immediate.
18086
18087         * expression.cs (Is*Applicable): Do better checking on the parameter type
18088         of a ref/out parameter. The ones from the system assemblies are already 
18089         marked with the correct type so we don't need to do any correction.
18090
18091         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18092         the object type is standard too so include that.
18093
18094 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18095
18096         * ecore.cs (StandardConversionExists): Augment with missing code:
18097         deal with IntConstant, LongConstants and Enumerations.
18098
18099         * assign.cs: Report the error, instead of failing silently
18100
18101         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18102         typecontainer that they are declared, because the
18103         typecontainer/namespace will have the list of using clauses that
18104         need to be applied.
18105
18106         Assembly Attributes were escaping the normal registration
18107         mechanism. 
18108
18109         (EmitCode): Apply attributes within an EmitContext that represents
18110         the container they were declared on.
18111
18112         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18113
18114 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18115
18116         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18117         Revamp completely - make much cleaner as we now operate only
18118         on a set of Types.
18119
18120         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18121         to implement the logic detailed in the spec more correctly.
18122
18123         (UserDefinedConversion): Update accordingly.
18124
18125 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18126
18127         * statement.cs: Return flow analysis information up.
18128
18129         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18130         and the default.
18131
18132         (token): Do not consume an extra character before calling
18133         decimal_digits.
18134
18135 2002-05-06  Piers Haken <piersh@friskit.com>
18136
18137         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18138
18139 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18142         EmitContext during the instance constructor initializer
18143         resolution, to stop access to instance variables.
18144
18145         This is mandated by the spec, last paragraph of the `constructor
18146         initializers' section. 
18147
18148 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18149
18150         * cs-parser.jay, class.cs (Accessor): new class used to represent
18151         an accessor (get or set).  In the past we used `null' to represent
18152         a missing accessor.  But this is ambiguous because there was no
18153         way to tell in abstract indexers/properties if one of them was
18154         specified.
18155
18156         Now there is a way of addressing that.
18157
18158         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18159         instead of FindMembers.
18160
18161         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18162         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18163
18164         * attribute.cs: Treat indexers and properties as the same in terms
18165         of applying attributes
18166
18167         * ecore.cs (FindMostEncompassedType): Use statically initialized
18168         EmptyExpressions()s like we do elsewhere to avoid creating useless
18169         objects (and we take this out of the tight loop).
18170
18171         (GetConversionOperators): Move the code to extract the actual
18172         operators to a separate routine to clean things up.
18173
18174 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18175
18176         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18177         events are always registered FieldBuilders.
18178
18179         * class.cs (FieldBase): New class shared by Fields 
18180
18181         * delegate.cs: If we are a toplevel delegate, use our full name.
18182         If we are a nested delegate, then only use our tail name.
18183
18184 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18185
18186         * expression.cs (IsApplicable): Ensure that we add the "&" to
18187         ref/out types before comparing it with the type of the argument.
18188
18189         (IsParamsMethodApplicable): Ditto.
18190
18191         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18192         silly me ;-)
18193
18194         * delegate.cs : Handle the case when we have more than one applicable
18195         method. Flag an error only when we finish checking all.
18196
18197 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * expression.cs: Add support for boolean static initializers.
18200
18201 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18202
18203         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18204
18205         * parameter.cs (ComputeParameterTypes,
18206         ComputeAndDefineParameterTypes): Better error handling: now we
18207         clear the `types' cache if we fail during any of the type lookups.
18208         We also return the status code correctly to our caller
18209
18210         * delegate.cs: If we fail to define a delegate, abort the extra
18211         steps. 
18212
18213         * expression.cs (Binary.ResolveOperator): for
18214         operator==(object,object) and operator !=(object, object) we also
18215         have to verify that there is an implicit conversion from one to
18216         the other.
18217
18218         (ArrayAccess.DoResolve): Array Access can operate on
18219         non-variables. 
18220
18221 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18222
18223         * assign.cs (CompoundAssign): A new class used as a "flag" that
18224         the assignment actually is happening as part of a compound
18225         assignment operator.
18226
18227         During compound assignment, a few new rules exist to enable things
18228         like:
18229
18230         byte b |= 1 + 2
18231
18232         From the spec:
18233
18234         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18235         to the type of x) if y is implicitly convertible to the type of x,
18236         and the operator is a builtin operator and the return type of the
18237         operator is explicitly convertible to the type of x. 
18238
18239         * rootcontext.cs: Reset warning level to 2.  4 catches various
18240         "interesting" features in mcs, we must clean this up at some
18241         point, but currently am trying to kill other bugs ;-)
18242
18243         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18244         in container classes as well.  
18245
18246         * expression.cs (Binary.ResolveOperator): Handle string case
18247         before anything else (as operator overloading does emit an error
18248         before doing anything else).
18249
18250         This code could go away when we move to a table driven model, but
18251         i could not come up with a good plan last night.
18252
18253 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18254
18255         * typemanager.cs (CSharpName): reimplementation using regex.
18256         * class.cs: added null check for fields in Emit
18257         * rootcontext.cs: set warninglevel to 4
18258
18259 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18260
18261         * typemanager.cs (CSharpName): reimplemented with Lupus
18262         suggestion.
18263
18264 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * statement.cs (If): correclty implement Resolve, because we were
18267         not catching sem errors in there.  The same process is needed
18268         everywhere else. 
18269         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18270
18271
18272         (Statement.Warning_DeadCodeFound): Factorize code.
18273         (While): Report dead code here too.
18274
18275         (Statement): Added Resolve virtual method to allow
18276         for resolution split from the emit code.
18277
18278 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * statement.cs (EmitBoolExpression): No longer try to resolve the
18281         expression here.    
18282         (MakeBoolean): New utility function that resolve, implicitly
18283         converts to boolean and tags the expression. 
18284
18285
18286         (If, Do): Implement dead code elimination.
18287         (While): Implement loop inversion
18288
18289         (Do, While, For, If): Resolve the expression prior to calling our
18290         code generation.
18291
18292 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18293
18294         * class.cs:
18295           - added method Report28 (warning: program has more than one entry point)
18296           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18297           - modified method Method.Define, the part at the end of the method
18298
18299         * rootcontext.cs: added static public Location EntryPointLocation;
18300           
18301         * ../errors/cs0028.cs : Add test case for the above warning.              
18302
18303         * typemanager.cs:
18304           - modified method CSharpName to allow arrays of primitive type to
18305             be printed nicely (e.g. instead of System.Int32[][] it now prints
18306             int[][])
18307           - added method CSharpSignature: returns the signature of a method
18308             in string format to be used in reporting errors, warnings, etc.
18309
18310         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18311         with String.Empty.
18312
18313 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18314
18315         * delegate.cs (Define): Fix extremely silly bug where I was
18316         setting the type of the 'object' parameter of the BeginInvoke
18317         method to System.IAsyncResult instead of System.Object ;-)
18318
18319 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18320
18321         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18322         here. 
18323
18324         (Constructor.Emit): return if we fail to initialize the
18325         constructor.  Another door closed!  
18326
18327         * expression.cs (New.DoResolve): Improve error message (from -6 to
18328         1501).  Use DeclaredOnly lookup to find the exact constructor.
18329
18330         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18331         loop.  This is useful.
18332
18333         * cs-parser.jay: Adjust the default parameters so that destructors
18334         have the proper signature.
18335
18336 2002-04-26  Martin Baulig  <martin@gnome.org>
18337
18338         * driver.cs (LoadAssembly): If `assembly' contains any characters
18339         which are only valid in path names and not in assembly names
18340         (currently slash, backslash and point), use Assembly.LoadFrom ()
18341         instead of Assembly.Load () on the `assembly' (before iteration
18342         over the link_paths).
18343
18344 2002-04-26  Martin Baulig  <martin@gnome.org>
18345
18346         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18347
18348 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18349
18350         * class.cs (Property): use the new typemanager.MemberLookup
18351
18352         (TypeContainer.MemberLookup): Implement using the
18353         TypeManager.MemberLookup now. 
18354
18355         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18356         and return MemberInfos, so that these can be used without an
18357         EmitContext (what we had before).
18358
18359 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18360
18361         * expression.cs: Fix the case where the argument to params if the
18362         type of the params.  I omitted handling this before.   Fixed
18363
18364 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * driver.cs: Call BootCorlib_PopulateCoreType
18367
18368         * class.cs (Property.CheckBase): Check for properties only, not
18369         for all members. 
18370
18371         * interface.cs: Temporary hack: try/catch around the
18372         CustomAttributeBuilder, because I am getting an exception that I
18373         do not understand.
18374
18375         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18376         types whose definitions are required to be there (attributes are
18377         defined before standard types).
18378
18379         Compute definitions as we boot the various types, as they are used
18380         immediately (value_type class will need object_type, but if we do
18381         not initialize object_type, we will pass a null, which will let
18382         the runtime pick the System.Object from the existing corlib, which
18383         is not what we want).
18384
18385 2002-04-22  Patrik Torstensson <totte@labs2.com>
18386
18387         * cs-tokenizer.cs: fixed a number of trim() issues.
18388
18389 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18390
18391         * expression.cs (Argument.Type): Ensure that we return the correct
18392         type when we have out or ref parameters [in which case we 
18393         append a "&"].
18394
18395 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18396
18397         * class.cs (Property, Indexer): Allow extern modifier in there. 
18398
18399         * typemanager.cs (InitBaseTypes): Initializes object_type and
18400         value_type, since those will be used early on during the bootstrap
18401         process to compile corlib.
18402
18403         (InitCoreTypes): Move code from here to InitBaseTypes.
18404
18405 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18406
18407         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18408         single-dimension arrays as using the ldlen opcode.  
18409
18410         Daniel Lewis discovered this optimization.  
18411
18412         * typemanager.cs: Add signature for System.Array::get_Length
18413
18414 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18415
18416         * statement.cs: report the error when the foreach does not apply to an
18417         array nor a collection.
18418
18419 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18420
18421         * expression.cs: Add implicit conversions to the operator ~.
18422
18423         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18424
18425         * typemanager.cs: Locate the decimal constructor.
18426
18427 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18428
18429         * attribute.cs: use the new property of TypeOf.
18430         * expression.cs: added 'get' property around typearg.
18431
18432         These changes fix a build breaker reported by NickD. Is this the
18433         correct way to fix?  If not, please, revert my changes and make it
18434         work :-).
18435
18436 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * attribute.cs: Add support for typeof in attribute invocations.
18439         I am not sure that this is right though.
18440
18441 2002-04-14  Duncan Mak  <duncan@ximian.com>
18442
18443         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18444         Binary.Operator.Division case.
18445
18446 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18447
18448         * class.cs (DefineType): Ensure that we do a proper check on
18449         attribute types and also register it with the TypeManager.
18450
18451         (TypeContainer.Targets): The default for attribute types is
18452         AttributeTargets.All.
18453
18454         * attribute.cs (ApplyAttributes): Registering the attribute type
18455         is done elsewhere, not when we discover we have a Usage attribute.
18456
18457 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18458
18459         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18460         and get rid of is_delegate parameter.
18461
18462         * everywhere : update.
18463
18464 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18465
18466         * cs-parser.jay (compilation_unit): Revamp completely to use
18467         some new ideas that I got from Rhys' grammar to solve the problems
18468         with assembly level attributes.
18469
18470         (outer_declaration): New grammar production.
18471
18472         (attribute_sections): Add.
18473
18474         (opt_attributes): Base on attribute_sections
18475
18476         (namespace_declaration): Allow opt_attributes to tackle the case
18477         when we have assembly level attributes - we are clever in this
18478         regard now ;-)
18479
18480         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18481         attributes in the non-global context.
18482
18483         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18484         instead of SetGlobalAttributes.
18485
18486         * class.cs, rootcontext.cs : Ensure we define and generate 
18487         attribute types before anything else.
18488
18489         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18490         and flag the new error -20 for the case when the attribute type
18491         does not have valid targets specified. csc does not catch this.
18492
18493         * ../errors/errors.txt : update for error # -20
18494
18495 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18496
18497         * support.cs (InternalParameters.ParameterModifier): Do some null
18498         checking and return sane values.
18499
18500         * class.cs (Method.Define): If we are a PInvoke method, ensure
18501         that we are static and extern. Report error # 601
18502
18503         * ../errors/cs0601.cs : Add test case for the above error.
18504
18505 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18506
18507         * rootcontext.cs (attribute_types): We need to keep type of
18508         all attribute types separately and emit code for them first.
18509
18510         (RegisterAttribute) : Implement.
18511
18512         * class.cs (DefineType): Check if the current Type is a custom
18513         attribute type and register it accordingly.
18514
18515         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18516         adding the first attribute twice and rename to
18517
18518         (SetGlobalAttributes): this.
18519
18520         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18521         lookups.
18522
18523         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18524         if we are processing global arguments. Hmm, I am unsure of this.
18525
18526 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18527
18528         * expression.cs: added static array of strings to avoid calling
18529         Enum.ToString () for Operator in Binary. Significant recover of
18530         performance.
18531
18532 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18533
18534         * class.cs (FindMembers): Allow the Builders of the various
18535         members to be null.  If they are skip them.  This only happens
18536         during the PInvoke declaration.
18537
18538 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18541         failure, so we do not keep going afterwards.
18542
18543         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18544         wanted to pass `false' as the `is_delegate' argument.  If this is
18545         the case, why not use delegate_type == null to mean `is_delegate =
18546         false' and anything else as is_delegate = true.
18547
18548 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18549
18550         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18551         code for the section, not the beginning of the tests.
18552
18553 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18556
18557         * expression.cs (Binary): same.  Warn about errors where we have
18558         Enum/Enum in operator + as well.
18559
18560 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18561
18562         * statement.cs:
18563                 - added support for switch(bool)
18564                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18565                 - add TableSwitchEmit() to handle table-based switch statements
18566
18567 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18568
18569         * expression.cs (Invocation.OverloadResolve): Factor out code which
18570         does parameter compatibility checking with arguments so that we can 
18571         re-use the code even from Delegate.VerifyApplicability
18572
18573         (VerifyArgumentsCompat): Move above code here.
18574
18575         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18576         and instead make a call to the above method.
18577
18578 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18579
18580         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18581         We use it to keep track of classes which are attribute types.
18582
18583 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * delegate.cs (Delegate.Define): Correctly define the types in the
18586         presence of fixed and array parameters.
18587
18588         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18589         doing FindMembers.
18590
18591         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18592         include NonPublic after the first iteration.
18593
18594         * class.cs (Indexer.CheckBase): Only check if both parents are
18595         non-null. 
18596
18597         * cs-parser.jay (accessor_body): If empty, set to null.
18598
18599         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18600         same code path here to resolve constants names that we did have in
18601         MemberAccess.DoResolve.  There is too much code duplicated here.
18602
18603 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18604
18605         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18606
18607         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18608         to MakeUnionSet.
18609
18610         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18611         tokens, numbers and strings.
18612
18613         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18614         parenthesis.
18615
18616         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18617         asyncronous parameters and the regular parameters.  
18618
18619         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18620         specify the target directory.
18621
18622         * expression.cs: (This.DoResolve): Simplify
18623         (As.Emit): Optimize, do not generate IsInst if the expression is
18624         always of the given type.
18625
18626         (Is.DoResolve): Bug fix, we were reporting both always/never for
18627         the is expression.
18628
18629         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18630         creating too many unnecessary arrays.
18631
18632 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18633
18634         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18635         fields instead of rolling our own initializer.   Takes care of all
18636         implicit conversions, and drops unnecessary static checks/argument.
18637
18638 2002-03-31  Dick Porter  <dick@ximian.com>
18639
18640         * driver.cs: use the GetDirectories() return values properly, and
18641         use "/" as path separator.
18642
18643 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18644
18645         * expression.cs (Unary): Optimize - - expr into expr.
18646         (Binary): Optimize a + (-b) into a -b.
18647
18648         * codegen.cs (CodeGen): Made all methods static.
18649
18650 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18651
18652         * rootcontext.cs: 
18653
18654         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18655         TypeBuilder property.
18656
18657         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18658         instead. 
18659
18660         * tree.cs: Removed the various RecordXXXX, and replaced with a
18661         single RecordDecl.  Removed all the accessor methods, and just
18662         left a single access point Type 
18663
18664         * enum.cs: Rename DefineEnum to DefineType.
18665
18666         * decl.cs: New abstract method `DefineType' used to unify the
18667         Defines for Enumerations, Interfaces, TypeContainers and
18668         Delegates.
18669
18670         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18671         LookupBaseClasses method that used to live in class.cs and
18672         interface.cs here, and renamed to FindType.
18673
18674         * delegate.cs: Implement DefineType.  Take advantage of the
18675         refactored pattern for locating the parent builder without taking
18676         the parent_builder argument (which we know does not work if we are
18677         nested, and triggering a toplevel definition).
18678
18679 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18680
18681         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18682         accessibility of a member has changed during override and report
18683         an error if so.
18684
18685         * class.cs (Method.Define, Property.Define): Only complain on
18686         overrides if the method is private, any other accessibility is
18687         fine (and since we just checked the permission is the same, we are
18688         good to go).
18689
18690         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18691         and elif are processed always.  The other pre-processing
18692         directives are only processed if we are "taking" the path
18693
18694 2002-03-29  Martin Baulig  <martin@gnome.org>
18695
18696         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18697         current location is not Null.
18698
18699         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18700         a separate method so we can profile it.
18701
18702         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18703         `span.Seconds' are just seconds, but no minutes or hours.
18704         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18705
18706 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18707
18708         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18709         Remove the gratuitous set of Final:
18710
18711                                 // If an interface implementation, then we can set Final.
18712                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18713                                     implementing.DeclaringType.IsInterface)
18714                                         flags |= MethodAttributes.Final;
18715
18716         I do not know what I was smoking when I used that.
18717
18718
18719         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18720         step into fixing the name resolution issues for delegates and
18721         unifying the toplevel name resolution.
18722
18723 2002-03-28  Martin Baulig  <martin@gnome.org>
18724
18725         * class.cs (Method.Emit): If we have a symbol writer, call its
18726         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18727         tell it about the current method.
18728
18729         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18730         writer that we're going to emit the first byte of IL code for a new
18731         statement (a new source line).
18732         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18733         EmitContext.Mark() before emitting any code.
18734
18735         * location.cs (SymbolDocument): Return null when we're Null.
18736
18737         * statement.cs (Statement): Moved the `Location loc' variable here.
18738         (Statement.EmitBoolExpression): If we have a symbol writer, call
18739         ec.Mark() before emitting any code to tell it that we're at the
18740         beginning of a new statement.
18741         (StatementExpression): Added `Location' argument to the constructor.
18742         (Block): Added public readonly variable `StartLocation' and public
18743         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18744         (Block): Added constructor which takes a start and end location.
18745         (Block.SetEndLocation): New method. This sets the end location.
18746         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18747         local variables we create.
18748         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18749         each statement and do also mark the begin and end of the block.
18750
18751         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18752         tell it the current lexer.Location, use Location.Null for the end of the
18753         block.
18754         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18755         current block, set its end location using SetEndLocation().
18756         (statement_expression): StatementExpression constructor now takes the
18757         lexer.Location as additional argument.
18758         (for_statement, declare_local_variables): Likewise.
18759         (declare_local_variables): When creating a new implicit block, use the
18760         new Block constructor and pass it the lexer.Location.
18761
18762 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18763
18764         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18765         members also on the parent interfaces recursively.
18766
18767 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18768
18769         * report.cs: Use new formats, since Gonzalo finished the missing
18770         bits. 
18771
18772         * expression.cs (Binary.ResolveOperator): added missing operator|
18773         operator& and operator^ for bool/bool.
18774
18775         * cs-parser.jay: CheckDef now takes a Location argument that is
18776         used to report errors more precisly (instead of reporting the end
18777         of a definition, we try to track something which is a lot closer
18778         to the source of the problem).
18779
18780         * cs-tokenizer.cs: Track global token use, so we can properly flag
18781         the use of #define/#undef after the first token has been seen.
18782
18783         Also, rename the reportXXXX to Error_DescriptiveName
18784
18785         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18786         TypeContainer, so that Enum and Interface can use this too.
18787
18788         * class.cs (TypeContainer.LookupInterfaceOrClass,
18789         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18790         `builder' argument.  Typically this was used to pass the parent
18791         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18792         the definition).  
18793
18794         The problem is that a nested class could trigger the definition of
18795         a toplevel class, and the builder would be obviously wrong in that
18796         case. 
18797
18798         So we drop this argument, and we compute dynamically the
18799         TypeBuilder/ModuleBuilder (the correct information was available
18800         to us anyways from DeclSpace.Parent)
18801
18802         * interface.cs (Interface.DefineInterface): Drop builder
18803         parameter cleanup like class.cs
18804
18805         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18806         like class.cs
18807
18808         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18809         values. 
18810
18811         (Try.Emit): Propagate the returns value from the statement.
18812
18813         (Return.Emit): Even if we are leavning 
18814
18815         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18816
18817         * modifiers.cs: Fix the computation of MethodAttributes flags.
18818
18819 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18820
18821         * driver.cs: allow compilation of files that start with '/'.
18822         Add a default case when checking the argument of --target.
18823
18824 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18825
18826         * interface.cs: Implement the same search algorithm for types in
18827         the interface code.
18828
18829         * delegate.cs: Do not allow multiple definition.
18830
18831         * Recovered ChangeLog that got accidentally amputated
18832
18833         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18834
18835         * rootcontext.cs: Load manually enum to allow core classes to
18836         contain enumerations.
18837
18838         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18839         Update to new static methods in TypeManager.
18840
18841         * typemanager.cs (GetMethod, GetConstructor): Use our
18842         implementation of FindMembers to find the members, since during
18843         corlib compilation, the types are TypeBuilders and GetMethod and
18844         GetConstructor do not work.
18845
18846         Make all methods in TypeManager static.
18847
18848         (InitCodeHelpers): Split the functionality from
18849         the InitCodeTypes function.
18850
18851         * driver.cs: Call InitCodeHelpers after we have populated the
18852         types. 
18853
18854         * cs-parser.jay (delegate_declaration): we did not used to compute
18855         the delegate name correctly for void delegates.
18856
18857 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18858
18859         * rootcontext.cs (RootContext): Init the interface_resolve_order
18860         and type_container_resolve_order always.
18861
18862         (ResolveCore, BootstrapCorlib_ResolveClass,
18863         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18864         compiler when compiling with --nostdlib
18865
18866         * class.cs (TypeContainer.DefineType): Check that our parent is
18867         not null.  This test is most important when we are bootstraping
18868         the core types.
18869
18870         * codegen.cs: Split out the symbol writing code.
18871
18872 2002-03-25  Martin Baulig  <martin@gnome.org>
18873
18874         * driver.cs (-g): Made -g an alias for --debug.
18875
18876 2002-03-24  Martin Baulig  <martin@gnome.org>
18877
18878         * codegen.cs (SymbolWriter): New public variable. Returns the
18879         current symbol writer.
18880         (CodeGen): Added `bool want_debugging_support' argument to the
18881          constructor. If true, tell the ModuleBuild that we want debugging
18882         support and ask it for the ISymbolWriter.
18883         (Save): If we have a symbol writer, call it's Close() method after
18884         saving the assembly.
18885
18886         * driver.c (--debug): New command line argument to create a
18887         debugger information file.
18888
18889         * location.cs (SymbolDocument): New public property. Returns an
18890         ISymbolDocumentWriter object for the current source file or null
18891         if we don't have a symbol writer.
18892
18893 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18894
18895         * driver.cs (LoadAssembly): Correctly return when all the paths
18896         have been tried and not before.
18897
18898         * statement.cs (Switch.Emit): return the actual coverage for this
18899         statement (returns/not-returns)
18900
18901         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18902         switch of the statement if we are the last switch section.  That
18903         kills two problems: try/catch problems (we used to emit an empty
18904         nop at the end) and switch statements where all branches would
18905         return. 
18906
18907 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * driver.cs: Add default assemblies (the equivalent to the
18910         Microsoft CSC.RSP file)
18911
18912         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18913         also update tokens_seen and set it to false.
18914
18915         * driver.cs: Implement --recurse for Mike.
18916
18917         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18918         correctly splitting out the paths.
18919
18920 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18921
18922         * interface.cs (Interface.PopulateProperty): Instead of using
18923         `parent' as the declaration space for the set parameters, use
18924         `this' 
18925
18926         * support.cs (InternalParameters): InternalParameters constructor
18927         takes a DeclSpace instead of a TypeContainer.
18928
18929         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18930         types are being initialized, load the address of it before calling
18931         the function.  
18932
18933         (New): Provide a mechanism to disable the generation of local
18934         value type temporaries when the caller will be providing us with
18935         an address to store it.
18936
18937         (ArrayCreation.EmitDynamicInitializers): Use it.
18938
18939 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18940
18941         * expression.cs (Invocation.EmitArguments): Only probe for array
18942         property if there is more than one argument.  Sorry about that.
18943
18944         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18945         empty param arrays.
18946
18947         * class.cs (Method.LabelParameters): Fix incorrect code path that
18948         prevented the `ParamArrayAttribute' from being applied to the
18949         params attribute.
18950
18951 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18952
18953         * support.cs (ReflectionParameters): Correctly compute whether the
18954         last argument is a params array.  Fixes the problem with
18955         string.Split ('a')
18956
18957         * typemanager.cs: Make the assemblies array always be non-null
18958         (empty, but non-null)
18959
18960         * tree.cs (RecordDecl): New function that abstracts the recording
18961         of names.  This reports error 101, and provides a pointer to the
18962         previous declaration.  Fixes a crash in the compiler.
18963
18964         * cs-parser.jay (constructor_declaration): Update to new grammar,
18965         and provide a constructor_body that can be empty.
18966
18967 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18968
18969         * driver.cs: Add support for --resources.
18970
18971         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18972         Make all types for the various array helper methods be integer.
18973
18974         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18975         CheckState to ConvCast.
18976
18977         (ConvCast): Now it takes a `checked' state argument, to avoid
18978         depending on the emit context for the conversion, and just using
18979         the resolve time setting.
18980
18981         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18982         instead of Invocation.EmitArguments.  We do not emit the original
18983         arguments, instead we emit those which have been converted to
18984         unsigned int expressions.
18985
18986         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18987
18988         * codegen.cs: ditto.
18989
18990         * expression.cs (LocalVariableReference): Drop the use of the
18991         Store function that depended on the variable index.
18992
18993         * statement.cs (VariableInfo): Drop the `Idx' property from this
18994         class, as this is not taking into account the indexes for
18995         temporaries tat we generate during the execution, getting the
18996         indexes wrong.
18997
18998         * class.cs: First emit class initializers, then call the parent
18999         constructor. 
19000
19001         * expression.cs (Binary): Fix opcode emision.
19002         (UnaryMutator.EmitCode): Support checked code generation
19003
19004         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19005         matches for events for both the Static and Instance scans,
19006         pointing to the same element.   Fix that.
19007
19008 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * rootcontext.cs (ResolveTree): Always set the
19011         interface_resolve_order, because nested interfaces will be calling
19012         into us.
19013
19014         * class.cs (GetInterfaceOrClass): Track the same resolution
19015         process used by TypeManager.LookupType.  This fixes the nested
19016         type lookups in class declarations (separate path from
19017         LookupType). 
19018
19019         (TypeContainer.DefineType): Also define nested interfaces.
19020         (TypeContainer.RegisterOrder): New public function used to
19021         register the order in which child interfaces need to be closed.
19022
19023         Nested interfaces need to be closed after their parents have been
19024         created. 
19025
19026         * interface.cs (InterfaceAttr): Put all the logic for computing
19027         the interface attribute here. 
19028
19029         (DefineInterface): Register our interface order with the
19030         RootContext or with the TypeContainer depending on the case.
19031
19032 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19033
19034         * cs-parser.jay: rework foreach statement to work with the new
19035         changes to the policy on SimpleNames.
19036
19037         * report.cs: support Stacktrace on warnings as well.
19038
19039         * makefile: drop --unsafe and /unsafe from the compile.
19040
19041 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19042
19043         * ecore.cs (StandardConversionExists): Modify to take an Expression
19044         as the first parameter. Ensure we do null -> reference type conversion
19045         checking.
19046
19047         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19048         temporary Expression objects.
19049
19050 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19051
19052         * interface.cs: workaround bug in method overloading resolution
19053         (there is already a bugzilla bug for it).
19054
19055 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19056
19057         We could also solve this problem by having a separate path for
19058         performing type lookups, instead of DoResolve, we could have a
19059         ResolveType entry point, and only participating pieces of the
19060         production (simplename, deref, array) would implement this. 
19061
19062         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19063         signal SimpleName to only resolve type names and not attempt to
19064         resolve anything else.
19065
19066         * expression.cs (Cast): Set the flag.
19067
19068         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19069
19070         * class.cs: Only report 108 if there is no `new' modifier.
19071
19072         * cs-parser.jay: rework foreach statement to work with the new
19073         changes to the policy on SimpleNames.
19074
19075         * report.cs: support Stacktrace on warnings as well.
19076
19077         * makefile: drop --unsafe and /unsafe from the compile.
19078
19079 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19080
19081         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19082         lookups here, instead of doing that at parse time.  This means
19083         that our grammar will not introduce `LocalVariableReferences' as
19084         expressions at this point.  That solves the problem of code like
19085         this:
19086
19087         class X {
19088            static void Main ()
19089            { int X = 1;
19090             { X x = null }}}
19091
19092         This is only half the fix.  The full fix requires parameters to
19093         also be handled in this way.
19094
19095         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19096         makes the use more obvious of the DeclSpace.  The
19097         ec.TypeContainer.TypeBuilder is now only used to pull the
19098         TypeBuilder for it.
19099
19100         My theory is that I can get rid of the TypeBuilder completely from
19101         the EmitContext, and have typecasts where it is used (from
19102         DeclSpace to where it matters).  
19103
19104         The only pending problem is that the code that implements Aliases
19105         is on TypeContainer, and probably should go in DeclSpace.
19106
19107         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19108         lookups here, instead of doing that at parse time.  This means
19109         that our grammar will not introduce `LocalVariableReferences' as
19110         expressions at this point.  That solves the problem of code like
19111         this:
19112
19113         class X {
19114            static void Main ()
19115            { int X = 1;
19116             { X x = null }}}
19117
19118         This is only half the fix.  The full fix requires parameters to
19119         also be handled in this way.
19120
19121         * class.cs (Property.DefineMethod): When implementing an interface
19122         method, set newslot, when implementing an abstract method, do not
19123         set the flag (before we tried never setting it, or always setting
19124         it, which is the difference).
19125         (Indexer.DefineMethod): same.
19126         (Method.DefineMethod): same.
19127
19128         * ecore.cs: Only set the status used flag if we get back a Field.
19129
19130         * attribute.cs: Temporary hack, so Paolo can keep working.
19131
19132 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19133
19134         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19135         the unmanaged type in the case we have a MarshalAs attribute.
19136
19137         (Resolve): Handle the case when we are parsing the special MarshalAs
19138         attribute [we need to store the unmanaged type to use later]
19139
19140         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19141         MarshalAs Attribute.
19142
19143         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19144         on parameters and accordingly set the marshalling info.
19145
19146 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19147
19148         * class.cs: Optimizing slightly by removing redundant code after
19149         we switched to the `NoTypes' return value.
19150         (Property.DefineMethod): use NoTypes here too.
19151
19152         This fixes the bug I introduced in my last batch of changes.
19153
19154 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19155
19156         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19157
19158         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19159         Enums since those are types too. 
19160
19161         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19162
19163         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19164         thanks to a call during the lookup process.
19165
19166 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19167
19168         * statement.cs (Foreach): Lots of work to accomodate a particular
19169         kind of foreach statement that I had not kept in mind.  It is
19170         possible to have foreachs on classes that provide a GetEnumerator
19171         method that return objects that implement the "pattern" for using
19172         a foreach, there is no need to support GetEnumerator
19173         specifically. 
19174
19175         This is needed to compile nant.
19176
19177         * decl.cs: Only report 114 if the member is not `Finalize' and if
19178         the warning level is at least 2.
19179
19180         * class.cs: Moved the compare function from Method to
19181         MethodSignature. 
19182
19183         (MethodSignature.InheritableMemberSignatureCompare): Add new
19184         filter function that is used to extract inheritable methods from a
19185         class. 
19186
19187         (Method.Define): Use the new `inheritable_method_signature_filter'
19188         delegate
19189
19190         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19191         command. 
19192
19193 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19194
19195         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19196
19197         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19198
19199         * expression.cs: Pass location information to
19200         ConvertImplicitStandard. 
19201
19202         * class.cs: Added debugging code to track return values from
19203         interfaces. 
19204
19205 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19206
19207         * expression.cs (Is.DoResolve): If either side of the `is' is an
19208         interface, do not flag the warning.
19209
19210         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19211         for interfaces
19212
19213         * report.cs: Allow for --fatal to be used with --probe.
19214
19215         * typemanager.cs (NoTypes): Move the definition for the empty Type
19216         array here. 
19217
19218         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19219         properties. 
19220         (TypeContainer.DefineProxy): New function used to proxy to parent
19221         implementations when implementing interfaces.
19222         (TypeContainer.ParentImplements): used to lookup if our parent
19223         implements a public function that is required by an interface.
19224         (TypeContainer.VerifyPendingMethods): Hook this up.
19225
19226         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19227         `modules' and `assemblies' arraylists into arrays.  We only grow
19228         these are the very early start up of the program, so this improves
19229         the speedof LookupType (nicely measured).
19230
19231         * expression.cs (MakeByteBlob): Replaced unsafe code with
19232         BitConverter, as suggested by Paolo.
19233
19234         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19235         folding of string concatenation, but if either side is a string,
19236         and the other is not, then return null, and let the runtime use
19237         the concatenation on the string plus the object (using
19238         `Object.ToString'). 
19239
19240 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19241
19242         Constant Folding has been implemented now.
19243
19244         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19245         the error instead on types that are not supported in one's
19246         complement. 
19247
19248         * constant.cs (Constant and all children): New set of functions to
19249         perform implict and explicit conversions.
19250
19251         * ecore.cs (EnumConstant): Implement the new functions to perform
19252         conversion by proxying to the child expression.
19253
19254         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19255         own separate setting that can not be turned off from the command
19256         line using --unchecked or --checked and is only controlled using
19257         the checked/unchecked statements and expressions.  This setting is
19258         used by the constant folder to flag errors.
19259
19260         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19261         ConstantCheckState as well.   
19262
19263         During Resolve, they also have to flag the state, because the
19264         constant folder runs completely in the Resolve phase.
19265
19266         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19267         well.
19268
19269 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * cfold.cs: New file, this file contains the constant folder.
19272
19273         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19274         argument to track whether we are using the resulting address to
19275         load or store a value and provide better error messages. 
19276
19277         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19278         new AddressOf arguments.
19279
19280         * statement.cs (Foreach.EmitCollectionForeach): Update
19281
19282         * expression.cs (Argument.Emit): Call AddressOf with proper
19283         arguments to track usage.
19284
19285         (New.DoEmit): Call AddressOf with new arguments.
19286
19287         (Unary.Emit): Adjust AddressOf call.
19288
19289 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19290
19291         * cs-parser.jay (member_access): Change the case for pre-defined types
19292         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19293         this suggestion.
19294
19295         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19296         a method body.
19297
19298         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19299         essentially like methods and apply attributes like MethodImplOptions to them too.
19300
19301         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19302         not being null.
19303
19304         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19305         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19306         is the DeclSpace.
19307
19308         * Update code everywhere accordingly.
19309
19310         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19311
19312         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19313
19314 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19315
19316         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19317         try performing lookups against those instead of jumping straight into using
19318         the 'using' clauses.
19319
19320         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19321
19322         (LookupType): Perform lookups in implicit parents too.
19323
19324         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19325         sequence as RootContext.LookupType. 
19326
19327         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19328         the various cases of namespace lookups into this method.
19329
19330 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19331
19332         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19333         in positional arguments)
19334
19335         * class.cs (Operator): Update the AllowedModifiers to contain
19336         extern. 
19337
19338         * cs-parser.jay: Update operator declaration to allow for the
19339         operator body to be empty.
19340
19341         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19342         values. 
19343
19344 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * class.cs (Method.Emit): Label parameters.
19347
19348         * driver.cs: Return 1 or 0 as the program exit code.
19349
19350 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19351
19352         * expression.cs: Special case the `null' object when trying to
19353         auto-compute the type, as anything can be explicitly converted to
19354         that. 
19355
19356         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19357         spotting this Paolo.
19358
19359         (Expression.ImplicitNumericConversion): Perform comparissions of
19360         the type using the underlying type in the case of an enumeration
19361         rather than using the enumeration type for the compare.
19362
19363         Cope with the underlying == type case, which is not possible to
19364         catch before. 
19365
19366         (Expression.ConvertNumericExplicit): Perform comparissions of
19367         the type using the underlying type in the case of an enumeration
19368         rather than using the enumeration type for the compare.
19369
19370         * driver.cs: If the user does not supply an extension, assume .exe
19371
19372         * cs-parser.jay (if_statement): Rewrote so that we can track the
19373         location for the if statement.
19374
19375         * expression.cs (Binary.ConstantFold): Only concat strings when
19376         the operation is "+", not everything ;-)
19377
19378         * statement.cs (Statement.EmitBoolExpression): Take a location
19379         argument. 
19380         (If, While, Do): Track location.
19381
19382         * expression.cs (Binary.ResolveOperator): In the object + string
19383         case, I was missing a call to ConvertImplicit
19384
19385 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19386
19387         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19388         Location arguments. Ensure we use RootContext.LookupType to do our work
19389         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19390
19391         * interface.cs (PopulateMethod): Handle the type of the parameter being
19392         null gracefully.
19393
19394         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19395         have a params method with no fixed arguments and a call is made with no
19396         arguments.
19397
19398 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19401         the verbatim-string-literal
19402
19403         * support.cs (InternalParameters.ParameterModifier): handle null
19404         fixed parameters.
19405         (InternalParameters.ParameterType): ditto.
19406
19407         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19408         duplicating the name of the variable parameter.
19409         (GetParameterByName): Fix bug where we were not looking up array
19410         paramters if they were the only present (thanks Paolo!).
19411         (GetParameterInfo): We only have an empty set of types if both
19412         fixed and array are set to null.
19413         (GetParameterInfo-idx): Handle FixedParameter == null
19414
19415         * cs-parser.jay: Handle the case where there is no catch
19416         statements (missing null test).
19417
19418 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19419
19420         * driver.cs (MainDriver): Be conservative on our command line
19421         handling.
19422
19423         Catch DirectoryNotFoundException when calling GetFiles.
19424
19425         (SplitPathAndPattern): Used to split the input specification into
19426         a path and a pattern that we can feed to Directory.GetFiles.
19427
19428 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * statement.cs (Fixed): Implement the last case of the Fixed
19431         statement (string handling).
19432
19433         * expression.cs (StringPtr): New class used to return a char * to
19434         a string;  Used by the Fixed statement.
19435
19436         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19437
19438         * expression.cs (Binary.ResolveOperator): Remove redundant
19439         MemberLookup pn parent type.
19440         Optimize union call, we do not need a union if the types are the same.
19441         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19442         type.
19443
19444         Specialize the use of MemberLookup everywhere, instead of using
19445         the default settings. 
19446
19447         (StackAlloc): Implement stackalloc keyword.
19448
19449         * cs-parser.jay: Add rule to parse stackalloc.
19450
19451         * driver.cs: Handle /h, /help, /?
19452
19453         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19454         before we supported unsafe code.
19455
19456         * makefile: add --unsafe to the self compilation of mcs.
19457
19458 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19459
19460         * expression.cs (PointerArithmetic): New class that is used to
19461         perform pointer arithmetic.
19462         (Binary.Resolve): Handle pointer arithmetic
19463         Handle pointer comparission.
19464         (ArrayPtr): Utility expression class that is used to take the
19465         address of an array.
19466
19467         (ElementAccess): Implement array access for pointers
19468
19469         * statement.cs (Fixed): Implement fixed statement for arrays, we
19470         are missing one more case before we are done.
19471
19472         * expression.cs (Indirection): Implement EmitAssign and set the
19473         ExprClass to Variable.  This allows pointer dereferences to be
19474         treated as variables, and to have values assigned to them.
19475
19476         * ecore.cs (Expression.StoreFromPtr): New utility function to
19477         store values dereferencing.
19478
19479 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19480
19481         * expression.cs (Binary.ResolveOperator): Ensure that we are
19482         not trying to operate on a void type - this fixes the reported
19483         bug.
19484
19485         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19486         the parent implementation is sealed.
19487
19488         * ../errors/cs0239.cs : Add.
19489
19490         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19491
19492         * typemanager.cs (unverifiable_code_type): Corresponds to 
19493         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19494         which have unsafe code in them.
19495
19496         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19497         unsafe context.
19498
19499 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19500
19501         * cs-tokenizer.cs: Add support for @"litreal strings"
19502
19503         Make tokenizer accept pre-processor directives
19504         on any column (remove the old C-like limitation). 
19505
19506         * rootcontext.cs (EmitCode): Emit any global attributes.
19507         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19508
19509         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19510
19511         * cs-parser.jay: Add support for global attributes.  
19512
19513 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19514
19515         * expression.cs (Indirection): New helper class.  Unary will
19516         create Indirection classes to be able to implement the
19517         IMemoryLocation interface on it.
19518
19519 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19520
19521         * cs-parser.jay (fixed_statement): reference the right statement.
19522
19523         * statement.cs (Fixed.Emit): Finish implementing the fixed
19524         statement for the &x case.
19525
19526 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19527
19528         * class.cs (Property.Define, Method.Define): Remove newslot when
19529         `implementing'.  
19530
19531         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19532         wrong.  NewSlot should only be used if the `new' keyword is present.
19533
19534         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19535         locating our system dir.  Sorry about this.
19536
19537 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * driver.cs (GetSystemDir): Compute correctly the location of our
19540         system assemblies.  I was using the compiler directory instead of
19541         the library directory.
19542
19543 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19544
19545         * expression.cs (BetterFunction): Put back in what Miguel commented out
19546         since it is the correct fix. The problem is elsewhere ;-)
19547
19548         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19549         parameters of the parms method are themselves compatible or not !
19550
19551         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19552         to check that a class implements an interface before saying that an implicit
19553         conversion was allowed. Use ImplementsInterface to do the checking.
19554
19555 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19556
19557         * class.cs (Method.Define): Track whether we are an explicit
19558         implementation or not.  And only call DefineMethodOverride if we
19559         are an explicit implementation.
19560
19561         (Property.DefineMethod): Ditto.
19562
19563 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19564
19565         * expression.cs (BetterFunction): Catch hideous bug which was
19566          preventing us from detecting ambiguous calls due to implicit casts i.e
19567         cs0121.
19568
19569 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19570
19571         * support.cs (Pair): Remove un-needed method.  I figured why I was
19572         getting the error in cs-parser.jay, the variable in a foreach loop
19573         is readonly, and the compiler does not really treat this as a variable.
19574
19575         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19576         instead of EQUALS in grammar.  
19577
19578         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19579
19580         * expression.cs (Unary.DoResolve): Check whether the argument is
19581         managed or not.
19582
19583 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * support.cs: Api for Pair to set a value.  Despite the fact that
19586         the variables are public the MS C# compiler refuses to compile
19587         code that accesses the field if the variable is part of a foreach
19588         statement. 
19589
19590         * statement.cs (Fixed): Begin implementation of the fixed
19591         statement.
19592
19593         (Block.AddVariable): Return the VariableInfo on success and null
19594         on failure instead of true/false. 
19595
19596         * cs-parser.jay (foreach): Catch errors on variables already
19597         defined (we were ignoring this value before) and properly unwind
19598         the block hierarchy
19599
19600         (fixed_statement): grammar for the fixed statement.
19601
19602 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19603
19604         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19605         pointer types to be incretemented.
19606
19607         (SizeOf): Implement.
19608
19609         * cs-parser.jay (pointer_member_access): Implement
19610         expr->IDENTIFIER production.
19611
19612         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19613         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19614         on safe contexts.
19615
19616         (Unary): Implement indirection.
19617
19618         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19619         use in non-unsafe context).
19620
19621         (SimpleName.DoResolve): Check for pointers in field access on safe
19622         contexts. 
19623
19624         (Expression.LoadFromPtr): Factor the load-indirect code in this
19625         function.  This was duplicated in UnboxCast and ParameterReference
19626
19627 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * expression.cs (ComposedCast): report an error if a pointer cast
19630         is used in a safe region.
19631
19632         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19633         pointer type casts in unsafe context.
19634
19635         * codegen.cs (EmitContext): Set up IsUnsafe.
19636
19637         * cs-parser.jay (non_expression_type): Add productions for pointer
19638         casts. 
19639
19640         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19641         code.  We should not use force into static mode if the method is
19642         not virtual.  Fixes bug in MIS
19643
19644         * statement.cs (Do.Emit, While.Emit, For.Emit,
19645         Statement.EmitBoolExpression): Add support to Do and While to
19646         propagate infinite loop as `I do return' semantics.
19647
19648         Improve the For case to also test for boolean constants.
19649
19650         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19651         to the list of attributes we can add.
19652
19653         Remove `EmitContext' argument.
19654
19655         * class.cs (Method.Define): Apply parameter attributes.
19656         (Constructor.Define): Apply parameter attributes.
19657         (MethodCore.LabelParameters): Move here the core of labeling
19658         parameters. 
19659
19660         * support.cs (ReflectionParameters.ParameterModifier,
19661         InternalParameters.ParameterModifier): Use IsByRef on the type and
19662         only return the OUT bit for these parameters instead of in/out/ref
19663         flags.
19664
19665         This is because I miss-understood things.  The ParameterInfo.IsIn
19666         and IsOut represent whether the parameter has the [In] and [Out]
19667         attributes set.  
19668
19669 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19670
19671         * ecore.cs (FieldExpr.Emit): Release temporaries.
19672
19673         * assign.cs (LocalTemporary.Release): new function.
19674
19675         * codegen.cs (EmitContext.GetTemporaryStorage,
19676         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19677         temporary storage.  Now we can "put back" localbuilders when we
19678         are done with them
19679
19680 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19683         need to make a copy of the variable to generate verifiable code.
19684
19685 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * driver.cs: Compute dynamically the system directory.
19688
19689         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19690         Slower, but more generally useful.  Used by the abstract
19691         registering implementation. 
19692
19693         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19694         the rules for the special rule on Type/instances.  First check if
19695         we have the same name, and if so, try that special static path
19696         rather than the instance path.
19697
19698 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19699
19700         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19701         for, while and if.
19702
19703         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19704         Enum, ValueType, Delegate or Array for non-corlib compiles.
19705
19706         * cs-tokenizer.cs: Catch long identifiers (645)
19707
19708         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19709         piece of code.
19710
19711         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19712         fix, we were returning too early, so we were not registering
19713         pending methods from abstract classes.
19714
19715         Do not register pending methods if the class is abstract.
19716
19717         * expression.cs (Conditional.DoResolve): Report circular implicit
19718         conversions when we neecd to compute it for conditional
19719         expressions. 
19720
19721         (Is.DoResolve): If the expression is always of the provided type,
19722         flag warning 183.  If the expression can not ever be of the
19723         provided type flag warning 184.
19724
19725         * class.cs: Catch 169 as well.
19726
19727         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19728         read. 
19729
19730 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19731
19732         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19733
19734 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19735
19736         * interface.cs: (PopulateMethod): Check for pointers being defined
19737         only if the unsafe context is active.
19738         (PopulateProperty): ditto.
19739         (PopulateIndexer): ditto.
19740
19741         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19742         specified.  If pointers are present, make sure that they are
19743         present in an unsafe context.
19744         (Constructor, Constructor.Define): ditto.
19745         (Field, Field.Define): ditto.
19746         (Property, Property.Define): ditto.
19747         (Event, Event.Define): ditto.
19748
19749         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19750         hashtable if there are classes or structs defined.
19751
19752         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19753         code, as the constant resolution moved.
19754
19755         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19756         the metadata, so we can flag error 133. 
19757
19758         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19759         pointer is being declared in an unsafe context.
19760
19761 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19762
19763         * modifiers.cs (Modifiers.Check): Require a Location argument.
19764         Report error 227 for Unsafe use.
19765
19766         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19767
19768         * statement.cs (For.Emit): If the test is null, then report that
19769         we do `return', as we wont reach anything afterwards.
19770
19771         (Switch.SwitchGoverningType): Track the expression that matched
19772         the conversion.
19773
19774         * driver.cs: Allow negative numbers as an error code to flag.
19775
19776         * cs-parser.jay: Handle 1551.
19777
19778         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19779
19780 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * cs-parser.jay: Report 1518 (type declaration can only contain
19783         class, struct, interface, enum or delegate)
19784
19785         (switch_label): Report 1523 (keywords `case' or `default' must
19786         preced code)
19787
19788         (opt_switch_sections): Report 1522 (empty switch)
19789
19790         * driver.cs: Report 1515 (response file specified multiple times)
19791         Report 1516 (Source file specified multiple times).
19792
19793         * expression.cs (Argument.Resolve): Signal 1510
19794
19795         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19796         access not allowed in static code)
19797
19798 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19799
19800         * typemanager.cs (IsPointerType): Utility method which we are going
19801         to need a lot.
19802
19803         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19804         the object type, so we take care of that.
19805
19806         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19807
19808         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19809         added to non-params parameters :-)
19810
19811         * typemanager.cs (CSharpName): Include 'void' type too. 
19812
19813         (void_ptr_type): Include in the set of core types.
19814
19815         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19816         duplicating code.
19817
19818         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19819         an unsafe context.
19820
19821         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19822         completely forgotten about it.
19823
19824 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19825
19826         * cs-parser.jay (pointer_type): Add. This begins our implementation
19827         of parsing rules for unsafe code.
19828
19829         (unsafe_statement): Implement.
19830
19831         (embedded_statement): Modify to include the above.
19832
19833         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19834
19835         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19836         if the current context is an unsafe one.
19837
19838         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19839         are handled differently, we need separate rules for them.
19840
19841         (local_variable_declaration): Update to use local_variable_pointer_type
19842         to allow variable declarations of unmanaged pointer types.
19843
19844         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19845         in unsafe contexts.
19846
19847         * ../errors/cs0214.cs : Add.
19848
19849 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19850
19851         * makefile: remove 'response' file when cleaning.
19852
19853 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * cs-parser.jay: Report 1524.
19856
19857 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19858
19859         * typemanager.cs (RegisterMethod): drop checking if we have
19860         registered this from here
19861
19862 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19863
19864         * class.cs (Method.EmitDestructor): Implement calling our base
19865         destructor. 
19866
19867         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19868         value of InFinally.
19869
19870         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19871         this routine and will wrap the call in a try/catch block.  Deal
19872         with the case.
19873
19874 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * ecore.cs (Expression.MemberLookup): instead of taking a
19877         parameter `same_type' that was used to tell whether we could
19878         access private members we compute our containing type from the
19879         EmitContext.
19880
19881         (FieldExpr): Added partial support for volatile fields.  This does
19882         not work for volatile fields exposed from assemblies, as I can not
19883         figure out how to extract the modreq from it.
19884
19885         Updated all the source files to use this.
19886
19887         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19888         because it is referenced by MemberLookup very often. 
19889
19890 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19891
19892         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19893         TypeBuilder.GetCustomAttributes to retrieve what we need.
19894
19895         Get rid of redundant default_member_attr_type as this is the same as
19896         default_member_type which already exists.
19897
19898         * interface.cs, attribute.cs : Update accordingly.
19899
19900 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19903         work for TYpeBuilders though.  Ravi, can you please fix this?
19904
19905         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19906
19907         * expression.cs (Argument.Emit): Handle the case of ref objects
19908         being passed to ref functions;  
19909
19910         (ParameterReference.EmitLoad): Loads the content of the pointer
19911         without dereferencing.
19912
19913 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19916
19917 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19918
19919         * class.cs (Indexer.DefineMethod): Incorporate the interface
19920         type in the name of the method if we are doing explicit interface
19921         implementation.
19922
19923         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19924
19925         (BetterConversion): Fix extremely trivial bug where we were referring to
19926         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19927         again !
19928
19929         * ../errors/bug16.cs : Add although we have fixed it.
19930
19931 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * expression.cs (BaseIndexer): Begin implementation.
19934
19935         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19936
19937         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19938         production directly to remove a shift/reduce, and implement
19939         explicit interface implementation.
19940
19941         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19942         after a floating point suffix.
19943
19944         * expression.cs (DoNumericPromotions): Improved the conversion for
19945         uint/uint.  If we have a constant, we avoid doing a typecast to a
19946         larger type.
19947
19948         * class.cs (Indexer): Implement explicit interface implementation
19949         for indexers.
19950
19951 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19952
19953         * class.cs: make the default instance constructor public and hidebysig.
19954
19955 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19956
19957         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19958         so we can call it from elsewhere.
19959
19960         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19961         we emit it internally if the class has a defined indexer; otherwise the user
19962         emits it by decorating the class definition with the DefaultMemberAttribute.
19963
19964         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19965         attribute is not used on a type which defines an indexer.
19966
19967         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19968         character when we skip whitespace.
19969
19970         * ../errors/cs0646.cs : Add.
19971
19972 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19973
19974         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19975         again. 
19976
19977         * makefile: Add practical target `mcs3.exe' which builds the third
19978         generation compiler. 
19979
19980         * expression.cs (New): Fix structures constructor calling.
19981
19982         * class.cs (Property, Method, Indexer): Emit Final flag on the
19983         method if we are an interface implementation and we are not
19984         abstract. 
19985
19986         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19987         whether this property is referencing a `base' method.
19988
19989         * expression.cs (Invocation.EmitCall): take an extra argument:
19990         is_base, this is used to determine whether the `call' or
19991         `callvirt' opcode should be used.
19992
19993
19994         * delegate.cs: update EmitCall.
19995
19996         * class.cs (Method.Define): Set NewSlot for the cases where we are
19997         not implementing an interface method.
19998
19999         (Property.Define): ditto.
20000
20001 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20004         'r'.  Allows mcs to parse itself fully.
20005
20006 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20007
20008         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20009         of the number of initializers that require the InitializeArray method.
20010
20011         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20012         update the above field where necessary.
20013
20014         (MakeByteBlob): Update accordingly.
20015
20016         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20017         greater than 2.
20018
20019         (EmitDynamicInitializers): Update in accordance with the new optimization.
20020
20021         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20022         same OpCode applies.
20023
20024         * cs-parser.jay : Fix some glaring errors I introduced.
20025
20026 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20027
20028         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20029         so that we can check for name clashes there too.
20030
20031         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20032         for interface indexers.
20033
20034         * interfaces.cs (Define): Emit the default member attribute.
20035
20036         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20037         variable was being referred to while setting the value ;-)
20038
20039 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20040
20041         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20042         byte-by-byte information when we know the data is zero.
20043
20044         Make the block always a multiple of 4, because
20045         DefineInitializedData has a bug.
20046
20047         * assign.cs: Fix, we should assign from the temporary, not from
20048         the source. 
20049
20050         * expression.cs (MakeByteBlob): Fix my incorrect code.
20051
20052 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * typemanager.cs (EnumToUnderlying): This function is used to get
20055         the underlying type from an enumeration, because it does not
20056         always work. 
20057
20058         * constant.cs: Use the I4_S form for values between -128 and 127.
20059
20060         * statement.cs (Block.LookupLabel): Looks up a label.
20061         (Block): Drop support for labeled blocks.
20062
20063         (LabeledStatement): New kind of statement that represents a label
20064         only.
20065
20066         (Goto): Finally implement this bad boy.
20067
20068         * cs-parser.jay: Update to reflect new mechanism to implement
20069         labels.
20070
20071 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * codegen.cs (EmitContext.This): a codegen property that keeps the
20074         a single instance of this instead of creating many different this
20075         instances. 
20076
20077         * delegate.cs (Delegate.DoResolve): Update to use the property;
20078
20079         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20080
20081         * expression.cs (BaseAccess.DoResolve): Ditto.
20082
20083 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20084
20085         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20086         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20087
20088         (InitCoreTypes): Update accordingly.
20089
20090         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20091         so we can quickly store the state.
20092
20093         (ApplyAttributes): Set the correct implementation flags
20094         for InternalCall methods.
20095
20096 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20097
20098         * expression.cs (EmitCall): if a method is not virtual, then do
20099         not use callvirt on it.
20100
20101         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20102         user defined stuff) requires the use of stobj, which takes an
20103         address on the stack instead of an array and an index.  So emit
20104         the Ldelema operation for it.
20105
20106         (EmitStoreOpcode): Use stobj for valuetypes.
20107
20108         (UnaryMutator.EmitCode): Use the right 1 value depending on
20109         whether we are dealing with int64/uint64, float or doubles.
20110
20111         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20112         constructors that I implemented last night.
20113
20114         (Constructor.IsDefault): Fix to work properly for static
20115         constructors.
20116
20117         * cs-parser.jay (CheckDef): report method signature errors.
20118         Update error number 103 to be 132.
20119
20120         * decl.cs: New AdditionResult enumeration value: MethodExists.
20121         Although we do this check for methods later on in the semantic
20122         analysis, catching repeated default constructors is so easy that
20123         we catch these here. 
20124
20125         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20126         promotions code.
20127
20128         (ParameterReference.EmitAssign, Emit): handle
20129         bools as bytes.
20130
20131         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20132         (ArrayAccess.EmitStoreOpcode): ditto.
20133
20134         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20135
20136         * expression.cs (MakeByteBlob): Complete all the missing types
20137         (uint, short, ushort, byte, sbyte)
20138
20139         * class.cs: Only init instance field initializers on instance
20140         constructors. 
20141
20142         Rename `constructors' to instance_constructors. 
20143
20144         (TypeContainer.AddConstructor): Only add constructors to the list
20145         if it is not static.
20146
20147         Make sure that we handle default_static_constructor independently
20148         everywhere where we handle instance_constructors
20149
20150 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20151
20152         * class.cs: Do not lookup or create a base initializer for a
20153         static constructor.
20154
20155         (ConstructorInitializer.Resolve): use the proper type to lookup
20156         for constructors.
20157
20158         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20159
20160         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20161         in DeclSpace. 
20162
20163         * decl.cs: CloseType is now an virtual method, the default
20164         implementation just closes this type.
20165
20166 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20167
20168         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20169         to PreserveSig by default. Also emit HideBySig on such methods.
20170
20171         Basically, set the defaults to standard values.
20172
20173         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20174         argument, if candidate is better, it can't be worse than the best !
20175
20176         (Invocation): Re-write bits to differentiate between methods being
20177         applicable in their expanded form and their normal form - for params
20178         methods of course.
20179
20180         Get rid of use_standard everywhere as only standard conversions are allowed
20181         in overload resolution. 
20182
20183         More spec conformance.
20184
20185 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * driver.cs: Add --timestamp, to see where the compiler spends
20188         most of its time.
20189
20190         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20191         `this' in static code.
20192
20193         (SimpleName.DoResolve): Implement in terms of a helper function
20194         that allows static-references to be passed upstream to
20195         MemberAccess.
20196
20197         (Expression.ResolveWithSimpleName): Resolve specially simple
20198         names when called by MemberAccess to implement the special
20199         semantics. 
20200
20201         (Expression.ImplicitReferenceConversion): Handle conversions from
20202         Null to reference types before others, as Null's type is
20203         System.Object. 
20204
20205         * expression.cs (Invocation.EmitCall): Handle the special case of
20206         calling methods declared on a reference type from a ValueType
20207         (Base classes System.Object and System.Enum)
20208
20209         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20210         the left hand side is a TypeExpr, not on every enumeration. 
20211
20212         (Binary.Resolve): If types are reference types, then do a cast to
20213         object on operators != and == of both arguments.
20214
20215         * typemanager.cs (FindMembers): Extract instance and static
20216         members if requested.
20217
20218         * interface.cs (PopulateProperty): Use void_type instead of null
20219         as the return type for the setter method.
20220
20221         (PopulateIndexer): ditto.
20222
20223 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20224
20225         * support.cs (ReflectionParameters): Fix minor bug where we
20226         were examining the wrong parameter for the ParamArray attribute.
20227
20228         Cope with requests for the type of the parameter at position
20229         greater than the params parameter's. We now return the element
20230         type of the params array as that makes more sense.
20231
20232         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20233         accordingly as we no longer have to extract the element type
20234         ourselves.
20235
20236         (Invocation.OverloadResolve): Update.
20237
20238 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20239
20240         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20241         against IEnumerator, test whether the return value is a descendant
20242         of the IEnumerator interface.
20243
20244         * class.cs (Indexer.Define): Use an auxiliary method to implement
20245         the other bits of the method definition.  Begin support for
20246         explicit interface implementation.
20247
20248         (Property.DefineMethod): Use TypeManager.void_type instead of null
20249         for an empty return value.
20250
20251 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20252
20253         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20254         dealing with a FieldExpr which is composed of a FieldBuilder, in
20255         the code path we did extract the constant, but we should have
20256         obtained the underlying value to be able to cast it (otherwise we
20257         end up in an infinite loop, this is what Ravi was running into).
20258
20259         (ArrayCreation.UpdateIndices): Arrays might be empty.
20260
20261         (MemberAccess.ResolveMemberAccess): Add support for section
20262         14.5.4.1 that deals with the special case of E.I when E is a type
20263         and something else, that I can be a reference to a static member.
20264
20265         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20266         handle a particular array type to create byte blobs, it is just
20267         something we dont generate byteblobs for.
20268
20269         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20270         arguments. 
20271
20272         * location.cs (Push): remove the key from the hashtable that we
20273         are about to add.   This happens for empty files.
20274
20275         * driver.cs: Dispose files after we have parsed them.
20276
20277         (tokenize): new function that only runs the tokenizer on its
20278         input, for speed testing.
20279
20280 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20281
20282         * class.cs (Event.Define): Define the private field only if there
20283         are no accessors defined.
20284
20285         * expression.cs (ResolveMemberAccess): If there is no associated
20286         field with the event, that means we have an event defined with its
20287         own accessors and we should flag error cs0070 since transforming
20288         ourselves into a field is not valid in that case.
20289
20290         * ecore.cs (SimpleName.DoResolve): Same as above.
20291
20292         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20293         and charset to sane values.
20294
20295 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20296
20297         * assign.cs (DoResolve): Perform check on events only if they 
20298         are being accessed outside the declaring type.
20299
20300         * cs-parser.jay (event_declarations): Update rules to correctly
20301         set the type of the implicit parameter etc.
20302
20303         (add_accessor, remove_accessor): Set current local parameters.
20304
20305         * expression.cs (Binary): For delegate addition and subtraction,
20306         cast the return value from the method into the appropriate delegate
20307         type.
20308
20309 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20310
20311         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20312         of these as the workaround is unnecessary.
20313
20314         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20315         delegate data - none of that is needed at all.
20316
20317         Re-write bits to extract the instance expression and the delegate method
20318         correctly.
20319
20320         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20321         on delegates too.
20322
20323         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20324         of attaching attributes instead of duplicating code everywhere.
20325
20326         * everywhere : Update code to do attribute emission using the above method.
20327
20328 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20329
20330         * expression.cs (IsParamsMethodApplicable): if there are not
20331         parameters, return immediately.
20332
20333         * ecore.cs: The 0 literal can be implicity converted to an enum
20334         type. 
20335
20336         (SimpleName.DoResolve): First lookup the type, then lookup the
20337         members. 
20338
20339         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20340         want to get its address.  If the InstanceExpression is not
20341         addressable, store the result in a temporary variable, then get
20342         the address of it.
20343
20344         * codegen.cs: Only display 219 errors on warning level or above. 
20345
20346         * expression.cs (ArrayAccess): Make it implement the
20347         IMemoryLocation interface.
20348
20349         (Binary.DoResolve): handle the operator == (object a, object b)
20350         and operator != (object a, object b) without incurring into a
20351         BoxedCast (because 5 != o should never be performed).
20352
20353         Handle binary enumerator operators.
20354
20355         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20356         value type, otherwise use Ldelem_ref.
20357
20358         Use precomputed names;
20359
20360         (AddressOf): Implement address of
20361
20362         * cs-parser.jay (labeled_statement): Fix recursive block
20363         addition by reworking the production.
20364
20365         * expression.cs (New.DoEmit): New has a special case:
20366                 
20367                  If we are dealing with a ValueType, we have a few
20368                  situations to deal with:
20369                 
20370                     * The target of New is a ValueType variable, that is
20371                       easy, we just pass this as the variable reference
20372                 
20373                     * The target of New is being passed as an argument,
20374                       to a boxing operation or a function that takes a
20375                       ValueType.
20376                 
20377                       In this case, we need to create a temporary variable
20378                       that is the argument of New.
20379
20380
20381 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20382
20383         * rootcontext.cs (LookupType): Check that current_type is not null before
20384         going about looking at nested types.
20385
20386         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20387         not implement the IAssignMethod interface any more.
20388
20389         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20390         where we tranform them into FieldExprs if they are being resolved from within
20391         the declaring type.
20392
20393         * ecore.cs (SimpleName.DoResolve): Do the same here.
20394
20395         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20396
20397         * ../errors/bug10.cs : Add.
20398
20399         * ../errors/cs0070.cs : Add.
20400
20401         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20402
20403         * assign.cs : Get rid of EventIsLocal everywhere.
20404
20405 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20406
20407         * ecore.cs (ConvertIntLiteral): finished the implementation.
20408
20409         * statement.cs (SwitchLabel): Convert the value we are using as a
20410         key before looking up the table.
20411
20412 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20413
20414         * codegen.cs (EmitTopBlock): Require a Location argument now.
20415
20416         * cs-parser.jay (constructor_declarator): We need to setup
20417         current_local_parameters before we parse the
20418         opt_constructor_initializer, to allow the variables to be bound
20419         to the constructor arguments.
20420
20421         * rootcontext.cs (LookupType): First lookup nested classes in our
20422         class and our parents before we go looking outside our class.
20423
20424         * expression.cs (ConstantFold): Extract/debox the values at the
20425         beginnning. 
20426
20427         * rootcontext.cs (EmitCode): Resolve the constants first before we
20428         resolve the types.  This is not really needed, but it helps debugging.
20429
20430         * statement.cs: report location.
20431
20432         * cs-parser.jay: pass location to throw statement.
20433
20434         * driver.cs: Small bug fix.
20435
20436         * report.cs: Updated format to be 4-zero filled digits.
20437
20438 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20439
20440         * expression.cs (CheckIndices): Fix minor bug where the wrong
20441         variable was being referred to ;-)
20442
20443         (DoEmit): Do not call EmitStaticInitializers when the 
20444         underlying type is System.Object.
20445
20446 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20447
20448         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20449         and do the usual workaround for SRE.
20450
20451         * class.cs (MyEventBuilder.EventType): New member to get at the type
20452         of the event, quickly.
20453
20454         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20455
20456         * assign.cs (Assign.DoResolve): Handle the case when the target
20457         is an EventExpr and perform the necessary checks.
20458
20459         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20460         interface.
20461
20462         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20463
20464         (EventExpr): Set the type in the constructor itself since we 
20465         are meant to be born fully resolved.
20466
20467         (EventExpr.Define): Revert code I wrote earlier.
20468                 
20469         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20470         instance expression is null. The instance expression is a This in that case
20471         or a null, depending on whether it is a static method or not.
20472
20473         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20474         refers to more than one method.
20475
20476         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20477         and accordingly flag errors.
20478
20479 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20480
20481         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20482
20483 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * location.cs (ToString): Provide useful rutine.
20486
20487 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20488
20489         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20490         objects, return the actual integral boxed.
20491
20492         * statement.cs (SwitchLabel): define an ILLabel for each
20493         SwitchLabel. 
20494
20495         (Switch.CheckSwitch): If the value is a Literal, extract
20496         the underlying literal.
20497
20498         Also in the unused hashtable we had, add the SwitchLabel so we can
20499         quickly look this value up.
20500
20501         * constant.cs: Implement a bunch of new constants.  Rewrite
20502         Literal based on this.  Made changes everywhere to adapt to this.
20503
20504         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20505         dereferencing array only once, and also copes with enumrations.
20506
20507         bytes are two bytes wide, not one.
20508
20509         (Cast): Perform constant conversions.
20510
20511         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20512         wrappers to the literals here.
20513
20514         * expression.cs (DoNumericPromotions): long literals can converted
20515         to ulong implicity (this is taken care of elsewhere, but I was
20516         missing this spot).
20517
20518         * ecore.cs (Expression.Literalize): Make the return type Literal,
20519         to improve type checking.
20520
20521         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20522
20523 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20524
20525         * literal.cs: Revert code from ravi that checked the bounds.  The
20526         bounds are sane by the definition of the type itself. 
20527
20528         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20529         need to actually look up in our parent hierarchy for interfaces
20530         implemented. 
20531
20532         * const.cs: Use the underlying type for enumerations
20533
20534         * delegate.cs: Compute the basename for the delegate creation,
20535         that should fix the delegate test case, and restore the correct
20536         Type Lookup semantics in rootcontext
20537
20538         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20539         referencing a nested type with the Reflection API is using the "+"
20540         sign. 
20541
20542         * cs-parser.jay: Do not require EOF token at the end.
20543
20544 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20545
20546         * rootcontext.cs (LookupType): Concatenate type names with
20547         a '.' instead of a '+' The test suite passes again.
20548
20549         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20550         field of the enumeration.
20551
20552         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20553         the case when the member is an EventExpr.
20554
20555         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20556         static has an associated instance expression.
20557
20558         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20559
20560         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20561
20562         * class.cs (Event.Define): Register event and perform appropriate checks
20563         for error #111.
20564
20565         We define the Add and Remove methods even if the use provides none because
20566         in that case, we provide default implementations ourselves.
20567
20568         Define a private field of the type of the event. This is done by the CSC compiler
20569         and we should be doing it too ;-)
20570
20571         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20572         More methods we use in code we generate.
20573
20574         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20575         is important.
20576
20577         (InitCoreTypes): Update accordingly for the above.
20578
20579         * class.cs (Event.Emit): Generate code for default accessors that we provide
20580
20581         (EmitDefaultMethod): Do the job in the above.
20582
20583         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20584         appropriate place.
20585
20586 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20589         builders even if we were missing one.
20590
20591         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20592         pass the Basename as our class name instead of the Name.  The
20593         basename will be correctly composed for us.
20594
20595         * parameter.cs (Paramters): Now takes a Location argument.
20596
20597         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20598         make all the code call directly LookupType in RootContext and take
20599         this chance to pass the Location information everywhere.
20600
20601         * Everywhere: pass Location information.
20602
20603 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * class.cs (Constructor.Define): Updated way of detecting the
20606         length of the parameters.
20607
20608         (TypeContainer.DefineType): Use basename as the type name for
20609         nested types.
20610
20611         (TypeContainer.Define): Do not recursively define types here, as
20612         definition is taken care in order by the RootContext.
20613
20614         * tree.cs: Keep track of namespaces in a per-file basis.
20615
20616         * parameter.cs (Parameter.ComputeSignature): Update to use
20617         DeclSpace. 
20618
20619         (Parameters.GetSignature): ditto.
20620
20621         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20622         instead of a TypeContainer.
20623
20624         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20625         resolve names.  Because we need to be resolve in our context, not
20626         our parents.
20627
20628         * driver.cs: Implement response files.
20629
20630         * class.cs (TypeContainer.DefineType): If we are defined, do not
20631         redefine ourselves.
20632
20633         (Event.Emit): Emit the code for add/remove handlers.
20634         (Event.Define): Save the MethodBuilders for add/remove.
20635
20636         * typemanager.cs: Use pair here too.
20637
20638         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20639         DictionaryEntry requires the first argument to be non-null.  
20640
20641         (enum_declaration): Compute full name for registering the
20642         enumeration.
20643
20644         (delegate_declaration): Instead of using
20645         formal_parameter_list, use opt_formal_parameter_list as the list
20646         can be empty.
20647
20648         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20649         (EventParsing): New property that controls whether `add' and
20650         `remove' are returned as tokens or identifiers (for events);
20651
20652 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20653
20654         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20655         use MyEventBuilder only and let it wrap the real builder for us.
20656
20657         (MyEventBuilder): Revamp constructor etc.
20658
20659         Implement all operations that we perform on EventBuilder in precisely the same
20660         way here too.
20661
20662         (FindMembers): Update to use the EventBuilder member.
20663
20664         (Event.Emit): Update accordingly.
20665
20666 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20667
20668         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20669         by calling the appropriate methods.
20670
20671         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20672         useful.
20673
20674         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20675
20676 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20677
20678         * delegate.cs (Delegate.Populate): Check that the return type
20679         and various parameters types are indeed accessible.
20680
20681         * class.cs (Constructor.Define): Same here.
20682
20683         (Field.Define): Ditto.
20684
20685         (Event.Define): Ditto.
20686
20687         (Operator.Define): Check that the underlying Method defined itself
20688         correctly - so it's MethodBuilder should not be null.
20689
20690         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20691         expression happens to be null.
20692
20693         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20694         members but as of now we don't seem to be able to do anything really useful with it.
20695
20696         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20697         not the EventBuilder.
20698
20699 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20700
20701         * cs-tokenizer.cs: Add support for defines.
20702         Add support for #if, #elif, #else, #endif
20703
20704         (eval_var): evaluates a variable.
20705         (eval): stubbed for evaluating functions.
20706
20707         * cs-parser.jay: Pass the defines information
20708
20709         * driver.cs: Add --define command line option.
20710
20711         * decl.cs: Move MemberCore here.
20712
20713         Make it the base class for DeclSpace.  This allows us to catch and
20714         report 108 and 109 for everything now.
20715
20716         * class.cs (TypeContainer.Define): Extract all the members
20717         before populating and emit the warning 108 (new keyword required
20718         to override) instead of having each member implement this.
20719
20720         (MemberCore.Define): New abstract method, we will be using this in
20721         the warning reporting engine in Populate.
20722
20723         (Operator.Define): Adjust to new MemberCore protocol. 
20724
20725         * const.cs (Const): This does not derive from Expression, it is a
20726         temporary object we use to create fields, it is a MemberCore. 
20727
20728         * class.cs (Method.Define): Allow the entry point to be in a
20729         specific class.
20730
20731         * driver.cs: Rewrite the argument handler to clean it up a bit.
20732
20733         * rootcontext.cs: Made it just an auxiliary namespace feature by
20734         making everything static.
20735
20736         * driver.cs: Adapt code to use RootContext type name instead of
20737         instance variable.
20738
20739         * delegate.cs: Remove RootContext argument.
20740
20741         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20742         argument. 
20743
20744         * class.cs (Event.Define): The lookup can fail.
20745
20746         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20747
20748         * expression.cs: Resolve the this instance before invoking the code.
20749
20750 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * cs-parser.jay: Add a production in element_access that allows
20753         the thing to become a "type" reference.  This way we can parse
20754         things like "(string [])" as a type.
20755
20756         Note that this still does not handle the more complex rules of
20757         casts. 
20758
20759
20760         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20761
20762         * ecore.cs: (CopyNewMethods): new utility function used to
20763         assemble the list of methods from running FindMembers.
20764
20765         (MemberLookup): Rework FindMembers so that 
20766
20767 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * class.cs (TypeContainer): Remove Delegates who fail to be
20770         defined.
20771
20772         * delegate.cs (Populate): Verify that we dont get null return
20773         values.   TODO: Check for AsAccessible.
20774
20775         * cs-parser.jay: Use basename to emit error 574 (destructor should
20776         have the same name as container class), not the full name.
20777
20778         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20779         possible representation.  
20780
20781         Also implements integer type suffixes U and L.
20782
20783 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20784
20785         * expression.cs (ArrayCreation.DoResolve): We need to do the
20786         argument resolution *always*.
20787
20788         * decl.cs: Make this hold the namespace.  Hold the root context as
20789         well.
20790         (LookupType): Move here.
20791
20792         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20793
20794         * location.cs (Row, Name): Fixed the code, it was always returning
20795         references to the first file.
20796
20797         * interface.cs: Register properties defined through interfaces.
20798
20799         * driver.cs: Add support for globbing on the command line
20800
20801         * class.cs (Field): Make it derive from MemberCore as well.
20802         (Event): ditto.
20803
20804 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20805
20806         * class.cs (Event::Define): Check that the type of the event is a delegate
20807         type else flag error #66.
20808
20809         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20810         same.
20811
20812         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20813         values of EntryPoint, CharSet etc etc.
20814
20815         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20816
20817         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20818         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20819         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20820         which needs this to do its work.
20821
20822         * ../errors/cs0066.cs : Add.
20823
20824 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20827         helper functions.
20828
20829         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20830         clears out the parameters field.
20831         (MemberSignatureCompare): Cleanup
20832
20833         (MemberCore): New base class used to share code between MethodCore
20834         and Property.
20835
20836         (RegisterRequiredImplementations) BindingFlags.Public requires
20837         either BindingFlags.Instace or Static.  Use instance here.
20838
20839         (Property): Refactored code to cope better with the full spec.
20840
20841         * parameter.cs (GetParameterInfo): Return an empty array instead
20842         of null on error.
20843
20844         * class.cs (Property): Abstract or extern properties have no bodies.
20845
20846         * parameter.cs (GetParameterInfo): return a zero-sized array.
20847
20848         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20849         method modifier validation to the typecontainer so we can reuse
20850         this on properties.
20851
20852         (MethodCore.ParameterTypes): return an empty sized array of types.
20853
20854         (Property.Define): Test property modifier validity.
20855
20856         Add tests for sealed/override too.
20857
20858         (Method.Emit): abstract or extern methods have no bodies.
20859
20860 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20861
20862         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20863         thing.
20864
20865         (Method::Define, ::Emit): Modify accordingly.
20866
20867         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20868
20869         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20870
20871         * makefile: Pass in /unsafe.
20872
20873 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20874
20875         * class.cs (MakeKey): Kill routine.
20876
20877         * class.cs (TypeContainer.Define): Correctly define explicit
20878         method implementations (they require the full interface name plus
20879         the method name).
20880
20881         * typemanager.cs: Deply the PtrHashtable here and stop using the
20882         lame keys.  Things work so much better.
20883
20884         This of course broke everyone who depended on `RegisterMethod' to
20885         do the `test for existance' test.  This has to be done elsewhere.
20886
20887         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20888         the object stupid Equals method (because, that like fails all over
20889         the place).  We still do not use it.
20890
20891         * class.cs (TypeContainer.SetRequiredInterface,
20892         TypeContainer.RequireMethods): Killed these two routines and moved
20893         all the functionality to RegisterRequiredImplementations.
20894
20895         (TypeContainer.RegisterRequiredImplementations): This routine now
20896         registers all the implementations required in an array for the
20897         interfaces and abstract methods.  We use an array of structures
20898         which can be computed ahead of time to reduce memory usage and we
20899         also assume that lookups are cheap as most classes will not
20900         implement too many interfaces.
20901
20902         We also avoid creating too many MethodSignatures.
20903
20904         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20905         clear the "pending" bit if we find that there are problems with
20906         the declaration.
20907
20908         (TypeContainer.VerifyPendingMethods): Update to report errors of
20909         methods that look like implementations but are not.
20910
20911         (TypeContainer.Define): Add support for explicit interface method
20912         implementation. 
20913
20914 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20915
20916         * typemanager.cs: Keep track of the parameters here instead of
20917         being a feature of the TypeContainer.
20918
20919         * class.cs: Drop the registration of parameters here, as
20920         InterfaceMethods are also interface declarations.
20921
20922         * delegate.cs: Register methods with the TypeManager not only with
20923         the TypeContainer.  This code was buggy.
20924
20925         * interface.cs: Full registation here.
20926
20927 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20928
20929         * expression.cs: Remove reducer for binary expressions, it can not
20930         be done this way.
20931
20932         * const.cs: Put here the code that used to go into constant.cs
20933
20934         * constant.cs: Put here the code for constants, this is a new base
20935         class for Literals.
20936
20937         * literal.cs: Make Literal derive from Constant.
20938
20939 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20940
20941         * statement.cs (Return.Emit): Report error 157 if the user
20942         attempts to return from a finally block.
20943
20944         (Return.Emit): Instead of emitting a return, jump to the end of
20945         the function.
20946
20947         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20948         LocalBuilder to store the result of the function.  ReturnLabel is
20949         the target where we jump.
20950
20951
20952 2001-12-09  Radek Doulik  <rodo@ximian.com>
20953
20954         * cs-parser.jay: remember alias in current namespace
20955
20956         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20957         namespaces
20958
20959         * class.cs (LookupAlias): lookup alias in my_namespace
20960
20961         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20962         aliases hashtable
20963         (LookupAlias): lookup alias in this and if needed in parent
20964         namespaces
20965
20966 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20967
20968         * support.cs: 
20969
20970         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20971         making things static.  I need this to avoid passing the
20972         TypeContainer when calling ParameterType.
20973
20974         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20975         that did string manipulation to compute the type and then call
20976         GetType.  Use Parameter.ParameterType instead.
20977
20978         * cs-tokenizer.cs: Consume the suffix for floating values.
20979
20980         * expression.cs (ParameterReference): figure out whether this is a
20981         reference parameter or not.  Kill an extra variable by computing
20982         the arg_idx during emission.
20983
20984         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20985         function that returns whether a parameter is an out/ref value or not.
20986
20987         (Parameter.ParameterType): The type of the parameter (base,
20988         without ref/out applied).
20989
20990         (Parameter.Resolve): Perform resolution here.
20991         (Parameter.ExternalType): The full type (with ref/out applied).
20992
20993         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20994         support for expressions on the using statement.
20995
20996 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20997
20998         * statement.cs (Using.EmitLocalVariableDecls): Split the
20999         localvariable handling of the using statement.
21000
21001         (Block.EmitMeta): Keep track of variable count across blocks.  We
21002         were reusing slots on separate branches of blocks.
21003
21004         (Try.Emit): Emit the general code block, we were not emitting it. 
21005
21006         Check the type of the declaration to be an IDisposable or
21007         something that can be implicity converted to it. 
21008
21009         Emit conversions if required.
21010
21011         * ecore.cs (EmptyExpression): New utility class.
21012         (Expression.ImplicitConversionExists): New utility function.
21013
21014 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21015
21016         * statement.cs (Using): Implement.
21017
21018         * expression.cs (LocalVariableReference): Support read only variables.
21019
21020         * statement.cs: Remove the explicit emit for the Leave opcode.
21021         (VariableInfo): Add a readonly field.
21022
21023 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * ecore.cs (ConvCast): new class used to encapsulate the various
21026         explicit integer conversions that works in both checked and
21027         unchecked contexts.
21028
21029         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21030         properly generate the overflow opcodes.
21031
21032 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21033
21034         * statement.cs: The correct type for the EmptyExpression is the
21035         element_type, not the variable type.  Ravi pointed this out.
21036
21037 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21038
21039         * class.cs (Method::Define): Handle PInvoke methods specially
21040         by using DefinePInvokeMethod instead of the usual one.
21041
21042         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21043         above to do the task of extracting information and defining the method.
21044
21045 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21046
21047         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21048         of the condition for string type.
21049
21050         (Emit): Move that here. 
21051
21052         (ArrayCreation::CheckIndices): Keep string literals in their expression
21053         form.
21054
21055         (EmitDynamicInitializers): Handle strings appropriately.
21056
21057 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * codegen.cs (EmitContext): Replace multiple variables with a
21060         single pointer to the current Switch statement.
21061
21062         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21063         EmitContext.
21064
21065 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21066
21067         * statement.cs 
21068
21069         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21070         default'.
21071
21072         (Foreach.Emit): Foreach on arrays was not setting
21073         up the loop variables (for break/continue).
21074
21075         (GotoCase): Semi-implented.
21076
21077 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21078
21079         * attribute.cs (CheckAttribute): Handle system attributes by using
21080         Attribute.GetAttributes to examine information we need.
21081
21082         (GetValidPlaces): Same here.
21083
21084         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21085
21086         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21087
21088         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21089
21090         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21091
21092         (Method::Emit): Handle the case when we are a PInvoke method.
21093
21094 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21095
21096         * expression.cs: Use ResolveWithSimpleName on compound names.
21097
21098 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21099
21100         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21101         before trying to reduce it.
21102
21103         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21104
21105         * constant.cs (LookupConstantValue): Implement.
21106
21107         (EmitConstant): Use the above in emitting the constant.
21108
21109         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21110         that are user-defined by doing a LookupConstantValue on them.
21111
21112         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21113         too, like above.
21114
21115 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21116
21117         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21118
21119         (BaseAccess.DoResolve): Implement.
21120
21121         (MemberAccess.DoResolve): Split this routine into a
21122         ResolveMemberAccess routine that can be used independently
21123
21124 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21125
21126         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21127         As that share bits of the implementation.  Is returns a boolean,
21128         while As returns the Type that is being probed.
21129
21130 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21131
21132         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21133         instead of a Literal - much easier.
21134
21135         (EnumInTransit): Remove - utterly useless :-)
21136
21137         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21138
21139         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21140
21141         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21142         chain when we have no associated expression.
21143
21144 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21145
21146         * constant.cs (Define): Use Location while reporting the errror.
21147
21148         Also emit a warning when 'new' is used and there is no inherited
21149         member to hide.
21150
21151         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21152         populated.
21153
21154         (LookupEnumValue): Implement to lookup an enum member's value and define it
21155         if necessary.
21156
21157         (Populate): Re-write accordingly to use the above routine.
21158
21159 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * expression.cs (This): Fix prototype for DoResolveLValue to
21162         override the base class DoResolveLValue.
21163
21164         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21165         declarations) 
21166
21167         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21168         (we need to load the address of the field here).  This fixes
21169         test-22. 
21170
21171         (FieldExpr.DoResolveLValue): Call the DoResolve
21172         function to initialize the Instance expression.
21173
21174         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21175         correctly the GetEnumerator operation on a value type.
21176
21177         * cs-parser.jay: Add more simple parsing error catches.
21178
21179         * statement.cs (Switch): Add support for string switches.
21180         Handle null specially.
21181
21182         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21183
21184 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21185
21186         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21187
21188         (declare_local_constant): New helper function.
21189
21190         * statement.cs (AddConstant): Keep a separate record of constants
21191
21192         (IsConstant): Implement to determine if a variable is a constant.
21193
21194         (GetConstantExpression): Implement.
21195
21196         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21197
21198         * statement.cs (IsVariableDefined): Re-write.
21199
21200 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21201
21202         * class.cs (TypeContainer::FindMembers): Look for constants
21203         in the case when we are looking for MemberTypes.Field
21204
21205         * expression.cs (MemberAccess::DoResolve): Check that in the
21206         case we are a FieldExpr and a Literal, we are not being accessed
21207         by an instance reference.
21208
21209         * cs-parser.jay (local_constant_declaration): Implement.
21210
21211         (declaration_statement): Implement for constant declarations.
21212
21213 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21214
21215         * statement.cs (Switch): Catch double defaults.
21216
21217         (Switch): More work on the switch() statement
21218         implementation.  It works for integral values now, need to finish
21219         string support.
21220
21221
21222 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21223
21224         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21225         integer literals into other integer literals.  To be used by
21226         switch. 
21227
21228 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21229
21230         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21231         some memory.
21232
21233         (EmitDynamicInitializers): Cope with the above since we extract data
21234         directly from ArrayData now.
21235
21236         (ExpectInitializers): Keep track of whether initializers are mandatory
21237         or not.
21238
21239         (Bounds): Make it a hashtable to prevent the same dimension being 
21240         recorded for every element in that dimension.
21241
21242         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21243         from being found.
21244
21245         Also fix bug which was causing the indices to be emitted in the reverse
21246         order.
21247
21248 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21249
21250         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21251         unfinished.  They do not work, because the underlying code is
21252         sloppy.
21253
21254 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * cs-parser.jay: Remove bogus fixme.
21257
21258         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21259         on Switch statement.
21260
21261 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21262
21263         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21264         the same. 
21265
21266         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21267         parameter. Apparently, any expression is allowed. 
21268
21269         (ValidateInitializers): Update accordingly.
21270
21271         (CheckIndices): Fix some tricky bugs thanks to recursion.
21272
21273         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21274         I was being completely brain-dead.
21275
21276         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21277         and re-write acordingly.
21278
21279         (DelegateInvocation): Re-write accordingly.
21280
21281         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21282
21283         (MakeByteBlob): Handle types more correctly.
21284
21285         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21286         initialization from expressions but it is incomplete because I am a complete
21287         Dodo :-|
21288
21289 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21290
21291         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21292         on If.  Basically, we have to return `true' (ie, we do return to
21293         our caller) only if both branches of the if return.
21294
21295         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21296         short-circuit operators, handle them as short circuit operators. 
21297
21298         (Cast.DoResolve): Resolve type.
21299         (Cast.Cast): Take an expression as the target type.
21300
21301         * cs-parser.jay (cast_expression): Remove old hack that only
21302         allowed a limited set of types to be handled.  Now we take a
21303         unary_expression and we resolve to a type during semantic
21304         analysis.
21305
21306         Use the grammar productions from Rhys to handle casts (this is
21307         not complete like Rhys syntax yet, we fail to handle that corner
21308         case that C# has regarding (-x), but we will get there.
21309
21310 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21311
21312         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21313         field which is an array type.
21314
21315         * cs-parser.jay (declare_local_variables): Support array initialization too.
21316
21317         * typemanager.cs (MakeKey): Implement.
21318
21319         (everywhere): Use the above appropriately.
21320
21321         * cs-parser.jay (for_statement): Update for array initialization while
21322         declaring variables.
21323
21324         * ecore.cs : The error message was correct, it's the variable's names that
21325         were misleading ;-) Make the code more readable.
21326
21327         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21328         the correct type etc.
21329
21330         (ConvertExplicit): Handle Enum types by examining the underlying type.
21331
21332 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21333
21334         * parameter.cs (GetCallingConvention): Always return
21335         CallingConventions.Standard for now.
21336
21337 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21338
21339         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21340         and `r' after calling DoNumericPromotions.
21341
21342         * ecore.cs: Fix error message (the types were in the wrong order).
21343
21344         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21345         BindingFlags.Instance as well 
21346
21347         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21348         implicit int literal conversion in an empty cast so that we
21349         propagate the right type upstream.
21350
21351         (UnboxCast): new class used to unbox value types.
21352         (Expression.ConvertExplicit): Add explicit type conversions done
21353         by unboxing.
21354
21355         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21356         the target type before applying the implicit LongLiterals to ULong
21357         literal cast.
21358
21359 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21360
21361         * cs-parser.jay (for_statement): Reworked the way For works: now
21362         we declare manually any variables that are introduced in
21363         for_initializer to solve the problem of having out-of-band code
21364         emition (that is what got for broken).
21365
21366         (declaration_statement): Perform the actual variable declaration
21367         that used to be done in local_variable_declaration here.
21368
21369         (local_variable_declaration): Do not declare anything, just pass
21370         the information on a DictionaryEntry
21371
21372 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21373
21374         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21375         re-write of the logic to now make it recursive.
21376
21377         (UpdateIndices): Re-write accordingly.
21378
21379         Store element data in a separate ArrayData list in the above methods.
21380
21381         (MakeByteBlob): Implement to dump the array data into a byte array.
21382
21383 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21384
21385         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21386         into CheckIndices.
21387
21388         * constant.cs (Define): Implement.
21389
21390         (EmitConstant): Re-write fully.
21391
21392         Pass in location info.
21393
21394         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21395         respectively.
21396
21397         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21398         DictionaryEntry since we need location info too.
21399
21400         (constant_declaration): Update accordingly.
21401
21402         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21403         code into another method : UpdateIndices.
21404
21405 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21406
21407         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21408         some type checking etc.
21409
21410 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21411
21412         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21413         bits to provide dimension info if the user skips doing that.
21414
21415         Update second constructor to store the rank correctly.
21416
21417 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21418
21419         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21420         and try to implement.
21421
21422         * ../errors/cs0150.cs : Add.
21423
21424         * ../errors/cs0178.cs : Add.
21425
21426 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * statement.cs: Implement foreach on multi-dimensional arrays. 
21429
21430         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21431         name of the params argument.
21432
21433         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21434         initializing the array.
21435
21436         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21437         we can use this elsewhere.
21438
21439         * statement.cs: Finish implementation of foreach for single
21440         dimension arrays.
21441
21442         * cs-parser.jay: Use an out-of-band stack to pass information
21443         around, I wonder why I need this.
21444
21445         foreach_block: Make the new foreach_block the current_block.
21446
21447         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21448         function used to return a static Parameters structure.  Used for
21449         empty parameters, as those are created very frequently.
21450
21451         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21452
21453 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21454
21455         * interface.cs : Default modifier is private, not public. The
21456         make verify test passes again.
21457
21458 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21459
21460         * support.cs (ReflectionParameters): Fix logic to determine
21461         whether the last parameter is a params one. Test 9 passes again.
21462
21463         * delegate.cs (Populate): Register the builders we define with
21464         RegisterParameterForBuilder. Test 19 passes again.
21465
21466         * cs-parser.jay (property_declaration): Reference $6 instead
21467         of $$ to get at the location.
21468
21469         (indexer_declaration): Similar stuff.
21470
21471         (attribute): Ditto.
21472
21473         * class.cs (Property): Register parameters for the Get and Set methods
21474         if they exist. Test 23 passes again.
21475
21476         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21477         call to EmitArguments as we are sure there aren't any params arguments. 
21478         Test 32 passes again.
21479
21480         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21481         IndexOutOfRangeException. 
21482
21483         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21484         Test 33 now passes again.
21485
21486 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21487
21488         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21489         broke a bunch of things.  Will have to come up with a better way
21490         of tracking locations.
21491
21492         * statement.cs: Implemented foreach for single dimension arrays.
21493
21494 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21495
21496         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21497         an error.  This removes the lookup from the critical path.
21498
21499         * cs-parser.jay: Removed use of temporary_loc, which is completely
21500         broken. 
21501
21502 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21503
21504         * support.cs (ReflectionParameters.ParameterModifier): Report
21505         whether the argument is a PARAMS argument or not.
21506
21507         * class.cs: Set the attribute `ParamArrayAttribute' on the
21508         parameter argument.
21509
21510         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21511         and cons_param_array_attribute (ConstructorInfo for
21512         ParamArrayAttribute)., 
21513
21514         * codegen.cs: Emit the return using the `Return' statement, that
21515         way we can report the error correctly for missing return values. 
21516
21517         * class.cs (Method.Emit): Clean up.
21518
21519         * expression.cs (Argument.Resolve): Take another argument: the
21520         location where this argument is used.  Notice that this is not
21521         part of the "Argument" class as to reduce the size of the
21522         structure (we know the approximate location anyways).
21523
21524         Test if the argument is a variable-reference, if not, then
21525         complain with a 206.
21526
21527         (Argument.Emit): Emit addresses of variables.
21528
21529         (Argument.FullDesc): Simplify.
21530
21531         (Invocation.DoResolve): Update for Argument.Resolve.
21532
21533         (ElementAccess.DoResolve): ditto.
21534
21535         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21536         method should be virtual, as this method is always virtual.
21537
21538         (NewDelegate.DoResolve): Update for Argument.Resolve.
21539
21540         * class.cs (ConstructorInitializer.DoResolve): ditto.
21541
21542         * attribute.cs (Attribute.Resolve): ditto.
21543
21544 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21545
21546         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21547
21548         * expression.cs (ParameterReference): Drop IStackStorage and implement
21549         IAssignMethod instead. 
21550
21551         (LocalVariableReference): ditto.
21552
21553         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21554         IAssignMethod instead. 
21555
21556 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21557
21558         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21559         enumerations that are used in heavily used structures derive from
21560         byte in a laughable and pathetic attempt to reduce memory usage.
21561         This is the kind of pre-optimzations that you should not do at
21562         home without adult supervision.
21563
21564         * expression.cs (UnaryMutator): New class, used to handle ++ and
21565         -- separatedly from the other unary operators.  Cleans up the
21566         code, and kills the ExpressionStatement dependency in Unary.
21567
21568         (Unary): Removed `method' and `Arguments' from this class, making
21569         it smaller, and moving it all to SimpleCall, so I can reuse this
21570         code in other locations and avoid creating a lot of transient data
21571         strucutres when not required.
21572
21573         * cs-parser.jay: Adjust for new changes.
21574
21575 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21576
21577         * enum.cs (Enum.Populate): If there is a failure during
21578         definition, return
21579
21580         * cs-parser.jay (opt_enum_base): we used to catch type errors
21581         here, but this is really incorrect.  The type error should be
21582         catched during semantic analysis.
21583
21584 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21585
21586         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21587         current_local_parameters as expected since I, in my stupidity, had forgotten
21588         to do this :-)
21589
21590         * attribute.cs (GetValidPlaces): Fix stupid bug.
21591
21592         * class.cs (Method::Emit): Perform check on applicability of attributes.
21593
21594         (Constructor::Emit): Ditto.
21595
21596         (Field::Emit): Ditto.
21597
21598         (Field.Location): Store location information.
21599
21600         (Property, Event, Indexer, Operator): Ditto.
21601
21602         * cs-parser.jay (field_declaration): Pass in location for each field.
21603
21604         * ../errors/cs0592.cs : Add.
21605
21606 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21607
21608         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21609
21610         (InitCoreTypes): Update accordingly.
21611
21612         (RegisterAttrType, LookupAttr): Implement.
21613
21614         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21615         info about the same.
21616
21617         (Resolve): Update to populate the above as necessary.
21618
21619         (Error592): Helper.
21620
21621         (GetValidPlaces): Helper to the above.
21622
21623         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21624
21625         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21626
21627 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21628
21629         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21630
21631         * ../errors/cs0617.cs : Add.
21632
21633 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21634
21635         * enum.cs (Emit): Rename to Populate to be more consistent with what
21636         we expect it to do and when exactly it is called.
21637
21638         * class.cs, rootcontext.cs : Update accordingly.
21639
21640         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21641         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21642
21643         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21644
21645         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21646         of a fieldinfo using the above, when dealing with a FieldBuilder.
21647
21648 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21649
21650         * ../errors/cs0031.cs : Add.
21651
21652         * ../errors/cs1008.cs : Add.
21653
21654         * ../errrors/cs0543.cs : Add.
21655
21656         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21657         enum type.
21658
21659         (FindMembers): Implement.
21660
21661         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21662         enums and delegates too.
21663
21664         (enum_types): Rename to builder_to_enum.
21665
21666         (delegate_types): Rename to builder_to_delegate.
21667
21668         * delegate.cs (FindMembers): Implement.
21669
21670 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21671
21672         * typemanager.cs (IsEnumType): Implement.
21673
21674         * enum.cs (Emit): Re-write parts to account for the underlying type
21675         better and perform checking etc.
21676
21677         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21678         of the underlying type.
21679
21680         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21681         value
21682
21683         * enum.cs (error31): Helper to report error #31.
21684
21685         * cs-parser.jay (enum_declaration): Store location of each member too.
21686
21687         * enum.cs (member_to_location): New hashtable. 
21688
21689         (AddEnumMember): Update location hashtable.
21690
21691         (Emit): Use the location of each member while reporting errors.
21692
21693 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21694
21695         * cs-parser.jay: A for_initializer if is a
21696         local_variable_declaration really ammount to have an implicit
21697         block with the variable declaration and no initializer for for.
21698
21699         * statement.cs (For.Emit): Cope with null initializers.
21700
21701         This fixes the infinite loop on for initializers.
21702
21703 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21704
21705         * enum.cs: More cleanup.
21706
21707         * ecore.cs: Remove dead code.
21708
21709         * class.cs (Property.Emit): More simplification.
21710         (Event.Emit): ditto.
21711
21712         Reworked to have less levels of indentation.
21713
21714 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21715
21716         * class.cs (Property): Emit attributes.
21717
21718         (Field): Ditto.
21719
21720         (Event): Ditto.
21721
21722         (Indexer): Ditto.
21723
21724         (Operator): Ditto.
21725
21726         * enum.cs (Emit): Ditto.
21727
21728         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21729         Enums too.
21730
21731         * class.cs (Field, Event, etc.): Move attribute generation into the
21732         Emit method everywhere.
21733
21734         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21735         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21736         as we had no way of defining nested enums !
21737
21738         * rootcontext.cs : Adjust code accordingly.
21739
21740         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21741
21742 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21743
21744         * expression.cs (EvalConstantExpression): Move into ecore.cs
21745
21746         * enum.cs (Enum): Rename some members and make them public and readonly
21747         according to our convention.
21748
21749         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21750         nothing else.
21751
21752         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21753
21754         (Enum::Emit): Write a simple version for now which doesn't try to compute
21755         expressions. I shall modify this to be more robust in just a while.
21756
21757         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21758
21759         (TypeContainer::CloseType): Create the Enum types too.
21760
21761         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21762
21763         * expression.cs (EvalConstantExpression): Get rid of completely.
21764
21765         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21766         user-defined values and other cases.
21767
21768         (IsValidEnumLiteral): Helper function.
21769
21770         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21771         out there in the case we had a literal FieldExpr.
21772
21773         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21774
21775         (Literalize): Revamp a bit to take two arguments.
21776
21777         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21778
21779 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21780
21781         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21782
21783         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21784
21785         (Resolve): Use the above to ensure we have proper initializers.
21786
21787 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21788
21789         * expression.cs (Expression::EvalConstantExpression): New method to 
21790         evaluate constant expressions.
21791
21792         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21793
21794 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21795
21796         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21797         in an array.
21798
21799         (Binary.ResolveOperator): Handle operator != (object a, object b)
21800         and operator == (object a, object b);
21801
21802         (Binary.DoNumericPromotions): Indicate whether the numeric
21803         promotion was possible.
21804
21805         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21806         Implement.  
21807
21808         Made the ArrayAccess implement interface IAssignMethod instead of
21809         IStackStore as the order in which arguments are passed reflects
21810         this.
21811
21812         * assign.cs: Instead of using expr.ExprClass to select the way of
21813         assinging, probe for the IStackStore/IAssignMethod interfaces.
21814
21815         * typemanager.cs: Load InitializeArray definition.
21816
21817         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21818         static data that can be used to initialize arrays. 
21819
21820 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21821
21822         * expression.cs: Handle operator== and operator!= for booleans.
21823
21824         (Conditioal.Reduce): Implement reducer for the ?: operator.
21825
21826         (Conditional.Resolve): Implement dead code elimination.
21827
21828         (Binary.Resolve): Catch string literals and return a new
21829         concatenated string.
21830
21831         (Unary.Reduce): Implement reduction of unary expressions.
21832
21833         * ecore.cs: Split out the expression core handling here.
21834
21835         (Expression.Reduce): New method used to perform constant folding
21836         and CSE.  This is needed to support constant-expressions. 
21837
21838         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21839         targets, and optimize for !x.
21840
21841 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21842
21843         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21844         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21845         set custom atttributes.
21846
21847         * literal.cs (Literal::GetValue): New abstract method to return the actual
21848         value of the literal, cast as an object.
21849
21850         (*Literal): Implement GetValue method.
21851
21852         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21853         expressions to the arraylist but objects of type Argument.
21854
21855         * class.cs (TypeContainer::Emit): Emit our attributes too.
21856
21857         (Method::Emit, Constructor::Emit): Ditto.
21858
21859         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21860         to be ignoring earlier.
21861
21862 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21863
21864         * attribute.cs (AttributeSection::Define): Implement to do the business
21865         of constructing a CustomAttributeBuilder.
21866
21867         (Attribute): New trivial class. Increases readability of code.  
21868
21869         * cs-parser.jay : Update accordingly.
21870
21871         (positional_argument_list, named_argument_list, named_argument): New rules
21872
21873         (attribute_arguments): Use the above so that we are more correct.
21874
21875 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21876
21877         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21878         to perform all checks for a method with a params parameter.
21879
21880         (Invocation::OverloadResolve): Update to use the above method and therefore
21881         cope correctly with params method invocations.
21882
21883         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21884         params too.
21885
21886         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21887         constructors in our parent too because we can't afford to miss out on 
21888         protected ones ;-)
21889
21890         * attribute.cs (AttributeSection): New name for the class Attribute
21891
21892         Other trivial changes to improve readability.
21893
21894         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21895         use the new class names.
21896
21897 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21898
21899         * class.cs (Method::Define): Complete definition for params types too
21900
21901         (Indexer::Define): Ditto.
21902
21903         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21904         Cope everywhere with a request for info about the array parameter.
21905
21906 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21907
21908         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21909
21910         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21911         local_variable_type to extract the string corresponding to the type.
21912
21913         (local_variable_type): Fixup the action to use the new helper method.
21914
21915         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21916         go.
21917
21918         * expression.cs : Clean out code which uses the above.
21919
21920 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21921
21922         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21923         and bale out if necessary by returning a false.
21924
21925         (RegisterProperty): Ditto.
21926
21927         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21928         and print out appropriate error messages.
21929
21930         * interface.cs (everywhere): Ditto.
21931
21932         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21933         location to constructor.
21934
21935         * class.cs (Property, Event, Indexer): Update accordingly.
21936
21937         * ../errors/cs111.cs : Added.
21938
21939         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21940         of a method, as laid down by the spec.
21941
21942         (Invocation::OverloadResolve): Use the above method.
21943
21944 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21945
21946         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21947         now take a TypeContainer and a Parameters object.
21948
21949         (ParameterData): Modify return type of ParameterModifier method to be 
21950         Parameter.Modifier and not a string.
21951
21952         (ReflectionParameters, InternalParameters): Update accordingly.
21953
21954         * expression.cs (Argument::GetParameterModifier): Same here.
21955
21956         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21957         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21958         symbol in it at all so maybe this is only for now.
21959
21960 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21961
21962         * support.cs (InternalParameters): Constructor now takes an extra argument 
21963         which is the actual Parameters class.
21964
21965         (ParameterDesc): Update to provide info on ref/out modifiers.
21966
21967         * class.cs (everywhere): Update call to InternalParameters to pass in
21968         the second argument too.
21969
21970         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21971         to return the modifier info [ref/out etc]
21972
21973         (InternalParameters, ReflectionParameters): Implement the above.
21974
21975         * expression.cs (Argument::ParameterModifier): Similar function to return
21976         info about the argument's modifiers.
21977
21978         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21979         too.
21980
21981         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21982         a new SetFormalParameters object which we pass to InternalParameters.
21983
21984 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21985
21986         * expression.cs (NewArray): Merge into the ArrayCreation class.
21987
21988 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21989
21990         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21991         NewUserdefinedArray into one as there wasn't much of a use in having
21992         two separate ones.
21993
21994         * expression.cs (Argument): Change field's name to ArgType from Type.
21995
21996         (Type): New readonly property which returns the proper type, taking into 
21997         account ref/out modifiers.
21998
21999         (everywhere): Adjust code accordingly for the above.
22000
22001         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22002         whether we are emitting for a ref or out parameter.
22003
22004         * expression.cs (Argument::Emit): Use the above field to set the state.
22005
22006         (LocalVariableReference::Emit): Update to honour the flag and emit the
22007         right stuff.
22008
22009         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22010
22011         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22012
22013         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22014
22015         (ReflectionParameters, InternalParameters): Implement the above method.
22016
22017         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22018         reporting errors.
22019
22020         (Invocation::FullMethodDesc): Ditto. 
22021
22022 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22023
22024         * cs-parser.jay: Add extra production for the second form of array
22025         creation. 
22026
22027         * expression.cs (ArrayCreation): Update to reflect the above
22028         change. 
22029
22030         * Small changes to prepare for Array initialization.
22031
22032 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * typemanager.cs (ImplementsInterface): interface might be null;
22035         Deal with this problem;
22036
22037         Also, we do store negative hits on the cache (null values), so use
22038         this instead of calling t.GetInterfaces on the type everytime.
22039
22040 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22041
22042         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22043
22044         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22045         split functionality out into different classes.
22046
22047         (New::FormArrayType): Move into NewBuiltinArray.
22048
22049         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22050         quite useless.
22051
22052         (NewBuiltinArray): New class to handle creation of built-in arrays.
22053
22054         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22055         account creation of one-dimensional arrays.
22056
22057         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22058
22059         (NewUserdefinedArray::DoResolve): Implement.
22060
22061         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22062
22063         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22064         we maintain inside the TypeManager. This is necessary to perform lookups on the
22065         module builder.
22066
22067         (LookupType): Update to perform GetType on the module builders too.     
22068
22069         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22070
22071         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22072
22073 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22074
22075         * expression.cs (New::DoResolve): Implement guts of array creation.
22076
22077         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22078
22079 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22080
22081         * expression.cs: Fix bug I introduced lsat night that broke
22082         Delegates. 
22083
22084         (Expression.Resolve): Report a 246 error (can not resolve name)
22085         if we find a SimpleName in the stream.
22086
22087         (Expression.ResolveLValue): Ditto.
22088
22089         (Expression.ResolveWithSimpleName): This function is a variant of
22090         ResolveName, this one allows SimpleNames to be returned without a
22091         warning.  The only consumer of SimpleNames is MemberAccess
22092
22093 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22094
22095         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22096         might arrive here.  I have my doubts that this is correct.
22097
22098         * statement.cs (Lock): Implement lock statement.
22099
22100         * cs-parser.jay: Small fixes to support `lock' and `using'
22101
22102         * cs-tokenizer.cs: Remove extra space
22103
22104         * driver.cs: New flag --checked, allows to turn on integer math
22105         checking. 
22106
22107         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22108         Threading.Monitor.Exit 
22109
22110 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22111
22112         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22113         Expression Class to be IndexerAccess.
22114
22115         Notice that Indexer::DoResolve sets the eclass to Value.
22116
22117 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22118
22119         * class.cs (TypeContainer::Emit): Emit code for indexers.
22120
22121         * assign.cs (IAssignMethod): New interface implemented by Indexers
22122         and Properties for handling assignment.
22123
22124         (Assign::Emit): Simplify and reuse code. 
22125
22126         * expression.cs (IndexerAccess, PropertyExpr): Implement
22127         IAssignMethod, clean up old code. 
22128
22129 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22130
22131         * typemanager.cs (ImplementsInterface): New method to determine if a type
22132         implements a given interface. Provides a nice cache too.
22133
22134         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22135         method.
22136
22137         (ConvertReferenceExplicit): Ditto.
22138
22139         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22140         various methods, with correct names etc.
22141
22142         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22143         Operator.UnaryNegation.
22144
22145         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22146         we have a unary plus or minus operator.
22147
22148         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22149         UnaryMinus.
22150
22151         * everywhere : update accordingly.
22152
22153         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22154         respectively.
22155
22156         * class.cs (Method::Define): For the case where we are implementing a method
22157         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22158         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22159
22160 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22161
22162         * interface.cs (FindMembers): Implement to work around S.R.E
22163         lameness.
22164
22165         * typemanager.cs (IsInterfaceType): Implement.
22166
22167         (FindMembers): Update to handle interface types too.
22168
22169         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22170         use IsAssignableFrom as that is not correct - it doesn't work.
22171
22172         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22173         and accordingly override EmitStatement.
22174
22175         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22176         using the correct logic :-)
22177
22178 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22179
22180         * ../errors/cs-11.cs : Add to demonstrate error -11 
22181
22182 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22183
22184         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22185         then pass this as a hint to ResolveLValue.
22186
22187         * expression.cs (FieldExpr): Add Location information
22188
22189         (FieldExpr::LValueResolve): Report assignment to readonly
22190         variable. 
22191
22192         (Expression::ExprClassFromMemberInfo): Pass location information.
22193
22194         (Expression::ResolveLValue): Add new method that resolves an
22195         LValue. 
22196
22197         (Expression::DoResolveLValue): Default invocation calls
22198         DoResolve. 
22199
22200         (Indexers): New class used to keep track of indexers in a given
22201         Type. 
22202
22203         (IStackStore): Renamed from LValue, as it did not really describe
22204         what this did.  Also ResolveLValue is gone from this interface and
22205         now is part of Expression.
22206
22207         (ElementAccess): Depending on the element access type
22208
22209         * typemanager.cs: Add `indexer_name_type' as a Core type
22210         (System.Runtime.CompilerServices.IndexerNameAttribute)
22211
22212         * statement.cs (Goto): Take a location.
22213
22214 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22215
22216         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22217         if two delegates are compatible.
22218
22219         (NewDelegate::DoResolve): Update to take care of the case when
22220         we instantiate a delegate from another delegate.
22221
22222         * typemanager.cs (FindMembers): Don't even try to look up members
22223         of Delegate types for now.
22224
22225 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22226
22227         * delegate.cs (NewDelegate): New class to take care of delegate
22228         instantiation.
22229
22230         * expression.cs (New): Split the delegate related code out into 
22231         the NewDelegate class.
22232
22233         * delegate.cs (DelegateInvocation): New class to handle delegate 
22234         invocation.
22235
22236         * expression.cs (Invocation): Split out delegate related code into
22237         the DelegateInvocation class.
22238
22239 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22240
22241         * expression.cs (New::DoResolve): Implement delegate creation fully
22242         and according to the spec.
22243
22244         (New::DoEmit): Update to handle delegates differently.
22245
22246         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22247         because of which we were printing out arguments in reverse order !
22248
22249         * delegate.cs (VerifyMethod): Implement to check if the given method
22250         matches the delegate.
22251
22252         (FullDelegateDesc): Implement.
22253
22254         (VerifyApplicability): Implement.
22255
22256         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22257         delegate invocations too.
22258
22259         (Invocation::Emit): Ditto.
22260
22261         * ../errors/cs1593.cs : Added.
22262
22263         * ../errors/cs1594.cs : Added.
22264
22265         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22266
22267 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22268
22269         * typemanager.cs (intptr_type): Core type for System.IntPtr
22270
22271         (InitCoreTypes): Update for the same.
22272
22273         (iasyncresult_type, asynccallback_type): Ditto.
22274
22275         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22276         correct.
22277
22278         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22279         too.
22280
22281         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22282         the builders for the 4 members of a delegate type :-)
22283
22284         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22285         type.
22286
22287         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22288
22289         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22290
22291 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22292
22293         * statement.cs (Break::Emit): Implement.   
22294         (Continue::Emit): Implement.
22295
22296         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22297         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22298         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22299         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22300         end loop
22301
22302         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22303         properties that track the label for the current loop (begin of the
22304         loop and end of the loop).
22305
22306 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22307
22308         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22309         use of emitting anything at all.
22310
22311         * class.cs, rootcontext.cs : Get rid of calls to the same.
22312
22313         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22314
22315         (Populate): Define the constructor correctly and set the implementation
22316         attributes.
22317
22318         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22319         have been defined.
22320
22321         (AddDelegateType): Implement.
22322
22323         (IsDelegateType): Implement helper method.
22324
22325         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22326
22327         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22328         and accordingly handle it.
22329
22330         * delegate.cs (Populate): Take TypeContainer argument.
22331         Implement bits to define the Invoke method. However, I still haven't figured out
22332         how to take care of the native int bit :-(
22333
22334         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22335         Qualify the name of the delegate, not its return type !
22336
22337         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22338         conversion.
22339
22340         (StandardConversionExists): Checking for array types turns out to be recursive.
22341
22342         (ConvertReferenceExplicit): Implement array conversion.
22343
22344         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22345
22346 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22347
22348         * cs-parser.jay (delegate_declaration): Store the fully qualified
22349         name as it is a type declaration.
22350
22351         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22352         readonly.
22353
22354         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22355         as TypeContainer::DefineType.
22356
22357         (Populate): Method in which all the definition of the various methods (Invoke)
22358         etc is done.
22359
22360         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22361         see.
22362
22363         (CloseDelegate): Finally creates the delegate.
22364
22365         * class.cs (TypeContainer::DefineType): Update to define delegates.
22366         (Populate, Emit and CloseType): Do the same thing here too.
22367
22368         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22369         delegates in all these operations.
22370
22371 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22372
22373         * expression.cs: LocalTemporary: a new expression used to
22374         reference a temporary that has been created.
22375
22376         * assign.cs: Handle PropertyAccess back here, so that we can
22377         provide the proper semantic access to properties.
22378
22379         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22380         a few more explicit conversions. 
22381
22382         * modifiers.cs: `NEW' modifier maps to HideBySig.
22383
22384         * expression.cs (PropertyExpr): Make this into an
22385         ExpressionStatement, and support the EmitStatement code path. 
22386
22387         Perform get/set error checking, clean up the interface.
22388
22389         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22390         them into toplevel access objects.
22391
22392 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22393
22394         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22395         SRE.
22396
22397         * typemanager.cs: Keep track here of our PropertyBuilders again to
22398         work around lameness in SRE.
22399
22400 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22401
22402         * expression.cs (LValue::LValueResolve): New method in the
22403         interface, used to perform a second resolution pass for LValues. 
22404
22405         (This::DoResolve): Catch the use of this in static methods.
22406
22407         (This::LValueResolve): Implement.
22408
22409         (This::Store): Remove warning, assigning to `this' in structures
22410         is 
22411
22412         (Invocation::Emit): Deal with invocation of
22413         methods on value types.  We need to pass the address to structure
22414         methods rather than the object itself.  (The equivalent code to
22415         emit "this" for structures leaves the entire structure on the
22416         stack instead of a pointer to it). 
22417
22418         (ParameterReference::DoResolve): Compute the real index for the
22419         argument based on whether the method takes or not a `this' pointer
22420         (ie, the method is static).
22421
22422         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22423         value types returned from functions when we need to invoke a
22424         method on the sturcture.
22425
22426
22427 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22428
22429         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22430         defining the type in the Modulebuilder or Typebuilder. This is to take
22431         care of nested types which need to be defined on the TypeBuilder using
22432         DefineNestedMethod.
22433
22434         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22435         methods in RootContext, only ported to be part of TypeContainer.
22436
22437         (TypeContainer::GetInterfaceOrClass): Ditto.
22438
22439         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22440
22441         * interface.cs (Interface::DefineInterface): New method. Does exactly
22442         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22443         too.
22444
22445         (Interface::GetInterfaces): Move from RootContext here and port.
22446
22447         (Interface::GetInterfaceByName): Same here.
22448
22449         * rootcontext.cs (ResolveTree): Re-write.
22450
22451         (PopulateTypes): Re-write.
22452
22453         * class.cs (TypeContainer::Populate): Populate nested types too.
22454         (TypeContainer::Emit): Emit nested members too.
22455
22456         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22457         instead just use the name argument passed in as it is already fully
22458         qualified.
22459
22460         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22461         to TypeContainer mapping to see if a type is user-defined.
22462
22463         * class.cs (TypeContainer::CloseType): Implement. 
22464
22465         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22466         the default constructor.
22467
22468         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22469         twice.
22470
22471         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22472
22473         * interface.cs (CloseType): Create the type here.
22474
22475         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22476         the hierarchy.
22477
22478         Remove all the methods which are now in TypeContainer.
22479
22480 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22481
22482         * delegate.cs (Define): Re-write bits to define the delegate
22483         correctly.
22484
22485 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22486
22487         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22488
22489         * expression.cs (ImplicitReferenceConversion): handle null as well
22490         as a source to convert to any reference type.
22491
22492         * statement.cs (Return): Perform any implicit conversions to
22493         expected return type.  
22494
22495         Validate use of return statement.  
22496
22497         * codegen.cs (EmitContext): Pass the expected return type here.
22498
22499         * class.cs (Method, Constructor, Property): Pass expected return
22500         type to EmitContext.
22501
22502 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22503
22504         * expression.cs: Make DoResolve take an EmitContext instead of a
22505         TypeContainer.
22506
22507         Replaced `l' and `location' for `loc', for consistency.
22508
22509         (Error, Warning): Remove unneeded Tc argument.
22510
22511         * assign.cs, literal.cs, constant.cs: Update to new calling
22512         convention. 
22513
22514         * codegen.cs: EmitContext now contains a flag indicating whether
22515         code is being generated in a static method or not.
22516
22517         * cs-parser.jay: DecomposeQI, new function that replaces the old
22518         QualifiedIdentifier.  Now we always decompose the assembled
22519         strings from qualified_identifier productions into a group of
22520         memberaccesses.
22521
22522 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22523
22524         * rootcontext.cs: Deal with field-less struct types correctly now
22525         by passing the size option to Define Type.
22526
22527         * class.cs: Removed hack that created one static field. 
22528
22529 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * statement.cs: Moved most of the code generation here. 
22532
22533 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22534
22535         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22536         seem very right.
22537
22538         (ElementAccess): Remove useless bits for now - keep checks as the spec
22539         says.
22540
22541 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22542
22543         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22544         and start performing checks according to the spec.
22545
22546 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22547
22548         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22549         rank_specifiers instead.
22550
22551         (rank_specifiers): Change the order in which the rank specifiers are stored
22552
22553         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22554
22555         * expression.cs (ElementAccess): Implement the LValue interface too.
22556
22557 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22558
22559         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22560         except that user defined conversions are not included.
22561
22562         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22563         perform the conversion of the return type, if necessary.
22564
22565         (New::DoResolve): Check whether we are creating an array or an object
22566         and accordingly do the needful.
22567
22568         (New::Emit): Same here.
22569
22570         (New::DoResolve): Implement guts of array creation.
22571
22572         (New::FormLookupType): Helper function.
22573
22574 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22575
22576         * codegen.cs: Removed most of the code generation here, and move the
22577         corresponding code generation bits to the statement classes. 
22578
22579         Added support for try/catch/finalize and throw.
22580
22581         * cs-parser.jay: Added support for try/catch/finalize.
22582
22583         * class.cs: Catch static methods having the flags override,
22584         virtual or abstract.
22585
22586         * expression.cs (UserCast): This user cast was not really doing
22587         what it was supposed to do.  Which is to be born in fully resolved
22588         state.  Parts of the resolution were being performed at Emit time! 
22589
22590         Fixed this code.
22591
22592 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22593
22594         * expression.cs: Implicity convert the result from UserCast.
22595
22596 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22597
22598         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22599         prevented it from working correctly. 
22600
22601         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22602         merely ConvertImplicit.
22603
22604 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22605
22606         * typemanager.cs: Make the LookupTypeContainer function static,
22607         and not per-instance.  
22608
22609         * class.cs: Make static FindMembers (the one that takes a Type
22610         argument). 
22611
22612         * codegen.cs: Add EmitForeach here.
22613
22614         * cs-parser.jay: Make foreach a toplevel object instead of the
22615         inline expansion, as we need to perform semantic analysis on it. 
22616
22617 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22618
22619         * expression.cs (Expression::ImplicitUserConversion): Rename to
22620         UserDefinedConversion.
22621
22622         (Expression::UserDefinedConversion): Take an extra argument specifying 
22623         whether we look for explicit user conversions too.
22624
22625         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22626
22627         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22628
22629         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22630         with the appropriate arguments.
22631
22632         * cs-parser.jay (cast_expression): Record location too.
22633
22634         * expression.cs (Cast): Record location info.
22635
22636         (Expression::ConvertExplicit): Take location argument.
22637
22638         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22639         to determine if we are doing explicit conversions.
22640
22641         (UserCast::Emit): Update accordingly.
22642
22643         (Expression::ConvertExplicit): Report an error if everything fails.
22644
22645         * ../errors/cs0030.cs : Add.
22646
22647 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22648
22649         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22650         virtual and newslot bits. 
22651
22652         * class.cs (TypeContainer::RegisterRequiredImplementations):
22653         Record methods we need.
22654
22655         (TypeContainer::MakeKey): Helper function to make keys for
22656         MethodBases, since the Methodbase key is useless.
22657
22658         (TypeContainer::Populate): Call RegisterRequiredImplementations
22659         before defining the methods.   
22660
22661         Create a mapping for method_builders_to_methods ahead of time
22662         instead of inside a tight loop.
22663
22664         (::RequireMethods):  Accept an object as the data to set into the
22665         hashtable so we can report interface vs abstract method mismatch.
22666
22667 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22668
22669         * report.cs: Make all of it static.
22670
22671         * rootcontext.cs: Drop object_type and value_type computations, as
22672         we have those in the TypeManager anyways.
22673
22674         Drop report instance variable too, now it is a global.
22675
22676         * driver.cs: Use try/catch on command line handling.
22677
22678         Add --probe option to debug the error reporting system with a test
22679         suite. 
22680
22681         * report.cs: Add support for exiting program when a probe
22682         condition is reached.
22683
22684 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22685
22686         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22687         we do a forcible conversion regardless of type, to check if 
22688         ForceConversion returns a null.
22689
22690         (Binary::error19): Use location to report error.
22691
22692         (Unary::error23): Use location here too.
22693
22694         * ../errors/cs0019.cs : Check in.
22695
22696         * ../errors/cs0023.cs : Check in.
22697
22698         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22699         case of a non-null MethodInfo object with a length of 0 !
22700
22701         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22702         an applicable member - according to the spec :-)
22703         Also fix logic to find members in base types.
22704
22705         (Unary::ResolveOperator): Same here.
22706
22707         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22708         as I was getting thoroughly confused between this and error19 :-)
22709
22710         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22711         (::FindMostEncompassedType): Implement.
22712         (::FindMostEncompassingType): Implement.
22713         (::StandardConversionExists): Implement.
22714
22715         (UserImplicitCast): Re-vamp. We now need info about most specific
22716         source and target types so that we can do the necessary conversions.
22717
22718         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22719         mathematical union with no duplicates.
22720
22721 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22722
22723         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22724         in order from base classes to child classes, so that we can in
22725         child classes look up in our parent for method names and
22726         attributes (required for handling abstract, virtual, new, override
22727         constructs: we need to instrospect our base class, and if we dont
22728         populate the classes in order, the introspection might be
22729         incorrect.  For example, a method could query its parent before
22730         the parent has any methods and would determine that the parent has
22731         no abstract methods (while it could have had them)).
22732
22733         (RootContext::CreateType): Record the order in which we define the
22734         classes.
22735
22736 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22737
22738         * class.cs (TypeContainer::Populate): Also method definitions can
22739         fail now, keep track of this.
22740
22741         (TypeContainer::FindMembers): Implement support for
22742         DeclaredOnly/noDeclaredOnly flag.
22743
22744         (Constructor::Emit) Return the ConstructorBuilder.
22745
22746         (Method::Emit) Return the MethodBuilder. 
22747         Check for abstract or virtual methods to be public.
22748
22749         * rootcontext.cs (RootContext::CreateType): Register all the
22750         abstract methods required for the class to be complete and the
22751         interface methods that must be implemented. 
22752
22753         * cs-parser.jay: Report error 501 (method requires body if it is
22754         not marked abstract or extern).
22755
22756         * expression.cs (TypeOf::Emit): Implement.
22757
22758         * typemanager.cs: runtime_handle_type, new global type.
22759
22760         * class.cs (Property::Emit): Generate code for properties.
22761
22762 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22763
22764         * expression.cs (Unary::ResolveOperator): Find operators on base type
22765         too - we now conform exactly to the spec.
22766
22767         (Binary::ResolveOperator): Same here.
22768
22769         * class.cs (Operator::Define): Fix minor quirk in the tests.
22770
22771         * ../errors/cs0215.cs : Added.
22772
22773         * ../errors/cs0556.cs : Added.
22774
22775         * ../errors/cs0555.cs : Added.
22776
22777 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22778
22779         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22780         single integer which is really efficient
22781
22782 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22783
22784         *  expression.cs (Expression::ImplicitUserConversion): Use location
22785         even in the case when we are examining True operators.
22786  
22787         * class.cs (Operator::Define): Perform extensive checks to conform
22788         with the rules for operator overloading in the spec.
22789
22790         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22791         some of the other conversions mentioned in the spec.
22792
22793         * typemanager.cs (array_type): New static member for the System.Array built-in
22794         type.
22795
22796         (cloneable_interface): For System.ICloneable interface.
22797
22798         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22799         we start resolving the tree and populating types.
22800
22801         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22802  
22803 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22804
22805         * expression.cs (Expression::ExprClassFromMemberInfo,
22806         Expression::Literalize): Create literal expressions from
22807         FieldInfos which are literals.
22808
22809         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22810         type casts, because they were wrong.  The test suite in tests
22811         caught these ones.
22812
22813         (ImplicitNumericConversion): ushort to ulong requires a widening
22814         cast. 
22815
22816         Int32 constant to long requires widening cast as well.
22817
22818         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22819         for integers because the type on the stack is not i4.
22820
22821 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22822
22823         * expression.cs (report118): require location argument. 
22824
22825         * parameter.cs: Do not dereference potential null value.
22826
22827         * class.cs: Catch methods that lack the `new' keyword when
22828         overriding a name.  Report warnings when `new' is used without
22829         anything being there to override.
22830
22831         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22832
22833         * class.cs: Only add constructor to hashtable if it is non-null
22834         (as now constructors can fail on define).
22835
22836         (TypeManager, Class, Struct): Take location arguments.
22837
22838         Catch field instance initialization in structs as errors.
22839
22840         accepting_filter: a new filter for FindMembers that is static so
22841         that we dont create an instance per invocation.
22842
22843         (Constructor::Define): Catch errors where a struct constructor is
22844         parameterless 
22845
22846         * cs-parser.jay: Pass location information for various new
22847         constructs. 
22848
22849         * delegate.cs (Delegate): take a location argument.
22850
22851         * driver.cs: Do not call EmitCode if there were problesm in the
22852         Definition of the types, as many Builders wont be there. 
22853
22854         * decl.cs (Decl::Decl): Require a location argument.
22855
22856         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22857         into integers, and find the most appropiate integer for it.
22858
22859         * literal.cs: Implement ULongLiteral.
22860
22861         * rootcontext.cs: Provide better information about the location of
22862         failure when CreateType fails.
22863
22864 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22865
22866         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22867         as well.
22868
22869         * expression.cs (Binary::CheckShiftArguments): Add missing type
22870         computation.
22871         (Binary::ResolveOperator): Add type to the logical and and logical
22872         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22873         before.
22874
22875         (Binary::DoNumericPromotions): In the case where either argument
22876         is ulong (and most signed types combined with ulong cause an
22877         error) perform implicit integer constant conversions as well.
22878
22879 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22880
22881         * expression.cs (UserImplicitCast): Method should always be
22882         non-null. 
22883         (Invocation::BetterConversion): Simplified test for IntLiteral.
22884
22885         (Expression::ImplicitNumericConversion): Split this routine out.
22886         Put the code that performs implicit constant integer conversions
22887         here. 
22888
22889         (Expression::Resolve): Become a wrapper around DoResolve so we can
22890         check eclass and type being set after resolve.
22891
22892         (Invocation::Badness): Remove this dead function
22893
22894         (Binary::ResolveOperator): Do not compute the expensive argumnets
22895         unless we have a union for it.
22896
22897         (Probe::Emit): Is needs to do an isinst and then
22898         compare against null.
22899
22900         (::CanConvert): Added Location argument.  If the Location argument
22901         is null (Location.Null), then we do not report errors.  This is
22902         used by the `probe' mechanism of the Explicit conversion.  We do
22903         not want to generate an error for something that the user
22904         explicitly requested to be casted.  But the pipeline for an
22905         explicit cast first tests for potential implicit casts.
22906
22907         So for now, if the Location is null, it means `Probe only' to
22908         avoid adding another argument.   Might have to revise this
22909         strategy later.
22910
22911         (ClassCast): New class used to type cast objects into arbitrary
22912         classes (used in Explicit Reference Conversions).
22913
22914         Implement `as' as well.
22915
22916         Reverted all the patches from Ravi below: they were broken:
22917
22918                 * The use of `level' as a mechanism to stop recursive
22919                   invocations is wrong.  That was there just to catch the
22920                   bug with a strack trace but not as a way of addressing
22921                   the problem.
22922
22923                   To fix the problem we have to *understand* what is going
22924                   on and the interactions and come up with a plan, not
22925                   just get things going.
22926
22927                 * The use of the type conversion cache that I proposed
22928                   last night had an open topic: How does this work across
22929                   protection domains.  A user defined conversion might not
22930                   be public in the location where we are applying the
22931                   conversion, a different conversion might be selected
22932                   (ie, private A->B (better) but public B->A (worse),
22933                   inside A, A->B applies, but outside it, B->A will
22934                   apply).
22935
22936                 * On top of that (ie, even if the above is solved),
22937                   conversions in a cache need to be abstract.  Ie, `To
22938                   convert from an Int to a Short use an OpcodeCast', not
22939                   `To convert from an Int to a Short use the OpcodeCast on
22940                   the variable 5' (which is what this patch was doing).
22941
22942 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22943
22944         * expression.cs (Invocation::ConversionExists): Re-write to use
22945         the conversion cache
22946
22947         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22948         cache all conversions done, not just user-defined ones.
22949
22950         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22951         to determine if a conversion exists instead of acutually trying to 
22952         perform the conversion. It's faster too.
22953
22954         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22955         and only then attempt the implicit conversion.
22956
22957 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22958
22959         * expression.cs (ConvertImplicit): Use a cache for conversions
22960         already found. Check level of recursion and bail out if necessary.
22961
22962 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22963
22964         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22965         Export standard methods that we expect for string operations.
22966
22967         * statement.cs (Block::UsageWarning): Track usage of variables and
22968         report the errors for not used variables.
22969
22970         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22971         operator. 
22972
22973 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22974
22975         * codegen.cs: remove unnneded code 
22976
22977         * expression.cs: Removed BuiltinTypeAccess class
22978
22979         Fix the order in which implicit conversions are
22980         done.  
22981
22982         The previous fixed dropped support for boxed conversions (adding a
22983         test to the test suite now)
22984
22985         (UserImplicitCast::CanConvert): Remove test for source being null,
22986         that code is broken.  We should not feed a null to begin with, if
22987         we do, then we should track the bug where the problem originates
22988         and not try to cover it up here.
22989
22990         Return a resolved expression of type UserImplicitCast on success
22991         rather than true/false.  Ravi: this is what I was talking about,
22992         the pattern is to use a static method as a "constructor" for
22993         objects. 
22994
22995         Also, do not create arguments until the very last minute,
22996         otherwise we always create the arguments even for lookups that
22997         will never be performed. 
22998
22999         (UserImplicitCast::Resolve): Eliminate, objects of type
23000         UserImplicitCast are born in a fully resolved state. 
23001
23002         * typemanager.cs (InitCoreTypes): Init also value_type
23003         (System.ValueType). 
23004
23005         * expression.cs (Cast::Resolve): First resolve the child expression.
23006
23007         (LValue): Add new method AddressOf to be used by
23008         the `&' operator.  
23009
23010         Change the argument of Store to take an EmitContext instead of an
23011         ILGenerator, because things like FieldExpr need to be able to call
23012         their children expression to generate the instance code. 
23013
23014         (Expression::Error, Expression::Warning): Sugar functions for
23015         reporting errors.
23016
23017         (Expression::MemberLookup): Accept a TypeContainer instead of a
23018         Report as the first argument.
23019
23020         (Expression::ResolvePrimary): Killed.  I still want to improve
23021         this as currently the code is just not right.
23022
23023         (Expression::ResolveMemberAccess): Simplify, but it is still
23024         wrong. 
23025
23026         (Unary::Resolve): Catch errors in AddressOf operators.
23027
23028         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23029         index to a byte for the short-version, or the compiler will choose
23030         the wrong Emit call, which generates the wrong data.
23031
23032         (ParameterReference::Emit, ::Store): same.
23033
23034         (FieldExpr::AddressOf): Implement.
23035
23036         * typemanager.cs: TypeManager: made public variable instead of
23037         property.
23038
23039         * driver.cs: document --fatal.
23040
23041         * report.cs (ErrorMessage, WarningMessage): new names for the old
23042         Error and Warning classes.
23043
23044         * cs-parser.jay (member_access): Turn built-in access to types
23045         into a normal simplename
23046
23047 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23048
23049         * expression.cs (Invocation::BetterConversion): Fix to cope
23050         with q being null, since this was introducing a bug.
23051
23052         * expression.cs (ConvertImplicit): Do built-in conversions first.
23053
23054 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23055
23056         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23057
23058 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23059
23060         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23061         I had introduced long ago (what's new ?).
23062
23063         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23064         the work of all the checking. 
23065         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23066         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23067
23068         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23069         that is the right way. 
23070
23071         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23072         overloading resolution. Use everywhere instead of cutting and pasting code.
23073
23074         (Binary::ResolveOperator): Use MakeUnionSet.
23075
23076         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23077         we have to convert to bool types. Not complete yet.
23078
23079 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23080
23081         * typemanager.cs (TypeManager::CSharpName): support ushort.
23082
23083         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23084         to provide an expression that performsn an implicit constant int
23085         conversion (section 6.1.6).
23086         (Expression::ConvertImplicitRequired): Reworked to include
23087         implicit constant expression conversions.
23088
23089         (Expression::ConvertNumericExplicit): Finished.
23090
23091         (Invocation::Emit): If InstanceExpression is null, then it means
23092         that we perform a call on this.
23093
23094 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23095
23096         * expression.cs (Unary::Emit): Remove some dead code.
23097         (Probe): Implement Resolve and Emit for `is'.
23098         (Expression::ConvertImplicitRequired): Attempt to do constant
23099         expression conversions here.  Maybe should be moved to
23100         ConvertImplicit, but I am not sure.
23101         (Expression::ImplicitLongConstantConversionPossible,
23102         Expression::ImplicitIntConstantConversionPossible): New functions
23103         that tell whether is it possible to apply an implicit constant
23104         expression conversion.
23105
23106         (ConvertNumericExplicit): Started work on explicit numeric
23107         conversions.
23108
23109         * cs-parser.jay: Update operator constants.
23110
23111         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23112         (Parameters::GetSignature): Hook up VerifyArgs here.
23113         (Parameters::VerifyArgs): Verifies that no two arguments have the
23114         same name. 
23115
23116         * class.cs (Operator): Update the operator names to reflect the
23117         ones that the spec expects (as we are just stringizing the
23118         operator names).
23119
23120         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23121         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23122         previous usage did only work for our methods.
23123         (Expression::ConvertImplicit): Handle decimal implicit numeric
23124         conversions as well.
23125         (Expression::InternalTypeConstructor): Used to invoke constructors
23126         on internal types for default promotions.
23127
23128         (Unary::Emit): Implement special handling for the pre/post
23129         increment/decrement for overloaded operators, as they need to have
23130         the same semantics as the other operators.
23131
23132         (Binary::ResolveOperator): ditto.
23133         (Invocation::ConversionExists): ditto.
23134         (UserImplicitCast::Resolve): ditto.
23135
23136 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23137
23138         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23139         operator, return after emitting body. Regression tests pass again !
23140
23141         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23142         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23143         (Invocation::OverloadResolve): Ditto.
23144         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23145
23146         * everywhere : update calls to the above methods accordingly.
23147
23148 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23151
23152         * expression.cs (ExpressionStatement): New base class used for
23153         expressions that can appear in statements, so that we can provide
23154         an alternate path to generate expression that do not leave a value
23155         on the stack.
23156
23157         (Expression::Emit, and all the derivatives): We no longer return
23158         whether a value is left on the stack or not.  Every expression
23159         after being emitted leaves a single value on the stack.
23160
23161         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23162         facilties of ExpressionStatement if possible.
23163
23164         * cs-parser.jay: Update statement_expression.
23165
23166 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * driver.cs: Change the wording of message
23169
23170 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23171
23172         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23173         the type of the expression to the return type of the method if
23174         we have an overloaded operator match ! The regression tests pass again !
23175         (Unary::ResolveOperator): Ditto.
23176
23177         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23178         to find "op_Implicit", not "implicit" ;-)
23179         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23180         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23181
23182         * everywhere : Correct calls to the above accordingly.
23183
23184         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23185         (ConvertImplicit): Do user-defined conversion if it exists.
23186
23187 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23188
23189         * assign.cs: track location.
23190         (Resolve): Use implicit conversions on assignment.
23191
23192         * literal.cs: Oops.  Not good, Emit of short access values should
23193         pass (Bytes) or the wrong argument will be selected.
23194
23195         * expression.cs (Unary::Emit): Emit code for -expr.
23196
23197         (Unary::ResolveOperator): Handle `Substract' for non-constants
23198         (substract from zero from the non-constants).
23199         Deal with Doubles as well. 
23200
23201         (Expression::ConvertImplicitRequired): New routine that reports an
23202         error if no implicit conversion exists. 
23203
23204         (Invocation::OverloadResolve): Store the converted implicit
23205         expressions if we make them
23206
23207 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23208
23209         * class.cs (ConstructorInitializer): Take a Location argument.
23210         (ConstructorBaseInitializer): Same here.
23211         (ConstructorThisInitializer): Same here.
23212
23213         * cs-parser.jay : Update all calls accordingly.
23214
23215         * expression.cs (Unary, Binary, New): Take location argument.
23216         Update accordingly everywhere.
23217
23218         * cs-parser.jay : Update all calls to the above to take a location
23219         argument.
23220
23221         * class.cs : Ditto.
23222
23223 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23224
23225         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23226         (Invocation::BetterConversion): Same here
23227         (Invocation::ConversionExists): Ditto.
23228
23229         (Invocation::ConversionExists): Implement.
23230
23231 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23232
23233         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23234         Also take an additional TypeContainer argument.
23235
23236         * All over : Pass in TypeContainer as argument to OverloadResolve.
23237
23238         * typemanager.cs (CSharpName): Update to check for the string type and return
23239         that too.
23240
23241         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23242         a given method.
23243
23244 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23245
23246         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23247         (Invocation::BetterFunction): Implement.
23248         (Invocation::BetterConversion): Implement.
23249         (Invocation::ConversionExists): Skeleton, no implementation yet.
23250
23251         Okay, things work fine !
23252
23253 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23254
23255         * typemanager.cs: declare and load enum_type, delegate_type and
23256         void_type. 
23257
23258         * expression.cs (Expression::Emit): Now emit returns a value that
23259         tells whether a value is left on the stack or not.  This strategy
23260         might be reveted tomorrow with a mechanism that would address
23261         multiple assignments.
23262         (Expression::report118): Utility routine to report mismatches on
23263         the ExprClass.
23264
23265         (Unary::Report23): Report impossible type/operator combination
23266         utility function.
23267
23268         (Unary::IsIncrementableNumber): Whether the type can be
23269         incremented or decremented with add.
23270         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23271         complemented. 
23272         (Unary::ResolveOperator): Implement ++, !, ~,
23273
23274         (Invocation::Emit): Deal with new Emit convetion.
23275
23276         * All Expression derivatives: Updated their Emit method to return
23277         whether they leave values on the stack or not.
23278
23279         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23280         stack for expressions that are statements. 
23281
23282 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23283
23284         * expression.cs (LValue): New interface.  Must be implemented by
23285         LValue objects.
23286         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23287         LValue interface.
23288
23289         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23290         interface for generating code, simplifies the code.
23291
23292 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23293
23294         * expression.cs (everywhere): Comment out return statements in ::Resolve
23295         methods to avoid the warnings.
23296
23297 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23298
23299         * driver.cs (parse): Report error 2001 if we can not open the
23300         source file.
23301
23302         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23303         not resolve it.
23304
23305         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23306         object. 
23307
23308         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23309         otherwise nested blocks end up with the same index.
23310
23311         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23312
23313         * expression.cs:  Instead of having FIXMEs in the Resolve
23314         functions, throw exceptions so it is obvious that we are facing a
23315         bug. 
23316
23317         * cs-parser.jay (invocation_expression): Pass Location information.
23318
23319         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23320         Use a basename for those routines because .NET does not like paths
23321         on them. 
23322
23323         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23324         already defined.
23325
23326 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23327
23328         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23329         are loading the correct data types (throws an exception if not).
23330         (TypeManager::InitCoreTypes): Use CoreLookupType
23331
23332         * expression.cs (Unary::ResolveOperator): return the child
23333         expression for expressions which are just +expr.
23334         (Unary::ResolveOperator): Return negative literals for -LITERAL
23335         expressions (otherwise they are Unary {Literal}).
23336         (Invocation::Badness): Take into account `Implicit constant
23337         expression conversions'.
23338
23339         * literal.cs (LongLiteral): Implement long literal class.
23340         (IntLiteral): export the `Value' of the intliteral. 
23341
23342 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23343
23344         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23345
23346         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23347         instead of 'Operator'
23348
23349         * expression.cs (Binary::ResolveOperator): Update accordingly.
23350         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23351         and 'Minus'
23352
23353         * cs-parser.jay (unary_expression): Update to use the new names.
23354
23355         * gen-treedump.cs (GetUnary): Same here.
23356
23357         * expression.cs (Unary::Resolve): Implement.
23358         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23359         operators are found instead of making noise ;-)
23360         (Unary::ResolveOperator): New method to do precisely the same thing which
23361         Binary::ResolveOperator does for Binary expressions.
23362         (Unary.method, .Arguments): Add.
23363         (Unary::OperName): Implement.   
23364         (Unary::ForceConversion): Copy and Paste !
23365
23366         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23367         a unary operator.
23368
23369         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23370         for the inbuilt operators. Only overloading works for now ;-)
23371
23372 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23373
23374         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23375         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23376
23377         * expression.cs (This::Emit): Implement. 
23378         (This::Resolve): Implement.
23379         (TypeOf:Resolve): Implement.
23380         (Expression::ResolveSimpleName): Add an implicit this to instance
23381         field references. 
23382         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23383         Bind instance variable to Field expressions.
23384         (FieldExpr::Instance): New field used to track the expression that
23385         represents the object instance.
23386         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23387         binding 
23388         (FieldExpr::Emit): Implement.
23389
23390         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23391         the last instruction contains a return opcode to avoid generating
23392         the last `ret' instruction (this generates correct code, and it is
23393         nice to pass the peverify output).
23394
23395         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23396         initializer for static and instance variables.
23397         (Constructor::Emit): Allow initializer to be null in the case of
23398         static constructors.  Only emit initializer for instance
23399         constructors. 
23400
23401         (TypeContainer::FindMembers): Return a null array if there are no
23402         matches.
23403
23404         Also fix the code for the MemberTypes.Method branch, as it was not
23405         scanning that for operators (or tried to access null variables before).
23406
23407         * assign.cs (Assign::Emit): Handle instance and static fields. 
23408
23409         * TODO: Updated.
23410
23411         * driver.cs: Stop compilation if there are parse errors.
23412
23413         * cs-parser.jay (constructor_declaration): Provide default base
23414         initializer for non-static constructors.
23415         (constructor_declarator): Do not provide a default base
23416         initializers if none was specified.
23417         Catch the fact that constructors should not have parameters.
23418
23419         * class.cs: Do not emit parent class initializers for static
23420         constructors, that should be flagged as an error.
23421
23422 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23423
23424         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23425         Move back code into TypeContainer::Populate.
23426
23427 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23428
23429         * class.cs (TypeContainer::AddConstructor): Fix the check to
23430         compare against Name, not Basename. 
23431         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23432
23433         * cs-parser.jay : Update accordingly.
23434
23435         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23436         for methods, don't forget to look into the operators too.
23437         (RegisterMethodBuilder): Helper method to take care of this for
23438         methods, constructors and operators.
23439         (Operator::Define): Completely revamp.
23440         (Operator.OperatorMethod, MethodName): New fields.
23441         (TypeContainer::Populate): Move the registering of builders into
23442         RegisterMethodBuilder.
23443         (Operator::Emit): Re-write.
23444
23445         * expression.cs (Binary::Emit): Comment out code path to emit method
23446         invocation stuff for the case when we have a user defined operator. I am
23447         just not able to get it right !
23448
23449 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23452         argument. 
23453
23454         (Expression::MemberLookup): Provide a version that allows to
23455         specify the MemberTypes and BindingFlags. 
23456
23457         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23458         so it was not fetching variable information from outer blocks.
23459
23460         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23461         Beforefieldinit as it was buggy.
23462
23463         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23464         that Ravi put here.  
23465
23466         * class.cs (Constructor::Emit): Only emit if block is not null.
23467         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23468         deal with this by semantically definining it as if the user had
23469         done it.
23470
23471         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23472         constructors as we now "emit" them at a higher level.
23473
23474         (TypeContainer::DefineDefaultConstructor): Used to define the
23475         default constructors if none was provided.
23476
23477         (ConstructorInitializer): Add methods Resolve and Emit. 
23478
23479         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23480
23481 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23482
23483         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23484         the default constructor builder with our hashtable for methodbuilders
23485         to methodcores.
23486
23487         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23488         and argument_count is 0 in which case we have a match.
23489         (Binary::ResolveOperator): More null checking and miscellaneous coding
23490         style cleanup.
23491
23492 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23493
23494         * rootcontext.cs (IsNameSpace): Compare against null.
23495
23496         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23497
23498         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23499         and Unary::Operator.
23500
23501         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23502         accordingly.
23503
23504         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23505         we have overloaded operators.
23506         (Binary::ResolveOperator): Implement the part which does the operator overload
23507         resolution.
23508
23509         * class.cs (Operator::Emit): Implement.
23510         (TypeContainer::Emit): Emit the operators we have too.
23511
23512         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23513         the case when we have a user-defined operator.
23514
23515 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23516
23517         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23518
23519 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23520
23521         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23522         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23523         (Constructor::Emit): Implement.
23524         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23525         if we have no work to do. 
23526         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23527         Emit method.
23528
23529         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23530         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23531
23532         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23533         of parent.parent.
23534
23535 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23536
23537         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23538         in the source.
23539         (Tree::RecordNamespace): Method to do what the name says ;-)
23540         (Tree::Namespaces): Property to get at the namespaces hashtable.
23541
23542         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23543         keep track.
23544
23545         * rootcontext.cs (IsNamespace): Fixed it :-)
23546
23547 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23548
23549         * class.cs (TypeContainer::FindMembers): Add support for
23550         constructors. 
23551         (MethodCore): New class that encapsulates both the shared aspects
23552         of a Constructor and a Method.  
23553         (Method, Constructor): Factored pieces into MethodCore.
23554
23555         * driver.cs: Added --fatal which makes errors throw exceptions.
23556         Load System assembly as well as part of the standard library.
23557
23558         * report.cs: Allow throwing exceptions on errors for debugging.
23559
23560         * modifiers.cs: Do not use `parent', instead use the real type
23561         container to evaluate permission settings.
23562
23563         * class.cs: Put Ravi's patch back in.  He is right, and we will
23564         have to cope with the
23565
23566 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23567
23568         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23569         FamORAssem, not FamANDAssem.
23570
23571 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23572
23573         * driver.cs: Added --parse option that only parses its input files
23574         and terminates.
23575
23576         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23577         incorrect.  IsTopLevel is not used to tell whether an object is
23578         root_types or not (that can be achieved by testing this ==
23579         root_types).  But to see if this is a top-level *class* (not
23580         necessarly our "toplevel" container). 
23581
23582 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23583
23584         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23585         parent instead of a direct call to GetType.
23586
23587 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23588
23589         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23590         Modifiers.TypeAttr. This should just be a call to that method.
23591
23592         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23593         object so that we can determine if we are top-level or not.
23594
23595         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23596         TypeContainer too.
23597
23598         * enum.cs (Enum::Define): Ditto.
23599
23600         * modifiers.cs (FieldAttr): Re-write.
23601
23602         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23603         (TypeContainer::HaveStaticConstructor): New property to provide access
23604         to precisely that info.
23605
23606         * modifiers.cs (MethodAttr): Re-write.
23607         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23608
23609         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23610         of top-level types as claimed.
23611
23612 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23613
23614         * expression.cs (MemberLookup): Fruitless attempt to lookup
23615         constructors.  Maybe I need to emit default constructors?  That
23616         might be it (currently .NET emits this for me automatically).
23617         (Invocation::OverloadResolve): Cope with Arguments == null.
23618         (Invocation::EmitArguments): new function, shared by the new
23619         constructor and us.
23620         (Invocation::Emit): Handle static and instance methods.  Emit
23621         proper call instruction for virtual or non-virtual invocations.
23622         (New::Emit): Implement.
23623         (New::Resolve): Implement.
23624         (MemberAccess:Resolve): Implement.
23625         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23626         to track instances.
23627         (FieldExpr::Resolve): Set type.
23628
23629         * support.cs: Handle empty arguments.
23630                 
23631         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23632         SimpleLookup): Auxiliary routines to help parse a qualifier
23633         identifier.  
23634
23635         Update qualifier_identifier rule.
23636
23637         * codegen.cs: Removed debugging messages.
23638
23639         * class.cs: Make this a global thing, this acts just as a "key" to
23640         objects that we might have around.
23641
23642         (Populate): Only initialize method_builders_to_methods once.
23643
23644         * expression.cs (PropertyExpr): Initialize type from the
23645         PropertyType. 
23646
23647         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23648         Resolve pattern.  Attempt to implicitly convert value to boolean.
23649         Emit code.
23650
23651         * expression.cs: Set the type for the int32/int32 argument case.
23652         (Binary::ResolveOperator): Set the return type to boolean for
23653         comparission operators
23654
23655         * typemanager.cs: Remove debugging print code.
23656
23657         (Invocation::Resolve): resolve type.
23658
23659         * class.cs: Allocate a MemberInfo of the correct size, as the code
23660         elsewhere depends on the test to reflect the correct contents.
23661
23662         (Method::) Keep track of parameters, due to System.Reflection holes
23663
23664         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23665         mapping here.
23666
23667         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23668         of the exact size and return that.
23669
23670         (Class::LookupMethodByBuilder): New function that maps
23671         MethodBuilders to its methods.  Required to locate the information
23672         on methods because System.Reflection bit us again.
23673
23674         * support.cs: New file, contains an interface ParameterData and
23675         two implementations: ReflectionParameters and InternalParameters
23676         used to access Parameter information.  We will need to grow this
23677         as required.
23678
23679         * expression.cs (Invocation::GetParameterData): implement a cache
23680         and a wrapper around the ParameterData creation for methods. 
23681         (Invocation::OverloadResolve): Use new code.
23682
23683 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23684
23685         * class.cs (TypeContainer::EmitField): Remove and move into 
23686         (Field::Define): here and modify accordingly.
23687         (Field.FieldBuilder): New member.
23688         (TypeContainer::Populate): Update accordingly.
23689         (TypeContainer::FindMembers): Implement.
23690
23691 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23692
23693         * statement.cs: (VariableInfo::VariableType): New field to be
23694         initialized with the full type once it is resolved. 
23695
23696 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23697
23698         * parameter.cs (GetParameterInfo): Use a type cache to compute
23699         things only once, and to reuse this information
23700
23701         * expression.cs (LocalVariableReference::Emit): Implement.
23702         (OpcodeCast::Emit): fix.
23703
23704         (ParameterReference::Resolve): Implement.
23705         (ParameterReference::Emit): Implement.
23706
23707         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23708         that are expressions need to stay as Expressions.
23709
23710         * typemanager.cs (CSharpName): Returns the C# name of a type if
23711         possible. 
23712
23713         * expression.cs (Expression::ConvertImplicit): New function that
23714         implements implicit type conversions.
23715
23716         (Expression::ImplicitReferenceConversion): Implements implicit
23717         reference conversions.
23718
23719         (EmptyCast): New type for transparent casts.
23720
23721         (OpcodeCast): New type for casts of types that are performed with
23722         a sequence of bytecodes.
23723
23724         (BoxedCast): New type used for casting value types into reference
23725         types.  Emits a box opcode.
23726
23727         (Binary::DoNumericPromotions): Implements numeric promotions of
23728         and computation of the Binary::Type.
23729
23730         (Binary::EmitBranchable): Optimization.
23731
23732         (Binary::Emit): Implement code emission for expressions.
23733
23734         * typemanager.cs (TypeManager): Added two new core types: sbyte
23735         and byte.
23736
23737 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23738
23739         * class.cs (TypeContainer::FindMembers): Method which does exactly
23740         what Type.FindMembers does, only we don't have to use reflection. No
23741         implementation yet.
23742
23743         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23744         typecontainer objects as we need to get at them.
23745         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23746
23747         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23748         typecontainer object.
23749
23750         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23751         of just a Report object.
23752
23753 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23754
23755         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23756         "remove_"
23757         (TypeContainer::Populate): Now define the delegates of the type too.
23758         (TypeContainer.Delegates): Property to access the list of delegates defined
23759         in the type.
23760
23761         * delegates.cs (Delegate::Define): Implement partially.
23762
23763         * modifiers.cs (TypeAttr): Handle more flags.
23764
23765 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23766
23767         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23768         and not <=
23769         (Operator::Define): Re-write logic to get types by using the LookupType method
23770         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23771         (Indexer::Define): Ditto.
23772         (Event::Define): Ditto.
23773         (Property::Define): Ditto.
23774
23775 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23776
23777         * class.cs (TypeContainer::Populate): Now define operators too. 
23778         (TypeContainer.Operators): New property to access the list of operators
23779         in a type.
23780         (Operator.OperatorMethodBuilder): New member to hold the method builder
23781         for the operator we are defining.
23782         (Operator::Define): Implement.
23783
23784 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23785
23786         * class.cs (Event::Define): Make the prefixes of the accessor methods
23787         addOn_ and removeOn_ 
23788
23789         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23790         of the location being passed in too. Ideally, this should go later since all
23791         error reporting should be done through the Report object.
23792
23793         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23794         (Populate): Iterate thru the indexers we have and define them too.
23795         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23796         for the get and set accessors.
23797         (Indexer::Define): Implement.
23798
23799 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23800
23801         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23802         my previous implementation, did not work.
23803
23804         * typemanager.cs: Add a couple of missing types (the longs).
23805
23806         * literal.cs: Use TypeManager.bool_type instead of getting it.
23807
23808         * expression.cs (EventExpr): New kind of expressions.
23809         (Expressio::ExprClassFromMemberInfo): finish
23810
23811 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23812
23813         * assign.cs: Emit stores to static fields differently.
23814
23815 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23816
23817         * Merge in changes and adjust code to tackle conflicts. Backed out my
23818         code in Assign::Resolve ;-) 
23819
23820 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23821
23822         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23823         instead Report.Error and also pass in the location.
23824         (CSharpParser::Lexer): New readonly property to return the reference
23825         to the Tokenizer object.
23826         (declare_local_variables): Use Report.Error with location instead of plain 
23827         old error.
23828         (CheckDef): Ditto.
23829
23830         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23831         (Operator.CheckBinaryOperator): Ditto.
23832
23833         * cs-parser.jay (operator_declarator): Update accordingly.
23834
23835         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23836         (CheckBinaryOperator): Same here.
23837
23838         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23839         on the name without any prefixes of namespace names etc. This is because we
23840         already might have something already fully qualified like 
23841         'System.Console.WriteLine'
23842
23843         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23844
23845 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23846
23847         * cs-tokenizer.cs (location): Return a string which also contains
23848         the file name.
23849
23850         * expression.cs (ElementAccess): New class for expressions of the
23851         type 'element access.'
23852         (BaseAccess): New class for expressions of the type 'base access.'
23853         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23854         respectively.
23855
23856         * cs-parser.jay (element_access): Implement action.
23857         (base_access): Implement actions.
23858         (checked_expression, unchecked_expression): Implement.
23859
23860         * cs-parser.jay (local_variable_type): Correct and implement.
23861         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23862
23863         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23864
23865         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23866         name and the specifiers.
23867
23868         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23869
23870         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23871         making them all public ;-)
23872
23873         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23874         class anyways.
23875
23876 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23877
23878         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23879         PropertyExprs.
23880         (FieldExpr, PropertyExprs): New resolved expressions.
23881         (SimpleName::MemberStaticCheck): Perform static checks for access
23882         to non-static fields on static methods. Maybe this should be
23883         generalized for MemberAccesses. 
23884         (SimpleName::ResolveSimpleName): More work on simple name
23885         resolution. 
23886
23887         * cs-parser.jay (primary_expression/qualified_identifier): track
23888         the parameter index.
23889
23890         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23891         (EmitContext::EmitBoolExpression): Chain to expression generation
23892         instead of temporary hack.
23893         (::EmitStatementExpression): Put generic expression code generation.
23894
23895         * assign.cs (Assign::Emit): Implement variable assignments to
23896         local variables, parameters and fields.
23897
23898 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23899
23900         * statement.cs (Block::GetVariableInfo): New method, returns the
23901         VariableInfo for a variable name in a block.
23902         (Block::GetVariableType): Implement in terms of GetVariableInfo
23903
23904         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23905         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23906
23907 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23908
23909         * cs-parser.jay (operator_declaration): Continue on my quest : update
23910         to take attributes argument.
23911         (event_declaration): Ditto.
23912         (enum_declaration): Ditto.
23913         (indexer_declaration): Ditto.
23914
23915         * class.cs (Operator::Operator): Update constructor accordingly.
23916         (Event::Event): Ditto.
23917
23918         * delegate.cs (Delegate::Delegate): Same here.
23919
23920         * enum.cs (Enum::Enum): Same here.
23921
23922 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23923
23924         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23925
23926         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23927
23928         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23929         being passed around as an arraylist.
23930         (Attributes::AddAttribute): Method to add attribute sections.
23931
23932         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23933         (struct_declaration): Update accordingly.
23934         (constant_declaration): Update.
23935         (field_declaration): Update.
23936         (method_header): Update.
23937         (fixed_parameter): Update.
23938         (parameter_array): Ditto.
23939         (property_declaration): Ditto.
23940         (destructor_declaration): Ditto.
23941
23942         * class.cs (Struct::Struct): Update constructors accordingly.
23943         (Class::Class): Ditto.
23944         (Field::Field): Ditto.
23945         (Method::Method): Ditto.
23946         (Property::Property): Ditto.
23947         (TypeContainer::OptAttribute): update property's return type.
23948
23949         * interface.cs (Interface.opt_attributes): New member.
23950         (Interface::Interface): Update to take the extra Attributes argument.
23951
23952         * parameter.cs (Parameter::Parameter): Ditto.
23953
23954         * constant.cs (Constant::Constant): Ditto.
23955
23956         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23957         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23958         the attributes as a parameter.
23959         (InterfaceProperty): Update constructor call.
23960         (InterfaceEvent): Ditto.
23961         (InterfaceMethod): Ditto.
23962         (InterfaceIndexer): Ditto.
23963
23964         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23965         pass the attributes too.
23966         (interface_event_declaration): Ditto.
23967         (interface_property_declaration): Ditto.
23968         (interface_method_declaration): Ditto.
23969         (interface_declaration): Ditto.
23970
23971 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23972
23973         * class.cs (Method::Define): Track the "static Main" definition to
23974         create an entry point. 
23975
23976         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23977         EntryPoint if we find it. 
23978
23979         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23980         (EmitContext::ig): Make this variable public.
23981
23982         * driver.cs: Make the default output file be the first file name
23983         with the .exe extension.  
23984
23985         Detect empty compilations
23986
23987         Handle various kinds of output targets.  Handle --target and
23988         rename -t to --dumper.
23989
23990         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23991         methods inherited from Expression return now an Expression.  This
23992         will is used during the tree rewriting as we resolve them during
23993         semantic analysis.
23994
23995         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23996         the spec.  Missing entirely is the information about
23997         accessability of elements of it.
23998
23999         (Expression::ExprClassFromMemberInfo): New constructor for
24000         Expressions that creates a fully initialized Expression based on
24001         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24002         a Type.
24003
24004         (Invocation::Resolve): Begin implementing resolution of invocations.
24005
24006         * literal.cs (StringLiteral):  Implement Emit.
24007
24008 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24009
24010         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24011         member.
24012
24013 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24014
24015         * cs-parser.jay (attribute_arguments): Implement actions.
24016         (attribute): Fix bug in production. Implement action.
24017         (attribute_list): Implement.
24018         (attribute_target): Implement.
24019         (attribute_target_specifier, opt_target_specifier): Implement
24020         (CheckAttributeTarget): New method to check if the attribute target
24021         is valid.
24022         (attribute_section): Implement.
24023         (opt_attributes): Implement.
24024
24025         * attribute.cs : New file to handle attributes.
24026         (Attribute): Class to hold attribute info.
24027
24028         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24029         (attribute_section): Modify production to use 2 different rules to 
24030         achieve the same thing. 1 s/r conflict down !
24031         Clean out commented, useless, non-reducing dimension_separator rules.
24032
24033         * class.cs (TypeContainer.attributes): New member to hold list
24034         of attributes for a type.
24035         (Struct::Struct): Modify to take one more argument, the attribute list.
24036         (Class::Class): Ditto.
24037         (Field::Field): Ditto.
24038         (Method::Method): Ditto.
24039         (Property::Property): Ditto.
24040
24041         * cs-parser.jay (struct_declaration): Update constructor call to
24042         pass in the attributes too.
24043         (class_declaration): Ditto.
24044         (constant_declaration): Ditto.
24045         (field_declaration): Ditto.
24046         (method_header): Ditto.
24047         (fixed_parameter): Ditto.
24048         (parameter_array): Ditto.
24049         (property_declaration): Ditto.
24050
24051         * constant.cs (Constant::Constant): Update constructor similarly.
24052         Use System.Collections.
24053
24054         * parameter.cs (Parameter::Parameter): Update as above.
24055
24056 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24057
24058         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24059         (TypeContainer.delegates): New member to hold list of delegates.
24060
24061         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24062         this time as I seem to be on crack ;-)
24063
24064 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24065
24066         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24067         tell whether an identifier represents a namespace.
24068
24069         * expression.cs (NamespaceExpr): A namespace expression, used only
24070         temporarly during expression resolution.
24071         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24072         utility functions to resolve names on expressions.
24073
24074 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24075
24076         * codegen.cs: Add hook for StatementExpressions. 
24077
24078         * class.cs: Fix inverted test for static flag in methods.
24079
24080 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24081
24082         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24083         to make it coincide with MS' number.
24084         (Operator::CheckBinaryOperator): Ditto.
24085
24086         * ../errors/errors.txt : Remove error numbers added earlier.
24087
24088         * ../errors/cs1019.cs : Test case for error # 1019
24089
24090         * ../errros/cs1020.cs : Test case for error # 1020
24091
24092         * cs-parser.jay : Clean out commented cruft.
24093         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24094         used anywhere - non-reducing rule.
24095         (namespace_declarations): Non-reducing rule - comment out.
24096
24097         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24098         with TypeContainer::AddEnum.
24099
24100         * delegate.cs : New file for delegate handling classes.
24101         (Delegate): Class for declaring delegates.
24102
24103         * makefile : Update.
24104
24105         * cs-parser.jay (delegate_declaration): Implement.
24106
24107 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24108
24109         * class.cs (Event::Define): Implement.
24110         (Event.EventBuilder): New member.
24111
24112         * class.cs (TypeContainer::Populate): Update to define all enums and events
24113         we have.
24114         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24115         readonly fields for all these cases ?
24116
24117 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24118
24119         * class.cs (Property): Revamp to use the convention of making fields readonly.
24120         Accordingly modify code elsewhere.
24121
24122         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24123         the Define method of the Property class.
24124
24125         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24126         trivial bug.
24127         (TypeContainer::Populate): Update to define all the properties we have. Also
24128         define all enumerations.
24129
24130         * enum.cs (Define): Implement.
24131
24132 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24133
24134         * cs-parser.jay (overloadable_operator): The semantic value is an
24135         enum of the Operator class.
24136         (operator_declarator): Implement actions.
24137         (operator_declaration): Implement.
24138
24139         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24140         validity of definitions.
24141         (Operator::CheckBinaryOperator): Static method to check for binary operators
24142         (TypeContainer::AddOperator): New method to add an operator to a type.
24143
24144         * cs-parser.jay (indexer_declaration): Added line to actually call the
24145         AddIndexer method so it gets added ;-)
24146
24147         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24148         already taken care of by the MS compiler ?  
24149
24150 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24151
24152         * class.cs (Operator): New class for operator declarations.
24153         (Operator::OpType): Enum for the various operators.
24154
24155 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24156
24157         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24158         ostensibly handle this in semantic analysis.
24159
24160         * cs-parser.jay (general_catch_clause): Comment out
24161         (specific_catch_clauses, specific_catch_clause): Ditto.
24162         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24163         (catch_args, opt_catch_args): New productions.
24164         (catch_clause): Rewrite to use the new productions above
24165         (catch_clauses): Modify accordingly.
24166         (opt_catch_clauses): New production to use in try_statement
24167         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24168         and re-write the code in the actions to extract the specific and
24169         general catch clauses by being a little smart ;-)
24170
24171         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24172         Hooray, try and catch statements parse fine !
24173
24174 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24175
24176         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24177         string from the hashtable of variables.
24178
24179         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24180         I end up making that mistake ;-)
24181         (catch_clauses): Fixed gross error which made Key and Value of the 
24182         DictionaryEntry the same : $1 !!
24183
24184 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24185
24186         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24187
24188         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24189         when the add and remove accessors are specified. 
24190
24191 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24192
24193         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24194         information about indexer_declarator.
24195         (indexer_declarator): Implement actions.
24196         (parsing_indexer): New local boolean used to keep track of whether
24197         we are parsing indexers or properties. This is necessary because 
24198         implicit_parameters come into picture even for the get accessor in the 
24199         case of an indexer.
24200         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24201
24202         * class.cs (Indexer): New class for indexer declarations.
24203         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24204         (TypeContainer::indexers): New member to hold list of indexers for the
24205         type.
24206
24207 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24208
24209         * cs-parser.jay (add_accessor_declaration): Implement action.
24210         (remove_accessor_declaration): Implement action.
24211         (event_accessors_declaration): Implement
24212         (variable_declarators): swap statements for first rule - trivial.
24213
24214         * class.cs (Event): New class to hold information about event
24215         declarations.
24216         (TypeContainer::AddEvent): New method to add an event to a type
24217         (TypeContainer::events): New member to hold list of events.
24218
24219         * cs-parser.jay (event_declaration): Implement actions.
24220
24221 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24222
24223         * cs-parser.jay (dim_separators): Implement. Make it a string
24224         concatenating all the commas together, just as they appear.
24225         (opt_dim_separators): Modify accordingly
24226         (rank_specifiers): Update accordingly. Basically do the same
24227         thing - instead, collect the brackets here.
24228         (opt_rank_sepcifiers): Modify accordingly.
24229         (array_type): Modify to actually return the complete type string
24230         instead of ignoring the rank_specifiers.
24231         (expression_list): Implement to collect the expressions
24232         (variable_initializer): Implement. We make it a list of expressions
24233         essentially so that we can handle the array_initializer case neatly too.
24234         (variable_initializer_list): Implement.
24235         (array_initializer): Make it a list of variable_initializers
24236         (opt_array_initializer): Modify accordingly.
24237
24238         * expression.cs (New::NType): Add enumeration to help us
24239         keep track of whether we have an object/delegate creation
24240         or an array creation.
24241         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24242         members to hold data about array creation.
24243         (New:New): Modify to update NewType
24244         (New:New): New Overloaded contructor for the array creation
24245         case.
24246
24247         * cs-parser.jay (array_creation_expression): Implement to call
24248         the overloaded New constructor.
24249
24250 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24251
24252         * class.cs (TypeContainer::Constructors): Return member
24253         constructors instead of returning null.
24254
24255 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24256
24257         * typemanager.cs (InitCoreTypes): Initialize the various core
24258         types after we have populated the type manager with the user
24259         defined types (this distinction will be important later while
24260         compiling corlib.dll)
24261
24262         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24263         on Expression Classification.  Now all expressions have a method
24264         `Resolve' and a method `Emit'.
24265
24266         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24267         generation from working.     Also add some temporary debugging
24268         code. 
24269
24270 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24271
24272         * codegen.cs: Lots of code generation pieces.  This is only the
24273         beginning, will continue tomorrow with more touches of polish.  We
24274         handle the fundamentals of if, while, do, for, return.  Others are
24275         trickier and I need to start working on invocations soon.
24276
24277         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24278         s.InitStatement. 
24279
24280         * codegen.cs (EmitContext): New struct, used during code
24281         emission to keep a context.   Most of the code generation will be
24282         here. 
24283
24284         * cs-parser.jay: Add embedded blocks to the list of statements of
24285         this block.  So code generation proceeds in a top down fashion.
24286
24287 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24288
24289         * statement.cs: Add support for multiple child blocks.
24290
24291 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24292
24293         * codegen.cs (EmitCode): New function, will emit the code for a
24294         Block of code given a TypeContainer and its ILGenerator. 
24295
24296         * statement.cs (Block): Standard public readonly optimization.
24297         (Block::Block constructors): Link children. 
24298         (Block::Child): Child Linker.
24299         (Block::EmitVariables): Emits IL variable declarations.
24300
24301         * class.cs: Drop support for MethodGroups here, delay until
24302         Semantic Analysis.
24303         (Method::): Applied the same simplification that I did before, and
24304         move from Properties to public readonly fields.
24305         (Method::ParameterTypes): Returns the parameter types for the
24306         function, and implements a cache that will be useful later when I
24307         do error checking and the semantic analysis on the methods is
24308         performed.
24309         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24310         and made a method, optional argument tells whether this is a class
24311         or a structure to apply the `has-this' bit.
24312         (Method::GetCallingConvention): Implement, returns the calling
24313         convention. 
24314         (Method::Define): Defines the type, a second pass is performed
24315         later to populate the methods.
24316
24317         (Constructor::ParameterTypes): implement a cache similar to the
24318         one on Method::ParameterTypes, useful later when we do semantic
24319         analysis. 
24320
24321         (TypeContainer::EmitMethod):  New method.  Emits methods.
24322
24323         * expression.cs: Removed MethodGroup class from here.
24324
24325         * parameter.cs (Parameters::GetCallingConvention): new method.
24326
24327 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24328
24329         * class.cs (TypeContainer::Populate): Drop RootContext from the
24330         argument. 
24331
24332         (Constructor::CallingConvention): Returns the calling convention.
24333         (Constructor::ParameterTypes): Returns the constructor parameter
24334         types. 
24335
24336         (TypeContainer::AddConstructor): Keep track of default constructor
24337         and the default static constructor.
24338
24339         (Constructor::) Another class that starts using `public readonly'
24340         instead of properties. 
24341
24342         (Constructor::IsDefault): Whether this is a default constructor. 
24343
24344         (Field::) use readonly public fields instead of properties also.
24345
24346         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24347         track of static constructors;  If none is used, turn on
24348         BeforeFieldInit in the TypeAttributes. 
24349
24350         * cs-parser.jay (opt_argument_list): now the return can be null
24351         for the cases where there are no arguments. 
24352
24353         (constructor_declarator): If there is no implicit `base' or
24354         `this', then invoke the default parent constructor. 
24355
24356         * modifiers.cs (MethodAttr): New static function maps a set of
24357         modifiers flags into a MethodAttributes enum
24358         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24359         MethodAttr, TypeAttr to represent the various mappings where the
24360         modifiers are used.
24361         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24362
24363 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24364
24365         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24366         method arguments.
24367
24368         * interface.cs (PopulateIndexer): Implemented the code generator
24369         for interface indexers.
24370
24371 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24372
24373         * interface.cs (InterfaceMemberBase): Now we track the new status
24374         here.  
24375
24376         (PopulateProperty): Implement property population.  Woohoo!  Got
24377         Methods and Properties going today. 
24378
24379         Removed all the properties for interfaces, and replaced them with
24380         `public readonly' fields. 
24381
24382 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24383
24384         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24385         initialize their hashtables/arraylists only when they are needed
24386         instead of doing this always.
24387
24388         * parameter.cs: Handle refs and out parameters.
24389
24390         * cs-parser.jay: Use an ArrayList to construct the arguments
24391         instead of the ParameterCollection, and then cast that to a
24392         Parameter[] array.
24393
24394         * parameter.cs: Drop the use of ParameterCollection and use
24395         instead arrays of Parameters.
24396
24397         (GetParameterInfo): Use the Type, not the Name when resolving
24398         types. 
24399
24400 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24401
24402         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24403         and instead use public readonly fields.
24404
24405         * class.cs: Put back walking code for type containers.
24406
24407 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * class.cs (MakeConstant): Code to define constants.
24410
24411         * rootcontext.cs (LookupType): New function.  Used to locate types 
24412
24413
24414 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24415
24416         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24417         this System.Reflection code is.  Kudos to Microsoft
24418
24419         * typemanager.cs: Implement a type cache and avoid loading all
24420         types at boot time.  Wrap in LookupType the internals.  This made
24421         the compiler so much faster.  Wow.  I rule!
24422
24423         * driver.cs: Make sure we always load mscorlib first (for
24424         debugging purposes, nothing really important).
24425
24426         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24427         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24428
24429         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24430         on namespaces that have been imported using the `using' keyword.
24431
24432         * class.cs (TypeContainer::TypeAttr): Virtualize.
24433         (Class::TypeAttr): Return attributes suitable for this bad boy.
24434         (Struct::TypeAttr): ditto.
24435         Handle nested classes.
24436         (TypeContainer::) Remove all the type visiting code, it is now
24437         replaced with the rootcontext.cs code
24438
24439         * rootcontext.cs (GetClassBases): Added support for structs. 
24440
24441 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24442
24443         * interface.cs, statement.cs, class.cs, parameter.cs,
24444         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24445         Drop use of TypeRefs, and use strings instead.
24446
24447 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24448
24449         * rootcontext.cs: 
24450
24451         * class.cs (Struct::Struct): set the SEALED flags after
24452         checking the modifiers.
24453         (TypeContainer::TypeAttr): new property, returns the
24454         TypeAttributes for a class.  
24455
24456         * cs-parser.jay (type_list): Oops, list production was creating a
24457         new list of base types.
24458
24459         * rootcontext.cs (StdLib): New property.
24460         (GetInterfaceTypeByName): returns an interface by type name, and
24461         encapsulates error handling here.
24462         (GetInterfaces): simplified.
24463         (ResolveTree): Encapsulated all the tree resolution here.
24464         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24465         types. 
24466
24467         * driver.cs: Add support for --nostdlib, to avoid loading the
24468         default assemblies.
24469         (Main): Do not put tree resolution here. 
24470
24471         * rootcontext.cs: Beginning of the class resolution.
24472
24473 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24474
24475         * rootcontext.cs: Provide better error reporting. 
24476
24477         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24478
24479         * rootcontext.cs (CreateInterface): Handle the case where there
24480         are no parent interfaces.
24481
24482         (CloseTypes): Routine to flush types at the end.
24483         (CreateInterface): Track types.
24484         (GetInterfaces): Returns an array of Types from the list of
24485         defined interfaces.
24486
24487         * typemanager.c (AddUserType): Mechanism to track user types (puts
24488         the type on the global type hash, and allows us to close it at the
24489         end). 
24490
24491 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24492
24493         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24494         RecordInterface instead.
24495
24496         * cs-parser.jay: Updated to reflect changes above.
24497
24498         * decl.cs (Definition): Keep track of the TypeBuilder type that
24499         represents this type here.  Not sure we will use it in the long
24500         run, but wont hurt for now.
24501
24502         * driver.cs: Smaller changes to accomodate the new code.
24503
24504         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24505         when done. 
24506
24507         * rootcontext.cs (CreateInterface):  New method, used to create
24508         the System.TypeBuilder type for interfaces.
24509         (ResolveInterfaces): new entry point to resolve the interface
24510         hierarchy. 
24511         (CodeGen): Property, used to keep track of the code generator.
24512
24513 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24514
24515         * cs-parser.jay: Add a second production for delegate_declaration
24516         with `VOID'.
24517
24518         (enum_body): Put an opt_comma here instead of putting it on
24519         enum_body or enum_member_declarations so we can handle trailing
24520         commas on enumeration members.  Gets rid of a shift/reduce.
24521
24522         (type_list): Need a COMMA in the middle.
24523
24524         (indexer_declaration): Tell tokenizer to recognize get/set
24525
24526         * Remove old targets.
24527
24528         * Re-add the parser target.
24529
24530 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24531
24532         * cs-parser.jay: Add precendence rules for a number of operators
24533         ot reduce the number of shift/reduce conflicts in the grammar.
24534
24535 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24536
24537         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24538         and put it here.
24539
24540         Get rid of old crufty code.
24541
24542         * rootcontext.cs: Use this to keep track of the parsed
24543         representation and the defined types available to the program. 
24544
24545         * gen-treedump.cs: adjust for new convention.
24546
24547         * type.cs: Split out the type manager, and the assembly builder
24548         from here. 
24549
24550         * typemanager.cs: the type manager will live here now.
24551
24552         * cil-codegen.cs: And the code generator here. 
24553
24554 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24555
24556         * makefile: Fixed up for easy making.
24557
24558 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24559
24560         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24561         the 
24562
24563         (unary_expression): Expand pre_increment_expression and
24564         post_decrement_expression to reduce a shift/reduce.
24565
24566 2001-07-11  Simon Cozens
24567
24568         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24569
24570         Improve allow_keyword_as_indent name.
24571
24572 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24573
24574         * Adjustments for Beta2. 
24575
24576 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24577
24578         * decl.cs: Added `Define' abstract method.
24579         (InTransit): new property, used to catch recursive definitions. 
24580
24581         * interface.cs: Implement `Define'. 
24582
24583         * modifiers.cs: Map Modifiers.constants to
24584         System.Reflection.TypeAttribute flags.
24585
24586         * class.cs: Keep track of types and user-defined types.
24587         (BuilderInit): New method for creating an assembly
24588         (ResolveType): New function to launch the resolution process, only
24589         used by interfaces for now.
24590
24591         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24592         that are inserted into the name space. 
24593
24594 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24595
24596         * ARGH.  I have screwed up my tree so many times due to the use of
24597         rsync rather than using CVS.  Going to fix this at once. 
24598
24599         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24600         load types.
24601
24602 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24603
24604         * Experiment successful: Use System.Type rather that our own
24605         version of Type.  
24606
24607 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24608
24609         * cs-parser.jay: Removed nsAliases from here.
24610
24611         Use new namespaces, handle `using XXX;' 
24612
24613         * namespace.cs: Reimplemented namespace handling, use a recursive
24614         definition of the class.  Now we can keep track of using clauses
24615         and catch invalid using clauses.
24616
24617 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24618
24619         * gen-treedump.cs: Adapted for all the renaming.
24620
24621         * expression.cs (Expression): this class now has a Type property
24622         which returns an expression Type.
24623
24624         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24625         `Type', as this has a different meaning now in the base
24626
24627 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24628
24629         * interface.cs, class.cs: Removed from all the sources the
24630         references to signature computation, as we can not do method
24631         signature computation during the parsing time, as we are not
24632         trying to solve at that point distinguishing:
24633
24634         class X {
24635                 void a (Blah x) {}
24636                 void a (NS.Blah x) {}
24637         }
24638
24639         Which depending on the context might be valid or not, as we do not
24640         know if Blah is the same thing as NS.Blah at that point.
24641
24642         * Redid everything so the code uses TypeRefs now instead of
24643         Types.  TypeRefs are just temporary type placeholders, that need
24644         to be resolved.  They initially have a pointer to a string and the
24645         current scope in which they are used.  This is used later by the
24646         compiler to resolve the reference to an actual Type. 
24647
24648         * DeclSpace is no longer a CIR.Type, and neither are
24649         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24650         are all DeclSpaces, but no Types. 
24651
24652         * type.cs (TypeRefManager): This implements the TypeRef manager,
24653         which keeps track of all the types that need to be resolved after
24654         the parsing has finished. 
24655
24656 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24657
24658         * ARGH.  We are going to have to store `foreach' as a class rather
24659         than resolving it, as we need to verify error 1579 after name
24660         resolution.   *OR* we could keep a flag that says `This request to
24661         IEnumerator comes from a foreach statement' which we can then use
24662         to generate the error.
24663
24664 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24665
24666         * class.cs (TypeContainer.AddMethod): we now add methods to the
24667         MethodGroup instead of the method hashtable.  
24668
24669         * expression.cs: Add MethodGroup abstraction, which gets us one
24670         step closer to the specification in the way we handle method
24671         declarations.  
24672
24673         * cs-parser.jay (primary_expression): qualified_identifier now
24674         tried to match up an identifier to a local variable reference or
24675         to a parameter reference.
24676
24677         current_local_parameters is now a parser global variable that
24678         points to the current parameters for the block, used during name
24679         lookup.
24680
24681         (property_declaration): Now creates an implicit `value' argument to
24682         the set accessor.
24683
24684 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24685
24686         * parameter.cs: Do not use `param' arguments as part of the
24687         signature, per the spec.
24688
24689 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24690
24691         * decl.cs: Base class for classes, structs and interfaces.  This
24692         is the "Declaration Space" 
24693
24694         * cs-parser.jay: Use CheckDef for checking declaration errors
24695         instead of having one on each function.
24696
24697         * class.cs: Factor out some code for handling error handling in
24698         accordance to the "Declarations" section in the "Basic Concepts"
24699         chapter in the ECMA C# spec.
24700
24701         * interface.cs: Make all interface member classes derive from
24702         InterfaceMemberBase.
24703
24704 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24705
24706         * Many things: all interfaces are parsed and generated in
24707         gen-treedump.  Support for member variables, constructors,
24708         destructors, properties, constants is there.
24709
24710         Beginning of the IL backend, but very little done, just there for
24711         testing purposes. 
24712
24713 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24714
24715         * cs-parser.jay: Fix labeled statement.
24716
24717         * cs-tokenizer.cs (escape): Escape " and ' always.
24718         ref_line, ref_name: keep track of the line/filename as instructed
24719         by #line by the compiler.
24720         Parse #line.
24721
24722 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24723
24724         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24725         to match the values in System.CodeDOM.
24726
24727         Divid renamed to Divide.
24728
24729         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24730         statements. 
24731         (Statements.set): remove.
24732
24733         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24734         statements. 
24735
24736         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24737         falseStatements always have valid values. 
24738
24739         * cs-parser.jay: Use System.CodeDOM now.
24740