2006-12-19 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2006-12-19  Marek Safar  <marek.safar@gmail.com>
2
3         * class.cs (GetClassBases): Write 5 times every day, will never use
4         FullName for error reporting.
5
6         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7
8 2006-12-19  Martin Baulig  <martin@ximian.com>
9
10         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
11         the symbol file info here.
12
13 2006-12-18  Marek Safar  <marek.safar@gmail.com>
14
15         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
16         of `elseif' is taking then following sections are not taking.
17         Fixes an issue reported on mono mailing list.
18
19 2006-12-18  Marek Safar  <marek.safar@gmail.com>
20
21         A fix for bug #80300
22         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
23         a caller is not taking.
24
25 2006-12-18  Raja R Harinath  <rharinath@novell.com>
26
27         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
28         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
29         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
30         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
31         * class.cs: Update to changes.
32
33 2006-12-17  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #79934
36         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
37         partial container.
38
39         * class.cs (ResolveMembers): Register an iterator in current container and
40         not in shared one.
41
42 2006-12-16  Raja R Harinath  <rharinath@novell.com>
43
44         Fix test-543.cs
45         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
46         satisfy a params annotated parameter.
47
48 2006-12-16  Marek Safar  <marek.safar@gmail.com>
49
50         A fix for bug #77014
51         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
52         paramters correctly and not rely on hacks in Parameters class.
53         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
54         at any possition.
55         (Invocation.VerifyArgumentsCompat): Ditto.
56         (Invocation.EmitArguments): Changed to correctly emit params arguments at
57         any possition.
58
59         * parameter.cs (HasParams): Don't assume that params is the last one.
60
61         * support.cs (ReflectionParameters.ctor): Look for params attribute
62         correctly.
63         (ReflectionParameters.ParameterType): Removed hack when we returned last
64         parameter for out of range parameters.
65         (ParameterName, ParameterModifier): Ditto.
66
67 2006-12-14  Marek Safar  <marek.safar@gmail.com>
68
69         A fix for bug #79987
70         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
71         when assembly is not CLS compliant but type is. I have no idea why is this
72         allowed.
73
74         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
75
76 2006-12-13  Miguel de Icaza  <miguel@novell.com>
77
78         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
79         in struct constructors, they are basically no-ops.
80
81 2006-12-12  Marek Safar  <marek.safar@gmail.com>
82
83         * cs-tokenizer.cs (Position): Save preprocessor status too.
84
85 2006-12-12  Marek Safar  <marek.safar@gmail.com>
86
87         A fix for bug #77794
88         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
89
90 2006-12-12  Marek Safar  <marek.safar@gmail.com>
91
92         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
93         Fixes #69299.
94         (pp_expr): Report error for an invalid expression.
95         (handle_preprocessing_directive): Simplified; add more error checking.
96
97 2006-12-11  Marek Safar  <marek.safar@gmail.com>
98
99         A fix for bug #74939
100         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
101         directives handling.
102
103 2006-12-10  Marek Safar  <marek.safar@gmail.com>
104
105         A fix for bugs #80093, and #75984
106         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
107         logic, it seems to me as it worked before "by coincidence".
108         (xtoken): Simplified to use reworked handle_preprocessing_directive.
109         (cleanup): Enabled endif check.
110
111 2006-12-09  Marek Safar  <marek.safar@gmail.com>
112
113         A fix for bug #80162
114         * statement.cs (CollectionForeach.TryType): Generics and non-generics
115         enumerators are never ambiguous.
116
117 2006-12-08  Raja R Harinath  <rharinath@novell.com>
118
119         Fix #80060
120         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
121
122 2006-12-06  Marek Safar  <marek.safar@gmail.com>
123
124         A fix for bug #80144
125         * class.cs (EventProperty.Define): Explicit implementation means
126         that an even is used.
127
128 2006-12-06  Marek Safar  <marek.safar@gmail.com>
129
130         Fixes the operators implementation (part II)
131
132         * cfold.cs (DoConstantNumericPromotions): Renamed to
133         DoBinaryNumericPromotions and simplified.
134         (BinaryFold): Couple of conversion fixes; simplified.
135
136         * constant.cs, ecore.cs, literal.cs
137         (ToType): Renamed to ConvertImplicitly.
138         (Reduce): Renamed to ConvertExplicitly.
139
140         * class.cs, convert.cs: Updated.
141
142         * expression.cs: TryReduce doesn't throw an exception.
143
144 2006-12-01  Marek Safar  <marek.safar@gmail.com>
145
146         A fix for bug #80108
147         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
148         compatible.
149
150 2006-11-30  Marek Safar  <marek.safar@gmail.com>
151
152         Fixes unary operators implementation (part I)
153         Also fixes #80026
154
155         * cfold.cs (Error_CompileTimeOverflow): Made internal
156
157         * const.cs (IConstant): Changed to use reference to constant and
158         not constant itself.
159         Updated IConstant implementations.
160
161         * constant.cs (CreateConstant): New factory method.
162         Updated IConstant implementation.
163
164         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
165
166         * ecore.cs: Updated to use CreateConstantReference.
167
168         * enum.cs: Reflects IConstant changes.
169
170         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
171
172         * literal.cs (NullConstant): Change to be independently usable.
173
174 2006-11-29  Martin Baulig  <martin@ximian.com>
175
176         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
177         we need to emit the scope initializer before calling the base .ctor.
178
179         * anonymous.cs: Merged back from the new anonymous methods branch.
180         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
181
182         * expression.cs (ParameterReference.DoResolveBase): Create a
183         "normal" ScopeInfo when capturing parameters rather than using the
184         root scope; this makes things work with anonymous methods having
185         parameters.
186
187         * statement.cs
188         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
189
190 2006-11-22  Marek Safar  <marek.safar@gmail.com>
191
192         A fix for bug #79987
193         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
194         check to a base class.
195         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
196         only when assembly has missing attribute.
197         * report.cs: Update.
198
199 2006-11-21  Marek Safar  <marek.safar@gmail.com>
200
201         * cs-tokenizer.cs: Merged with gmcs version.
202
203 2006-11-20  Marek Safar  <marek.safar@gmail.com>
204
205         * cs-tokenizer.cs,
206         * cs-parser.jay: Better error message when partial keyword is misplaced.
207
208 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
209
210         A fix for bug #79810
211         report.cs: CS1058 only applies to 2.0 profile (gmcs).
212         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
213         a RuntimeWrappedException by default.
214
215 2006-11-18  Marek Safar  <marek.safar@gmail.com>
216
217         A fix for bug #79843
218         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
219         implementation.
220         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
221
222 2006-11-18  Marek Safar  <marek.safar@gmail.com>
223
224         * driver.cs, namespace.cs: Uses faster IndexOf version.
225
226 2006-11-17  Marek Safar  <marek.safar@gmail.com>
227
228         A fix for bug #79941
229         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
230         operators.
231         (Operator.Define): Implicit/Explicit operator of same type is duplicate
232         even if internal name is different.
233         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
234         (UserDefinedConversion): Simplified as the operators cannot be internal.
235         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
236         conversions.
237         (MethodLookup): Replaced EmitContext with parentType.
238         * expression.cs: Updated.
239
240 2006-11-09  Raja R Harinath  <rharinath@novell.com>
241
242         * driver.cs (BadAssembly): Handle all the ugliness of
243         DefineDynamicAssembly.
244
245 2006-11-08  Raja R Harinath  <rharinath@novell.com>
246
247         Address parts of #58244 -- most of what's left is in the runtime
248         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
249         CS1509 error checks, and handle them for all assembly loads, not
250         just the first invocation.
251         (LoadModule): Likewise.  Move handling of 'adder_method' ...
252         * codegen.cs (AssemblyClass.AddModule): ... here.
253
254 2006-11-02  Marek Safar  <marek.safar@gmail.com>
255
256         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
257         IEnumerable<T> is ambiguous.
258
259 2006-10-31  Marek Safar  <marek.safar@gmail.com>
260
261         A fix for bug #67689
262         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
263         GetEnumerator is ambiguous.
264
265         * report.cs: Add new warning.
266
267 2006-10-29  Marek Safar  <marek.safar@gmail.com>
268
269         A fix for bug #78602
270         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
271         to protected member can be nested type.
272
273 2006-10-28  Marek Safar  <marek.safar@gmail.com>
274
275         A fix for bug #78965
276         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
277         to protected member must derive from current type.
278
279 2006-10-27  Marek Safar  <marek.safar@gmail.com>
280
281         assign.cs: Reuses error method.
282
283         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
284         instead of type for constants.
285         (Expression.Error_ValueAssignment): Common error method.
286
287         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
288         for any assignment.
289
290 2006-10-27  Marek Safar  <marek.safar@gmail.com>
291
292         A fix for bug #79081
293         * expression.cs (MemberAccess.DoResolve): Check nested type
294         accessibility.
295
296 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
297
298         * doc.cs : nested delegates were not handled. Fixed bug #79754.
299
300 2006-10-26  Marek Safar  <marek.safar@gmail.com>
301
302         A fix for bug #76591
303         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
304
305 2006-10-26  Marek Safar  <marek.safar@gmail.com>
306
307         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
308         type forwarder of the same type multiple times.
309
310 2006-10-26  Raja R Harinath  <rharinath@novell.com>
311
312         Fix #78820
313         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
314         instance as an rvalue, even when we later resolve as an lvalue.
315
316 2006-10-25  Martin Baulig  <martin@ximian.com>
317
318         * anonymous.cs: Fix #79673.
319
320 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
321
322         A fix for bug #79666
323         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
324         ignored when is optimized (= default value) as its value is already set.
325
326 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
327
328         A fix for bug #79724
329         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
330         TypeContainer for type lookup.
331
332 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
333
334         A fix for bug #79231
335         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
336         * expression.cs (OverloadResolve): Always convert type name for
337         an error message.
338         (ResolveNamespaceOrType): Don't confuse a nested type with any 
339         other member.
340
341 2006-10-18  Martin Baulig <martin@ximian.com>
342
343         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
344
345 2006-10-17  Miguel de Icaza  <miguel@novell.com>
346
347         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
348         an int32, but requesting an int64 from the conversion
349
350 2006-10-12  Martin Baulig  <martin@ximian.com>
351
352         * anonymous.cs
353         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
354         
355 2006-10-12  Martin Baulig  <martin@ximian.com>
356
357         * statement.cs
358         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
359
360 2006-10-11  Miguel de Icaza  <miguel@novell.com>
361
362         * convert.cs: Remove broken code: I was doing the "Existance"
363         tests for Implicit conversions.
364
365 2006-10-10  Miguel de Icaza  <miguel@novell.com>
366
367         * convert.cs: Added one missing case in
368         ImplicitStandardConversionExists uint64 to intptr.
369
370         Fixes #59800
371         
372         * typemanager.cs (uintptr_type): another core known type.   
373
374         * ecore.cs (OperatorCast): routine used to do cast operations that
375         depend on op_Explicit.  We could change some of the Decimal
376         conversions to use this.
377
378         This one has a probe mechanism that checks both types for an op_
379         which it coudl be used to eliminate two classes: CastToDecimal
380         and CastFromDecimal.
381
382         * convert.cs: Implement the conversions documented in #59800
383         
384 2006-10-10  Martin Baulig  <martin@ximian.com>
385
386         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
387         before RootScope.ResolveMembers().
388
389         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
390         `CurrentType' if appropriate.
391
392 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
393
394         A fix for bug #78568
395         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
396         when contains binary operators.
397         * cs-parser.jay: Updated.
398
399 2006-10-09  Martin Baulig  <martin@ximian.com>
400
401         * delegate.cs
402         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
403         moved that into Define() and also do the other type parameter
404         checks there.  Fixes #79094.  Added gtest-292.cs.
405
406         * expression.cs
407         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
408         since that doesn't include type parameters; don't use `Ldelema'
409         for type parameters.  Fixes #78980.  Added gtest-293.cs.
410
411 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
412
413         A fix for #77796
414         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
415         conversion is allowed.
416
417 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
418
419         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
420         error reporting when no error occurs.
421
422 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
423
424         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
425         does not exist.
426
427 2006-10-06  Raja R Harinath  <rharinath@novell.com>
428
429         Fix #79584
430         * class.cs (DefineTypeBuilder): Check circular dependencies before
431         setting the parent of the TypeBuilder.
432         (CheckRecursiveDefinition): Don't use 'BaseType', since
433         it may not be valid until after DefineTypeBuilder.  Use
434         'base_type' instead.
435
436 2006-10-04  Martin Baulig  <martin@ximian.com>
437
438         Merged the Anonymous Methods patch.
439
440         * anonymous.cs, iterators.cs: The new anonymous methods code.
441
442         * statement.cs (Variable): New public abstract class.
443         (LocalInfo.Variable): New public property.
444         (LocalInfo.ResolveVariable): New public method.
445         (Block.Flags): Add `IsIterator'.
446         (Block.AddVariable): Improved the CS0136 check.
447         (Block.AnonymousChildren): New public property.
448         (Block.AddAnonymousChild): New public method.
449         (ToplevelBlock): Update to use the new anonymous method framework.
450         (ToplevelBlock.ctor): `container' is now a `Block' and not a
451         `ToplevelBlock'; this is required to correctly implement the
452         CS0136 check.
453         (Fixed, Using): Use `TemporaryVariable' instead of directly
454         creating the `LocalBuilder'.
455
456         * parameter.cs (Parameter.ResolveVariable): New public method.
457         (Parameters.ResolveVariable): Likewise.
458
459         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
460
461         * class.cs (TypeContainer): Replaced the `iterators' list and
462         corresponding methods with a list of `CompilerGeneratedClass'es.
463         (TypeContainer.ResolveMembers): New public method.
464         (Method): `IIteratorContainer' has been replaced by
465         `IAnonymousHost'.
466
467         * expression.cs (VariableReference): New public abstract base
468         class for `LocalVariableReference', `ParameterReference' and
469         `This'.
470
471         * codegen.cs (EmitContext): Removed `capture_context',
472         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
473         (EmitContext.EmitThis): Removed.
474
475         * cs-parser.jay: Replace `iterator_container' with
476         `anonymous_host'.       
477
478 2006-10-04  Martin Baulig  <martin@ximian.com>
479
480         * generic.cs (GenericMethod): Don't make this abstract.
481         (Constraints.Clone): Added dummy implementation.
482
483 2006-10-04  Raja R Harinath  <harinath@gmail.com>
484
485         Fix #79577
486         * namespace.cs (LookForAnyGenericType): Avoid nullref on
487         'declspaces'.  Avoid allocating arrays willy-nilly.
488
489         Fix #79553
490         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
491         cases out of the switch.
492
493 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
494
495         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
496         message when non-generic type is used with the type arguments.
497         * expression.cs: Updated.
498
499 2006-09-28  Raja R Harinath  <rharinath@novell.com>
500
501         Fix #79013
502         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
503         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
504         Change semantics slightly.  Don't insist on having only one
505         temporary EmptyExpression -- just throttle the creation of new ones.
506
507         Fix #79451
508         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
509         non-interfaces too.  If no methods are found, don't try to create
510         a MethodGroupExpr.
511
512 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
513
514         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
515         generic type.
516
517         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
518         us produce better error message.
519
520 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
521
522         * expression.cs (Binary.ResolveOperator): Warn about a side effect
523         of the `|' operator.
524
525         * report.cs: A new warning added.
526
527 2006-09-27  Martin Baulig  <martin@ximian.com>
528
529         * generic.cs (GenericMethod): Don't make this abstract.
530
531 2006-09-27  Martin Baulig  <martin@ximian.com>
532
533         * report.cs
534         (InternalErrorException): Added overloaded ctor taking a params array.
535
536 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
537
538         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
539         Fixed the cases when same error was reported twice.
540
541         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
542         now report symbol information.
543
544 2006-09-25  Martin Baulig  <martin@ximian.com>
545
546         * class.cs: Completely unified with the gmcs version.
547
548 2006-09-25  Martin Baulig  <martin@ximian.com>
549
550         * typemanager.cs (TypeManager.IsNullableType): New public function.
551         (TypeManager.IsNullableTypeOf): Likewise.
552         (TypeManager.IsNullableValueType): Likewise.
553
554         * class.cs (MethodCore): Added the `GenericMethod' argument from
555         gmcs and also unified all classes derived from `MethodCore' with gmcs.
556
557 2006-09-24  Raja R Harinath  <harinath@gmail.com>
558
559         * convert.cs: Unify with gmcs version.
560
561 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
562
563         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
564         verify them as well.
565
566         * report.cs: New warning.
567
568 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
569
570         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
571         for anonymous block with out argument.
572
573 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
574
575         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
576         not used private events only.
577
578 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
579
580         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
581
582         * const.cs (Const.Define): Check for constant type.
583         (Const.IsConstantTypeValid): Looks for valid constant types.
584
585         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
586
587         * ecore.cs (EmptyConstantCast): New common class for all constant based
588         EmptyCast(s).
589
590         * expression.cs (Is.DoResolve): Handle null constant especially.
591         (New.DoResolve): Check for new void().
592         (MemberAccess.DoResolve): Cope with all kind of nulls.
593
594         * literal.cs (NullConstant): Uses EmptyConstantCast.
595         (NullDefault): Based on EmptyConstantCast.
596         (NullLiteral): Uses EmptyConstantCast.
597
598         * statement.cs (Block.ResolveMeta): Check for constant type.
599
600 2006-09-22  Martin Baulig  <martin@ximian.com>
601
602         * delegate.cs, attribute.cs: Merged with the gmcs versions.
603
604 2006-09-22  Raja R Harinath  <rharinath@novell.com>
605
606         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
607         not the null type.
608
609         Fix part of #79451
610         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
611         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
612         code slightly.
613
614 2006-09-22  Martin Baulig  <martin@ximian.com>
615
616         * ecore.cs: Merged with the gmcs version.
617
618         * generic.cs (ConstructedType): New dummy class.
619         (TypeArguments): Don't make this abstract.
620
621         * typemanager.cs
622         (TypeManager.IsGenericTypeDefinition): New method.
623         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
624
625 2006-09-22  Raja R Harinath  <rharinath@novell.com>
626
627         * expression.cs (ComposedCast): Check for arrays of TypedReference
628         before creating the type, not after.
629
630 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
631
632         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
633         after ToType change.
634
635         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
636         when constant must be implicitly convertible.
637
638         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
639
640         * ecore.cs (NullCast): Derives from NullConstant.
641
642         * expression.cs (Is.DoResolve): Removed useless variables.
643         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
644         (New.Constantify): Add enum support.
645         (MemberAccess.DoResolve): Add warning when accessing null constant or
646         variable.
647
648         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
649         property.
650
651         * literal.cs (NullConstant): New abstract class with common
652         functionality for all null specializations.
653         (NullDefault): Represents default(X) when result can be
654         reduced to null.
655         (NullLiteral): Updated.
656
657         * report.cs: Add new warning.
658
659 2006-09-21  Martin Baulig  <martin@ximian.com>
660
661         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
662
663 2006-09-21  Martin Baulig  <martin@ximian.com>
664
665         * generic.cs (GenericConstraints): New dummy class.
666         (Constraints): Likewise.
667         (TypeParameter): Likewise.
668         (TypeParameterName): Likewise.
669         (GenericMethod): Likewise.
670
671         * typemanager.cs (TypeManager.GetGenericArguments): New method.
672
673         * decl.cs: Merged with the gmcs version.
674
675 2006-09-21  Raja R Harinath  <rharinath@novell.com>
676
677         * generic.cs (TypeParameter): Implement IMemberContainer.
678         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
679
680         * rootcontext.cs: Unify with gmcs version.
681
682         * report.cs: Unify with gmcs version.
683         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
684         from gmcs/generics.cs.
685         * generics.cs (TypeParameter): New dummy class.
686
687         * support.cs: Unify with gmcs version.
688
689 2006-09-20  Raja R Harinath  <rharinath@novell.com>
690
691         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
692         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
693
694         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
695         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
696         * mcs.exe.sources: Add generic.cs.
697
698         * codegen.cs: Unify with gmcs version.
699
700         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
701         (EmitContext): Add GenericDeclContainer implementation.
702         * decl.cs (MemberCore, DeclSpace): Likewise.
703         * namespace.cs: Remove #ifdef GMCS_SOURCE.
704
705         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
706         MCS TypeManager has a corresponding dummy method.
707
708 2006-09-19  Martin Baulig  <martin@ximian.com>
709
710         * expression.cs: Completely merged with the gmcs version.
711
712 2006-09-19  Martin Baulig  <martin@ximian.com>
713
714         * expression.cs (Invocation): Merged with the gmcs version.
715         (ArrayAccess.GetStoreOpcode): Likewise.
716
717 2006-09-19  Martin Baulig  <martin@ximian.com>
718
719         * typemanager.cs
720         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
721         (TypeManager.IsGenericMethodDefinition): Likewise.
722
723 2006-09-19  Martin Baulig  <martin@ximian.com>
724
725         * typemanager.cs
726         (TypeManager.IsEqual): Moved the gmcs implementation here.
727         (TypeManager.DropGenericTypeArguments): Likewise.
728         (TypeManager.DropGenericMethodArguments): Likewise.
729         (TypeManager.GetTypeArguments): Moved here from gmcs.
730         (TypeManager.HasGenericArguments): Likewise.
731
732 2006-09-19  Martin Baulig  <martin@ximian.com>
733
734         * expression.cs (Binary): Merged with the gmcs version.
735
736 2006-09-19  Martin Baulig  <martin@ximian.com>
737
738         * expression.cs (Probe, As, Is): Merged with the gmcs version.
739
740 2006-09-19  Martin Baulig  <martin@ximian.com>
741
742         * typemanager.cs: Merged with the gmcs version.
743
744 2006-09-16  Raja R Harinath  <rharinath@novell.com>
745
746         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
747         * driver.cs: Likewise.
748
749 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
750
751         A fix for #79401
752         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
753         only if parent type is class.
754         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
755         update.
756
757 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
758
759         * cs-parser.jay,
760         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
761         keywords are used.
762         * typemanager.cs(CSharpName): Converts NullType to null.
763
764 2006-09-15  Martin Baulig  <martin@ximian.com>
765
766         * typemanager.cs
767         (TypeManager.GetMethodName): Added mcs implementation.
768         (TypeManager.IsEqual): Likewise.
769
770         * ecore.cs
771         (SimpleName.RemoveGenericArity): Added dummy implementation.
772
773         * pending.cs: Merged with the gmcs version.     
774
775 2006-09-15  Martin Baulig  <martin@ximian.com>
776
777         * statement.cs: Merge with the gmcs version.
778
779 2006-09-15  Martin Baulig  <martin@ximian.com>
780
781         * statement.cs (Switch): Merge with the gmcs implementation
782         (without nullables), which is newer.
783
784 2006-09-15  Martin Baulig  <martin@ximian.com>
785
786         * statement.cs (Block.Variables): Make this public.
787         (ToplevelBlock.Parameters): Make this a property.
788         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
789
790 2006-09-15  Martin Baulig  <martin@ximian.com>
791
792         * namespace.cs: Merge with the gmcs version.
793
794 2006-09-15  Martin Baulig  <martin@ximian.com>
795
796         * decl.cs (MemberName): Minor code cleanups.
797
798 2006-09-15  Martin Baulig  <martin@ximian.com>
799
800         * parameter.cs: Merge with the gmcs version.
801
802 2006-09-15  Martin Baulig  <martin@ximian.com>
803
804         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
805         and an error in mcs.
806
807 2006-09-15  Martin Baulig  <martin@ximian.com>
808
809         * flowanalysis.cs: Merged from GMCS; added the generics code into
810         a `GMCS_SOURCE' conditional so we can share this file.
811
812 2006-09-08  Martin Baulig  <martin@ximian.com>
813
814         * typemanager.cs (TypeManager.interlocked_type): New public field.
815         (TypeManager.int_interlocked_compare-exchange): New public field.
816         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
817         enumerator types here and call InitGenericCoreTypes().
818         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
819         after calling InitEnumUnderlyingTypes().
820
821         * rootcontext.cs
822         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
823         `classes_second_stage'. 
824
825 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
826
827         * assign.cs, ecore.cs, expression.cs: Share error message text.
828         * class.cs (FieldMember.Define): Check for varible of static type.
829         * driver.cs (LoadAssembly): Uses error output for errors.
830         * statement.cs: Updated.
831
832 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
833
834         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
835         type instance.
836
837 2006-09-07  Martin Baulig  <martin@ximian.com>
838
839         * driver.cs
840         (MainDriver): Revert r62663 from Marek; see #70506 for details.
841
842 2006-08-29  Miguel de Icaza  <miguel@novell.com>
843
844         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
845         
846 2006-08-17  Miguel de Icaza  <miguel@novell.com>
847
848         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
849         #52019 and #79064, the use of the \uXXXX sequence in source code
850         to represent unicode characters.
851
852 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
853
854         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
855         support.
856         * class.cs, ecore.cs, statement.cs: Merged to one error message.
857
858 2006-08-13  Miguel de Icaza  <miguel@novell.com>
859
860         * assign.cs: Catch attempts to assign to a method groups in += and
861         report as 1656
862
863 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
864
865         A fix for #79056
866         * cs-parser.jay: Don't destroy current array type by typeof of array's.
867
868 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
869
870         * class.cs (Method.Define): Issue a warning when generic method looks like
871         an entry point.
872         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
873         as well.
874
875 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
876  
877         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
878         looking for ctor.
879         * decl.cs (MemberCache.FindMembers): When container is interface we need to
880         search all base interfaces as a member can be ambiguous.
881         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
882         Constructor member type filter. 
883         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
884         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
885         reporting for returned memberinfos.
886         * report.cs: Updated.
887         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
888         version to work on all runtimes.
889         (TypeManager.RealMemberLookup): Removed members filtering.
890
891 2006-08-08  Raja R Harinath  <rharinath@novell.com>
892
893         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
894         (PropertyExpr.EmitAssign): Likewise.
895         * expression.cs (Indirection.EmitAssign): Likewise.
896         (LocalVariableReference.EmitAssign): Likewise.
897         (ParameterReference.EmitAssign): Likewise.
898         (Invocation.EmitArguments): Likewise.
899         (ArrayAccess.EmitAssign): Likewise.
900         (IndexerAccess.EmitAssign): Likewise.
901         (This.EmitAssign): Likewise.
902         (ConditionalLogicalOperator.Emit): Likewise.
903
904         Fix #79026
905         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
906         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
907         leave it in after returning it.
908         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
909
910 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
911
912         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
913         message.
914
915 2006-08-03  Raja R Harinath  <rharinath@novell.com>
916
917         Fix cs0146-3.cs and cs0146-4.cs.
918         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
919         enclosing types don't depend on the current type.
920
921 2006-08-02  Raja R Harinath  <rharinath@novell.com>
922
923         Fix #77963
924         * class.cs (TypeContainer.DoDefineMembers): Use
925         FindBaseMemberWithSameName on Parent, since we're interested in
926         whether we hide inherited members or not.
927         (FindBaseMemberWithSameName): Make slightly more robust.
928
929         Fix the non-generic testcase from #77396
930         * decl.cs (DeclSpace.DeclContainer): Remove override.
931
932         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
933         declspaces for doppelgangers too.
934         (UsingEntry): Implement IResolveContext.
935         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
936         'this' as the resolve context.
937         (LocalAliasEntry): Likewise.
938
939         Implement parts of #77403
940         * roottypes.cs (RootDeclSpace): New.  Used to represent the
941         toplevel declaration space.  Each namespace declaration introduces
942         a "partial" root declaretion space.
943         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
944         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
945         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
946         from 'current_namespace.SlaveDeclSpace'.
947         (namespace_declaration): Likewise.
948         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
949         check.  It can't happen now.
950         * decl.cs (DeclSpace.LookupType): Likewise.
951         * driver.cs (MainDriver): Sanity check.
952
953 2006-08-01  Raja R Harinath  <rharinath@novell.com>
954
955         * decl.cs (DeclSpace.FindNestedType): Remove.
956         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
957         LookupTypeContainer to get the container of the nested type.
958         * class.cs (TypeContainer.FindNestedType): Make non-override.
959
960 2006-07-31  Raja R Harinath  <rharinath@novell.com>
961
962         * decl.cs (DeclSpace.PartialContainer): Move field from ...
963         * class.cs (TypeContainer.PartialContainer): ... here.
964         (TypeContainer.AddBasesForPart): New helper.
965         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
966         instead.
967         * cs-parser.jay (current_class): Convert to DeclSpace.
968         (struct_declaration, interface_declaration, class_declaration):
969         Use AddBasesForPart instead of .Bases directly.
970         * const.cs, iterators.cs: Update to changes.
971
972 2006-07-28  Raja R Harinath  <rharinath@novell.com>
973
974         * class.cs (TypeContainer.AddMemberType): Rename from
975         AddToTypeContainer.
976         (TypeContainer.AddMember): Rename from AddToMemberContainer.
977         (AddTypeContainer): New.  Combine AddClassOrStruct and
978         AddInterface.
979         (AddPartial): Update.  Add 'is_partial' argument.
980         * roottypes.cs: Update to changes.
981         * cs-parser.jay (push_current_class): New helper for handling
982         current_container and current_class.
983         (struct_declaration, interface_declaration, class_declaration):
984         Use it.
985
986 2006-07-26  Raja R Harinath  <rharinath@novell.com>
987
988         * roottypes.cs: Rename from tree.cs.
989
990         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
991         * tree.cs (Tree, ITreeDump): Remove types.
992         * rootcontext.cs (tree, Tree): Remove fields.
993         (root, ToplevelTypes): New.
994         * *.cs: Update to rename.
995
996         * tree.cs (Tree.RecordDecl): Remove.
997         (RootTypes.AddToTypeContainer): Record the toplevel type in its
998         namespace here.
999         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
1000
1001 2006-07-23  Raja R Harinath  <harinath@gmail.com>
1002
1003         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
1004         DoFlowAnalysis and OmitStructFlowAnalysis here.
1005         (ec.With): Rename from WithUnsafe and generalize.
1006         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
1007         (ec.WithFlowAnalyis): New.
1008         * ecore.cs, expression.cs, statement.cs: Update.
1009
1010 2006-07-22  Raja R Harinath  <harinath@gmail.com>
1011
1012         * statement.cs (Block.ResolveMeta): Simplify slightly.
1013
1014         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
1015         multiple boolean fields.  Convert InUnsafe, constant_check_state,
1016         check_state to flags.
1017         (CheckState, ConstantCheckState): Update.
1018         (InUnsafe): New read-only property.
1019         (FlagsHandle): Rename from CheckStateHandle and convert to handle
1020         arbitrary flags.
1021         (WithUnsafe): New helper similar to WithCheckState.
1022         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
1023         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
1024
1025 2006-07-21  Raja R Harinath  <rharinath@novell.com>
1026
1027         Make comparisons use the same IL irrespective of whether they're
1028         in a 'checked' or 'unchecked' context: one of the issues in #78899
1029         * codegen.cs (EmitContext.CheckState): Make read-only property.
1030         (EmitContext.ConstantCheckState): Likewise.
1031         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
1032         helper that implement a save/restore stack for CheckState
1033         values.  This is the only way to change check-state.
1034         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
1035         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
1036         (CheckedExpr.EmitBranchable): New forwarding method.
1037         (UnCheckedExpr): Likewise.
1038         * statement.cs (Block.ResolveMeta): Use WithCheckState.
1039         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
1040         (Checked.Resolve, checked.DoEmit): Likewise.
1041
1042 2006-07-20  Miguel de Icaza  <miguel@novell.com>
1043
1044         * anonymous.cs: Cache the resolved anonymous delegate, and return
1045         this so that the ResolveTopBlock is only triggered once, not
1046         twice.
1047
1048         Currently we trigger ResolvetopBlock twice due to a first pass of
1049         argument check compatibility, and a second pass that does the
1050         actual resolution.   
1051         
1052 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1053
1054         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
1055         modifiers.
1056         * rootcontext.cs (Reset): Add helper_classes.
1057
1058 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
1059
1060         A fix for #78860
1061         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
1062         correctly.
1063
1064 2006-07-13  Miguel de Icaza  <miguel@novell.com>
1065
1066         * statement.cs (Lock): Handle expressions of type
1067         TypeManager.null_type specially.  Fixes #78770
1068
1069 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1070
1071         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
1072         to an event.
1073
1074 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
1077         for accessors as well.
1078         * ecore.cs (EventExpr): Add AccessorTable.
1079
1080 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
1081
1082         A fix for #78738
1083         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
1084         for CS0122 where appropriate.
1085         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
1086         level attributes.
1087         (Filter): Assembly can be null in the case of top level attributes.
1088
1089 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
1090
1091         A fix for #78690
1092
1093         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
1094         is done at global level.
1095
1096 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1097
1098         A fix for #77002, Implemented TypeForwarder support.
1099
1100         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
1101         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
1102         * typemanager.cs (): Add type_forwarder_attr_type.
1103
1104 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
1105
1106         * report.cs: Add CS0469 warning.
1107
1108 2006-06-21  Martin Baulig  <martin@ximian.com>
1109
1110         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
1111         the `try'-block, so we also report CS0016 etc. there.
1112
1113 2006-06-21  Martin Baulig  <martin@ximian.com>
1114
1115         * delegate.cs
1116         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
1117
1118 2006-06-21  Martin Baulig  <martin@ximian.com>
1119
1120         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
1121         also report CS1686 for parameters.
1122
1123 2006-06-21  Martin Baulig  <martin@ximian.com>
1124
1125         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
1126         instead of an error if the value is not implicitly convertible to
1127         the switch types; fixes #77964.
1128
1129 2006-06-21  Raja R Harinath  <rharinath@novell.com>
1130
1131         Fix #78673
1132         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
1133         FieldBuilder is null.
1134
1135         Fix #78662
1136         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
1137         'left' and 'right' before error-checking.
1138
1139 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
1140
1141         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
1142         Fixed bug #78601.
1143         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
1144         (FieldExpr.DoResolve): likewise.
1145         (PropertyExpr.InstanceResolve): likewise.
1146         (EventExpr.InstanceResolve): likewise. 
1147
1148 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
1149
1150         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
1151         attribute applicable tests for attribute argument.
1152
1153 2006-06-02  Raja R Harinath  <rharinath@novell.com>
1154
1155         Fix #78079
1156         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
1157         (Binary.OverloadResolve_PredefinedIntegral): New.
1158         (Binary.OverloadResolve_PredefinedFloating): New.
1159         (Binary.OverloadResolve_PredefinedString): New.
1160         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
1161         Follow the standard more closely, and treat numeric promotions in
1162         terms of overload resolution.
1163         (Binary.CheckShiftArguments): Simplify.
1164
1165 2006-06-01  Raja R Harinath  <rharinath@novell.com>
1166
1167         * flowanalysis.cs (MyBitVector): Simplify representation.
1168         (MyBitVector.Clone): Avoid allocating BitArray.
1169         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
1170         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
1171         (*): Update.  Change all references to MyBitVector.And and
1172         MyBitVector.Or to &= and |=.
1173
1174 2006-05-29  Raja R Harinath  <rharinath@novell.com>
1175
1176         Fix cs0231-[34].cs.
1177         * cs-parser.jay (formal_parameter_list): Extend the pattern below
1178         to param arguments too.
1179
1180 2006-05-26  Miguel de Icaza  <miguel@novell.com>
1181
1182         * cs-parser.jay: Catch another parsing form for arglist being
1183         followed by other arguments.  Fixes #78313.
1184
1185 2006-05-24  Raja R Harinath  <rharinath@novell.com>
1186
1187         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
1188         checking of out parameters to ...
1189         (FlowBranchingToplevel.Merge): ... here.
1190         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1191         set, propagate the origin upward, and only complain if there was
1192         no other error.
1193         (FlowBranchingException.AddContinueOrigin): Likewise.
1194         (FlowBranchingException.AddReturnOrigin): Likewise.
1195         (FlowBranchingException.AddGotoOrigin): Likewise.       
1196
1197 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1198
1199         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1200         unreachable, skip it.
1201         (FlowBranchingException.Merge): Always propagate jumps, even if
1202         the finally block renders subsequent code unreachable.
1203
1204 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1205
1206         Fix #77601
1207         * statement.cs (Goto.Resolve): Move responsibility for resolving
1208         'goto' to FlowBranching.AddGotoOrigin.
1209         (Goto.SetResolvedTarget): New.  Callback to set the
1210         LabeledStatement that's the target of the goto.
1211         (Goto.DoEmit): Use Leave instead of Br when crossing an
1212         unwind-protect boundary.
1213         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1214         LookupLabel and adjust to new semantics.
1215         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1216         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1217         Goto.SetResolvedTarget to update target.
1218         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1219         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1220         AddBreakOrigin & co.  Delay propagation until ...
1221         (FlowBranchingException.Merge): ... this.
1222
1223         * statement.cs (Block.Resolve): Always depend on flow-branching to
1224         determine unreachability.  Kill workaround that originally emitted
1225         only one statement after an "unreachable" label (see infloop in
1226         test-515.cs).
1227
1228         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1229         This is still "wrong", but anything better would probably need a
1230         multi-pass algorithm.
1231         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1232         usage vector.  Force current usage vector to be reachable, to
1233         optimistically signify backward jumps.
1234         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1235         detected.
1236         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1237         detected, return the original salted-away usage vector instead,
1238         updated with appropriate changes.  Print unreachable warning if
1239         necessary.
1240         * statement.cs (Block.Resolve): Don't print unreachable warning on
1241         a labeled statement.
1242
1243 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1244
1245         * driver.cs: Pass filename without path to AssemblyBuilder's 
1246         AddResourceFile. Fixes bug #78407.
1247
1248 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1249
1250         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1251         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1252         (FlowBranching.MergeChild): Overwrite
1253         reachability information from Labeled branchings too.
1254
1255 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1256
1257         * statement.cs (Goto.Resolve): Merge jump origins here ...
1258         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1259
1260         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1261         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1262         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1263         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1264         here, ...
1265         * statement.cs (Goto.Resolve): ... not here.
1266         (Goto.Emit): Remove CS1632 check.
1267
1268 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1271         error message.
1272
1273 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1274
1275         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1276         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1277         (FlowBranchingException.Label): Likewise.
1278
1279         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1280         given value.
1281         (MyBitVector.Or): Use it to avoid losing information (Count).
1282         (FlowBranching.MergeOrigins): Likewise.
1283
1284         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1285         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1286         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1287         (UsageVector.ToString): Simplify.
1288         (UsageVector.MergeSiblings): Move here from ...
1289         (FlowBranching.Merge): ... here.
1290         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1291         not a MyBitVector.
1292
1293 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1294
1295         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1296         null bitvector is treated as all-true.
1297
1298         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1299         (MyBitVector): Rationalize invariants.  'vector != null' implies
1300         that we have our own copy of the bitvector.  Otherwise,
1301         'InheritsFrom == null' implies all inherited bits are true.
1302
1303 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1304
1305         * statement.cs (LocalInfo): Add IsConstant.
1306         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1307         local variable for constants.
1308
1309 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1310
1311         * flowanalysis.cs (MyBitVector.Empty): New.
1312         (MyBitVector): Don't allow InheritedFrom to be null.
1313         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1314         (UsageVector, FlowBranching): Update to changes.
1315
1316         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1317         recursion.  The 'Parent == null' condition isn't sufficient for
1318         anonymous methods.
1319         (FlowBranching.AddBreakOrigin): Likewise.
1320         (FlowBranching.AddContinueOrigin): Likewise.
1321         (FlowBranching.AddReturnOrigin): Likewise.
1322         (FlowBranching.StealFinallyClauses): Likewise.
1323         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1324         (FlowBranching.CheckOutParameters): Likewise.
1325         (FlowBranchingToplevel): Terminate all the above recursions here.
1326         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1327         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1328
1329         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1330         toplevel block.
1331         (FlowBranchingToplevel): New.  Empty for now.
1332         (FlowBranching.MergeTopBlock): Update.
1333         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1334         branching for the anonymous delegate.
1335         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1336
1337         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1338         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1339         information at the start of the merge.  Reorganize.
1340
1341 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1342
1343         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1344
1345 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1346
1347         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1348         to newly introduced ctor.
1349
1350         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1351         message to one place.
1352         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1353         global namespace.
1354
1355 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1356
1357         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1358
1359         * ecore.cs (Expression.ResolveAsConstant): Updated.
1360
1361         * statement.cs (ResolveMeta): Updated.
1362
1363 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1364
1365         * cs-parser.jay: __arglist cannot be used in initializer.
1366
1367 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1368
1369         A fix for #77879
1370         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1371         private types.
1372
1373 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1374
1375         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1376         (LabeledStatement): Add 'name' parameter.
1377         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1378         (Block.AddLabel): Update to changes.
1379         * cs-parser.jay (labeled_statement): Likewise.
1380
1381         * flowanalysis.cs (BranchingType.Labeled): New.
1382         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1383         (FlowBranchingLabeled): New.  Does nothing for now, but will
1384         eventually handle 'goto' flows.
1385         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1386         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1387         that's terminated ...
1388         (Block.Resolve): ... here.
1389
1390         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1391         (UsageVector.MergeFinallyOrigins): Likewise.
1392         (FlowBranching.InTryOrCatch): Likewise.
1393         (FlowBranching.AddFinallyVector): Likewise.
1394         (FlowBranchingException): Update to changes.
1395
1396         Fix #78290
1397         * statement.cs (Return.Resolve): Move error checking to ...
1398         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1399         (FlowBranchingException): Handle return origins like break and
1400         continue origins.
1401         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1402
1403 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1404
1405         A fix for #76122
1406         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1407         filter.
1408
1409 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1410
1411         A fix for #77543
1412         * class.cs (MethodData.Define): Do public accessor check only when method
1413         implements an interface.
1414
1415 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1416
1417         Remove special handling of 'break'
1418         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1419         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1420         (UsageVector.Break): Remove.
1421         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1422         reachability.
1423         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1424
1425         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1426         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1427
1428 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1429
1430         A fix for #75726
1431         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1432         be the interface member.
1433
1434 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1435
1436         A fix for #60069
1437         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1438         for emitting small (int) values.
1439
1440 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1441
1442         Fix #59427
1443         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1444         control-flow passes through the 'finally' after merging-in all the
1445         control-flows from 'try' and the 'catch' clauses.
1446
1447         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1448         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1449         always true at the only non-recursive entry point.
1450         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1451         FlowBranchingBreakable.
1452         (FlowBranchingLoop): Remove.
1453         * statement.cs (Return.DoResolve): Update to changes.
1454
1455         Fix #76471, #76665
1456         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1457         (FlowBranching.CreateBranching): Handle it: create a
1458         FlowBranchingContinuable.
1459         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1460         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1461         except that it handles the 'continue' command.
1462         (FlowBranching.UsageVector.MergeOrigins): Rename from
1463         MergeBreakOrigins.
1464         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1465         except that it overrides AddContinueOrigin.
1466         (FlowBranchingException): Override AddContinueOrigin, similar to
1467         AddBreakOrigin.
1468         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1469         Create a new branching around the embedded statement.
1470         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1471         control flow after the embedded statement.
1472         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1473
1474         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1475         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1476         FlowBranchingBreakable.
1477         (FlowBranchingSwitch): Remove.
1478
1479         Fix test-503.cs
1480         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1481         error reporting to ...
1482         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1483         Rename from 'AddBreakVector'.  Add new location argument.  Return
1484         a bool indicating whether the 'break' crosses an unwind-protect.
1485         (FlowBranchingException.AddBreakOrigin): Add.
1486         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1487         flowbranching after updating with the effects of the 'finally'
1488         clause.
1489         (FlowBranchingBreakable): New common base class for
1490         FlowBranchingLoop and FlowBranchingSwitch.
1491
1492         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1493         embedded statement.
1494         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1495
1496 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1497
1498         * statement.cs (Do.Resolve): If the loop is infinite, set the
1499         barrier.
1500         (While.Resolve, For.Resolve): Set a barrier after the embedded
1501         statement.  There's no direct control flow that goes from the end
1502         of the embedded statement to the end of the loop.
1503         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1504         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1505         above ensure that the reachability is correctly computed.
1506
1507         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1508         (UsageVector.MergeBreakOrigins): If the current path is
1509         unreachable, treat it as if all parameters/locals are initialized.
1510         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1511         infinite loops before merging-in break origins.
1512
1513         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1514         (Reachability.Reachable): Split part into ...
1515         (Reachability.Unreachable): ... this.  Simplify.
1516         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1517
1518         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1519         (Reachability.SetThrowsSometimes): Likewise.
1520         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1521         TriState.Always, use corresponding property.
1522         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1523         (Block.Resolve): Likewise.  Remove some redundant checks.
1524
1525 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1526
1527         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1528         (Reachability.Meet): Don't bother checking AlwaysThrows --
1529         barrier is always set.
1530         (FlowBranchingBlock.Merge): Likewise.
1531
1532 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1533
1534         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1535         checks for unreachable.
1536
1537 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1538
1539         A fix for #77980
1540         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1541
1542         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1543         whether field is really assigned.
1544
1545 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1546
1547         * flowanalysis.cs (Reachability): Make 4-argument constructor
1548         private.
1549         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1550         (Reachability.Always): Rename from the highly misleading
1551         'Reachability.Never'.
1552         (FlowBranching.Merge): Update to changes.  Mark an impossible
1553         situation with a 'throw'.
1554         (*): Update to changes.
1555
1556 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1557
1558         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1559         Remove 'Undefined'.
1560         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1561         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1562         (*): Update to changes.
1563         * statement.cs: Update to changes.
1564
1565 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1566
1567         A fix for #78049
1568         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1569
1570 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1571
1572         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1573         dummy UsageVector.
1574
1575         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1576         argument to two arguments: an usage-vector and a bool.  Move call
1577         to FlowBranching.Merge () ...
1578         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1579
1580         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1581         handling of loop and switch reachability to ...
1582         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1583
1584 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1585
1586         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1587         handling to FlowBranchingLoop.InLoop.
1588         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1589
1590 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1591
1592         A fix for #78115
1593         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1594         anonymous method is allowed from AnonymousContainer here.
1595
1596         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1597
1598 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1599
1600         Fix #78156
1601         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1602
1603 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1604
1605         A fix for #49011.
1606         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1607         (DoubleConstant.Reduce): Ditto.
1608
1609 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1610
1611         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1612         Remove 'lvalue_right_side' argument.  Move parts to ...
1613         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1614         (LocalVariable.DoResolveLValue): ... these.
1615
1616 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1617
1618         Fix cs1655.cs
1619         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1620         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1621         (LocalVariableReference.DoResolveBase): Use it to implement new
1622         CS1655 check.
1623         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1624         (Argument.Resolve): Simplify.  Move CS1510 check ...
1625         * ecore.cs (Expression.ResolveLValue): ... here.
1626         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1627         (PropertyExpr.DoResolveLValue): Likewise.
1628         (FieldExpr.Report_AssignToReadonly): Likewise.
1629         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1630         LValueMemberAccess or LValueMemberOutAccess on instance depending
1631         on it.
1632         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1633         DoResolve as appropriate.
1634
1635 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1636
1637         Fix #75800
1638         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1639         implicit conversions on 'out' and 'ref' arguments.
1640
1641         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1642         improve clarity.  Remove dead code.
1643
1644         Fix #66031
1645         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1646         (Catch.Resolve): Resolve VarBlock if it exists.
1647
1648 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1649
1650         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1651         twice, this was some residual code, the enumerator was emitted
1652         properly in the two branche of if later.
1653
1654 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1655
1656         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1657         cast is never an lvalue.
1658         (Cast.DoResolve, Cast.ResolveRest): Combine.
1659         (Argument.Emit): Simplify slightly.  Move 'Expr is
1660         IMemoryLocation' check ...
1661         (Argument.Resolve): ... here.
1662         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1663
1664         Simplifications.  Fix cs0191-2.cs
1665         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1666         CS1649 and CS1651 to ...
1667         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1668         the actual selection of the error code and message to a lookup
1669         table.  Add a dummy return value to simplify callsites.
1670         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1671         readonly fields of other instances of the same type.  Move CS0197
1672         warning from ...
1673         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1674         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1675         resolution of an out or ref argument.  The code simplification
1676         above uses this invariant.
1677
1678 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1679
1680         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1681         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1682         CheckMarshallByRefAccess.  Drop parameter.
1683         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1684         warning.
1685         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1686         InstanceExpression.
1687         * report.cs (AllWarnings): Add CS1690.
1688         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1689         for ref access too.
1690         (LocalVariableReference.DoResolveBase): Update.
1691
1692 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1693
1694         * class.cs (MethodOrOperator): Moved common parts from method class.
1695         detect obsolete attributes.
1696         (Method.Define): Simplified as it reuses code from base.
1697         (Constructor.ValidAttributeTargets): Fixed issue found during
1698         refactoring.
1699         (Destructor.ValidAttributeTargets): Fixed issue found during
1700         refactoring.
1701         (Operator): Finished refactoring set off by #78020. Operator class is now
1702         ordinary method class.
1703
1704         * anonymous.cs: Updated.
1705
1706         * decl.cs (DeclSpace): Add IsGeneric
1707
1708 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1709
1710         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1711
1712 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1713
1714         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1715         detect obsolete attributes.
1716         (Method.CreateEmitContext): Moved to MethodOrOperator.
1717
1718 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1719
1720         A fix for #78048.
1721         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1722         customized exception to make crash detection easier.
1723         (MethodOrOperator): Started to work on new base class for methods and
1724         operators.
1725         (Method): Derives from MethodOrOperator.
1726         (Constructor.Emit): Emits its own attributes.
1727         (AbstractPropertyEventMethod.Emit): Ditto.
1728         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1729         patch.
1730         (Operator.Emit): It's temporary more tricky than should be.
1731         
1732         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1733
1734         * report.cs (InternalErrorException): Add ctor with inner exception.
1735
1736 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1737
1738         A fix for #76744.
1739         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1740         only not visible.
1741
1742 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1743
1744         A fix for #77916.
1745         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1746         array.
1747
1748 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1749
1750         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1751         attribute is present and Guid not.
1752         (Interface.ApplyAttributeBuilder): Ditto.
1753
1754         * attribute.cs: Add error message.
1755
1756 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1757
1758         A fix for #78020.
1759
1760         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1761         sources (it's composite) so hold them in extra array as they are used in
1762         Emit phase only. It worked in the previous versions by mistake.
1763         (Attribute.Emit): Emit attribute for more owners when exist.
1764
1765         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1766         it has now different behaviour.
1767
1768 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1769
1770         * constant.cs (Constant.IsDefaultInitializer): New method.
1771
1772         * class.cs: Updated.
1773
1774         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1775         re-initialize default values. It saves KBs almost for every assembly.
1776         Thanks Zoltan for the idea.
1777         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1778         (ArrayCreation.DoResolve): Resolve only once.
1779         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1780         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1781
1782 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1783
1784         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1785         From #77961.
1786
1787 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1788
1789         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1790         in an embedded statement too.
1791
1792 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1793
1794         Fix #77958
1795         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1796
1797 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1798
1799         A fix for #77966.
1800
1801         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1802         was not specified.
1803
1804         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1805
1806 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1807
1808         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1809         phase.
1810
1811         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1812         LocalTemporary change.
1813
1814         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1815         TypeContainer.
1816         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1817         initializers optimization.
1818         (ClassOrStruct.TypeAttr): Moved from modifiers.
1819         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1820         (FieldBase.ResolveInitializer): Resolves initializer.
1821         (FieldBase.HasDefaultInitializer): New property.
1822
1823         * cs-parser.jay: Removed message.
1824
1825         * expression.cs (CompilerGeneratedThis): New specialization.
1826
1827         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1828
1829 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1830
1831         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1832
1833 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1834
1835         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1836         be now EnumConstants only.
1837
1838 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1839
1840         * attribute.cs, driver.cs: Reset more caches.
1841
1842 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1843
1844         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1845
1846 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1847
1848         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1849         for easier reuse. Updated all overrides.
1850         (IntegralConstant): New base class for all integral constants.
1851         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1852         of the constant range, report custom error.
1853         (UIntConstant.Reduce): Fixed uint conversion.
1854
1855         * ecore.cs, literal.cs: Reduce updates.
1856
1857 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1858
1859         A fix for #75813.
1860
1861         * class.cs (Constructor.Define): Removed extra if for default ctors.
1862         A patch from Atsushi Enomoto.
1863
1864 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1865
1866         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1867         GetAttributableValue.
1868
1869         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1870         when required.
1871
1872         * convert.cs (ImplicitConversionRequired): Error message moved to
1873         DoubleLiteral.
1874
1875         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1876         automatic implicit conversion of an output value.
1877         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1878
1879         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1880         conversion.
1881         (TypeOf.GetAttributableValue): Add extra handling for object type.
1882
1883         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1884         special error message.
1885
1886 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1887
1888         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1889         InternalCall.
1890         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1891         compatible with MS runtime.
1892
1893 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1894
1895         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1896         attribute arguments here.
1897
1898         * class.cs (Indexer.Define): The check was moved to attribute class.
1899
1900 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1901
1902         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1903         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1904         easier.
1905
1906 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1907
1908         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1909         mcs to keep code differences small.
1910         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1911         * typemanager.cs (parameter_default_value_attribute_type): New.
1912         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1913         CS1908 check.
1914
1915 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1916
1917         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1918
1919 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1920
1921         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1922
1923         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1924         the blocks too.
1925
1926 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1927
1928         * doc-bootstrap.cs : fix build.
1929
1930 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1931
1932         * expression.cs (StringConcat.Append): Issue a warning when empty string
1933         is going to append.
1934
1935 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1936
1937         * assign.cs (CompoundAssign.ResolveSource): Removed.
1938
1939         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1940         clean up.
1941
1942         * class.cs (TypeContainer.FindMethods): Removed.
1943         (TypeContainer.CheckMemberUsage): Made static.
1944
1945         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1946
1947         * constant.cs (CheckRange): Removed unused type argument.
1948         (CheckUnsigned): Removed unused type argument.
1949
1950         * cs-parser.jay: Updated after MemberAccess clean up.
1951         Uses Length for empty string test.
1952
1953         * cs-tokenizer.cs: Uses Length for empty string test.
1954         (IsCastToken): Made static.
1955         (is_hex): Made static.
1956         (real_type_suffix): Made static.
1957
1958         * decl.cs (SetupCache): Made static.
1959         (OnGenerateDocComment): Removed unused ds argument.
1960
1961         * delegate.cs (VerifyDelegate): Removed unused argument.
1962
1963         * doc.cs: Uses Length for empty string test.
1964
1965         * driver.cs: Uses Length for empty string test.
1966
1967         * enum.cs (IsValidEnumType): Made static
1968
1969         * expression.cs (EnumLiftUp): Removed unused argument.
1970         (ResolveMethodGroup): Ditto.
1971         (BetterConversion): Ditto.
1972         (GetVarargsTypes): Ditto.
1973         (UpdateIndices): Ditto.
1974         (ValidateInitializers): Ditto.
1975         (MemberAccess.ctor): Ditto.
1976         (GetIndexersForType): Ditto.
1977
1978         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1979
1980         * iterators.cs: Updated after MemberAccess clean up.
1981
1982         * location.cs: Uses Length for empty string test.
1983
1984         * namespace.cs: Uses Length for empty string test.
1985
1986          * report.cs (CheckWarningCode): Made static.
1987
1988         * statement.cs (LabeledStatement): Removed unused argument.
1989
1990         * typemanager.cs (FilterNone): Removed.
1991
1992 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1993
1994         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1995         obsolete.
1996
1997         * class.cs: Updated.
1998
1999 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2000
2001         * cs-parser.jay.cs: __arglist is not allowed for delegates.
2002
2003 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2004
2005         A fix for #77822.
2006
2007         * expression.cs (VerifyArgumentsCompat): Reverted to double error
2008         reporting, it's more tricky than I thought.
2009
2010 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
2011
2012         A fix for #77816.
2013
2014         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
2015         host container.
2016         (AnonymousMethod.ImplicitStandardConversionExists): New method.
2017         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
2018         Add more error reporting; Fixed issue with params.
2019
2020         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
2021
2022         * cs-parser.jay: AnonymousMethod requires host container.
2023
2024         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
2025
2026 2006-03-18  Raja R Harinath  <harinath@gmail.com>
2027
2028         * class.cs: Change 'TypeContainer ds' constructor argument to
2029         'DeclSpace parent'.  Some classes were missed below due to
2030         different naming convention.
2031
2032         * class.cs (MemberCore.Parent): Delete.  This makes the
2033         ParentContainer changes below enforceable by the compiler.
2034
2035         Treat pointers to enclosing declaration space as 'DeclSpace', not
2036         'TypeContainer'.
2037         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
2038         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
2039
2040         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
2041         of TypeContainer.
2042         (Block.AddThisVariable): Likewise.
2043         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
2044         (AbstractPropertyEventMethod.Emit): Likewise.
2045         (AbstractPropertyEventMethod.EmitMethod): Likewise.
2046         (GetMethod.Define, SetMethod.Define): Likewise.
2047         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
2048         (DelegateMethod.EmitMethod): Likewise.
2049
2050         Fix regression test-partial-13.cs.
2051         Rationalize use of PartialContainer.  Ensure that the partial
2052         class semantics can be tied to type-correctness, i.e., any
2053         violation will cause a compile error.
2054         * class.cs, const.cs: Access all fields that belong to class
2055         TypeContainer via ParentContainer.  Arguments of EmitContexts and
2056         Resolve()-like functions still use 'Parent'.
2057
2058         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
2059         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
2060         (PropertyMethod.CheckModifiers): Remove unused argument.
2061         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
2062         DeclSpace.
2063
2064 2006-03-17  Raja R Harinath  <harinath@gmail.com>
2065
2066         Make semantics of PartialContainer simpler.
2067         * decl.cs (DeclSpace.IsPartial): Remove.
2068         * class.cs (TypeContainer.IsPartial): Likewise.
2069         (TypeContainer..ctor): Set PartialContainer to point to self.
2070         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
2071         (TypeContainer.FindNestedType): Likewise.
2072         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
2073
2074 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
2075
2076         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
2077
2078 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2079
2080         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
2081         classes.
2082
2083 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
2084
2085         * class.cs (Operator.Define): An error for base conversion was not
2086         reported correctly.
2087
2088 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
2089
2090         * iterator.cs : yield break is allowed in try statement which has
2091           catch clauses. Fixed bug #77767.
2092
2093 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
2094
2095         A fix for #77593, #77574.
2096
2097         * class.cs (MethodCore.CheckBase): Another if for operator.
2098
2099 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
2100
2101         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
2102         were not resolved
2103
2104         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
2105         (DelegateCreation.ImplicitStandardConversionExists): New method for just
2106         conversion test.
2107         
2108         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
2109         not needed.
2110
2111         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
2112         Updated after another emitcontext usage was clean up. It should help us to
2113         synchronize with gmcs easier.
2114
2115 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
2116
2117         A fix for #77353.
2118
2119         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
2120         (Event.Define): ditto
2121         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
2122
2123         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
2124         Removed redundant code and set NewSlot for Invoke method too.
2125
2126         * parameter.cs (Parameters.ctor): Add custom, type ctor.
2127         (Parameters.MergeGenerated): New method. Use this method when you merge
2128         compiler generated argument with user arguments.
2129
2130 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
2131
2132         * attribute.cs (ResolveAsTypeTerminal): Removed.
2133
2134         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
2135         specialization for predefined types; 30% speed up.
2136         Finally placed obsolete check to right place.
2137         (Expression.ResolveType): Removed.
2138
2139         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
2140         Updated after ResolveType was removed.
2141
2142         * expression.cs (Cast.ctor): Check void cast.
2143         (Binary.ResolveAsTypeTerminal): Is never type.
2144         (Conditional.ResolveAsTypeTerminal): Is never type.
2145
2146         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
2147
2148 2006-03-01  Raja R Harinath  <rharinath@novell.com>
2149
2150         Fix #77679.
2151         * expression.cs (ParameterReference.DoResolveBase): Change return
2152         type to bool.
2153         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
2154         Update.
2155
2156         Fix #77628.
2157         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
2158
2159         Fix #77642.
2160         * typemanager.cs (GetFullNameSignature): Don't nullref on
2161         protected accessors.
2162
2163 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
2164
2165         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
2166         these two separated members to simplify the code.
2167         (Attribute.Resolve): Refactored to use new fields and methods.
2168         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
2169         implemented obsolete attribute checking.
2170         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
2171         implemented obsolete checking again. It look line never ending quest ;-)
2172         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
2173
2174         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
2175
2176         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
2177
2178         *class.cs (Property.Define): Add RegisterProperty call.
2179
2180         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
2181         argument groups (only 2).
2182
2183         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
2184         encoding expression to arguments.
2185         (Expression.ExprClassToResolveFlags): Just turned to property.
2186
2187         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
2188         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2189         optimized as well as implemented support for zero-length attributes.
2190
2191         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2192         Add caching of PropertyInfo's.
2193
2194 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2195
2196         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2197         error multiple times.
2198
2199 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2200
2201         New partial class implementation.
2202         A fix for #77027, #77029, #77403
2203
2204         * attribute.cs (Attributable): Made attributes protected.
2205
2206         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2207         the replacements of ClassPart and PartialContainer.
2208         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2209         (TypeContainer.AddInterface): Ditto.
2210         (TypeContainer.AddPartial): The main method for partial classes. It checks
2211         for errors and merges ModFlags and attributes. At the end class is added to
2212         partial_parts list.
2213         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2214         required here.
2215         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2216         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2217         from the rest of partial classes.
2218         (TypeContainer.GetClassBases): Simplified.
2219         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2220         DefineType.
2221         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2222         (TypeContainer.HasExplicitLayout): Uses Flags now.
2223         (PartialContainer): Removed.
2224         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2225         (StaticClass): Was merged with Class.
2226         (Class.GetClassBases): class and static class bases are verified here.
2227         (Class.TypeAttr): Added static attributes when class is static.
2228         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2229         (MemberBase): In some cases we need to call parent container for partial
2230         class. It should be eliminated but it's not easy now.
2231
2232         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2233
2234         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2235         partial classed to accumulate class comments.
2236         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2237
2238         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2239
2240         * driver.cs (MainDriver): Tree.GetDecl was removed.
2241
2242         * modifiers.cs (Modifiers): Add partial modifier.
2243
2244         * tree.cs (Tree.decl): Removed.
2245         (RootTypes): Started to use this class more often for root types
2246         specializations.
2247
2248 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2249
2250         A fix for #77615
2251
2252         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2253         external interface does not have an attribute.
2254
2255 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2256
2257         Another prerequisites for new partial classs implementation.
2258         
2259         * attribute.cs (Attribute.Equal): Implemented.
2260         (Attribute.Emit): Changed as attributes can be applied more than twice.
2261         (Attributes.Emit): Check for duplicate attributes here.
2262
2263         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2264         as a parameter, clean-up.
2265
2266 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2267
2268         A fix for #77485
2269
2270         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2271         contains obsolete attribute check which can in some cases look for base
2272         type of current class which is not initialized yet.
2273         (TypeContainer.BaseType): Replacement of ptype.
2274
2275         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2276
2277 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2278
2279         First of prerequisites for new partial classs implemention.
2280         
2281         * attribute.cs (Attributable): Extended by ResolveContext;
2282         Attributes finally have correct context for resolving in all cases.
2283         (AttachTo): Attribute owner is assigned here.
2284
2285         * codegen.cs (IResolveContext): Introduce new interface to hold
2286         all information needed in resolving phase.
2287         (EmitContext): Implements IResolveContext; more clean-up needed here.
2288         
2289         * decl.cs (MemberCore): Implemented IResolveContext.
2290
2291         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2292         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2293         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2294         Refactored to use new IResolveContext instead of EmitContext; cleanup
2295
2296 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2297
2298         * codegen.cs (EmitScopeInitFromBlock): check here the
2299         capture_context, there is no need to make two calls to the
2300         EmitContext. 
2301
2302         * anonymous.cs: Add some debugging messages that might help me
2303         track other instances of this problem in the future (the
2304         regression of test 467).
2305
2306         * cs-parser.jay: track the variable block, as we need to initalize
2307         any captured variables declared in this block for the "catch"
2308         portion of the "Try" statement.
2309
2310         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2311         scope initialization for captured variables. 
2312
2313         Also, move the emit for the variables after the block location has
2314         been marked.
2315
2316 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2317
2318         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2319
2320 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2321
2322         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2323         commit yesterday, the initialization for the roots is necessary.
2324         What is not necessary is the scope activation.
2325
2326 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2327
2328         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2329         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2330         CS0206 checks.
2331         (Argument.Resolve): Remove CS0206 checks.
2332
2333 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2334
2335         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2336         scopes for all the roots, the scopes will now be emitted when the
2337         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2338
2339         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2340         code.  This reduces a lot of existing cruft.
2341         
2342         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2343         that the ScopeInfo is generated as we enter the scope, not at the
2344         time of use, which is what we used to do before.
2345
2346         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2347         every time a Block is about to be emitted if we have a
2348         CaptureContext. 
2349
2350 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2351
2352         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2353         (Reset): Update.
2354         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2355
2356         * typemanager.cs (cons_param_array_attribute): Make private.
2357         (Reset): Set it to null.
2358         (InitCoreHelpers): Don't initialize it.
2359         (ConsParamArrayAttribute): New.  Initialize it as needed.
2360         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2361
2362 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2363
2364         * expression.cs: There might be errors reported during the
2365         selection of applicable methods.  If there are errors, do not
2366         continue execution as it will lead the compiler to crash.
2367
2368 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2369
2370         * expression.cs: Member access is not allowed on anonymous
2371         methods.  Fixes #77402.
2372
2373 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2374
2375         Fix #77401
2376         * cs-parser.jay (VariableDeclaration): Don't set
2377         current_array_type to null.
2378         (field_declaration, event_declaration, declaration_statement):
2379         Set it to null here.
2380
2381 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2382
2383         * typemanager.cs (GenericParameterPosition): New.
2384         * doc.cs: Use it.
2385
2386 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2387
2388         * doc.cs : To process "include" elements, first we should create
2389           another list than XmlNodeList, because it could result in node
2390           removal, which could result in that the XmlNodeList gives up
2391           yielding next node.
2392
2393           (Also made code identical to gmcs again.)
2394
2395 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2396
2397         * ecore.cs: Introduce an error report that we were not catching
2398         before, if not silent, we must report the error.  Gonzalo ran into
2399         it.
2400
2401 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2402
2403         A fix for bug: #76957
2404         
2405         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2406         ComputeMethodHost before creating the method, this is a new
2407         requirement. 
2408
2409         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2410         that this method references (RegisterScope).  The actual scope
2411         where the method is hosted is computed with the ComputeMethodHost
2412         before we create the method.
2413
2414         Moved the Deepest routine here.
2415
2416         (AnonymousContainer.ComputeMethodHost): New routine used to
2417         compute the proper ScopeInfo that will host the anonymous method.
2418
2419         (ScopeInfo): Deal with multiple roots.  The problem was that we
2420         did not have a unique root where all ScopeInfos could be hanged
2421         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2422         of roots.  
2423
2424         Remove AdjustMethodScope which is now computed at the end.  Remove
2425         LinkScope which did a partial link, instead link all ScopeInfos
2426         before code generation from the new "LinkScopes" routine. 
2427
2428         Simplify all the Add* routines as they no longer need to maintain
2429         the tree, they just need to record that they are using variables
2430         from a ScopeInfo.
2431
2432         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2433         routines to produce the forest of ScopeInfo trees.
2434
2435         * class.cs (TypeContainer.AppendMethod): This is just like
2436         AddMethod, but ensures that an interface implementation method
2437         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2438         methods, but at the end.
2439
2440         We use this functionality to ensure that the generated MoveNext
2441         method in the iterator class is resolved/emitted before the
2442         enumerator methods created.   
2443
2444         This is required because the MoveNext method computes the right
2445         ScopeInfo for the method.  And the other methods will eventually
2446         need to resolve and fetch information computed from the anonymous
2447         method. 
2448
2449 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2450             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2451
2452         Fix rest of #76995.
2453         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2454         the 'aliases' hash.
2455         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2456         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2457
2458 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2459
2460         Fix #76656, cs0231-2.cs.
2461         * cs-parser.jay (formal_parameter_list): Make error case catch
2462         more issues.
2463         (parenthesized_expression_0): Add CS1026 check.
2464         (invocation_expression): Remove unused { $$ = lexer.Location }.
2465
2466 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2467
2468         Fix #76824.
2469         * cs-parser.jay (statement_expression): Don't list out the
2470         individual statement-expressions.  Convert syntax error into
2471         CS0201 check.
2472
2473 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2474
2475         Fix #76874.
2476         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2477         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2478         CheckIntermediateModification.
2479         (FieldExpr.DoResolve): Add new two-argument version that
2480         allows us to resolve the InstanceExpression as an lvalue.
2481         The one-argument variant is now just a wrapper.
2482         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2483         Resolve the lhs as an lvalue if the it has a value type.
2484         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2485         from Assign.DoResolve.
2486         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2487         resolved as an lvalue.
2488         (PropertyExpr.DoResolve): Update.
2489         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2490         has a value type.  Move CS1612 check here from
2491         CheckIntermediateModification.
2492         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2493         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2494         'right_side' of a ResolveLValue on an 'out' argument.
2495         (EmptyExpression.LValueMemberAccess): New.  Used as the
2496         'right_side' of a propagated ResolveLValue on a value type.
2497         (LocalVariableReference.DoResolveBase): Recognize
2498         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2499         Add CS1654 check.
2500         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2501         EmptyExpression.Null.
2502
2503 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2504
2505         * typemanager.cs : added IsGenericParameter(). In mcs it always
2506           return false.
2507         * doc.cs : for generic parameters, use GenericParameterPosition,
2508           not FullName.
2509
2510 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2511
2512         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2513
2514 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2515
2516         This fixes the problem where we used ldfld instead of ldflda to
2517         load the "THIS" pointer on captured parameters, when THIS is a
2518         value type.  See bug #77205.
2519         
2520         * iterators.cs (CapturedThisReference.Emit): Pass false to
2521         EmitThis (we do not need the address).
2522
2523         * codegen.cs (EmitThis): it needs to know whether we need the
2524         address of `this' or not.  This is used by value types.  
2525
2526         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2527         every other call passes false.
2528
2529 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2530
2531         Fix #77221.
2532         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2533         GetOverride.
2534         * expression.cs (Invocation.OverloadResolve): Update.
2535         (Invocation.DoResolve): Avoid double resolution of invocation.
2536
2537 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2538
2539         Fix #77180.
2540         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2541         unary negation of floating point types as 0-expr; negation cannot
2542         overflow in floating point types.
2543
2544         Fix #77204.
2545         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2546         on operands of 'void' type.
2547
2548         Fix #77200.
2549         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2550         and ExclusiveOr for boolean constants too.
2551
2552 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2553
2554         Fix #75636.
2555         * expression.cs (Invocation.OverloadResolve): Replace reflected
2556         override methods with their base virtual methods, rather than
2557         skipping over them.
2558         * typemanager.cs (TypeManager.GetOverride): New.
2559
2560 2006-01-05  Jb Evain  <jbevain@gmail.com>
2561
2562         * class.cs (Property.Define, Indexer.Define): do not tag the
2563         properties as SpecialName | RTSpecialName.
2564
2565 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2566
2567         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2568         doing a low-level comparission of parameter types.  It was lacking
2569         a check for __argslist. 
2570
2571 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2572
2573         * expression.cs (ParameterReference.DoResolveBase): Allow
2574         reference parameters if they are local to this block. 
2575
2576         This allows the ref and out parameters of a delegate to be used in
2577         an anonymous method, for example:
2578
2579         delegate void set (out int x);
2580
2581         set s = delegate (out int x){
2582                 x = 0;
2583         };
2584
2585         This is used by functionality introduced late in the C# language.
2586         
2587         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2588         method that take ref and out parameters. 
2589
2590         Fixes #77119 which was a late change in the spec.
2591
2592 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2593
2594         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2595         parent if its the same scope.  Fixes #77060.
2596
2597 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2598
2599         * driver.cs: Report the case of no source files and no -out:
2600         argument provided.
2601
2602 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2603
2604         Fix #77035.
2605         * expression.cs (ComposedCast.GetSignatureForError): Define.
2606
2607 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2608
2609         Fix #76995
2610
2611         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2612         ListDictionary, to contain the ExternAliasEntry entries (in
2613         addition to the NamespaceEntry.aliases hashtable). This field is
2614         shared between the original entry and its doppelganger (bodyless 
2615         copy of it).
2616         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2617         extern_aliases field.
2618         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2619         lookup in extern_aliases.
2620
2621 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2622
2623         Fix #77006.
2624         * class.cs (TypeContainer.Mark_HasEquals): New.
2625         (TypeContainer.Mark_HasGetHashCode): New.
2626         (ClassPart): Override them.
2627         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2628
2629         Fix #77008.
2630         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2631         'parent' argument to the base constructor.
2632
2633         Remove all mention of TypeContainer from decl.cs.
2634         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2635         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2636         (DeclSpace.DeclSpace): Likewise.
2637         (DeclSpace.DefineMembers): Remove unused argument.
2638         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2639         debugging check -- we don't care if the debug code throws an
2640         InvalidCastException instead of an InternalErrorException.
2641         * class.cs (TypeContainer.DefineMembers): Update to changes.
2642         (TypeContainer.DoDefineMembers): Likewise.
2643         (TypeContainer.GetMethods): Likewise.
2644         (PropertyMember.Define): Likewise.
2645         (MemberBase.Parent): New property that forwards to
2646         MemberCore.Parent, but ensures that we get a TypeContainer.
2647         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2648         (RootContext.PopulateTypes): Likewise.  Remove special case code
2649         for !RootContext.StdLib: DefineMembers is idempotent.
2650
2651 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2652
2653         * convert.cs (ExplicitConversionCore): Check the return value from
2654         ExplicitConversionCore which can return null on failure.  Fixes #76914
2655
2656 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2657
2658         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2659
2660 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2661
2662         * doc.cs : The search for referenced namespace was insufficient to
2663           get global one as it used to do. Fixed bug #76965.
2664
2665 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2666
2667         * doc.cs : check name in cref in the last phase that whether it is
2668           namespace or not.
2669
2670 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2671
2672         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2673           Mono.C5.
2674
2675 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2676
2677         * doc.cs : so it turned out that we cannot skip override check for 
2678           interface members. Fixed bug #76954.
2679
2680 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2681
2682         * cs-tokenizer.cs : fixed bug #75984:
2683           - #warning and #error should not be handled when the source line
2684             is disabled.
2685           - #line is not checked strictly when the source line is disabled.
2686           - #define and #undef is on the other hand checked strictly at any
2687             state.
2688
2689 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2690
2691         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2692           CS1027 report.
2693
2694 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2695
2696         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2697
2698         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2699         event initializers.
2700         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2701         (FieldBase.Initializer): Initializer is now optional.
2702         (EventField.Define): Only event field can have initializer.
2703
2704         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2705
2706         * const.cs (Const): Reuse initializer.
2707
2708         * cs-parser.jay: Updated after FieldBase changes.
2709         Added current_array_type to simplify array initializers.
2710
2711         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2712
2713         * expression.cs, iterators.cs: Updated.
2714
2715         * namespace.cs (NamespaceEntry): Made UsingFound private.
2716
2717 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2718
2719         * parameterCollection.cs: Obsolete, removed.
2720         * parser.cs: Obsolete, removed.
2721
2722 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2723
2724         Fix #76849.
2725         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2726
2727         * enum.cs (Enum.Define): Set obsolete context here.
2728
2729 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2730
2731         * doc.cs :
2732           - FindDocumentedMember() now expects 1) paramList as null
2733             when "we don't have to check the number of parameters" and
2734             2) Type.EmptyTypes when "there is no arguments".
2735           - Introduced FoundMember struct to hold the exact type which was
2736             used to find the documented member (the above change broke
2737             test-xml-044; it might be better just to use DeclaringType than
2738             what MS does, like this change does, but it depends on usage.)
2739
2740 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2741
2742         * doc.cs : documented member might be from DeclaringType for nested
2743           types. Fixed bug #76782.
2744
2745 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2746
2747         * anonymous.cs: Have the param code handle leaving copies on the
2748         stack etc. Allows anonymous params to take part in the assignment
2749         code (++, +=, etc). Fixes bug #76550
2750
2751         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2752         it down to the anon code.
2753
2754         * iterators.cs: Use dummy var here
2755
2756         * codegen.cs: Handle new vars
2757
2758 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2759
2760         Fix #76849.
2761         * class.cs (MethodData.Define): Set proper Obsolete context.
2762
2763         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2764         obsolete context.
2765         (FieldExpr.DoResolve): Ditto.
2766
2767 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2768
2769         Fix #76849.
2770         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2771         parent is not obsolete.
2772
2773 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2774
2775         * doc.cs : (FindDocumentedMember) find parameterless members first
2776           and get CS0419 in the early stage. Fixed first case of bug #76727.
2777
2778 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2779
2780         Fix #76859.
2781         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2782         no error was reported.
2783
2784         *expression.cs (Binary.DoResolve): left can be null.
2785
2786 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2787
2788         Fix #76783.
2789         * class.cs (MethodData.Emit): Parameters should be labeled first.
2790
2791 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2792
2793         Fix #76761.
2794         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2795
2796 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2797
2798         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2799
2800         * class.cs (MethodCore): Parameter clean up.
2801         (IMethodData): Added ParameterInfo.
2802         (MethodData): Parameter clean up.
2803         (Indexer.Define): Parameter clean up.
2804
2805         * anonymous.cs,
2806         * codegen.cs,
2807         * cs-parser.jay,
2808         * decl.cs,
2809         * doc.cs,
2810         * ecore.cs,
2811         * flowanalysis.cs,
2812         * iterators.cs,
2813         * pending.cs,
2814         * statement.cs,
2815         * typemanager.cs: Parameter clean up.
2816
2817         * delegate.cs (Define): Get rid of duplicated code.
2818
2819         * expression.cs (ParameterReference): Removed useless parameters
2820         and simplified.
2821         (Invocation): Ditto.
2822
2823         * parameter.cs (ParamsParameter): New class, params specialization.
2824         (ArglistParameter): Attemp to separate arglist.
2825         (Parameter): Refactored to be reusable and faster.
2826         (Parameter.Modifier): Made understandable.
2827         (Parameters): Changed to be used as a class for `this' assembly
2828         parameters. Refactored to use new specialized classes.
2829
2830         * support.cs (ParameterData): Added Types property.
2831         (InternalParameters): Deleted.
2832
2833 2005-08-20  Martin Baulig  <martin@ximian.com>
2834
2835         Merging this patch from GMCS to fix #75867.
2836
2837         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2838         scope if we don't already have it.
2839
2840 2005-11-17  Martin Baulig  <martin@ximian.com>
2841
2842         * anonymous.cs
2843         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2844         inherit the scope from our parent.  Fixes #76653.
2845
2846 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2847
2848         * doc.cs : the previous patch does not actually fix the bug.
2849           PropertyInfo override check is now implemented and really fixed it.
2850         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2851
2852 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2853
2854         * doc.cs : apply "override filter" also to properties.
2855           Fixed bug #76730.
2856
2857 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2858
2859         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2860           no need to check overrides. For classes, omit those results from 
2861           interfaces since they must exist in the class. Fixed bug #76726.
2862
2863 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2864
2865         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2866           with different parameters. Fixed the second problem in #76685.
2867
2868 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2869
2870         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2871           get expected 'protected' access in CheckValidFamilyAccess()).
2872           Fixed bug #76692.
2873
2874 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2875
2876         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2877           Fixed bug #76705.  CS1569 was incorrectly commented out.
2878
2879 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2880
2881         * doc.cs : use Invocation.IsOverride() to do real override check.
2882         * expression.cs : made Invocation.IsOverride() internal.
2883
2884 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2885
2886         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2887           TypeBuilder.FindMembers() and filter overriden base members out.
2888           Fixed bug #76990.
2889
2890 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2891
2892         * doc.cs : ref/out parameters are represented as '@' (instead of
2893           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2894
2895 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2896
2897         * doc.cs : when there was no '.' in cref to methods in doc comment,
2898           then parameters were missing in the output. Fixed bug #76691.
2899
2900 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2901
2902         * driver.cs : don't output docs when there is an error.
2903           Fixed bug #76693.
2904
2905 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2906
2907         * doc.cs :
2908           Now it should detect indexers. Fixed primary concern in bug #76685.
2909           Fixed CS0419 message to not show the identical member signature in
2910           the message.
2911
2912 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2913
2914         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2915           instead of Type.FindMembers() since it does not handle events.
2916           Fixed bug #71604.
2917
2918 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2919
2920         * codegen.cs: Fixed typo (speficied -> specified).
2921
2922 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2923
2924         Fix #76369.
2925         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2926
2927 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2928
2929         * attribute.cs: Changed error message.
2930
2931         * cs-tokenizer.cs: One more check.
2932
2933 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2934
2935         * statement.cs (Block.Resolve): Ignore empty statement.
2936
2937 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2938
2939         * report.cs: Made error/warning methods more strict to avoid
2940         their misuse.
2941
2942         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2943         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2944         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2945         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2946
2947 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2948
2949         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2950         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2951
2952         * class.cs (TypeContainer.IsComImport): New property.
2953         (Constructor.Define): Create proper ctor for ComImport types.
2954
2955         * expression.cs (New.CheckComImport): Fixed.
2956
2957 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2958
2959         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2960         that a parameter has been captured does not mean that we do not
2961         have to do the rest of the processing.  This fixes the second part
2962         of #76592.  If there was another anonymous method capturing
2963         values in the past, the Scope would never be set for the second
2964         method that captured the same parameter.
2965
2966         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2967         properly manipulate the stack.   Second part of fix for #76592.
2968
2969         * expression.cs (New): Add support for invoking "new" on
2970         interfaces that have been flagged with the ComImport attribute and
2971         the CoClass.  Fixes #76637 
2972
2973         * statement.cs (Try.DoEmit): When a variable is captured, do not
2974         try to emit the vi.LocalBuilder variable as it has been captured.
2975         Create a temporary variable and store the results on the
2976         FieldBuilder.  Fixes #76642
2977
2978 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2979
2980         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2981
2982         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2983
2984         * expression.cs (Binary.DoResolve): Added && optimalization.
2985     
2986         * typemanager.cs (AddUserType): Removed useless argument.
2987
2988 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2989
2990         * statement.cs (Block.variables): Uses ListDictionary.
2991
2992 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2993
2994         Fix #75969.
2995         * class.cs (PartialContainer.EmitType): Customized to emit
2996         security attributes.
2997         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2998         for partial classes.
2999
3000 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
3001
3002         Fix #76599.
3003         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
3004         access has to be fixed.
3005         
3006         * typemanager.cs (IsUnmanagedType): Wrong common field type.
3007
3008 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
3009
3010         Fix #76590.
3011         * ecore.cs (NullCast.Reduce): Implemented.
3012
3013         * expression.cs (ArrayCreation.CheckIndices): Correcly check
3014         constant type.
3015         
3016         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
3017         properly.
3018         (Foreach.Resolve): Catch null properly.
3019
3020 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3021  
3022         * cs-tokenizer.cs: Warning text fix.
3023
3024         * driver.cs: AllWarningNumbers exposed on public interface.
3025
3026         * report.cs (): Reviewed warning numbers.
3027         (IsValidWarning): Use binary search.
3028
3029 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
3030  
3031         * driver.cs: Implemeted resource visibility.
3032         (Resources): New class for code sharing between /res: and
3033         /linkres:
3034  
3035 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
3036
3037         Fix #76568.
3038         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
3039         folding.
3040         
3041         * convert (Convert.ImplicitReferenceConversion): NullCast holds
3042         contants only.
3043         
3044         * ecore.cs (NullCast): Child is contant only.
3045         
3046         * literal.cs (NullLiteral.Reduce): null can be converted to any
3047         reference type.
3048
3049 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
3050
3051         * driver.cs: Use Encoding.Default as default code page instead
3052           of ISO-28591.
3053
3054 2005-10-27  Raja R Harinath  <rharinath@novell.com>
3055
3056         Fix #76085.
3057         * expression.cs (Invocation.Error_InvalidArguments): Handle
3058         __arglist parameters.
3059         (Invocation.VerifyArgumentsCompat): Likewise.
3060         * support.cs (ReflectionParameters.GetSignatureForError): Print
3061         __arglist parameters.
3062         (InternalParamters.GetSignatureForError): Likewise.
3063         * parameter.cs (Parameters.GetSignatureForError): Likewise.
3064
3065 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
3066
3067         * attribute.cs (GetPropertyValue): Made public.
3068
3069         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
3070         Resolve.
3071         Add new property WrapNonExceptionThrows to handle 2.0 assembly
3072         attribute.
3073         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
3074         is not defined.
3075         
3076         * driver.cs: Reflect method name change.
3077         
3078         * statement.cs (Try.Resolve): Warn when try has both general
3079         exception handlers.
3080         
3081         * typemanager.cs: runtime_compatibility_attr_type new predefined
3082         type.
3083
3084 2005-10-26  Raja R Harinath  <harinath@gmail.com>
3085
3086         Fix #76419.
3087         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
3088         treat it as an empty parameter list.
3089
3090 2005-10-26  Raja R Harinath  <rharinath@novell.com>
3091
3092         Fix #76271.     
3093         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
3094         ResolveAsTypeStep silent.
3095         * statement.cs (Block.AddConstant): Mark block as used.
3096         (Block.ResolveMeta): Avoid piling on error messages
3097         if a constant initializer resolution fails.
3098
3099 2005-10-25  Raja R Harinath  <rharinath@novell.com>
3100
3101         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
3102         Remove.
3103         (NamespaceEntry.VerifyAllUsing): New.
3104         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
3105         behaviour.  Delegates actual resolution of alias to ...
3106         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
3107         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
3108         Update.
3109         * driver.cs (Driver.MainDriver): Update.
3110         
3111         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
3112         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
3113         property.
3114         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
3115         Remove.
3116         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
3117         RootNamespace.DefineNamespacesForAll.
3118
3119 2005-10-24  Raja R Harinath  <harinath@gmail.com>
3120
3121         * typemanager.cs (assemblies, external_aliases, modules)
3122         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
3123         (ComputeNamespaces, GetRootNamespace): Remove extra staging
3124         overhead.  Move resposibility ...
3125         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
3126         * driver.cs, attribute.cs, codegen.cs: Update to changes.
3127
3128 2005-10-23  Raja R Harinath  <harinath@gmail.com>
3129
3130         * namespace.cs (RootNamespace.all_namespaces): Renamed from
3131         cached_namespaces.  Improve usage.
3132         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
3133         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
3134         Move from GlobalRootNamespace and simplify.
3135         (RootNamespace.Global): Make instance variable.
3136         (RootNamespace.RootNamespace): Add "alias name" parameter.
3137         (GlobalRootNamespace): Simplify drastically.
3138         (Namespace.Lookup): Don't use GetNamespace.
3139         * typemanager.cs (GetRootNamespace): Rename from
3140         ComputeNamespaceForAlias.
3141         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
3142
3143 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3144
3145         * anonymous.cs (AnonymousContainer): Don't crash when container
3146         doesn't exist.
3147
3148 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3149
3150         * expression.cs (Binary.DoResolve): Warn when comparing same
3151         values.
3152
3153 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
3154
3155         Fix #76486.
3156         * expression.cs (Binary.DoResolve): It looks like there are no
3157         convetsion rules in enum context.
3158
3159 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3160
3161         Add support for extern alias qualifiers.
3162         * typemanager.cs: Move some LookupTypeReflection code
3163         to namespace.cs, to have cleaner code. Added some methods
3164         to help us keep track of the extern aliased references.
3165         * driver.cs: Add suport for extern alias assemblies on command
3166         line and check for their warnings/errors. Also keep track of the
3167         extern aliased assemblies.
3168         * namespace.cs: Move the global functionality of Namespace
3169         to GlobalRootNamespace/RootNamespace. Now the global namespace
3170         is GlobalRootNamespace.Globa. Also the code moved from 
3171         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
3172         Finally added LocalAliasEntry (AliasEntry before) and
3173         ExternAliasEntry, to handle alias statements.
3174         * cs-parser.jay: Add support in the grammar for extern alias
3175         statement.
3176         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
3177         Update callings to Namespace (now in GlobalRootNamespace).
3178
3179 2005-10-18  Raja R Harinath  <rharinath@novell.com>
3180
3181         Fix #76371.
3182         * class.cs (TypeContainer.DefineType): Move updating of
3183         topological sort earlier in the code.
3184         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
3185
3186 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
3187
3188         Fix #76273.
3189         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3190         
3191         * constant.cs (Constant.TryReduce): Moved from Cast class.
3192         (Reduce): Made little bit more OO and fixed missing conversions.
3193         
3194         * ecore.cs (Reduce): Implemented.
3195         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3196         
3197         * literal.cs (Reduce): Implemented.
3198         
3199         * class.cs: Reverted Miguel's wrong commit.
3200
3201 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3202
3203         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3204
3205 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3206
3207         * cs-parser.jay, expression.cs : CS0214 was missing error location
3208           for constants. Fixed bug #76404.
3209
3210 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3211
3212         Fix #76370.
3213         * convert.cs (ExplicitConversionCore): Fixed object->enum
3214         conversion.
3215
3216 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3217
3218         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3219         InstanceExpression.
3220         (PropertyExpr.EmitCall): Likewise.
3221         * expression.cs (Invocation.EmitArguments): Handle case where
3222         arguments == null.
3223         (Invocation.EmitCall): Avoid allocating temporary variable if
3224         there are no arguments.
3225
3226 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3227
3228         Fix #76323.
3229         * convert.cs (ImplicitConversionStandard): Move conversion of
3230         void* to arbitrary pointer types ...
3231         (ExplicitConversionStandard): .. here.
3232         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3233         error to always print typenames.
3234
3235 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3236
3237         * convert.cs (GetConversionOperator): Rename from
3238         GetConversionOperators.  Move operator selection code from ...
3239         (UserDefinedConversion): ... here.
3240
3241 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3242
3243         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3244         conversion.
3245
3246 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * assign.cs (Assign.DoResolve): Error method changed.
3249
3250         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3251         
3252         * const.cs (ResolveValue): Reset in_transit immediately.
3253         
3254         * constant.cs: Error method changed.
3255         
3256         * convert.cs: Removed useless location parameter.
3257         (ExplicitNumericConversion): Don't do double enum check.
3258         (ExplicitConversionCore): Renamed from ExplicitConversion.
3259         (ExplicitUnsafe): Extracted from ExplicitConversion.
3260         (ExplicitConversion): Uses for error reporting.
3261         
3262         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3263         error messages.
3264         (ResolveBoolean): Uses common error method.
3265         (CastToDecimal): Get rid of ec.
3266         (CastFromDecimal): Optimized.
3267         (ConvCast): Get rid of ec.
3268         
3269         * enum.cs (ResolveValue): Reset in_transit immediately.
3270         (Emit): Return after first error.
3271         
3272         * expression.cs: Convert changes.
3273         
3274         * literal.cs: Error method changed.
3275         
3276         * statement.cs: Error method changed.
3277
3278 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3279
3280         * support.cs (SeekableStreamReader.Position): Don't error out when
3281         the requested position is just beyond the end of the current
3282         buffered data.
3283
3284 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3285
3286         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3287         try to keep in sync with the byte count of the underlying Stream.
3288         However, this limits us to a window size of 2048 characters: i.e.,
3289         the maximum lookahead of our lexer/parser can be 2048 characters.
3290
3291 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3292
3293         Fix #76255.
3294         * driver.cs: Fix compilation files with full root path.
3295
3296 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3297
3298         * report.cs (SymbolRelatedToPreviousError): Format the output so
3299         it does not use an open parenthesis that is never closed. 
3300
3301         * driver.cs: Follow coding guidelines
3302
3303 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3304
3305         Fix #72930.
3306         * const.cs (Const.ResolveValue): Check for assigning non-null
3307         value to reference type.
3308
3309 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3310
3311         * anonymous.cs: Implemented ExprClassName.
3312         
3313         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3314         delegate.
3315         
3316         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3317         check.
3318         
3319         * class.cs (StaticClass.DefineContainerMembers): Report protected
3320         members as error.
3321         
3322         * codegen.cs: if(ed) PRODUCTION.
3323         
3324         * convert.cs (Error_CannotImplicitConversion): Better error
3325         distinction.
3326         
3327         * cs-parser.jay: More error checks.
3328         
3329         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3330         
3331         * driver.cs (CSCParseOption): Enabled wrong option check.
3332         
3333         * ecore.cs (Expression.ExprClassName): Turned to property.
3334         (MemberExpr.CheckIntermediateModification): For checking boxed
3335         value types     modification.
3336         
3337         * statement.cs (Fixed.Resolve): Expression type must be
3338         convertible to fixed type.
3339         (CollectionForeach.GetEnumeratorFilter,TryType):
3340         Small refactoring for easier error checking.
3341
3342 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3343
3344         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3345         attributes.
3346         
3347         * class.cs (GeneratedBaseInitializer): New class for customization
3348         compiler generated initializers.
3349         (MemberBase.DoDefine): Check Obsolete attribute here.
3350         (FieldMember.DoDefine): Ditto.
3351         
3352         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3353         constants.
3354         
3355         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3356         (MemberCore.GetObsoleteAttribute): Removed argument.
3357         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3358         (MemberCore.CheckObsoleteType): New helper.
3359         
3360         * delegate.cs,
3361         * enum.cs,
3362         * statement.cs: Updates after MemberCore changes.
3363         
3364         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3365         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3366         
3367         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3368         obsolete attribute for compiler construct.
3369         (As.DoResolve): Cache result.
3370         
3371         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3372
3373 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3374
3375         Fix #76133.
3376         * expression.cs (This.VerifyFixed): In a value type T, the type of
3377         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3378         value type R, 'this' is treated as a value parameter.
3379
3380 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3381
3382         * statement.cs (Lock): Use the TemporaryVariable class instead of
3383         manually using local variables as those do not work when variables
3384         are captured.
3385
3386         * ecore.cs: Moved the TemporaryVariable class from being a nested
3387         class inside Foreach to be a public class that can be employed in
3388         other places. 
3389
3390 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * cs-parser.jay: interface_accessors replaced by
3393         accessor_declarations.
3394
3395         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3396         location.
3397         
3398         * statement.cs (GotoCase.Resolve): Convert null constant to
3399         null case.
3400         (SwitchLabel.ResolveAndReduce): Ditto.
3401         (SwitchLabel.NullStringCase): Custom null stamp.
3402         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3403         
3404         typemanager.cs (CSharpSignature): Don't skip first argument
3405         for full names.
3406
3407 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3408
3409         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3410
3411         * location.cs (InEmacs): in this mode, do not report column
3412         location as it confuses Emacs.
3413
3414 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3415
3416         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3417         expression.cs, iterators.cs, literal.cs: Store constants and
3418         literals location.
3419         
3420         * class.cs (MemberBase.ShortName): Pass location.
3421         
3422         * cs-parser.jay: Some location fixes.
3423         
3424         * ecore.cs (Expression.Location): Made virtual.
3425
3426 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3427
3428         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3429         if the underlying types are the same, otherwise we need to produce
3430         code that will do the proper cast.
3431
3432         This was exposed by Marek's constant rewrite which produced
3433         invalid code for the call site:
3434
3435         enum X : long { a }
3436         void Method (X v) {}
3437
3438         Method ((X) 5)
3439
3440         This fixes test-49.cs
3441
3442 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3443
3444         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3445           Type/Object should be allowed as well. Fixed bug #75968.
3446
3447 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3448
3449         * expression.cs : (Binary.DoResolve): when one is enum constant and
3450           another is constant 0, then return enum one *as enum type*.
3451           Fixed bug 74846.
3452
3453 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3454
3455         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3456         internal.
3457
3458         Fix #75941.
3459         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3460         flow-branching for LocalVariableReferences in case we were invoked
3461         from a MemberAccess.
3462         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3463         Carved out of ...
3464         (LocalVariableReference.DoResolveBase): ... this.
3465         (MemberAccess.Resolve): Do the check that was disabled during
3466         SimpleNameResolve.
3467
3468 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3469
3470         * class.cs :
3471           (PartialContainer.Create): check abstract/sealed/static strictly
3472           but abstract/sealed can exist only at one side. Fixed bug #75883.
3473
3474 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3475
3476         Fix #75945.
3477         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3478         specified, don't default to UnmanagedType.I4.
3479
3480 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3481
3482         * expression.cs : conditional operator should check possibly
3483           incorrect assign expression. Fixed bug #75946.
3484
3485 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3486
3487         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3488           Reverting the change. gmcs is much complex than mcs on this matter.
3489
3490 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3491
3492         * cs-tokenizer.cs : To read another token ahead of the actual 
3493           consumption, use new SavedToken and cache token instead of moving
3494           back the stream with SeekableStreamReader (it seemed problematic).
3495         * cs-parser.jay,
3496           driver.cs : Thus use StreamReader directly.
3497         * support.cs : Thus removed SeekableStreamReader.
3498
3499 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3500
3501         Fix #75934.
3502         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3503         (ScopeInfo.EmitScopeType): Use it to construct field names from
3504         names of captured locals.
3505
3506         Fix #75929.
3507         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3508         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3509         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3510         (ExplicitConversion): Remove enum cases already handled by
3511         implicit conversion.  Move implicit conversion check to the beginning.
3512         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3513         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3514         Don't treat System.Enum as a struct.
3515
3516 2005-08-30  Jb Evain  <jbevain@gmail.com>
3517
3518         * attribute.cs: handles as expression in parameters.
3519
3520 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3521
3522         Fix #75802.
3523         * class.cs (TypeContainer.VerifyClsName): Don't use a
3524         PartialContainer when verifying CLS compliance.
3525         (AbstractPropertyEventMethod): Set Parent here, ...
3526         (PropertyMethod): ... not here.
3527
3528 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3529
3530         * attribute.cs : escaped attribute name should not be allowed to be
3531           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3532
3533 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3534
3535         Fix #75927.
3536         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3537         when converting a long constant to unsigned long.
3538         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3539         detect where IsApplicable and VerifyArgumentsCompat disagree.
3540
3541 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3542         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3543
3544         Fix #75848.
3545         * class.cs (TypeContainer.CanElideInitializer): New helper.
3546         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3547         can safely emitting the initializer of a field.
3548
3549 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3550
3551         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3552           allowed inside a switch (without loop). Fixed bug #75433.
3553
3554 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3555
3556         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3557         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3558
3559 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3560
3561         * driver.cs : kinda reverting the default encoding changes (not exact 
3562           revert since I noticed that "codepage:reset" might not work fine).
3563
3564 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3565
3566         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3567           Location. Now getter and setter store location correctly.
3568           (errors/cs0111-12.cs now reports the expected location.)
3569
3570 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3571
3572         * driver.cs : Use default encoding on the environment.
3573           Removed (now that) extra parameter for SeekableStreamReader.
3574         * support.cs : (SeekableStreamReader) third .ctor() argument for
3575           StreamReader is not required (always true). preamble size could
3576           be acquired in simpler and safe way.
3577
3578 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3579
3580         * cs-parser.jay: report CS0642 at warning level 3
3581           and report CS0642 for an if else statement also
3582           fixes bug #74745. Patch by John Luke (and a bit
3583           modified by me).
3584           Removed extra CS0642 warning check for "while",
3585           "for" and "fixed".
3586         * statement.cs: In Block.Resolve(), CS0642 check
3587           is reimplemented to check a sequence of an empty
3588           statement and a block.
3589
3590           Both fix bug #66777.
3591
3592 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3593
3594         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3595         detection until I fix it.
3596         
3597         * cs-tokenizer.cs: Changed error message.
3598         
3599         * cs-parser.jay: Fixed 2 error locations.
3600         
3601         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3602         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3603         properties.
3604         
3605         * enum.cs (GetSignatureForError): Fixed.
3606         
3607         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3608         method detection.
3609         
3610         * class.cs,
3611         * typemanager.cs (RegisterProperty): Removed.
3612         
3613         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3614
3615 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3616
3617         Fix #75874.
3618         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3619         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3620
3621 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3622
3623         * expression.cs : tiny fix is required for not warning positive ulong.
3624           See test-441.cs.
3625
3626 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3627
3628         * expression.cs : add CS0652 check for constant and integral
3629           expression. Fixed bug #53974.
3630
3631 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3632
3633         * expression.cs : in DoNumericPromotions(), check if there is implicit
3634           conversion overload for string (to check CS0034). Fixed bug #52492.
3635
3636 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3637
3638         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3639
3640 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3641
3642         * ecore.cs : report location when it is *not* Null.
3643
3644 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3645
3646         * codegen.cs,
3647           ecore.cs,
3648           flowanalysis.cs,
3649           expression.cs:
3650           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3651           correctly. Fixed bug #75721.
3652
3653 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3654
3655         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3656         loop that performs 'min (pos, char_count)'.
3657
3658         Fix #75862.
3659         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3660         converted value in Operator.OnesComplement.
3661
3662 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3663
3664         * anonymous.cs: If the anon method is pulled into a helper class,
3665         it needs to be `internal' not `private'. Fixes runtime behavior on
3666         msft. bug #75704
3667
3668 2005-08-20  Martin Baulig  <martin@ximian.com>
3669
3670         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3671         scope if we don't already have it.
3672
3673         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3674         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3675         fixes #75867.
3676
3677 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3678
3679         Fix #75803
3680         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3681         is a partial class.
3682
3683 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3684
3685         The big constants rewrite
3686         Fix #75746, #75685 and more
3687         As a side effect saved 1MB for MWF ;-)
3688         
3689         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3690         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3691         enum based for corlib compilation.
3692         
3693         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3694         subtractions.
3695         
3696         * class.cs (FixedField.Define): Use ResolveAsConstant.
3697         
3698         * const.cs (IConstant): Interface constants and enums.
3699         (Const.ResolveValue): New method for constant resolvning.
3700         (ExternalConstant): Constants from imported assemblies.
3701         
3702         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3703         conversion; like enums.
3704         (Constant.ToType): Converts this constant to different type.
3705         (Constant.Increment): Adds 1.
3706         
3707         * convert.cs (ImplicitConversionRequired): Simplified.
3708         
3709         * cs-parser.jay: Create EnumMember directly.
3710         
3711         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3712         
3713         * doc.cs (GenerateEnumDocComment): Removed.
3714         
3715         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3716         (ConvertIntLiteral): Removed.
3717         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3718         
3719         * enum.cs (EnumMember): Implement IConstant.
3720         (Enum.IsValidEnumConstant): Removed.
3721         (Enum.GetNextDefaultValue): Removed.
3722         (Enum.FindMembers): Updated.
3723         (Enum.GenerateDocComment): Iterate enum members.
3724         
3725         * expression.cs (Cast.TryReduce): Handle enums correctly.
3726         (New.Constantify): Made public.
3727         (MemberAccess.DoResolve): Removed contant specific if(s).
3728         
3729         * literal.cs (NullLiteral): Implement new abstract methods.
3730         
3731         * statement.cs (GotoCase.Resolve): Use new constant methods.
3732         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3733         
3734         * typemanager.cs (LookupEnum): Removed.
3735         (IsEnumType): Fixed to work with corlib.
3736         (RegisterConstant): Removed.
3737         (LookupConstant): Removed.
3738         (GetConstant): Changed to work with IConstant.
3739
3740 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3741
3742         * location.cs : Fixed overflown (>255) column number.
3743
3744 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3745
3746         First cut of the qualified-alias-member feature.
3747         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3748         token.
3749         * cs-parser.jay (DOUBLE_COLON): New token.
3750         (namespace_or_type_name): Add rule for recognizing
3751         qualified-alias-members.
3752         (primary_expression): Likewise.
3753         (element_access): Allow QualifiedAliasMember as a possible
3754         type-bearing expression.
3755         (local_variable_type, local_variable_pointer_type): Likewise.
3756         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3757         aliases in the current and enclosing namespace declarations.
3758         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3759         * decl.cs (MemberName.is_double_colon): New.
3760         (MemberName.MemberName): Add new constructor for alias-member.
3761         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3762         * expression.cs (QualifiedAliasMember): New expression type.
3763
3764 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3765
3766         * location.cs : it borked when no argument was specified.
3767
3768 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3769
3770         * location.cs : tiny ToString() format fix.
3771
3772 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3773
3774         * statement.cs : oops, it was missing.
3775
3776 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3777
3778         A set of fixes for precise line/column location.
3779
3780         * location.cs :
3781           "token" field now holds a file/line "delta", a line number offset 
3782           from the segment, and a column number. See also:
3783           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3784           December/009508.html
3785           Removed static IsNull. Use instance IsNull property instead.
3786         * cs-tokenizer.cs :
3787           For some tokens it stores Location. For Identifier it stores
3788           LocatedToken which is a pair of string name and location.
3789           Column numbers are adjusted only at getChar().
3790         * report.cs :
3791           Use Location.ToString() for reporting (it now contains column).
3792         * cs-parser.jay :
3793           Largely modified to use LocatedToken instead of
3794           string (IDENTIFIER), and to acquire Location from some tokens.
3795         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3796           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3797           codegen.cs :
3798           Now MemberName holds Location. DeclSpace.ctor() receives Location
3799           as a parameter. Removed extra parameters to all derived classes.
3800           Replaced Location.IsNull() with instance property.
3801         * assign.cs, expression.cs :
3802           Added .ctor() overload that omits Location.
3803         * attribute.cs :
3804           Added "nameEscaped" flag that indicates the identifier was escaped
3805           in the source file. This fixes bug #57047.
3806
3807 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3808
3809         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3810         New method, looking for lo-case imported cls type.
3811
3812         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3813         here.
3814
3815         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3816
3817         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3818
3819         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3820         all_imported_types.
3821         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3822
3823         Optimized to save 3.5 MB for SWF compilation.
3824
3825 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3826
3827         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3828         (PartialContainer.Create): Moved logic AddToContainer.
3829         (PartialContainer.MarkForDuplicationCheck): Shares name.
3830         
3831         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3832         place.
3833         
3834         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3835         initialization.
3836         (Namespace.GetSignatureForError): New method.
3837         
3838         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3839         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3840
3841 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3842
3843         Fix #75669.
3844         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3845         member lookup rather than qualifier_type, since qualifier_type can
3846         be null.
3847
3848 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3849
3850         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3851         enum member.
3852
3853 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3854
3855         * statement.cs: Copy the local exception into the exception
3856         captured local.  Fixes 75674
3857
3858 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3859
3860         Fix #75658.
3861         * expression.cs (Invocation.OverloadResolve): Don't report error
3862         CS1501 if error CS1502 has been reported.
3863         (New.DoResolve): Delegate CS1501 reporting to
3864         Invocation.OverloadResolve.
3865
3866         Fix #75656.
3867         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3868         invariant-meaning-in-block property in an enclosing block if
3869         necessary.
3870
3871 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3872
3873         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3874         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3875         (Switch.CheckSwitch): Just save 50kb for SWF.
3876
3877 2005-07-27  Martin Baulig  <martin@ximian.com>
3878
3879         * anonymous.cs (CaptureContext.AddField): Added
3880         `AnonymousContainer am' argument; compute its toplevel scope if
3881         it's not already computed.  Fixes #75649.
3882
3883 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3884
3885         Fix #75628.
3886         * class.cs (Constructor.Emit): Reset block to null if the block
3887         resolve fails.
3888
3889 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3890
3891         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3892
3893 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3894
3895         * class.cs (MethodData.Define): Check whether accessor implementing
3896         interface is public.
3897
3898         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3899
3900 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3901
3902         Fix #57245
3903         * namespace.cs (LookupType): Moved same type check to...
3904         
3905         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3906         with the same name.
3907
3908 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3909
3910         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3911         already found a typebuilder.
3912         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3913         MemberNames, not strings.
3914
3915         * const.cs (Error_ExpressionMustBeConst): 
3916         Rename from Error_EpressionMustBeConst.
3917         * const.cs, class.cs, statement.cd: Update.
3918
3919 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3920
3921         Fix #65573
3922
3923         * const.cs (Const.LookupConstantValue): Report missing contant expression
3924         everytime.
3925         (Error_EpressionMustBeConstant): Only one error method.
3926
3927         * class.cs, statement.c: Updated.
3928
3929 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3930
3931         * statement.cs (Block.Flags): Add back HasVarargs.
3932         (Block.flags): Make protected.
3933         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3934
3935         * typemanager.cs (types, typecontainers, user_types): Remove.
3936         (UserTypes, TypeContainers): Likewise.
3937         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3938         (CleanUp, Reset): Update.
3939         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3940         (GetNestedType): Use Type.GetNestedType.
3941         (CoreLookupType): Take two arguments, the namespace and the
3942         basename of the type.  Update to use the Namespace.Lookup
3943         mechanism.
3944         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3945         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3946         string concatenation and substring matches.
3947         * class.cs, enum.cs, delegate.cs: Update to changes.
3948
3949 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3950
3951         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3952         Expression and made virtual.
3953
3954         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3955         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3956
3957         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3958
3959         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3960         error message.
3961
3962         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3963         change.
3964
3965 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3966
3967         Fix #57707
3968         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3969         AssemblyCultureAttribute is not used on executable.
3970
3971         * rootcontext.cs,
3972         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3973
3974 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3975
3976         Fix #60638.
3977         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3978         New.  Reports CS0252/CS0253.
3979         Mostly taken from preliminary patch by Duncak Mak.
3980         (Binary.DoResolveOperator): Store results of operator lookup.
3981         Use them to detect if we need to warn about unintended reference
3982         comparisons.
3983
3984 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3985
3986         Fix #72969.
3987         * namespace.cs (Namespace.Lookup): Add back location parameter.
3988         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3989         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3990
3991         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3992         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3993         (Namespace.LookupType): ... this.
3994         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3995         of namespaces.
3996         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3997         purported to handle pointers.
3998         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3999         CoreLookupType.
4000
4001 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
4002
4003         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
4004         type as namespace.
4005
4006 2005-07-15  Raja R Harinath  <rharinath@novell.com>
4007
4008         * namespace.cs (Namespace.Lookup): Drop location parameter.
4009         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
4010         (NamespaceEntry.Lookup): ... this.
4011         (NamespaceEntry.Error_AmbiguousTypeReference):
4012         Move here from DeclSpace.
4013         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
4014         names ...
4015         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
4016         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
4017         Move to NamespaceEntry.
4018         * delegate.cs, expression.cs: Update to changes.
4019
4020 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
4021
4022         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
4023         CheckAttributeType and refactored.
4024         (Attribute.ResolvePossibleAttributeType): Changed to reuse
4025         ResolveAsTypeTerminal error handling.
4026         (ResolveAsTypeTerminal): Introduced because of global attributes extra
4027         handling.
4028         (GetSignatureForError): Print errors in same way.
4029
4030         * class.cs,
4031         * codegen.cs: Reflect attribute GetSignatureForError change.
4032
4033         * ecore.cs,
4034         * expression.cs: Add silent parameter to ResolveAsTypeStep.
4035
4036         * namespace.cs (UsingEntry): Refactored to make fields private.
4037
4038         * assign.cs,
4039         statement.cs: Error_UnexpectedKind has extra parameter.
4040
4041 2005-07-14  Raja R Harinath  <rharinath@novell.com>
4042
4043         * ecore.cs (IAlias): Remove.
4044         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
4045         that implement the interface.
4046         * namespace.cs (Namespace): Likewise.
4047         (Namespace.declspaces): Renamed from 'defined_names'.
4048         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
4049         DeclSpace instead of an IAlias.
4050         * tree.cs (Tree.AddDecl): Update.
4051
4052 2005-07-12  Raja R Harinath  <rharinath@novell.com>
4053
4054         * statement.cs (Block.Flags); Remove HasVarargs.
4055         (Block.HasVarargs): Move to ToplevelBlock.
4056         (Block.ThisVariable, Block.AddThisVariable): Likewise.
4057         (Block.Variables): Make protected.  Initialize variable hashtable
4058         if necessary.
4059         (Block.AddVariable): Update.
4060         (Block.Resolve): Update to changes.
4061         (ToplevelBlock.HasVarargs): New boolean.
4062         (ToplevelBlock.ThisVariable): Move here from Block.
4063         (ToplevelBlock.AddThisVariable): Likewise.
4064         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
4065         * expression.cs (This.ResolveBase): Update to changes.
4066         (ArglistAccess.DoResolve): Likewise.
4067
4068 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4069
4070         Fix #75321
4071         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
4072
4073         * class.cs (TypeContainer.VerifyMembers): Distinguish between
4074         not used and not used & assigned.
4075         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
4076
4077 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
4078
4079         Fix #75053
4080         * expression.cs (Is.DoResolve): null is never provided type.
4081
4082 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
4083
4084         Fix #52496
4085         * cs-parser.jay: Less strict event error rule to catch more errors.
4086
4087 2005-07-08  Martin Baulig  <martin@ximian.com>
4088
4089         Fix test-iter-10.cs - distinguish whether we `yield' in a property
4090         gettter (allowed) or setter (not allowed).
4091
4092         * class.cs (Accessor): Implement IIteratorContainer.
4093         (Accessor.Yields): New public field.
4094         (PropertyBase.PropertyMethod.Define): Handle iterators on a
4095         per-accessor basis.
4096
4097         * cs-parser.jay
4098         (get_accessor_declaration, set_accessor_declaration): Set the
4099         `yields' flag on the accessor, not the property.
4100         (property_declaration): Do the iterators check on a per-accessor
4101         basis and not for the whole property.
4102
4103 2005-07-08  Martin Baulig  <martin@ximian.com>
4104
4105         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4106         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4107
4108 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4109
4110         Fix #74975
4111         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4112         (ExtractSecurityPermissionSet): Cope with self referencing security
4113         attributes properly.
4114
4115         * driver.cs (SetOutputFile): Made public property OutputFile.
4116
4117 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4118
4119         Fix #75486.
4120         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4121         has_nonstatic_fields.  Make into a FieldBase pointer.
4122         (TypeContainer.AddField): Add CS0282 check.
4123         (TypeContainer.EmitType): Update.
4124
4125 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4126
4127         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4128         compare if they start with __.
4129
4130 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4131
4132         * statement.cs (Switch.SwitchGoverningType): Only look at
4133         UserCasts that don't need implicit standard conversions to one of
4134         the allowed switch types (Fixes test-322.cs).
4135         (LocalInfo.Resolve): Re-enable sanity-test.
4136
4137 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4138
4139         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4140         
4141         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4142         
4143         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4144
4145 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4146
4147         Fix #75472.
4148         * ecore.cs (SimpleName.GetSignatureForError): Add.
4149         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4150         (MemberAccess.GetSignatureForError): Add.
4151
4152 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4153  
4154         The big error and warning messages review.
4155         
4156         * anonymous.cs,
4157         * assign.cs,
4158         * attribute.cs,
4159         * class.cs,
4160         * codegen.cs,
4161         * convert.cs,
4162         * cs-parser.jay,
4163         * cs-tokenizer.cs,
4164         * decl.cs,
4165         * delegate.cs,
4166         * doc.cs,
4167         * driver.cs,
4168         * ecore.cs,
4169         * enum.cs,
4170         * expression.cs,
4171         * flowanalysis.cs,
4172         * iterators.cs,
4173         * literal.cs,
4174         * location.cs,
4175         * modifiers.cs,
4176         * namespace.cs,
4177         * parameter.cs,
4178         * pending.cs,
4179         * report.cs,
4180         * rootcontext.cs,
4181         * statement.cs,
4182         * support.cs,
4183         * tree.cs,
4184         * typemanager.cs: Updated.
4185         
4186         * class.cs: (MethodCore.SetYields): Moved here to share.
4187         (PropertyMethod.Define): Moved iterator setup here.
4188         
4189         * iterators.cs: Add orig_method to have full access to parent
4190         container.
4191
4192 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4193
4194         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4195         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4196         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4197         variable of struct type.
4198         * expression.cs (Unary.ResolveOperator): Update to change.
4199         (Indirection.VerifyFixed): Likewise.
4200         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4201         (ParameterReference.VerifyFixed): Value parameters are fixed.
4202         (This.VerifyFixed): Treat 'this' as a value parameter.
4203         * statement.cs (LocalInfo.IsFixed): Remove.
4204
4205 2005-07-01  Martin Baulig  <martin@ximian.com>
4206
4207         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4208         `ec.EmitThis ()' to get the correct scope.
4209
4210 2005-07-01  Martin Baulig  <martin@ximian.com>
4211
4212         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4213         instance is a ParameterReference; fixes #75299.
4214
4215 2005-07-01  Martin Baulig  <martin@ximian.com>
4216
4217         Reverted Marek's latest patch (r46725):
4218         - it contains structural changes which are neither mentioned in
4219           the ChangeLog nor explained anywhere; for example the additional
4220           argument of EmitContext's and Iterator's .ctor's and the
4221           TypeContainer.DefineMembers() change.
4222         - structural changes like this should go in in seperate patches
4223           and not be hidden in a huge patch which just seems to affect
4224           warnings and errors.
4225           a big and hard to understand patch.
4226         - it breaks iterators and causes regressions, for instance in
4227           test-iter-03.cs.      
4228
4229 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4230
4231         Fix #75412.
4232         * expression.cs (Indexers.map): Remove.
4233         (Indexers.Append): Filter out inaccessible setters and getters.
4234         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4235
4236         Fix #75283.
4237         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4238         Refactored from ...
4239         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4240         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4241         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4242         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4243
4244 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4245
4246         Fix #75322
4247         * class.cs (FieldBase.GetInitializerExpression): One more field
4248         for backup.
4249
4250 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4251
4252         * pending.cs: Do not define a proxy if the base method is virtual,
4253         it will be picked up by the runtime (bug 75270).
4254
4255 2005-06-08  Martin Baulig  <martin@ximian.com>
4256
4257         The big Iterators rewrite :-)
4258
4259         * iterators.cs: Rewrite this to use the anonymous methods framework.
4260
4261         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4262         before the TypeContainers; see 2test-21.cs.
4263
4264         * class.cs
4265         (TypeContainer.DefineType): Don't create a new EmitContext if we
4266         already have one (this only happens if we're an Iterator).
4267         (TypeContainer.Define): Also call Define() on all our iterators.
4268         (Method.CreateEmitContext): Added support for iterators.
4269
4270         * anonymous.cs
4271         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4272         (AnonymousContainer.CreateMethodHost): Moved here from
4273         AnonymousMethod and made abstract.
4274         (AnonymousContainer.CreateScopeType): New abstract method.
4275         (AnonymousContainer.IsIterator): New public property.
4276         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4277         get the ScopeTypeBuilder rather than manually defining it here. 
4278         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4279         iterators here.
4280
4281         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4282         before RootContext.DefineTypes().
4283
4284         * codegen.cs (EmitContext.RemapToProxy): Removed.
4285         (EmitContext.CurrentAnonymousMethod): Changed type from
4286         AnonymousMethod -> AnonymousContainer.
4287         (EmitContext.ResolveTopBlock): Protect from being called twice.
4288         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4289         (EmitContext.EmitThis): Removed the iterators hacks; use the
4290         anonymous methods framework for that.
4291
4292         * statement.cs
4293         (ToplevelBlock.Container): Make this a property, not a field.
4294         (ToplevelBlock.ReParent): New public method; move the
4295         ToplevelBlock into a new container.
4296         (Foreach.TemporaryVariable): Simplify.
4297
4298 2005-06-05  Martin Baulig  <martin@ximian.com>
4299
4300         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4301         (Block.AddTemporaryVariable): New public method; creates a new
4302         `LocalInfo' for a temporary variable.
4303         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4304         variables here.
4305         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4306         non-iterator variables.
4307
4308 2005-06-05  Martin Baulig  <martin@ximian.com>
4309
4310         * statement.cs (Foreach.TemporaryVariable): Create the
4311         LocalBuilder in the Emit phase and not in Resolve since in some
4312         situations, we don't have an ILGenerator during Resolve; see
4313         2test-19.cs for an example.
4314
4315 2005-06-04  Martin Baulig  <martin@ximian.com>
4316
4317         **** Merged r45395 from GCS ****
4318
4319         The big Foreach rewrite - Part II.
4320
4321         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4322         with `PropertyInfo ienumerator_getcurrent'.
4323
4324         * codegen.cs (VariableStorage): Removed.
4325
4326         * statement.cs
4327         (Foreach): Derive from Statement, not ExceptionStatement.
4328         (Foreach.CollectionForeach): New nested class.  Moved all the code
4329         dealing with collection foreach here.
4330         (Foreach.ForeachHelperMethods): Removed.
4331         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4332
4333 2005-05-23  Martin Baulig  <martin@ximian.com>
4334
4335         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4336         don't need to.  Fix #75014.
4337
4338 2005-05-20  Martin Baulig  <martin@ximian.com>
4339
4340         Merged r44808 from GMCS.
4341
4342         * class.cs (TypeContainer.CircularDepException): Removed.
4343         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4344         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4345         (CS0146) and interface (CS0529) dependencies here.
4346
4347 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4348
4349         * expression.cs (Invocation.EmitCall): Fix initialization
4350         'this_call' to reflect current behaviour.  Fix indentation.
4351
4352         * convert.cs (FindMostEncompassedType): Add two trivial special
4353         cases (number_of_types == 0 || number_of_types == 1).
4354         (FindMostEncompasingType): Likewise.
4355
4356 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4357
4358         Some cleanups preparing for the fix of #75283.
4359         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4360         error testing.
4361         (EventExpr.InstanceResolve): Likewise.
4362         (EventExpr.DoResolve): Remove redundant checks.
4363
4364 2005-06-10  Duncan Mak  <duncan@novell.com>
4365
4366         * cs-tokenizer.cs (process_directives): New flag for controlling
4367         the processing of preprocessor directives.
4368         (x_token): After seeing a '#', return Token.NONE instead of going
4369         to handle_preprocessing_directive() when not processing
4370         directives. This avoids unnecessary processing during the token peek in
4371         is_punct().
4372
4373         This fixes #74939.
4374
4375         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4376         the existing error reporting methods instead of Report.Error.
4377
4378         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4379         after Raja's rewrite.
4380
4381 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4382
4383         * class.cs: Small fix.
4384
4385 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4386
4387         Fix #75160.
4388         * class.cs (GetPartialBases): Fix return value check of
4389         part.GetClassBases.
4390
4391 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4392
4393         Ensure that partial classes are registered in their enclosing
4394         namespace.  Initial part of fix of #75160.
4395         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4396         Register declspace with namespace here, not in
4397         DeclSpace.RecordDecl.
4398         * cs-parser.jay: Pass namespace to RecordDecl.
4399         * class.cs (PartialContainer.Create): Likewise.
4400         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4401         called.
4402         * decl.cs (Declspace.RecordDecl): Remove.
4403         * namespace.cs (NamespaceEntry.DefineName): Remove.
4404
4405 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4406
4407         * rootcontext.cs: Reset TargetExt as well.
4408
4409 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4410
4411         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4412         -langversion:ISO-1.
4413
4414 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4415
4416         Fix #75080, cs0119.cs.
4417         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4418         of ...
4419         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4420         allowing ExprClass.Type and ExprClass.Namespace for
4421         ResolveFlags.VariableOrValue.
4422         (Expression.Resolve) [1-argument variant]: Change default resolve
4423         flags based on language version.
4424         (Expression.Error_UnexpectedKind): Use a simple string array
4425         rather than an ArrayList.
4426         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4427         not ExprClass.Type.
4428         (TypeOfVoid.DoResolve): Likewise.
4429         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4430         flags argument -- it always has the same value.
4431
4432 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4433
4434         Fix #75081.
4435         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4436         Use it in the error message.
4437         * assign.cs, expression.cs, statement.cs: Update.
4438
4439 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4440
4441         Fix #75088.
4442         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4443         the "almostMatchedMember" case too.
4444         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4445         that failed the accessibility checks to 'almost_match'.
4446
4447 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4448
4449         * attribute.cs: Use internal MethodBuilder methods to set
4450         ExactSpelling and SetLastError on PInvoke methods, instead
4451         of passing them via charset.  Fixes #75060.
4452
4453 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4454
4455         * parameter.cs (Parameter): Remove TODO comment.
4456         (Parameter.DefineParameter): Remove Location parameter.
4457         (Parameters.LabelParameters): Likewise.
4458         * class.cs (Constructor.Emit): Update to change.
4459         (MethodData.Emit): Likewise.
4460         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4461         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4462
4463 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4464
4465         * parameter.cs,
4466           Removed Parameters.Location and added Parameter.Location instead.
4467           Removed Location parameter from Emit() and GetSignature().
4468         * anonymous.cs,
4469           class.cs,
4470           cs-parser.jay,
4471           delegate.cs,
4472           iterators.cs,
4473           statement.cs :
4474           Modified all related calls.
4475
4476 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4477
4478         Improve user-defined conversion handling.
4479         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4480         applicable operators.
4481         (AddConversionOperators): New.  Helper for GetConversionOperators.
4482         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4483         there is only one most encompassed/encompassing type.
4484         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4485         "applicable operator" handling.
4486         (UserConversion): Move cache here from GetConversionOperators.
4487         Directly cache the chosen operator, rather than the whole
4488         MethodGroup.
4489         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4490         case.  Allow conversion of decimal to sbyte and byte too.
4491         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4492         New static methods.  Used to avoid allocating EmptyExpressions in
4493         convert.cs.
4494
4495 2005-05-24  Duncan Mak  <duncan@novell.com>
4496
4497         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4498         another class, used in Convert.ExplicitNumericConversion.
4499         (CastToDecimal): New class, similar to above, but casts to
4500         System.Decimal, used in Convert.ImplicitNumericConversion and also
4501         in explicit convesion from double/float to decimal.
4502
4503         * convert.cs (ImplicitNumericConversion): Handle implicit
4504         conversions to System.Decimal.
4505         (ExplicitNumericConversion): handle explicit conversions to
4506         System.Decimal.
4507
4508         This fixes #68711.
4509         
4510 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4511
4512         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4513         know the type at this stage, just break through.   Fixes #75008 
4514
4515 2005-05-19  Martin Baulig  <martin@ximian.com>
4516
4517         * delegate.cs
4518         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4519         to disable error reporting.
4520
4521         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4522         here since we don't want to report an error; see the new test-336.cs.
4523
4524 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4525
4526         * statement.cs (ToplevelBlock.GetParameterReference)
4527         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4528         Move here from class Block.
4529         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4530         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4531
4532 2005-05-18  Martin Baulig  <martin@ximian.com>
4533
4534         Fix #74978.
4535
4536         * flowanalysis.cs
4537         (FlowBranching.Reachability): Add non-static public And() and Or()
4538         methods.
4539         (FlowBranchingSwitch): New class; do the `break_origins' thing
4540         like in FlowBranchingLoop.
4541         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4542         reachability, not just locals and parameters.
4543         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4544         switch; MergeBreakOrigins() now takes care of that.
4545
4546 2005-05-18  Martin Baulig  <martin@ximian.com>
4547
4548         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4549         a loop and may leave it, reset the barrier; fixes #74974.
4550
4551 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4552         
4553         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4554         is back.
4555         
4556         * cs-parser.jay: Catch more lexical errors.
4557         
4558         * report.cs: Add one more Error method.
4559         
4560         * rootcontext.cs,
4561         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4562
4563 2005-05-17  Martin Baulig  <martin@ximian.com>
4564
4565         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4566         #70970. 
4567
4568 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4569
4570         Fix test-382.cs.  Emit values of decimal constants.
4571         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4572         Carved out of ...
4573         (TypeContainer.AddField): ... this.
4574         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4575         with initializers to include 'Const's.
4576         (ClassPart.RegisterFieldForInitialization): Forward to
4577         PartialContainer.
4578         * const.cs (Const.Const): Pass initializer to base class.
4579         (Const.Define): In case of decimal constants, register them for
4580         initialization in a static constructor.
4581
4582 2005-05-14  Martin Baulig  <martin@ximian.com>
4583
4584         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4585         do not call ResolveUnreachable() on unreachable statements in
4586         here, see the comment in the source code.
4587
4588 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4589
4590         Fix #74934.
4591         * expression.cs (BinaryResolveOperator): If one of the operands of
4592         an equality comparison is 'null' and the other is a pointer type,
4593         convert the null to a NullPointer.
4594         * convert.cs (ImplicitReferenceConversion): If the expression is a
4595         NullLiteral and the target type is a pointer type, return a
4596         NullPointer instead.
4597         (ImplicitConversionStandard): Likewise.
4598
4599 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4600         
4601         * cs-parser.jay: Set readonly context based on special constructs.
4602         
4603         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4604         readonly variable error handling.
4605         
4606         * rootcontext.cs (EmitCode): Don't verify members when error
4607         occurred.
4608         
4609         * statement.cs (LocalInfo): Add reaodnly context information.
4610         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4611
4612 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4613
4614         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4615         for #74041 to initialize 'resolved' to false only for explicit
4616         blocks.  Fixes #74873.
4617
4618 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4619
4620         Fix #74920.
4621         * typemanager.cs (unmanaged_enclosing_types): New.
4622         (IsUnmanagedType): Avoid infloops by using
4623         'unmanaged_enclosing_types' to talk with recursive invocations.
4624
4625 2005-05-13  Martin Baulig  <martin@ximian.com>
4626
4627         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4628         instance variable, not a local.  Fix #74873.
4629         (Block.ResolveUnreachable): Set it to true here.
4630
4631 2005-05-11  Duncan Mak  <duncan@novell.com>
4632
4633         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4634         continuing to process for 'arg'.
4635         (handle_preprocessing_directive): Check the argument of the #endif
4636         directive and report error CS1025 if there are any trailing
4637         characters.
4638
4639         According to the C# spec, having even whitespace after the #endif
4640         directive is illegal; however, because we call arg.TrimEnd ()
4641         beforehand, we have the same behavior as csc, allowing whitespace
4642         after the directive.
4643
4644         Fixes #74892.
4645
4646 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4647
4648         Fix #74863.
4649         
4650         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4651         (Constructor.GetObsoleteAttribute): Implemented correctly.
4652
4653 2005-05-10  Martin Baulig  <martin@ximian.com>
4654
4655         * support.cs (ReflectionParameters.ParameterModifier): Use
4656         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4657         and `ParameterAttributes.In'.  Fixes #74884.
4658
4659 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4660
4661         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4662         
4663         * expression.cs (Argument.GetParameterModifier): Turned to property.
4664         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4665         
4666         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4667         its C# equivalent.
4668         
4669 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4670
4671         Fix #74852.
4672         * decl.cs (MemberCache.AddMethods): Register override methods,
4673         rather than non-override methods.
4674         * typemanager.cs (RegisterOverride): New.
4675         (IsOverride): Update.
4676
4677 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4678
4679         Fix #73105.
4680         
4681         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4682         recursive declaration.
4683         
4684         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4685         
4686 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4687
4688         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4689         
4690         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4691
4692 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4693
4694         Fix #74797.
4695         * decl.cs (DeclSpace.FamilyAccessible): 
4696         Use TypeManager.IsNestedFamilyAccessible.
4697
4698         Fix reopened #64812.
4699         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4700         internal'.
4701
4702 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4703             Abin Thomas  <projectmonokochi@rediffmail.com>
4704             Anoob V E  <projectmonokochi@rediffmail.com>
4705             Harilal P R  <projectmonokochi@rediffmail.com>
4706
4707         Fix #64812.
4708         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4709         allow access to all static members.
4710
4711 2005-05-04  Martin Baulig  <martin@ximian.com>
4712
4713         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4714
4715 2005-05-04  Martin Baulig  <martin@ximian.com>
4716
4717         Fix #74655.
4718
4719         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4720         section at the end; make things work if `default' is not the last
4721         section.        
4722
4723 2005-05-04  Martin Baulig  <martin@ximian.com>
4724
4725         Fix #70400.
4726
4727         * statement.cs (Switch): Replaced the `got_default' field with a
4728         `default_section' one.
4729         (Switch.CheckSwitch): Set `default_section' here.
4730         (Switch.Resolve): If we're a constant switch and the constant is
4731         not found, use the default section.
4732
4733 2005-05-03  Martin Baulig  <martin@ximian.com>
4734
4735         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4736
4737         * statement.cs (Foreach.ArrayForeach): New nested class.
4738         (Foreach.TemporaryVariable): New nested class.
4739         (Foreach.EmitArrayForeach): Removed; this is now in the new
4740         ArrayForeach class.
4741
4742 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4743
4744         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4745         more conservative.
4746         (VerifyPendingMethods): Revert change below.
4747
4748         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4749         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4750         that used to trigger warning -28.  Remove warning -28.
4751         * expression.cs (Invocation.OverloadResolve): Use
4752         TypeManager.IsOverride to distinguish override methods.
4753
4754         Fix #74773.
4755         * pending.cs (VerifyPendingMethods): If a base type implements the
4756         requested interface, don't bother checking individual methods of
4757         the base type.  As a side-effect, this prevents the creation of
4758         unnecessary proxies.
4759
4760 2005-05-02  Martin Baulig  <martin@ximian.com>
4761
4762         Fix #70182.
4763
4764         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4765         Also `And' the locals if the old vector is null.
4766         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4767         null; in this case we basically reset all the variables.        
4768
4769 2005-05-02  Martin Baulig  <martin@ximian.com>
4770
4771         Fix #74529.
4772
4773         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4774         Added `FlowBranching branching' argument; always `and' the
4775         variables instead of `or'ing them unless we're an infinite loop.
4776
4777         * statement.cs (While.Resolve): Create a new sibling unless we're
4778         infinite.       
4779
4780 2005-05-02  Martin Baulig  <martin@ximian.com>
4781
4782         Fix #70140.
4783
4784         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4785         arguments; use it instead of creating a new TopLevelBlock.
4786         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4787         our ConstructorInitializer.
4788
4789         * statement.cs
4790         (TopLevelBlock.TopLevelBranching): New public property.
4791         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4792         and create our `TopLevelBranching'.
4793
4794         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4795         anonymous method host, use `block.TopLevelBranching' rather than
4796         creating a new branching.
4797
4798 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4799
4800         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4801         a ScopeInfo, if any of the current children is a child of the new
4802         entry, move those children there.
4803
4804 2005-04-30  Martin Baulig  <martin@ximian.com>
4805
4806         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4807         at the beginning of a SwitchSection.  Fix #73335.
4808
4809 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4810
4811         Fix #74378
4812         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4813         
4814         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4815         (FieldExpr.DoResolve): Obsolete members are ignored for field
4816         initializers.
4817         
4818 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4819
4820         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4821         of arrays detection.
4822
4823         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4824         verification.
4825         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4826
4827         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4828         arrays report.
4829
4830 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4831
4832         * cs-parser.jay: Use the prefered version of -unsafe in error
4833         message.
4834
4835 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4836
4837         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4838         circumstances.
4839
4840 2005-04-20  John Luke  <john.luke@gmail.com>
4841
4842         * driver.cs: fix typo in error message, --outout to --output
4843
4844 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4845
4846         * codegen.cs (InRefOutArgumentResolving): New field.
4847         
4848         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4849         fields outside contructor.
4850         
4851         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4852         
4853 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4854
4855         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4856         parameter code was not completed ever, so it was not as up-to-date
4857         as local variables.  Must finish it.
4858
4859         The bug fix was to compare the Toplevel of the block, not the
4860         current block.  Thanks for Ben for pointing this out. 
4861
4862 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4863
4864         * decl.cs (AddMethods): Use the declaring type of the problem
4865         method to determine if we want to squash a warning.
4866
4867 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4868
4869         * attribute.cs: Removed debug output.
4870
4871         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4872         
4873         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4874         Report.Stderr.
4875         
4876 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4877
4878         Fix #74481.
4879         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4880         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4881         all null comparisons against reference types.
4882
4883 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4884
4885         Fix# 74565
4886         * class.cs (TypeContainer.CircularDepException) New nested
4887         exception class.
4888         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4889         (TypeContainer.DefineType): Removed error, reset InTransit before
4890         exit.
4891         (Class.DefineType): Throw exception when is in Transit.
4892         Catch exception and report error.
4893         (Struct.DefineType): Throw exception when is in Transit.
4894         Catch exception and report error.
4895         (Interface.DefineType): Throw exception when is in Transit.
4896         Catch exception and report error.
4897
4898         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4899         handle nested exception handlers.
4900
4901         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4902         a catch.
4903
4904         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4905         InFinally and InCatch storage.
4906
4907         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4908         (Catch.Resolve): Set and Restore ec.InCatch.
4909         (Try.Resolve): Set and Restore ec.InFinally.
4910         (Try.HasCatch): True when try has catch.
4911
4912 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4913
4914         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4915           for the same event member, so exclude such cases from warning 419.
4916           Fixed bug #74633.
4917
4918 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4919
4920         * expression.cs (Binary.ResolveOperator): Apply patch from John
4921         Luke to fix bug 59864: operators &, | and ^ on enumerations
4922         require that the same enum type on both sides.
4923
4924         * driver.cs: Add warnings to old flag usage, this is to assist
4925         people who produce Makefiles and hope that the Makefiles will be
4926         used on Windows.
4927
4928         * class.cs (TypeContainer.EmitType): Moved the definition of the
4929         special $PRIVATE$ field from the resolve phase to the Emit phase.
4930         During resolve we do not know if we are a struct with
4931         HasExplicitLayout, we know this only after the attributes for the
4932         type are emitted.
4933
4934         Set the FieldOffset to zero on the dummy field that we create for
4935         the class.   Fixes 74590.
4936
4937 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4938
4939         Fix #73834.
4940         * ecore.cs (PropertyExpr.resolved): New.
4941         (DoResolve): Use it to handle a case of double resolution here.
4942         Handle a case of identical-name-and-type-name.
4943         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4944         resolution by storing the results of expression resolution back
4945         into the "probes" array.
4946
4947 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4948
4949         Fix cs0208-7.cs and cs0208-8.cs.
4950         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4951         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4952         error reporting to point out the reason a struct is not unmanaged.
4953
4954 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4955
4956         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4957           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4958
4959 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4960
4961         Fix #74528.
4962         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4963         IdenticalNameAndTypeName here.
4964         (EventExpr.InstanceResolve): Likewise.
4965
4966 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4967
4968         C# 2.0 DefaultCharSetAttribute implementation
4969         
4970         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4971         which allows us to set GlobalNamespace for every resolve.
4972         (Attribute.ResolveArguments): Cut from Resolve.
4973         (Attribute.GetCharSetValue): Returns CharSet named argument.
4974         (Attribute.DefinePInvokeMethod): Gets default charset from
4975         module settings.
4976         (GlobalAttribute.ResolveAsTypeStep): Override.
4977         (GlobalAttribute.ResolveArguments): Override.
4978         
4979         * class.cs (TypeAttr): Is protected.
4980         
4981         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4982         (ModuleClass.DefaultCharSetType): New memeber.
4983         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4984         
4985         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4986         charset from module.
4987         
4988         * delegate.cs (TypeAttr): Override.
4989         (Delegate.DefineType): Use this TypeAttr.
4990         
4991         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4992         at very early stage (before types are defined) to resolve model
4993         module attributes. It will probably not work with corlib but it
4994         should be ok.
4995         
4996         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4997         charset from module.
4998         
4999         * typemanager.cs (default_charset_type): New type.
5000
5001 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5002
5003         * decl.cs (MemberCache.AddMethods): Don't warn if
5004         System.Object.Finalize has buggy MethodAttributes.
5005
5006         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5007         removed below.
5008
5009 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5010
5011         * doc.cs : detect ambiguous reference to overloaded members.
5012           Fixed bug #71603. MS 1.1 csc does not detect it.
5013
5014 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5015
5016         * doc.cs : delegates must not be referenced with parameters.
5017           Fixed bug #71605.
5018
5019 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5020
5021         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5022
5023 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5024
5025         * driver.cs (MainDriver): Stop processing if the CLS stage found
5026         errors. 
5027
5028         (CompilerCallableEntryPoint.InvokeCompiler): Always
5029         reset after execution;   Take a TextWriter argument for the
5030         output.
5031
5032         * report.cs: Use the error stream instead of hardcoding stderr. 
5033
5034 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5035
5036         * class.cs: Reduce code paths to test, too small of an
5037         optimization to make it worth the extra testing.  Always perform
5038         it. 
5039
5040 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5041
5042         Fix #74510.
5043         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5044         operators that had errors reported on them.
5045
5046 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5047
5048         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5049         argument types.
5050         (Attribute.Resolve): Add named argument type checking.
5051         
5052         * class.cs (FixedField.Define): Use IsPrimitiveType
5053         
5054         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5055         
5056         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5057         unsafe parameter types.
5058         
5059         * statement.cs (Using.ResolveExpression): Add better error description.
5060         
5061         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5062         
5063 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5064
5065         Fix #74484.
5066         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5067         AttributeUsageAttribute in the emitcontext of the attribute class,
5068         not in the emitcontext of the attributable entity it was attached to.
5069         * cs-parser.jay: Use 'current_class', not 'current_container',
5070         when creating a GlobalAttribute.
5071
5072 2005-04-08  Alp Toker  <alp@atoker.com>
5073
5074         * pending.cs: The fix to #58413 failed to compile methods implementing
5075         interfaces with/without params modifiers and vice versa, even though
5076         params modifiers aren't part of the signature. Make the modifier check
5077         less strict as in csc.
5078
5079 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5080             Anoob V E  <projectmonokochi@rediffmail.com>
5081             Harilal P R  <projectmonokochi@rediffmail.com>
5082
5083         Fix #58413.
5084         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5085         modifiers of pending methods.
5086         (PendingImplementation.PendingImplementation): Initialize it.
5087         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5088         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5089         with ParameterData.  Add check for modifiers.
5090         * class.cs (MethodData.Define): Update to changes.
5091
5092 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5093
5094         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5095
5096 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5097
5098         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5099         property.
5100         
5101         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5102         
5103         * rootcontext.cs,
5104         * typemanager.cs: Registered RequiredAttributeAttribute.
5105         
5106 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5107
5108         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5109         Warning CS0169 is back at level 3.
5110         (IMethodData.SetMemberIsUsed): New method.
5111         
5112         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5113         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5114         
5115         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5116
5117         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5118         contants.
5119         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5120         is used.
5121         
5122         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5123         is used.
5124         
5125         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5126         to avoid the problems with nested types.
5127
5128 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5129             Anoob V.E  <projectmonokochi@rediffmail.com>
5130             Harilal P.R  <projectmonokochi@rediffmail.com>
5131             Raja R Harinath  <rharinath@novell.com>
5132
5133         Fix #73820.
5134         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5135         attribute.
5136         * typemanager (GetConstructor): Make public.
5137
5138 2005-04-05  John Luke  <john.luke@gmail.com>
5139             Raja R Harinath  <rharinath@novell.com>
5140
5141         Fix #62232.
5142         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5143         struct too.  Return false quicker in a few cases.
5144         (VerifyUnManaged): Use it.
5145
5146 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5147
5148         Fix #74041.
5149         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5150         not 'unreachable_seen'.
5151
5152 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5153
5154         * attribute.cs (Attribute.GetValue): Removed unused.
5155         
5156         * codegen.cs (CodeGen.TrimExt): Removed unused.
5157         
5158         * cs-parser.jay (output): Removed unused.
5159         
5160         * cs-tokenizer.cs (hex_digits): Removed unused.
5161         
5162         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5163         
5164         * expression.cs (Indirection.LoadExprValue): Removed unused.
5165         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5166         
5167         * iterators.cs (Iterator.param_types): Removed unused.
5168         
5169         * statement.cs (Goto.block): Removed unused.
5170         (ToplevelBlock.did): Removed unused.
5171         (Switch.ResolveConstantSwitch): Removed unused.
5172
5173 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5174
5175         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5176         resetting thingy.
5177
5178 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5179
5180         Fix #74232 and cs0208-3.cs.
5181         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5182         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5183         unmanaged type.  Don't use FieldBuilders when 't' is a
5184         TypeBuilder.  Use ModFlags and MemberType fields.
5185         * class.cs (MemberBase.member_type): Rename from MemberType.
5186         (MemberBase.MemberType): New property.  Determines member_type on
5187         demand.
5188         (MemberBase.DoDefine): Don't initialize MemberType here.
5189         (FieldMember.Define): Likewise.
5190
5191 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5192
5193         Fix #74241
5194         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5195         Attributes are emitted there.
5196         
5197 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5198
5199         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5200         keyword in 'partial enum' too.
5201         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5202         is not allowed).
5203         Report from Kamil Skalski <nazgul@omega.pl>.
5204
5205         Fix #74309.
5206         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5207         have partial containers too.
5208
5209         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5210         in block' checks to Block.CheckInvariantMeaningInBlock.
5211         * statement.cs (Block.GetKnownVariableInfo): Make private.
5212         (Block.IsVariableUsedInChildBlock): Remove.
5213         (Block.IsVariableUsedInBlock): Likewise.
5214         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5215         conflicting declaration.
5216         (Block.AddVariable): Make error messages less long-winded and more
5217         specific.  Show location of conflicting declaration.
5218         * parameter.cs (Parameters.Location): New readonly property.
5219
5220 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5221
5222         Clean up semantics of invoking ResolveMemberAccess.
5223         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5224         can have an instance, ensure that we pass in a non-TypeExpression
5225         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5226         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5227         argument.  Update to changes and simplify.
5228         (FieldExpr.Emitinstance): Remove CS0120 check.
5229         (PropertyExpr.EmitInstance): Likewise.
5230         * expression.cs (Argument.Resolve): Likewise.
5231         (Invocation.DoResolve): Update to changes in semantics of
5232         InstanceExpression.
5233
5234 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5235
5236         Fix #74241
5237         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5238         customization.
5239         
5240         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5241
5242 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5243
5244         Fix difference in behaviour with commandline invocation.
5245         * driver.cs (Driver.Reset): New.
5246         (CompilerCallableEntryPoint): Call it.
5247
5248         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5249         variable" warnings if the boolean expression failed to resolve.
5250
5251 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5252
5253         * attribute.cs: Fix the union of several permissions when some of them
5254         are unrestricted (so the result isn't an unrestricted permission set).
5255         Fix #74036.
5256
5257 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5258
5259         * ecore.cs (MemberExpr): New class.  Convert from interface
5260         IMemberExpr.
5261         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5262         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5263         error checks.
5264         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5265         (MethodGroupExpr.IsExplicitImpl): Remove.
5266         (Expression.GetFieldFromEvent): Remove.
5267         (SimpleName.MemberStaticCheck): Remove.
5268         (SimpleName.DoSimpleNameResolve): Update to changes.
5269         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5270         (MemberAccess.IdenticalNameAndTypeName): Remove.
5271         (MemberAccess.error176): Move to MemberExpr.
5272         (MemberAccess.DoResolve): Update to changes.
5273         (BaseAccess.DoResolve): Likewise.
5274
5275 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5276
5277         C# 2.0 Conditional attribute class implementation
5278         
5279         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5280         Analyzes class whether it has attribute which has ConditionalAttribute
5281         and its condition is not defined.
5282         
5283         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5284         (Class.IsExcluded): New method. Search for at least one defined
5285         condition in ConditionalAttribute of attribute class.
5286
5287 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5288
5289         * ecore.cs (PropertyExpr): Derive from Expression, not
5290         ExpressionStatement.
5291         (PropertyExpr.EmitStatement): Remove.
5292
5293 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5294
5295         Fix #74060.
5296         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5297         internal field "value__" of an enum be private.  The examples for
5298         "value__" that I found on MSDN all used FieldAttributes.Private.
5299
5300         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5301         Don't mention IL method attribute names.
5302
5303         Fix #47991.  Remove a TODO.
5304         * statement.cs (Block.Toplevel): Make into a field.
5305         (Block.Parameters): Move into ToplevelBlock.
5306         (Block.known_variables): Rename from child_variable_names.
5307         (Block.Block): Remove variants that take Parameters.  Initialize
5308         'Toplevel' with the immediately surrounding toplevel block.
5309         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5310         LocalInfo parameter.
5311         (Block.GetKnownVariableInfo): New.
5312         (Block.IsVariableNameUsedInChildBlock): Update.
5313         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5314         the block, even though it may not be in scope.
5315         (Block.AddVariable): Remove Parameters parameter.  Use
5316         Toplevel.Parameters instead.
5317         (Block.AddConstant): Remove Parameters parameter.
5318         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5319         (Block.IsParamaterReference): Likewise.
5320         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5321         (ToplevelBlock.Parameters): New.  Moved from Block.
5322         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5323         initialize Parameters to a non-null value.
5324         * cs-parser.jay: Update to changes.
5325         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5326         simple names that mean different things in the same block.  Use
5327         Block.IsVariableNameUsedInBlock.
5328
5329 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5330
5331         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5332         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5333         GetTypeHandle.  It is possible for a reflected type to derive from
5334         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5335         System.Array during mscorlib compilation).
5336         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5337         contain a method_hash, don't create one either.  Don't create a
5338         deep copy of the base cache's method_hash.
5339         (MemberCache.SetupCache): Rename back from DeepCopy.
5340         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5341         already initialized.  If we see an override function, add its
5342         underlying base virtual function to the member_hash too.
5343
5344         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5345
5346 2005-03-26  Raja R Harinath  <harinath@acm.org>
5347
5348         Fix #73038.
5349         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5350         fails to resolve, ensure that the LHS is still resolved as an
5351         lvalue.
5352
5353 2005-03-25  Raja R Harinath  <harinath@acm.org>
5354
5355         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5356         ec.ContainerType.
5357         (Enum.current_ec): Remove.
5358         (Enum.LookupEnumValue): Remove EmitContext argument.
5359         Just uses the one created during DefineType.
5360         (Enum.FindMembers): Update.
5361         * expression.cs (MemberAccess.DoResolve): Update.
5362
5363 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5364
5365         * assign.cs (Assign.DoResolve): Check for CS1717 when
5366         source and target are same (uses Equals).
5367
5368         * expression.cs (LocalVariableReference, ParameterReference,
5369         This): Implemented Equals, GetHashCode.
5370
5371         * statement.cs (Block.GetParameterReference): Removed useless
5372         local variable.
5373
5374 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5375
5376         Fix cs0128.cs
5377         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5378         blocks before deciding whether the error is cs0136 or cs0128.
5379
5380         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5381         (using_alias_directive, using_namespace_directive): Pass
5382         MemberName, not an expression to Namespace.UsingAlias and
5383         Namespace.Using.
5384         (MakeName): Use the MemberName of the namespace.
5385         * namespace.cs (Namespace.MemberName): New.
5386         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5387         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5388         Likewise.
5389         * decl.cs (MemberName.Name): Make readonly.
5390         (MemberName.FromDotted): New "constructor".
5391         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5392         (MemberCore.Name): Compute from MemberName on demand.
5393         (MemberCore.SetMemberName): Provide a way to change the
5394         MemberName.
5395         (MemberCore.AddToContainer): Don't take a fullname parameter.
5396         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5397         fully qualified name of the container to the member name.
5398         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5399         only if the type is a member of the root container.
5400         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5401         MemberName.Left rather than searching for an embedded ".".
5402         (PartialContainer.CreatePart): Update to changes in RootContext.
5403         (MemberBase.ShortName): Turn into a property.  Use
5404         MemberCore.SetMemberName.
5405         (MemberBase.ExplicitInterfaceName): Remove.
5406         (MemberBase.UpdateMemberName): Remove.
5407         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5408         (PropertyBase.SetMemberName): New override.
5409         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5410         (Tree.GetDecl): New.
5411         (Tree.AllDecls): Rename from Decls.
5412         * attribute.cs, enum.cs, report.cs: Update to changes.
5413         * driver.cs (MainDriver): Use MemberName.FromDotted on
5414         RootContext.MainClass.
5415
5416 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5417
5418         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5419         checks.
5420
5421         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5422
5423 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5424
5425         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5426         property accessor modifiers.
5427
5428         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5429         fixed buffer attribute (CS1716).
5430         (PropertyMethod.HasCustomAccessModifier): When property accessor
5431         has custom modifier.
5432
5433         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5434         modifiers.
5435         (PropertyExpr.DoResolveLValue): Add CS0272.
5436
5437 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5438
5439         * convert.cs: When converting to a pointer, use the proper Conv.U
5440         or Conv.I depending on the source data type.
5441
5442         * cs-tokenizer.cs: Make the size for large decimal constants,
5443         fixes #72957.
5444
5445 2005-03-17  Martin Baulig  <martin@ximian.com>
5446
5447         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5448         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5449
5450 2005-03-17  Martin Baulig  <martin@ximian.com>
5451
5452         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5453         to bool so we can return an error condition.
5454         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5455         returned an error.
5456
5457 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5458
5459         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5460         attributes.
5461
5462 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5463
5464         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5465         Refactor to avoid traversing the list of assemblies, and to avoid
5466         string concatenation.
5467         * typemanager.cs (guid_attr_type): Remove.
5468         (negative_hits, pointers, references): Remove hashes.
5469         (type_hash): New.
5470         (GetConstructedType): New.  Uses type_hash to handle constructed
5471         types (arrays, references, pointers).
5472         (GetReferenceType, GetPointerType): Use it.
5473         (GetNestedType): New.  Uses type_hash to handle nested types of
5474         reflected types.
5475         (LookupType, LookupTypeDirect): Remove.
5476         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5477         'types' hash and LookupTypeReflection directly.
5478         (params_string, params_object): Use GetConstructedType.
5479         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5480         top-level types.
5481         (Namespace.Lookup): Use cached_types.
5482         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5483         provided by old TypeManager.LookupType.
5484         * rootcontext.cs (MakeFQN): Remove.
5485         * decl.cs (DeclSpace.MakeFQN): Likewise.
5486         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5487         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5488         TypeManager.GetConstructedType.
5489         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5490
5491 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5492
5493         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5494         indexers.
5495
5496         * cs-parser.jay: Reports CS1527 for any namespace element.
5497
5498         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5499         Added CS0407.
5500
5501         * expression.cs (ParameterReference.IsAssigned): Changed error to
5502         CS0269.
5503         (Error_WrongNumArguments): Moved CS0245 detection here.
5504
5505         * statement.cs (Return.Resolve): Add CS1622 report.
5506
5507 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5508
5509         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5510
5511 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5512
5513         * attribute.cs expression.cs: Get rid of some allocations.
5514
5515 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5516
5517         * doc.cs : just eliminate the latest change.
5518
5519 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5520
5521         * doc.cs : commented out the latest change. It breaks xml-030.cs
5522
5523 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5524
5525         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5526           fail. So invoke CreateType() in FindDocumentedType().
5527
5528 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5529
5530         * cs-tokenizer.cs : added IsKeyword().
5531         * doc.cs : Detect keyword incorrectly used as identifier.
5532           Allow identifiers prefixed by @.
5533
5534 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5535
5536         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5537         It caused exception in namespace resolving (again!).
5538         
5539         * class.cs (Class.ctor): Removed exit.
5540         (PropertyMethod.ctor): ditto.
5541         
5542         * codegen.cs (Codegen.Reset): Reset static data.
5543         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5544         
5545         * cs-tokenizer.cs (Cleanup): Removed.
5546         
5547         * driver.cs (GetSystemDir): Rewrote to one line command.
5548         It caused problem with unloaded dynamic modules.
5549         (UnixParseOption): Removed Exit.
5550         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5551         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5552         Now can be mcs used as library.
5553         
5554         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5555         empty location.
5556         
5557         * location.cs (Reset): Reset static data.
5558         
5559         * namespace.cs (Reset): Reset static data.
5560         
5561         * report.cs (Report.Reset): Reset static data.
5562         
5563         * rootcontext.cs (RootContext.Reset): Reset static data.
5564         
5565         * tree.cs (RootTypes.ctor): Use Location.Null
5566         
5567         * typemanager.cs (TypeManager.Reset): Reset static data.
5568         (CoreLookupType): Removed Exit.
5569         (TypeHandle.Reset): Reset static data.
5570         
5571 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5572
5573         Fix #73516.
5574         * typemanager.cs (ComputeNamespaces): Import namespaces from
5575         referenced modules too.
5576
5577 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5578
5579         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5580         than '.'.
5581
5582 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5583
5584         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5585         enclosing DeclSpace.  This ensures that a name-lookup populates
5586         more caches and there are fewer 'TypeExpression's.  Carve out
5587         nested type lookup into ...
5588         (LookupNestedTypeInHierarchy): ... this.
5589
5590 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5591
5592         Clean up a few partial-class semantics.  
5593         Fixes test-357.cs and cs1618-2.cs.
5594         * cs-parser.jay (struct_declaration): Use 'current_class' as
5595         parent of newly-created struct.  Remove call to Register ().
5596         Use 'pop_current_class' to complete handing the current struct.
5597         (interface_declaration): Likewise.
5598         (class_declaration): Likewise.
5599         (enum_declaration): Use 'current_class' as parent of newly created
5600         enum.
5601         (delegate_declaration): Likewise.
5602         (pop_current_class): New function.  This is used to handle closing
5603         up the 'current_class' and 'current_container', and pointing them
5604         to the enclosing class/container.
5605         (CSharpParser): Initialize 'current_class' too.
5606         * decl.cs (MemberCore): Add check for invariant: a partial
5607         container is not a parsed entity, and thus does not enclose any
5608         parsed members.
5609         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5610         (DeclSpace.BaseTypeExpr): Use it.
5611         (DeclSpace.LookupType): Add check for invariant.
5612         * class.cs (TypeContainer): Add check for invariant: a nested
5613         class should have the same NamespaceEntry as its enclosing class.
5614         (TypeContainer.EmitFieldInitializers): Make virtual.
5615         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5616         MemberCore.
5617         (TypeContainer.Register): Remove.
5618         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5619         null.  Use TypeResolveEmitContext for resolving base types and
5620         interfaces.  Move initialization of Parts.TypeBuilder here from
5621         ...
5622         (TypeContainer.DefineNestedTypes): ... here.
5623         (PartialContainer): Take a Namespace not a NamespaceEntry.
5624         (PartialContainer.Create): Don't use Register.  Call the
5625         appropriate Add... function directly.
5626         (ClassPart): Take both the PartialContainer and the enclosing
5627         class as constructor arguments.
5628         (ClassPart.EmitFieldInitializers): Override.
5629         (ClassPart.PartFindNestedTypes): Remove.
5630         (FieldBase.GetInitializerExpression): Resolve the initializer
5631         expression in the emit context of the enclosing class.
5632         * tree.cs (RootTypes): Remove Register ().
5633         
5634 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5635
5636         * cs-parser.jay: Removed CS0134.
5637         
5638         * driver.cs: Removed CS1901.
5639         
5640         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5641         for predefined types.
5642
5643 2005-03-07  Duncan Mak  <duncan@novell.com>
5644
5645         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5646         well. Fixes bug #73454.
5647
5648 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5649
5650         * cs-tokenizer.cs (xtoken): Add CS1035.
5651         
5652         * class.cs (MethodData.Define): Add CS0683.
5653         (FieldMember.ctor): Add CS0681.
5654
5655 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5656
5657         * ecore.cs (SimpleName.DoResolve): Rename from
5658         SimpleName.DoResolveAllowStatic.
5659         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5660         Pass 'intermediate' flag to MemberStaticCheck.
5661         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5662         of "intermediate" lookups via MemberAccess.
5663         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5664         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5665
5666 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5667
5668         Fix #73394.
5669         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5670         slipped in because of variable names that are identical to a
5671         builtin type's BCL equivalent ('string String;', 'int Int32;').
5672         (PropertyExpr.EmitInstance): Likewise.
5673
5674 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5675
5676         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5677         
5678         * report.cs (warning_ignore_table): Made public.
5679
5680 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5681
5682         Fix #73282.
5683         * class.cs (MethodData.Emit): Pass 'container' to
5684         container.GetObsoleteAttribute instead of 'container.Parent'.
5685
5686 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5687
5688         * cs-parser.jay: Add 1534 error test.
5689
5690         * iterators.cs (Yield.CheckContext): Add error 1629.
5691         (Iterator.ctor): Save unsafe modifier.
5692         (MoveNextMethod.DoEmit): Restore unsafe context.
5693
5694         * namespace.cs (UsingAlias): Better error message.
5695
5696 2005-03-03  Dan Winship  <danw@novell.com>
5697
5698         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5699         the warning message [#73219]
5700
5701 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5702
5703         Fix compile with MCS 1.0.0.0.
5704         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5705         w_restore to not depend on string constant folding.
5706
5707 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5708
5709         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5710         CS0246 check to users who passed 'silent = false'.
5711         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5712         check.
5713         (SimpleName.SimpleNameResolve): Update.
5714         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5715         (MemberAccess.IdenticalNameAndTypeName): Update.
5716         * doc.cs (FindDocumentedTypeNonArray): Update.
5717
5718 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5719
5720         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5721         * parameters.cs (ComputeAndDefineParameters): Remove.
5722         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5723         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5724         Use GetParameterInfo.
5725
5726 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5727
5728         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5729
5730 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5731
5732         Unify DeclSpace.LookupType and DeclSpace.FindType.
5733         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5734         is in charge of defining nested types on demand.
5735         (DeclSpace.LookupType): Use it when the current_type is a
5736         TypeBuilder.  Use LookupTypeDirect for reflected types.
5737         (DeclSpace.FindType): Remove.
5738         (DeclSpace.LookupInterfaceOrClass): Likewise.
5739         (DeclSpace.DefineTypeAndParents): Likewise.
5740         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5741         DeclSpace.LookupType.
5742         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5743         * typemanager.cs (LookupType): Simplify.
5744         (AddUserType): Remove type from negative_hits.
5745         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5746         * class.cs (TypeContainer.FindMembers): Move handling of nested
5747         types ...
5748         (TypeContainer.FindMembers_NestedTypes): ... here.
5749         (TypeContainer.FindNestedType): Implement override.
5750         (ClassPart.FindNestedType): Delegate to PartialContainer.
5751         (ClassPart.PartFindNestedType): Looks up the nested types of the
5752         part alone.
5753
5754 2005-03-02  Martin Baulig  <martin@ximian.com>
5755
5756         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5757         static constructor in static classes.
5758
5759 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5760
5761         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5762         sizeParamIndex is not specified.
5763
5764 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5765
5766         Fix #73117
5767         * report.cs (WarningMessage.IsEnabled): Missing null check.
5768
5769 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5770
5771         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5772         in the fields and not in the properties.
5773
5774 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5775
5776         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5777         fields as well.
5778
5779 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5780
5781         * attribute.cs: Small refactoring (improved robustness).
5782         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5783         (ValidateGuid): Removed.
5784         (Resolve): Removed referenced to above mentioned.
5785         (GetAttributeUsage): Made private and changed to work without
5786         class assistance.
5787         (GetIndexerAttributeValue): Don't crash.
5788         (GetConditionalAttributeValue): Ditto.
5789         (GetClsCompliantAttributeValue): Ditto.
5790         (ExtractSecurityPermissionSet): All attributes exceptions are
5791         error 648.
5792         (GetPropertyValue): New helper.
5793         (GetMethodImplOptions): New method.
5794         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5795         some missing properties.
5796         
5797         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5798         (Method.ApplyAttributeBuilder): Updated.
5799         
5800         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5801         exception.
5802
5803 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5804
5805         Fix #73052.
5806         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5807         non-simple types (array, pointer, reference).
5808
5809 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5810
5811         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5812
5813         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5814         for operators.
5815         (Method.CheckBase): Catch wrong destructor here.
5816         (MethodData.Define): Add errors 550, 668.
5817
5818         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5819
5820         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5821
5822         * pending.cs (VerifyPendingMethods): Add error 551.
5823
5824         * typemanager.cs (CSharpName): Next error report helper.
5825
5826 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5827
5828         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5829         attributes. Removed useless attribute double check.
5830         It saves almost 2MBs for corlib.
5831
5832 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5833
5834         Fix #72924.
5835         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5836         called twice in case of error.
5837
5838 2005-02-23  Chris Toshok  <toshok@ximian.com>
5839
5840         Fix compiler portions of #72827.
5841         * statement.cs (Block.Emit): call Begin/EndScope on the
5842         EmitContext instead of the ILGenerator.
5843
5844         * codegen.cs (EmitContext.BeginScope): new method, call
5845         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5846         we have one.)
5847         (EmitContext.BeginScope): same, but EndScope and CloseScope
5848
5849         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5850         offset and call the superclass's OpenScope(int) with it.
5851         (SymbolWriter.CloseScope): get the current il
5852         offset and call superclass's CloseScope(int) with it.
5853
5854 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5855
5856         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5857         CS1677 for out and ref as well.
5858
5859         * class.cs (Method.Define): Add error CS1599 detection.
5860         
5861         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5862         
5863         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5864         
5865         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5866         
5867         * support.cs.cs (ModifierDesc): New helper method.
5868
5869 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5870             Abin Thomas  <projectmonokochi@rediffmail.com>
5871             Anoob V E  <projectmonokochi@rediffmail.com>
5872             Harilal P R  <projectmonokochi@rediffmail.com>
5873
5874         Fix #57851, #72718.
5875         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5876         MemberLookup (used for error reporting) actually returns a result.
5877         Fix error report number (122, not 112).
5878
5879 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5880             Anoob V E  <projectmonokochi@rediffmail.com>
5881             Harilal P R  <projectmonokochi@rediffmail.com>
5882
5883         Fix #71134.
5884         * pending.cs (PendingImplementation.GetAbstractMethods):
5885         Find NonPublic members too.
5886
5887 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5888
5889         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5890         Fixed error 217.
5891         
5892         * class.cs (MethodCore.CheckMethodAgainstBase):
5893         Add error 239 report.
5894
5895 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5896
5897         Fix #68955.
5898         * expression.cs (Invocation.IsApplicable): Make public.
5899         (Invocation.IsParamsMethodApplicable): Likewise.
5900         * delegate.cs (Delegate.VerifyApplicability): Don't use
5901         Invocation.VerifyArgumentCompat for parameter applicability
5902         testing.  Use Invocation.IsApplicable and
5903         Invocation.IsParamsMethodApplicable.
5904
5905 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5908         
5909         * class.cs (Operator.Define): Add error 217 report.
5910         
5911 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5912
5913         * namespace.cs (UsingEntry.Resolve): Undo change below.
5914
5915 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5916
5917         Fix #72756.
5918         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5919         disable the error message when the extended MemberLookup also
5920         fails.
5921         (Expression.MemberLookupFinal): Update.
5922         (SimpleName.DoSimpleNameResolve): Update.
5923         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5924         Don't use MemberLookupFinal.
5925         (New.DoResolve): Update.
5926         (BaseAccess.CommonResolve): Update.
5927
5928 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5929
5930         Fix #72732.
5931         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5932         occured previously, don't resolve again.
5933
5934 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5935
5936         Fix #69949
5937         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5938         argument. Call ResolveAttributeUsage for unresolved.
5939         when types doesn't match ctor arguments.
5940         
5941         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5942         for nested attribute classes.
5943         (Class.attribute_usage): Removed.
5944         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5945         for attribute class.
5946         
5947         * ecore.cs (IsAttribute): Removed.
5948         
5949         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5950         
5951         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5952         now normal types.
5953         (attribute_types): Removed.
5954         (EmitCode): Global attributes are emited as the latest.
5955
5956 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5957
5958         * class.cs (EmitFieldInitializers): Don't emit field initializer
5959         for default values when optimilization is on.
5960         
5961         * constant.cs (Constant.IsDefaultValue): New property.
5962         
5963         * driver.cs: Add /optimize handling.
5964         
5965         * constant.cs,
5966         * ecore.cs,
5967         * literal.cs: Implement new IsDefaultValue property.
5968         
5969         * rootcontext.cs (Optimize): New field, holds /optimize option.
5970
5971 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5972
5973         Fix crasher in re-opened #72347.
5974         * namespace.cs (Namespace.Lookup): Return null if
5975         DeclSpace.DefineType returns null.
5976
5977         Fix #72678.
5978         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5979
5980 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5981
5982         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5983         now returns null if it cannot resolve to an lvalue.
5984         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5985         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5986         returned null.  Remove check for SimpleName.
5987         (EventExpr.DoResolveLValue): New.
5988         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5989         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5990         error from ...
5991         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5992         avoid CS0131 error.
5993         (Unary.ResolveOperator): Move CS0211 check ...
5994         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5995         CS0131 error.
5996         (Unary.DoResolveLValue): Simplify.
5997         (AddressOf.DoResolveLValue): New.
5998         (ArrayAccess.DoResolveLValue): New.
5999
6000 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6001
6002         * attribute.cs (Attribute.Resolve): Add arguments casting for
6003         when types doesn't match ctor arguments.
6004
6005 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6006
6007         Fix parts of #63202.
6008         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6009         lookup of operator in base type.  Ensure that all checks happen
6010         when the operator resolves to an "op_..." method.
6011
6012 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6013
6014         Fix #71992.
6015         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6016         'ignore_cs0104' parameter.  Pass it to ...
6017         (NamespaceEntry.Lookup): ... this.
6018         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6019         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6020         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6021         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6022         Update.  Request that cs0104 errors be ignored.
6023         (ComposedCast.ResolveAsTypeStep): Update.
6024
6025 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6026
6027         Fix #59209.
6028         * expression.cs (Invocation.BetterFunction): Remove support for
6029         comparing virtual functions and their overrides.
6030         (Invocation.IsOverride): New.
6031         (Invocation.OverloadResolve): Don't consider 'override' functions
6032         during candidate selection.  Store them in a lookaside list.
6033         If the selected method is a 'virtual' function, use the list to
6034         find any overrides that are closer to the LHS type.
6035
6036 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6037
6038         * expression.cs (New.DoResolve): Add complex core type reduction.
6039         (New.Constantify): Converts complex core type syntax like 'new int ()'
6040         to simple constant.
6041         
6042 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6043
6044         * decl.cs (EntryType.EntryType): New constructor to create an
6045         updated copy of a cache entry.
6046         (MemberCache.AddMethods): Use it.
6047         (MemberCache.ClearDeclaredOnly): Remove.
6048         (MemberCache.MemberCache): Update.
6049
6050 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6051
6052         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6053         variable.  This one is represents the actual low-level declaration
6054         of the method, as opposed to the semantic level `IsStatic'.   
6055
6056         An anonymous method which is hosted into a static method might be
6057         actually an instance method.  IsStatic would reflect the
6058         container, while MethodIsStatic represents the actual code
6059         generated.
6060
6061         * expression.cs (ParameterReference): Use the new MethodIsStatic
6062         instead of IsStatic.
6063
6064         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6065         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6066         set on the current EmitContext. 
6067
6068         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6069         resolve our casted expression as an LValue.  This triggers the
6070         proper LValue processing that is later required by Assign.
6071
6072         This fixes 72347.
6073
6074         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6075
6076 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6077
6078         C# 2.0 Fixed buffer implementation
6079
6080         * anonymous.cs: Update after RegisterHelperClass renaming.
6081
6082         * attribute.cs (AttributeTester.fixed_buffer_cache):
6083         Cache of external fixed buffers.
6084         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6085         implementation if field is fixed buffer else null.
6086
6087         * class.cs
6088         (TypeContainer.AddField): Accept FieldMember instead of Field.
6089         (FieldBase.IsFieldClsCompliant): Extracted code from
6090         VerifyClsCompliance descendant customization.
6091         (FixedField): New class handles fixed buffer fields.
6092         (FixedFieldExternal): Keeps information about imported fixed
6093         buffer.
6094         (IFixedField): Make access to internal or external fixed buffer
6095         same.
6096
6097         * cs-parser.jay: Add fixed buffer parsing.
6098
6099         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6100         buffer.
6101
6102         * expression.cs (Indirection): Extended implementation to accept
6103         fixed buffer field.
6104         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6105         (ElementAccess.MakePointerAccess): Get type as parameter.
6106         (DoResolve): Add fixed buffer field expression conversion.
6107         (DoResolveLValue): Ditto.
6108         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6109         (ArrayPtr): Derives from FixedBufferPtr.
6110         (ArrayPtr.Emit): Add extra emit for array elements.
6111
6112         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6113
6114         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6115         for compiler generated types.
6116         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6117
6118         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6119         and consume less memory.
6120         (Fixed.Resolve): Add fixed buffer case.
6121
6122         * typemanager.cs (compiler_generated_attr_ctor,
6123         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6124         (HasElementType): Add our own implementation to work on every
6125         runtime.
6126
6127 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6128
6129         * anonymous.cs (CaptureContext): Track whether `this' has been
6130         referenced.   
6131
6132         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6133         only captured `this' if it was implicitly done (instance
6134         methods/variables were used). 
6135
6136         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6137         `this' must be captured.
6138
6139 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6140  
6141         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6142         is null it means that there has been no need to capture anything,
6143         so we just create a sibling.
6144
6145         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6146
6147         Just a partial fix.  The other half is fairly elusive.
6148         
6149 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6150
6151         Fix #52586, cs0121-4.cs.
6152         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6153         and return a hashtable.
6154         (MemberCache.ClearDeclaredOnly): New.
6155         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6156         the method_hash of a base type too.
6157         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6158         type methods.  Overwrite entries with the same MethodHandle so
6159         that the ReflectedType is correct.  The process leaves in base
6160         virtual functions and their overrides as distinct entries.
6161         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6162         matters since it was boxed in a ArrayList before.
6163         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6164         modifier.
6165         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6166         case of a virtual function and its override (choose the overload
6167         as better).
6168         (Invocation.OverloadResolve): Avoid 'override' members during
6169         'applicable_type' calculation.
6170
6171 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6172
6173         Combine two near-redundant caches.
6174         * typemanager.cs (method_params): Rename from method_internal_params.
6175         (TypeManager.GetParameterData): New.  Replace
6176         Invocation.GetParameterData.
6177         (TypeManager.LookupParametersByBuilder): Remove.
6178         * expression.cs (Invocation.method_parameter_cache): Remove.
6179         (Invocation.GetParameterData): Remove.
6180         Update to changes.
6181         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6182         Update to changes.
6183
6184 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6185
6186         Fix #72015.
6187         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6188         TypeManager.multicast_delegate_type is null, resolve it by looking
6189         up "System.MulticastDelegate".
6190         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6191
6192 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6193             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6194             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6195
6196         Fix cs0164.cs.
6197         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6198         (LabeledStatement.AddReference): New.  Set 'referenced'.
6199         (Goto.Resolve): Use it.
6200
6201 2005-02-05  John Luke  <john.luke@gmail.com>
6202
6203         * driver.cs: remove duplicate -doc line in Usage ()
6204
6205 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6206
6207         * location.cs (Location.AddFile): Fix CS2002 error report.
6208
6209 2005-02-02  Martin Baulig  <martin@ximian.com>
6210
6211         * delegate.cs (Delegate.DefineType): Report an internal error if
6212         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6213         details.        
6214
6215 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6216
6217         Fix a crasher in a variant of #31984.
6218         * const.cs (Constant.CheckBase): New override that defers the
6219         new-or-override check in case the base type hasn't been populated
6220         yet.
6221         (Constant.Define): Ensure the new-or-override check is performed.
6222
6223 2005-02-01  Duncan Mak  <duncan@ximian.com>
6224
6225         * const.cs (LookupConstantValue): Check that `ce' is not null
6226         before calling GetValue ().
6227
6228 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6229
6230         Fix test-334.cs (#69519).
6231         * cs-parser.jay (using_alias_directive): Pass in an expression to
6232         NamespaceEntry.UsingAlias.
6233         (using_namespace_directive): Pass in an expression to
6234         NamespaceEntry.Using.
6235         (namespace_name): Don't flatten to a string.
6236         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6237         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6238         ResolveAsTypeStep.
6239         (NamespaceEntry.UsingEntry): Likewise.
6240         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6241         changes.
6242         (NamespaceEntry.LookupForUsing): Remove.
6243         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6244         names.
6245         (NamespaceEntry.Lookup): Remove support for dotted names.
6246
6247 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6248
6249         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6250         split into two.
6251         (NamespaceEntry.ImplicitParent): Compute on demand.
6252         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6253         parallels the current.
6254         (NamespaceEntry.LookupForUsing): Use it.
6255         (NamespaceEntry.Lookup): If the current namespace-entry is
6256         implicit, don't search aliases and using tables.
6257
6258 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6259
6260         Fix #31984.
6261         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6262         BaseCache here.
6263         (TypeContainer.BaseCache): Compute on demand.
6264         (TypeContainer.FindMembers): Define constants and types if they're
6265         not already created.
6266         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6267         check.
6268         * const.cs (Constant.Define): Make idempotent.
6269
6270 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6271
6272         * pending.cs: Produce better code (no nops produced by using Ldarg
6273         + value).
6274         
6275         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6276         i - 1' it should be arg + 1.
6277
6278         Fixes bug #71819.
6279
6280 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6281
6282         * attribute.cs (Attribute.CheckAttributeType): Make private
6283         non-virtual.
6284         (Attribute.ResolveType): Make virtual.
6285         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6286         handling of RootContext.Tree.Types.
6287
6288 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6289
6290         Update attribute-handling to use the SimpleName/MemberAccess
6291         mechanisms.
6292         * cs-parser.jay (attribute): Pass in an expression to the
6293         constructors of Attribute and GlobalAttribute.
6294         * attribute.cs (Attribute): Take an expression for the name.
6295         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6296         passed in attribute name expression.
6297         (Attribute.CheckAttributeType): Use it.
6298         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6299         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6300         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6301         argument to prevent error messages if the lookup fails.
6302
6303 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6304
6305         * expression.cs (Indirection): Implemented IVariable interface
6306         to support indirection in AddressOf operator.
6307         (PointerArithmetic.Emit): Add optimalization for case where
6308         result can be precomputed.
6309
6310 2005-01-26  Martin Baulig  <martin@ximian.com>
6311
6312         * class.cs (TypeContainer.AttributeTargets): Return the correct
6313         AttributeTargets depending on our `Kind' instead of throwing an
6314         exception; fixes #71632.
6315
6316 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6317
6318         Fix #71257
6319         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6320         constant members.
6321
6322 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6323
6324         Fix #71602.
6325         * expression.cs (MemberAccess.DoResolve): Don't complain with
6326         cs0572 when the LHS of a member access has identical name and type
6327         name.
6328
6329 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6330
6331         Fix #71651, #71675
6332         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6333         CreatePermission.
6334         Create custom PermissionSet only for PermissionSetAttribute.
6335
6336 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6337
6338         Fix #71649
6339         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6340         delegates in static class.
6341
6342 2005-01-24  Martin Baulig  <martin@ximian.com>
6343
6344         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6345         merging an implicit block, just use its reachability.
6346
6347         * statement.cs (Block.Resolve): Make the unreachable code check
6348         work wrt. implicit blocks; see test-337 from #63842.
6349
6350 2005-01-21  Alp Toker  <alp@atoker.com>
6351  
6352         * cs-parser.jay: destructor_declaration's container is PartialContainer
6353         not Class when partial types are used, so use Kind prop instead of
6354         'is'.
6355         
6356 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6357
6358         * cs-parser.jay: Improve error reporting when an interface
6359         declares new types.
6360
6361 2005-01-20  Dick Porter  <dick@ximian.com>
6362
6363         * support.cs: SeekableStreamReader fix from Sandor Dobos
6364         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6365         chars are read.  Fixes bug 70369.
6366
6367 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6368
6369         * cs-parser.jay (catch_clause): Simplify current_block handling
6370         somewhat.
6371
6372 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6373
6374         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6375         code with ImplicitStandardConversion to handle the implicit
6376         conversion of method groups into valid delegate invocations. 
6377
6378         The problem is that in parameter handling we were using this code
6379         path.  Fixes bug #64698
6380
6381 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6382
6383         * cs-parser.jay: Fix several infelicities.
6384         - Avoid assigning to the parser value stack.  Code like 
6385           '$3 = null' is unclean.  Synthesize a value for the code block
6386           instead. 
6387         - Avoid using oob_stack for storing location information.  Use ...
6388         (_mark_): ... this.  New (empty) rule.  Saves the current location
6389         in $$.
6390         (foreach_statement): Avoid using oob_stack for current_block
6391         handling.  Use technique used in for_statement and
6392         using_statement.  Synthesize a value for the code block to store
6393         additional intermediate information.
6394
6395 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6396
6397         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6398         of a different type is only allowed to private fields of a
6399         containing type, not on fields of a base class.
6400
6401         See test-174.cs and error cs0122-9.cs
6402
6403 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6404
6405         Fix test-335.cs (bug #58126).
6406         * cs-parser.jay (argument): Split out non-expression parts of the
6407         rule into 'non_simple_argument'.
6408         (invocation_expression): Support parenthesized invocations with
6409         multiple arguments, and with single non-simple arguments.
6410
6411 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6412
6413         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6414         places.
6415
6416 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6417
6418         Fix cs0038-1.cs, cs1640-6.cs.
6419         * ecore.cs (Expression.Resolve): Remove special-case for
6420         SimpleName in error-handling.
6421         (Expression.almostMatchedMembers): Relax access permission to
6422         protected.
6423         (Expression.MemberLookupFailed): Handle duplicates in
6424         almostMatchedMembers list.
6425         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6426         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6427         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6428         overload if the passed in MemberInfo is a MethodBase.
6429
6430 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6431
6432         Fix #70749
6433         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6434         for non-CAS & merge permission sets properly.
6435
6436 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6437
6438         Improve standard-compliance of simple name and member access 
6439         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6440         * ecore.cs (FullNamedExpression): New abstract base class 
6441         for Namespaces and TypeExpressions.
6442         (ResolveFlags.SimpleName): Remove.
6443         (SimpleName): Remove support for dotted names.
6444         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6445         DeclSpace.FindType and DeclSpace.LookupType.
6446         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6447         (Expression.ExprClassName): Make member function.
6448         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6449         a namespace.  Remove creation of dotted "SimpleName"s.
6450         (MemberAccess.DoResolve): Likewise.
6451         * decl.cs (DeclSpace.Cache): Make private.
6452         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6453         (DeclSpace.FindType): Update.
6454         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6455         FullNamedExpression.
6456         * namespace.cs (Namespace): Derive from FullNamedExpression
6457         so that it can be part of expression resolution.
6458         (Namespace.Lookup): Return an FullNamedExpression.
6459         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6460         namespace.
6461         * rootcontext.cs (NamespaceLookup): Remove.
6462         (LookupType): Move to DeclSpace.
6463         * attribute.cs (CheckAttributeType): Update.
6464         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6465         (FindDocumentedTypeNonArray): Likewise.
6466
6467 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6468
6469         Fix cs0509.cs, cs1632.cs.
6470         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6471         is the same as IsInterface.
6472         (TypeContainer.GetClassBases): Likewise.
6473         * statement.cs (LabeledStatement.ig): New field.
6474         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6475         label.
6476         (LabeledStatement.DoEmit): Check that the label was created with
6477         the same ILGenerator.
6478
6479 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6480
6481         Fix #71058
6482         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6483         accessors to its properties.
6484
6485         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6486         from accessors to property.
6487         
6488 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6489
6490         Fix #70722
6491         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6492         only for overrides.
6493         
6494 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6495
6496         * attribute.cs: Check for null and empty strings.  
6497
6498         I have lost another battle to Paolo.
6499
6500 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6501
6502         Fix #70942
6503         * class.cs (PropertyMethod): Set Parent field in ctors.
6504         (SetMethod.InternalParameters): Add unsafe switch hack.
6505         Override MarkForDuplicationCheck where it is appropriate.
6506
6507         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6508         It says whether container allows members with the same name.
6509         Base default is no.
6510         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6511         Removed is_method parameter.
6512
6513 2005-01-06  Duncan Mak  <duncan@ximian.com>
6514
6515         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6516         because the previous change led to incorrect reporting of CS1032
6517         ("Cannot define/undefine preprocessor symbols after first token in
6518         file"). Instead of using `tokens_seen' as the only flag that
6519         triggers CS1040, introduce `comments_seen'. This new flag is used
6520         to signify having seen comments on the current line, so it is
6521         unset after a newline.
6522
6523 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6524
6525         * doc.cs : When searching for a type, find nested type too.
6526           This fixes bug #71040.
6527
6528 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6529
6530         * doc.cs :
6531           - Warn missing member comment on those classes which also does not
6532             have doc comments. Fixed bug #71041.
6533           - Don't warn missing doc comment on default constructor.
6534             Fixed bug #71042.
6535
6536 2005-01-06  Duncan Mak  <duncan@ximian.com>
6537
6538         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6539         comments, set `tokens_seen' to true. This allows us to detect
6540         misplaced preprocessor directives (i.e. not at the beginning of
6541         the a line, nor after whitespaces). In that case, report error
6542         CS1040. This fixes bug #56460.
6543
6544         * cs-parser.jay (interface_member_declaration): Add checks for
6545         IsExplicitImpl, and report CS0541 error if an interface member is
6546         defined as an explicit interface declaration.
6547
6548 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6549
6550         Fix #70817
6551         * class.cs (PropertyMethod): Set Parent field in ctors.
6552         (SetMethod.InternalParameters): Add unsafe switch hack.
6553         
6554         * decl.cs (MemberCore.Parent): Cannot be readonly.
6555
6556 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6557
6558         * decl.cs (DeclSpace.ResolveType): Remove.
6559         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6560         Merge in code from ...
6561         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6562         * class.cs, enum.cs: Update to changes.
6563
6564 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6565
6566         * anonymous.cs: Ensure that we init the scope of our parent if it
6567         has not been initialized yet.
6568
6569 2004-12-30  Duncan Mak  <duncan@ximian.com>
6570
6571         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6572         if field.FieldBuilder is null. Fixes #70758.
6573
6574         * convert.cs: Fixed some typos and updated some of the comments.
6575         (ImplicitStandardConversionExists):
6576         (TryImplicitIntConversion): If `target_type' is an interface and
6577         the type of `ic' implements this interface, return true or a new
6578         BoxedCast instead of null. This fixes #70468.
6579
6580 2004-12-29  Duncan Mak  <duncan@ximian.com>
6581
6582         * expression.cs (Argument.Emit): Check that Expr is
6583         IMemoryLocation before casting to it, and report CS1510 otherwise.
6584
6585         This fixes #70402.
6586
6587 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6588
6589         * statement.cs (Block.ThisVariable): remove the recursion here, to
6590         make the --profile more sane.
6591
6592 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6593
6594         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6595         assembly, by JB Evain.
6596
6597 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6598
6599         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6600           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6601         "parent" refers to enclosing type/class.  "base" refers to superclass.
6602
6603 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6604
6605         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6606         Ensure that we only have GlobalAttributes.
6607         * attribute.cs (Attribute.Emit): Make non-virtual.
6608         (GlobalAttribute.Emit): Remove.
6609         (Attribute.Resolve): Make virtual.
6610         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6611         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6612         the argument. Don't create one.
6613         (Attribute.GetObsoleteAttribute): Likewise.
6614         (Attribute.GetClsCompliantAttributeValue): Likewise.
6615         * class.cs, decl.cs: Update to changes.
6616
6617 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6618
6619         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6620         
6621         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6622         
6623         * statement.cs (Foreach.Resolve): Add error 186 report.
6624
6625 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6626
6627         * expression.cs (Conditional.DoResolve): Add warning 429.
6628         
6629         * statement.cs (If.Resolve): Add warning 665.
6630
6631 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6632
6633         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6634         except when in the parser, and in GlobalAttribute.
6635         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6636         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6637         RootContext.Tree.Types.NamespaceEntry once work is done.
6638         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6639         and resets RootContext.Tree.Types.NamespaceEntry.
6640
6641 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6642
6643         * cs-parser.jay: Don't create a block for every variable.
6644
6645 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6646
6647         * location.cs: Provide extra information.
6648
6649         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6650         variables from the captured environment, it is the ldarg_0.
6651
6652 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6653
6654         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6655         find a conclusion.
6656         
6657         * class.cs: Changed warning level for 169 to avoid developer
6658         displeasure from warning flooding. It will be changed back when they
6659         fix most of current BCL warnings.
6660         
6661         * RootContext.cs: Pushed default WarningLevel to 3.
6662         
6663         * statement.cs: Removed unused variable.
6664
6665 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6666
6667         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6668         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6669         Add error 502 report.
6670         (StaticClass.DefineType): Add error 441 report.
6671         (Class.AllowedModifiersProp): New virtual property as temporary
6672         extension to AllowedModifiers.
6673         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6674         to share implementation with StaticClass and don't call virtual
6675         methods from ctor.
6676         
6677         * driver.cs (MainDriver): Add error 1558 test.
6678
6679         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6680         report. Moved error 36 test here.
6681
6682         * statement.cs (Throw.Resolve): Add error 724 report.
6683
6684         * typemanager.cs: Add out_attribute_type core type.
6685         
6686 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6687
6688         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6689         3018 report.
6690         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6691
6692         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6693         3017 report.
6694         
6695         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6696
6697         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6698         Add error 3023 report.
6699         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6700
6701         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6702         implementation.
6703
6704 2004-12-12  John Luke  <john.luke@gmail.com>
6705
6706         * driver.cs (AddArgs): take -- into account when
6707         adding arguments, fixes bug 65710 
6708
6709 2004-12-12  Martin Baulig  <martin@ximian.com>
6710
6711         * expression.cs (Unary.TryReduceNegative): Added support for
6712         SByteConstant and ByteConstant.
6713         (Unary.Reduce): Check error values from TryReduceNegative().
6714
6715 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6716
6717         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6718         and report exception as error 182.
6719
6720 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6721
6722         * driver.cs (Main): Fix message when there are warnings.
6723
6724 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6725
6726         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6727
6728 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6729
6730         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6731         Reduced number of warnings.
6732         
6733         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6734
6735 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6736
6737         * driver.cs: Removed message.
6738
6739         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6740
6741 2004-12-08    <vargaz@freemail.hu>
6742
6743         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6744
6745 2004-12-08  Martin Baulig  <martin@ximian.com>
6746
6747         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6748         instead of a CS3002 for properties and indexer.
6749
6750 2004-12-08  Martin Baulig  <martin@ximian.com>
6751
6752         * decl.cs (MemberName.ToString): Make this work again.
6753
6754 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6755
6756         * attribute.cs (Resolve): Add error 591 detection.
6757
6758         * class.cs (FieldMember.Define): Add error 1547 detection.
6759         (Indexer.Define): Add error 620 detection.
6760         (Operator.Define): Add error 590 detection.
6761
6762         * ecore.cs: Missing argument for error 79.
6763
6764         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6765         detection.
6766
6767 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6768
6769         Fix #70106
6770         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6771         only.
6772
6773 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6774
6775         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6776           Some operator comments were suppressed.
6777         * doc.cs : Implicit/explicit operator name in doc comments are like
6778           "op_Explicit(type)~returnType", so added suffix handling.
6779
6780 2004-12-07  Martin Baulig  <martin@ximian.com>
6781
6782         * decl.cs
6783         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6784         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6785         (DeclSpace.ec): New protected field; store the EmitContext here.
6786         (DeclSpace.EmitContext): New public property; moved here from
6787         `TypeContainer'.
6788         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6789         EmitContext.
6790
6791         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6792         (Enum.Emit): Don't create a new EmitContext.
6793
6794         * delegate.cs (Delegate.DefineType): Always create the
6795         EmitContext.
6796
6797         * iterators.cs (Iterators.DefineIterator): Create a new
6798         EmitContext and store it in `ec'.
6799
6800 2004-08-24  Martin Baulig  <martin@ximian.com>
6801
6802         * typemanager.cs
6803         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6804         this for accessibility checks.
6805         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6806         IsNestedFamilyAccessible.
6807         (TypeManager.IsSubclassOf): New method, do what the name actually
6808         says.   
6809
6810 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6811
6812         Fix crash on cs0657-17.cs.
6813         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6814         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6815         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6816         the case where the NamespaceEntry gets overwritten.
6817
6818 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6819
6820         Fixed #69195, #56821
6821         * ecore.cs (ResolveBoolean): Tiny refactoring.
6822
6823         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6824         of right expression resolving when left is false constant and
6825         operator is LogicalAnd OR true constant and operator is LogicalOr.
6826
6827         * statement.cs (ResolveUnreachable): Always reports warning.
6828
6829 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6830
6831         * class.cs: Distinguish between 1721 and 1722 (just a little help
6832         for the programmer).
6833
6834 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6835
6836         * delegate.cs: Only allow this on new versions of the language. 
6837
6838 2004-12-02  Duncan Mak  <duncan@ximian.com>
6839
6840         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6841         Expression class.
6842         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6843         here as a static method. Take an additional bool out parameter
6844         `must_do_cs1540_check' for signaling to InstanceResolve.
6845         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6846         member field from PropertyExpr class and made it an argument of
6847         the method instead.
6848         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6849         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6850         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6851         and `remove_accessor' as well as InstanceResolve: report CS0122
6852         where applicable.
6853
6854         Fixes #70129.
6855
6856 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6857
6858         Fix test-327.cs, test-328.cs, and put in early infrastructure
6859         for eventually fixing #52697.
6860         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6861         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6862         from other methods.
6863         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6864         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6865         (VerifyUsing, error246): Update.
6866         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6867         'NamespaceEntry.LookupNamespaceOrType'.
6868
6869 2004-12-03  Martin Baulig  <martin@ximian.com>
6870
6871         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6872         method as our child, call AnonymousMethod.Compatible() on it.
6873
6874 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6875
6876         Disable XML documentation support in 'basic' profile.
6877         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6878         Redirect XmlElement to System.Object.
6879         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6880         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6881         * mcs.exe.sources: Add doc-bootstrap.cs.
6882         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6883         of doc.cs.
6884
6885 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6886
6887         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6888           comments are allowed.
6889
6890 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6891
6892         * delegate.cs: Add checks for subtypes in paramaters and return values
6893         in VerifyMethod () to add support for Covariance/Contravariance
6894         in delegates.
6895         
6896 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6897
6898         * report.cs: Remove extra closing parenthesis.
6899
6900         * convert.cs (Error_CannotImplicitConversion): If the name of the
6901         types are the same, provide some extra information.
6902
6903         * class.cs (FieldBase): Use an unused bit field from the field to
6904         encode the `has_offset' property from the FieldMember.  This saves
6905         a couple of Ks on bootstrap compilation.
6906
6907         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6908         method as our child, return the AnonymousMethod resolved
6909         expression.
6910
6911         * expression.cs (New.DoResolve): Allow return values from
6912         NewDelegate to also include AnonymousMethods.
6913
6914         Fixes #70150.
6915
6916 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6917
6918         Fix bug #70102
6919         * attribute.cs (Resolve): Improved implementation of params
6920         attribute arguments.
6921
6922         * support.cs (ParameterData): Add HasParams to be faster.
6923
6924 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6925
6926         all things are for /doc support:
6927
6928         * doc.cs: new file that supports XML documentation generation.
6929         * mcs.exe.sources: added doc.cs.
6930         * driver.cs:
6931           Handle /doc command line option.
6932           Report error 2006 instead of 5 for missing file name for /doc.
6933           Generate XML documentation when required, after type resolution.
6934         * cs-tokenizer.cs:
6935           Added support for picking up documentation (/// and /** ... */),
6936           including a new XmlCommentState enumeration.
6937         * cs-parser.jay:
6938           Added lines to fill Documentation element for field, constant,
6939           property, indexer, method, constructor, destructor, operator, event
6940           and class, struct, interface, delegate, enum.
6941           Added lines to warn incorrect comment.
6942         * rootcontext.cs :
6943           Added Documentation field (passed only when /doc was specified).
6944         * decl.cs:
6945           Added DocComment, DocCommentHeader, GenerateDocComment() and
6946           OnGenerateDocComment() and some supporting private members for
6947           /doc feature to MemberCore.
6948         * class.cs:
6949           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6950         * delegate.cs:
6951           Added overriden DocCommentHeader.
6952         * enum.cs:
6953           Added overriden DocCommentHeader and GenerateDocComment().
6954
6955 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6956
6957         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6958         unwrapping the enumeration values, chain to
6959         DoConstantNumericPromotions again, so we can promote things to the
6960         fundamental types (takes care of enums that are bytes, sbytes).
6961
6962         Fixes bug #62054.
6963
6964 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6965
6966         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6967         Fix long-standing bug in type-lookup.  Use FindType instead of
6968         LookupType when ec.ResolvingTypeTree.
6969         (Attribute.ResolveType, Attribute.Resolve)
6970         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6971         Update to changes.
6972         (Attributes.Search): Remove internal version.  Update.
6973         (Attributes.SearchMulti): Update.
6974         (Attributes.GetClsCompliantAttribute): Remove.
6975         (Attributes.GetIndexerNameAttribute): Remove.
6976         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6977         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6978         * class.cs (Indexer.Define): Likewise.
6979
6980 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6981
6982         Fix bug #68790
6983         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6984         MarshallByReference members access.
6985
6986         * expression.cs: Use CheckMarshallByRefAccess;
6987         Better error CS0197 message.
6988
6989         * report.cs: Print whole related error message.
6990
6991 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6992
6993         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6994         the current directory to help debugging.
6995
6996 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6997
6998         * class (GetClassBases): Better error 60 report.
6999         (EventProperty): Disabled warning 67 detection.
7000
7001 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7002
7003         Fix bug #60324
7004         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7005
7006         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7007         precise values.
7008
7009 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7010
7011         Fix bug #49488
7012         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7013
7014         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7015
7016 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7017
7018         * attribute.cs (Attribute.Resolve): Refine error reporting and
7019         report a cs0117 if the identifier does not exist, to distinguish
7020         from 0617 which is a miss-use of the actual identifier.
7021
7022         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7023         between cs0070 and cs0079.
7024
7025         * class.cs (MemberBase.DoDefine): When reporting a wrong
7026         accessibility level, we use MethodCore to compare instead of
7027         Method (this was a regression in some refactoring effort).
7028
7029         So now we correctly report cs0056 again.
7030
7031         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7032         testing the target_type (which was known to be object_type) and
7033         not the source type (which is anonymous_method).
7034
7035         Fixed reporting of error cs1660.
7036
7037         * expression.cs (UserCast.Source): Expose the underlying cast.
7038
7039         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7040         allowed types to find a match to int32 first (most common).
7041
7042         In addition, it ignores any ImplicitUserConversions that did an
7043         internal implicit conversion (as the switch statement allows only
7044         one integral conversion to exist).
7045
7046         * class.cs (PartialContainer.Create): rename `name' to
7047         `member_name' for clarity.  Then replace the string calls with a
7048         call to MemberName.GetPartialName, as now using
7049         MemberName.ToString is an error (this is due to the side effects
7050         it had, that were fixed in the past).
7051
7052         This will restore the error reporting on a number of partial class
7053         errors that were missusing this (and getting an exception as a
7054         results, which is now just a plain textual warning, because
7055         yyparse debug output would crash otherwise).
7056
7057 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7058
7059         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7060
7061 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7062
7063         * rootcontext.cs (LookupType): Make sure to cache lookups that
7064         don't give us a negative result. This saves about 5% of corlib
7065         compilation time.
7066
7067 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7068
7069         * report.cs (AbstractMessage.Print): messages are sent to stderr
7070
7071         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7072         non-interface in the list of interfaces (at this point, either
7073         parent was properly set, or a base class is being listed in the
7074         interfaces section).
7075
7076         This flags error 1722, and resolves the crash from bug 69259.
7077
7078 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7079
7080         * statement.cs (Using.EmitExpressionFinally): make this work right
7081         for valuetypes. Fixes 69926.
7082
7083 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7084
7085         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7086         converted to an enum" here, before we try to change the underlying
7087         type.  This code exists, but it is a different code path than the
7088         one used while encoding constants.
7089
7090         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7091         old bug: when converting from the null literal to a pointer,
7092         return an EmptyCast, not the NullLiteral.
7093
7094         This fixes #69921, the recent null_type changes probably made this
7095         bug more prominent.
7096
7097         (ImplicitReferenceConversionExists): In addition, resynchronized
7098         the code here, so it matches the same code in
7099         ImplicitReferenceConversionExists for the `from any class-type S
7100         to any interface-type T'.
7101         
7102
7103 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7104
7105         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7106
7107 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7108
7109         * cs-parser.jay: Use verbosity accordingly. 
7110
7111 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7112
7113         * expression.cs (Unary.ResolveOperator): Do not report warning;
7114         AddressOf reads from variable.
7115         
7116         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7117
7118 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7119
7120         Fix bug #69462
7121
7122         * attribute.cs (Attributable): Removed CheckTargets.
7123         (Attributes.Emit): Explicit attribute targets are tested here.
7124
7125         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7126         not enabled for interfaces.
7127
7128         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7129         (GetAssemblyName): Ouch next bug there.
7130
7131 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7132
7133         * expression.cs: Error 275 added.
7134         
7135 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7136
7137         Fix bug #69177 (Implemented decimal constant support)
7138
7139         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7140         (BinaryFold): Add DecimalConstant.
7141
7142         * const.cs (Define): Decimal constant 
7143         (is not constant.
7144         (ChangeType): Add decimal type handling.
7145         (LookupConstantValue): Don't set value for decimal type but
7146         emit DecimalConstantAttribute. Needed for constant optimization.
7147
7148         * constant.cs (ToDecimal): New method.
7149         (ConvertToDecimal): New method.
7150         (IntConstant): Implemented ConvertToDecimal.
7151         (DecimalConstant.Emit): Emit optimized version for decimals in
7152         int range.
7153
7154         * expression.cs (ResolveOperator): Changed order of constant
7155         reduction to work correctly with native types which have
7156         overloaded operators.
7157         (ResolveMemberAccess): Extract constant value from attribute
7158         for decimal type.
7159
7160         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7161
7162         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7163         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7164         (ChangeType): Decimal is special.
7165         (TypeToCoreType): Add decimal type.
7166
7167 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7168
7169         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7170         decimal types.
7171
7172 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7173
7174         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7175         test cs1667-5.cs.
7176
7177 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7178
7179         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7180
7181         * pending.cs (PendingImplementation): Grab only interfaces.
7182
7183 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7184
7185         * statement.cs (ForeachHelperMethods): Add location member and
7186         error 202 detection.
7187
7188 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7189
7190         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7191         automatically handled by executable.make.
7192         (PROGRAM): Make profile-specific.
7193
7194 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7195
7196         * expression.cs (DoResolveBase): Fixed wrong warning for out
7197         variables.
7198
7199 2004-11-18  Martin Baulig  <martin@ximian.com>
7200
7201         Merged latest changes into gmcs.  Please keep this comment in
7202         here, it makes it easier for me to see what changed in MCS since
7203         the last time I merged.
7204
7205 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7206
7207         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7208         (TypeHandle.GetMemberCache): New.
7209         (TypeHandle.TypeHandle): Update.
7210         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7211         (TypeManager.LookupParentInterfacesCache):
7212         Rename from LookupInterfaceCache.  Optimize slightly.
7213         (TypeManager.MemberLookup_FindMembers): Update.
7214         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7215         multi-type variant.
7216         (AddCacheContents): Rename from AddHashtable.
7217         * class.cs (TypeContainer.parent_container): Remove.
7218         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7219         (TypeContainer.DoDefineMembers): Don't initialize it.
7220         Update to name changes.
7221         
7222 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7223
7224         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7225         that factors the code to check access modifiers on override.  
7226
7227         (PropertyBase): Use the code here.
7228
7229         Patch from Lluis S'anchez, fixes bug #69361.
7230
7231 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7232
7233         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7234         routine that is used to report the use of a captured variable
7235         whose address has been taken.
7236
7237         There are two checks: one when variables are being captured and
7238         the other check is when the address of a variable is taken. 
7239         
7240         (because an anonymous methods might be resolved before *or* after
7241         the address has been taken) and 
7242
7243         * expression.cs (Conditional.DoResolve): Remove the special
7244         casing that Martin added to trueExpr and falseExpr being both
7245         NullLiteral.  We get the right behavior now just by introducing
7246         the null_type into the compiler. 
7247
7248         * convert.cs (ExplicitConversion): Change the code to use
7249         null_type instead of testing `expr is NullLiteral'.
7250         (ImplicitConversionStandard): use null_type too.
7251         (ImplicitReferenceConversionExists): use null_type too.
7252         (ImplicitReferenceConversion): use null_type too.
7253
7254         * literal.cs: The type of `NullLiteral' is now null_type instead
7255         of object_type. 
7256         (Resolve): Set the type here.
7257
7258         * typemanager.cs: Introduce null_type.
7259
7260 2004-11-17  Martin Baulig  <martin@ximian.com>
7261
7262         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7263         direction, like FindMembers() does.  Fixes #69546, testcase is in
7264         test-315.cs.    
7265
7266 2004-11-16  Martin Baulig  <martin@ximian.com>
7267
7268         This is based on a patch from Marek Safar, see bug #69082.
7269         Fixes bugs #63705 and #67130.
7270
7271         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7272         method; create a MemberCache for an interface type and cache the
7273         result.
7274
7275         * decl.cs (IMemberContainer.ParentContainer): Removed.
7276         (IMemberContainer.ParentCache): New property.
7277         (MemberCache.SetupCacheForInterface): Removed.
7278         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7279         to create a cache for an interface's "parent".
7280
7281         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7282         interfaces too.
7283
7284 2004-11-16  Martin Baulig  <martin@ximian.com>
7285
7286         Merged back from gmcs; these changes already went into gmcs a
7287         couple of weeks ago.
7288
7289         * typemanager.cs
7290         (TypeManager.AddUserType): Removed the `ifaces' argument.
7291         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7292         `TypeExpr []'.
7293         (TypeManager.AddUserInterface): Removed.
7294         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7295         `TypeExpr []'.
7296         (TypeManager.GetInterfaces): Likewise.
7297         (TypeManager.GetExplicitInterfaces): Likewise.
7298
7299         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7300
7301         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7302         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7303
7304 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7305
7306         * statement.cs: Avoid adding bools to a hashtable.
7307
7308 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7309
7310         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7311         calling an unsafe method from a safe location.
7312
7313 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7314
7315         Fix #69167
7316         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7317
7318 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7319
7320         * namespace.cs (VerifyUsing): use GetPartialName instead of
7321         ToString. 
7322
7323 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7324
7325         * statement.cs (Return.Resolve): Fix regression in typo: if
7326         `in_exc', we have to request a NeedReturnLabel, this was a typo
7327         introduced in the anonymous method check-in.  Fixes #69131.
7328
7329         * Indexers were using the ShortName when defining themselves,
7330         causing a regression in the compiler bootstrap when applying the
7331         patch from 2004-11-02 (first part), now they use their full name
7332         and the bug is gone.
7333
7334 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7335
7336         * driver.cs: Strip the path from the names of embedded resources. Fixes
7337         #68519.
7338
7339 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7340
7341         Fix error message regression: cs0104-2.cs.
7342         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7343         (AliasEntry.Resolve): Update.
7344         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7345         'silent' flag.
7346         (RootContext.LookupType): Update.
7347
7348 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7349
7350         * cs-parser.jay: Add support for handling accessor modifiers
7351         * class: Add support port accessor modifiers and error checking,
7352         define PropertyMethod.Define as virtual (not abstract anymore)
7353         * ecore.cs: Add checking for proeprties access with access modifiers
7354         * iterators.cs: Modify Accessor constructor call based in the modified
7355         constructor
7356 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7357
7358         * expression.cs (StringConcat): Handle being called twice,
7359         as when we have a concat in a field init with more than two
7360         ctors in the class
7361
7362 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7363
7364         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7365         special case explicit implementations, we should always produce
7366         the .property or .event declaration.
7367         
7368         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7369         since it will not return correct data if people use this
7370         unresolved in the presence of using statements (see test-313).
7371
7372         * class.cs (MethodData.Define): If we are an explicit interface
7373         implementation, set the method name to the full name of the
7374         interface plus the name of the method.  
7375
7376         Notice that using the method.MethodName.GetFullName() does not
7377         work, as it will only contain the name as declared on the source
7378         file (it can be a shorthand in the presence of using statements)
7379         and not the fully qualifed type name, for example:
7380
7381         using System;
7382
7383         class D : ICloneable {
7384                 object ICloneable.Clone ()  {
7385                 }
7386         }
7387
7388         Would produce a method called `ICloneable.Clone' instead of
7389         `System.ICloneable.Clone'.
7390
7391         * namespace.cs (Alias.Resolve): Use GetPartialName.
7392         
7393 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7394
7395         * cs-parser.jay: Add error 1055 report.
7396
7397 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7398
7399         * assign.cs (Assign.DoResolve): Only do the transform of
7400         assignment into a New if the types are compatible, if not, fall
7401         through and let the implicit code deal with the errors and with
7402         the necessary conversions. 
7403
7404 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7405
7406         * cs-parser.jay: Add error 1031 report.
7407
7408         * cs-tokenizer.cs: Add location for error 1038.
7409
7410 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7411
7412         * cs-parser.jay: Add error 1016 report.
7413
7414 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7415
7416         * cs-parser.jay: Add errors 1575,1611 report.
7417
7418 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7419
7420         * cs-parser.jay: Add error 1001 report.
7421
7422 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7423
7424         Fix #68850
7425         * attribute.cs (GetMarshal): Add method argument for
7426         caller identification.
7427
7428         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7429         agument for GetMarshal and RuntimeMissingSupport.
7430
7431 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7432
7433         * attribute.cs (ExtractSecurityPermissionSet): Removed
7434         TypeManager.code_access_permission_type.
7435
7436         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7437
7438 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7439
7440         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7441         for obsolete use of a variable here.   Fixes regression on errors
7442         cs0619-25 and cs0619-26.
7443
7444 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7445
7446         Fix #62358, implemented security attribute encoding.
7447
7448         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7449         Tests permitted SecurityAction for assembly or other types.
7450         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7451         data from SecurityPermissionAttribute to PermisionSet class.
7452
7453         * class.cs (ApplyAttributeBuilder): Added special handling
7454         for System.Security.Permissions.SecurityAttribute based types.
7455
7456         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7457         special handling for System.Security.Permissions.SecurityAttribute
7458         based types.
7459
7460         * enum.cs (ApplyAttributeBuilder): Added special handling
7461         for System.Security.Permissions.SecurityAttribute based types.
7462
7463         * parameter.cs (ApplyAttributeBuilder): Added special handling
7464         for System.Security.Permissions.SecurityAttribute based types.
7465
7466         * rootcontext.cs: Next 2 core types.
7467
7468         * typemanager.cs (TypeManager.security_permission_attr_type):
7469         Built in type for the SecurityPermission Attribute.
7470         (code_access_permission_type): Build in type.
7471
7472 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7473
7474         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7475         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7476         all of this information into
7477         EmitContext.EmitCapturedVariableInstance.
7478         
7479         * codegen.cs (EmitCapturedVariableInstance): move here the
7480         funcionality of emitting an ldarg.0 in the presence of a
7481         remapping.   This centralizes the instance emit code.
7482
7483         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7484         then emit a load of this: it means that we have reached the
7485         topmost ScopeInfo: the one that contains the pointer to the
7486         instance of the class hosting the anonymous method.
7487
7488         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7489         captures to the topmost CaptureContext.
7490
7491 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7492
7493         * expression.cs (LocalVariableReference): Move the knowledge about
7494         the iterators into codegen's EmitCapturedVariableInstance.
7495
7496 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7497
7498         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7499         all code paths return a value from an anonymous method (it is the
7500         same as the 161 error, but for anonymous methods).
7501
7502 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7503
7504         The introduction of anonymous methods in the compiler changed
7505         various ways of doing things in the compiler.  The most
7506         significant one is the hard split between the resolution phase
7507         and the emission phases of the compiler.
7508
7509         For instance, routines that referenced local variables no
7510         longer can safely create temporary variables during the
7511         resolution phase: they must do so from the emission phase,
7512         since the variable might have been "captured", hence access to
7513         it can not be done with the local-variable operations from the runtime.
7514         
7515         * statement.cs 
7516
7517         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7518         is a toplevel block.
7519
7520         (ToplevelBlock): A new kind of Block, these are the blocks that
7521         are created by the parser for all toplevel method bodies.  These
7522         include methods, accessors and anonymous methods.
7523
7524         These contain some extra information not found in regular blocks:
7525         A pointer to an optional CaptureContext (for tracking captured
7526         local variables and parameters).  A pointer to the parent
7527         ToplevelBlock.
7528         
7529         (Return.Resolve): Catch missmatches when returning a value from an
7530         anonymous method (error 1662).
7531         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7532         phase.
7533
7534         (Break.Resolve): ditto.
7535
7536         (SwitchLabel): instead of defining the labels during the
7537         resolution phase, we now turned the public ILLabel and ILLabelCode
7538         labels into methods called GetILLabelCode() and GetILLabel() that
7539         only define the label during the Emit phase.
7540
7541         (GotoCase): Track the SwitchLabel instead of the computed label
7542         (its contained therein).  Emit the code by using
7543         SwitchLabel.GetILLabelCode ().
7544
7545         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7546         whether the Local has been captured or not.
7547
7548         (LocalInfo.IsCaptured): New property, used to tell whether the
7549         local has been captured.
7550         
7551         * anonymous.cs: Vastly updated to contain the anonymous method
7552         support.
7553
7554         The main classes here are: CaptureContext which tracks any
7555         captured information for a toplevel block and ScopeInfo used to
7556         track the activation frames for various local variables.   
7557
7558         Each toplevel block has an optional capture context associated
7559         with it.  When a method contains an anonymous method both the
7560         toplevel method and the anonymous method will create a capture
7561         context.   When variables or parameters are captured, they are
7562         recorded on the CaptureContext that owns them, for example:
7563
7564         void Demo () {
7565              int a;
7566              MyDelegate d = delegate {
7567                  a = 1;
7568              }
7569         }
7570
7571         Here `a' will be recorded as captured on the toplevel
7572         CapturedContext, the inner captured context will not have anything
7573         (it will only have data if local variables or parameters from it
7574         are captured in a nested anonymous method.
7575
7576         The ScopeInfo is used to track the activation frames for local
7577         variables, for example:
7578
7579         for (int i = 0; i < 10; i++)
7580                 for (int j = 0; j < 10; j++){
7581                    MyDelegate d = delegate {
7582                         call (i, j);
7583                    }
7584                 }
7585
7586         At runtime this captures a single captured variable `i', but it
7587         captures 10 different versions of the variable `j'.  The variable
7588         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7589         recorded on a child.  
7590
7591         The toplevel ScopeInfo will also track information like the `this'
7592         pointer if instance variables were referenced (this is necessary
7593         as the anonymous method lives inside a nested class in the host
7594         type of the method). 
7595
7596         (AnonymousMethod): Expanded to track the Toplevel, implement
7597         `AnonymousMethod.Compatible' to tell whether an anonymous method
7598         can be converted to a target delegate type. 
7599
7600         The routine now also produces the anonymous method content
7601
7602         (AnonymousDelegate): A helper class that derives from
7603         DelegateCreation, this is used to generate the code necessary to
7604         produce the delegate for the anonymous method that was created. 
7605
7606         * assign.cs: API adjustments for new changes in
7607         Convert.ImplicitStandardConversionExists.
7608
7609         * class.cs: Adjustments to cope with the fact that now toplevel
7610         blocks are of type `ToplevelBlock'. 
7611
7612         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7613         insteda of standard blocks.
7614
7615         Flag errors if params arguments are passed to anonymous methods.
7616
7617         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7618         `CurrentAnonymousMethod' which points to the current Anonymous
7619         Method.  The variable points to the AnonymousMethod class that
7620         holds the code being compiled.  It is set in the new EmitContext
7621         created for the anonymous method.
7622
7623         (EmitContext.Phase): Introduce a variable and an enumeration to
7624         assist in enforcing some rules about when and where we are allowed
7625         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7626         only one that enfonces this right now).
7627
7628         (EmitContext.HaveCaptureInfo): new helper method that returns
7629         whether we have a CapturedContext initialized.
7630
7631         (EmitContext.CaptureVariable): New method used to register that a
7632         LocalInfo must be flagged for capturing. 
7633
7634         (EmitContext.CapturedParameter): New method used to register that a
7635         parameters must be flagged for capturing. 
7636         
7637         (EmitContext.CapturedField): New method used to register that a
7638         field must be flagged for capturing. 
7639
7640         (EmitContext.HaveCapturedVariables,
7641         EmitContext.HaveCapturedFields): Return whether there are captured
7642         variables or fields. 
7643
7644         (EmitContext.EmitMethodHostInstance): This is used to emit the
7645         instance for the anonymous method.  The instance might be null
7646         (static methods), this (for anonymous methods that capture nothing
7647         and happen to live side-by-side with the current method body) or a
7648         more complicated expression if the method has a CaptureContext.
7649
7650         (EmitContext.EmitTopBlock): Routine that drives the emission of
7651         code: it will first resolve the top block, then emit any metadata
7652         and then emit the code.  The split is done so that we can extract
7653         any anonymous methods and flag any captured variables/parameters.
7654         
7655         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7656         during this phase, the ILGenerator should not be used as labels
7657         and local variables declared here might not be accessible to any
7658         code that is part of an anonymous method.  
7659
7660         Exceptions to this include the temporary variables that are
7661         created by some statements internally for holding temporary
7662         variables. 
7663         
7664         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7665         metadata for a cb
7666
7667         (EmitContext.TemporaryReturn): This method is typically called
7668         from the Emit phase, and its the only place where we allow the
7669         ReturnLabel to be defined other than the EmitMeta.  The reason is
7670         that otherwise we would have to duplicate a lot of logic in the
7671         Resolve phases of various methods that today is on the Emit
7672         phase. 
7673
7674         (EmitContext.NeedReturnLabel): This no longer creates the label,
7675         as the ILGenerator is not valid during the resolve phase.
7676
7677         (EmitContext.EmitThis): Extended the knowledge in this class to
7678         work in anonymous methods in addition to iterators. 
7679
7680         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7681         code is necessary on the stack to access the instance to a local
7682         variable (the variable will be accessed as a field).
7683
7684         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7685         EmitContext.EmitAddressOfParameter): Routines to support
7686         parameters (not completed at this point). 
7687         
7688         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7689         will also remove the parameters.
7690
7691         * convert.cs (Convert): Define a `ConstantEC' which points to a
7692         null.  This is just to prefity some code that uses
7693         ImplicitStandardConversion code and do not have an EmitContext
7694         handy.
7695
7696         The idea is to flag explicitly that at that point in time, it is
7697         known that the conversion will not trigger the delegate checking
7698         code in implicit conversions (which requires a valid
7699         EmitContext). 
7700
7701         Everywhere: pass new EmitContext parameter since
7702         ImplicitStandardConversionExists now requires it to check for
7703         anonymous method conversions. 
7704
7705         (Convert.ImplicitStandardConversionExists): If the type of an
7706         expression is the anonymous_method_type, and the type is a
7707         delegate, we invoke the AnonymousMethod.Compatible method to check
7708         whether an implicit conversion is possible. 
7709
7710         (Convert.ImplicitConversionStandard): Only do implicit method
7711         group conversions if the language level is not ISO_1.
7712
7713         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7714         MethodInfo for the Invoke method.  used by Delegate and
7715         AnonymousDelegate.
7716
7717         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7718         method conversions if the target type is a delegate.
7719
7720         Removed extra debugging nops.
7721
7722         (LocalVariableReference): Turn the `local_info' into a public
7723         field. 
7724
7725         Add `prepared' field, the same hack used for FieldExprs to cope
7726         with composed assignments, as Local variables do not necessarily
7727         operate purely on the stack as they used to: they can be captured
7728         fields. 
7729
7730         Add `temp' for a temporary result, like fields.
7731
7732         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7733
7734         It now copes with Local variables that are captured and emits the
7735         proper instance variable to load it from a field in the captured
7736         case. 
7737
7738         (ParameterReference.DoResolveBase): During the resolve phase,
7739         capture parameters if we are in an anonymous method.
7740
7741         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7742         anonymous method, use the EmitContext helper routines to emit the
7743         parameter reference.
7744
7745         * iterators.cs: Set RemapToProxy to true/false during the
7746         EmitDispose class.
7747
7748         * parameters.cs (GetParameterByName): New helper method. 
7749
7750         * typemanager.cs (anonymous_method_type) a new type that
7751         represents an anonyous method.  This is always an internal type,
7752         used as a fencepost to test against the anonymous-methodness of an
7753         expression. 
7754         
7755 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7756
7757         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7758         561 report.
7759         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7760
7761 2004-10-18  Martin Baulig  <martin@ximian.com>
7762
7763         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7764         `Type' directly, but call ResolveType() on it.
7765         (Catch.Resolve): Likewise.
7766         (Foreach.Resolve): Likewise.
7767
7768 2004-10-18  Martin Baulig  <martin@ximian.com>
7769
7770         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7771         `Type' directly, but call ResolveType() on it.
7772         (Probe.DoResolve): Likewise.
7773         (ArrayCreation.LookupType): Likewise.
7774         (TypeOf.DoResolve): Likewise.
7775         (SizeOf.DoResolve): Likewise.
7776
7777 2004-10-18  Martin Baulig  <martin@ximian.com>
7778
7779         * expression.cs (Invocation.BetterFunction): Put back
7780         TypeManager.TypeToCoreType().
7781
7782 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7783
7784         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7785         the ResolveType.
7786
7787 2004-10-18  Martin Baulig  <martin@ximian.com>
7788
7789         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7790         `Type' directly, but call ResolveType() on it.
7791
7792 2004-10-18  Martin Baulig  <martin@ximian.com>
7793
7794         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7795         `Type' directly, but call ResolveType() on it.
7796         (MemberBase.DoDefine): Likewise.
7797
7798         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7799         `Type' directly, but call ResolveType() on it.
7800         (ComposedCast.DoResolveAsTypeStep): Likewise.
7801
7802         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7803         `Type' directly, but call ResolveType() on it.
7804
7805 2004-10-17  John Luke  <john.luke@gmail.com>
7806
7807         * class.cs (Operator.GetSignatureForError): use CSharpName
7808
7809         * parameter.cs (Parameter.GetSignatureForError): Returns
7810         correct name even if was not defined.
7811
7812 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7813
7814         Fix #65816.
7815         * class.cs (TypeContainer.EmitContext): New property.
7816         (DefineNestedTypes): Create an emitcontext for each part.
7817         (MethodCore.DoDefineParameters): Use container's emitcontext.
7818         Pass type array to InternalParameters.
7819         (MemberBase.DoDefine): Use container's emitcontext.
7820         (FieldMember.Define): Likewise.
7821         (Event.Define): Likewise.
7822         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7823         Pass type array to InternalParameters.
7824         (SetIndexerMethod.GetParameterInfo): Likewise.
7825         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7826         * delegate.cs (Define): Pass emitcontext to
7827         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7828         array to InternalParameters.
7829         * expression.cs (ParameterReference.DoResolveBase): Pass
7830         emitcontext to GetParameterInfo.
7831         (ComposedCast.DoResolveAsTypeStep): Remove check on
7832         ec.ResolvingTypeTree.
7833         * parameter.cs (Parameter.Resolve): Change argument to
7834         EmitContext.  Use ResolveAsTypeTerminal.
7835         (Parameter.GetSignature): Change argument to EmitContext.
7836         (Parameters.ComputeSignature): Likewise.
7837         (Parameters.ComputeParameterTypes): Likewise.
7838         (Parameters.GetParameterInfo): Likewise.
7839         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7840         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7841         * support.cs (InternalParameters..ctor): Remove variant that takes
7842         a DeclSpace.
7843         * typemanager.cs (system_intptr_expr): New.
7844         (InitExpressionTypes): Initialize it.
7845
7846 2004-10-12  Chris Toshok  <toshok@ximian.com>
7847
7848         * cs-parser.jay: fix location for try_statement and catch_clause.
7849
7850 2004-10-11  Martin Baulig  <martin@ximian.com>
7851
7852         * report.cs: Don't make --fatal abort on warnings, we have
7853         -warnaserror for that.
7854
7855 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7856
7857         More DeclSpace.ResolveType avoidance.
7858         * decl.cs (MemberCore.InUnsafe): New property.
7859         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7860         with newly created EmitContext.
7861         (FieldMember.Define): Likewise.
7862         * delegate.cs (Delegate.Define): Likewise.
7863         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7864         only if normal name-lookup fails.
7865         (TypeExpr.DoResolve): Enable error-checking.
7866         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7867         (SizeOf.DoResolve): Likewise.
7868         (ComposedCast.DoResolveAsTypeStep): Likewise.
7869         (StackAlloc.DoResolve): Likewise.
7870         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7871         (Block.Unsafe): New property.
7872         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7873         (Unsafe): Set 'unsafe' flag of contained block.
7874         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7875         (Fixed.Resolve): Likewise.
7876         (Catch.Resolve): Likewise.
7877         (Using.ResolveLocalVariableDecls): Likewise.
7878         (Foreach.Resolve): Likewise.
7879
7880 2004-10-05  John Luke <john.luke@gmail.com>
7881
7882         * cs-parser.jay: add location to error CS0175
7883
7884 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7885
7886         * ecore.cs (Expression.Constantity): Add support for turning null
7887         into a constant.
7888
7889         * const.cs (Const.Define): Allow constants to be reference types
7890         as long as the value is Null.
7891
7892 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7893
7894         * namespace.cs (NamespaceEntry.Using): No matter which warning
7895         level is set, check if this namespace name has already been added.
7896
7897 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7898
7899         * expression.cs: reftype [!=]= null should always use br[true,false].
7900         # 67410
7901
7902 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7903
7904         Fix #67108
7905         * attribute.cs: Enum conversion moved to 
7906         GetAttributeArgumentExpression to be applied to the all
7907         expressions.
7908
7909 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7910
7911         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7912         * class.c (TypeContainer.DefineType): Flag error if
7913         base types aren't accessible due to access permissions.
7914         * decl.cs (DeclSpace.ResolveType): Move logic to
7915         Expression.ResolveAsTypeTerminal.
7916         (DeclSpace.ResolveTypeExpr): Thin layer over
7917         Expression.ResolveAsTypeTerminal.
7918         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7919         Refactor code into NestedAccess.  Use it.
7920         (DeclSpace.NestedAccess): New.
7921         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7922         argument to silence errors.  Check access permissions.
7923         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7924         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7925         (Cast.DoResolve): Likewise.
7926         (New.DoResolve): Likewise.
7927         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7928         (TypeOf.DoResolve): Likewise.
7929
7930         * expression.cs (Invocation.BetterConversion): Return the Type of
7931         the better conversion.  Implement section 14.4.2.3 more faithfully.
7932         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7933         section 14.4.2.2 explicit.
7934         (Invocation.OverloadResolve): Update.
7935         (Invocation): Remove is_base field.
7936         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7937         (Invocation.Emit): Likewise.
7938
7939 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7940
7941         * README: Update to changes.
7942
7943 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7944
7945         * cs-parser.jay: Reverted 642 warning fix.
7946
7947 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7948
7949         Fix bug #66615
7950         * decl.cs (FindMemberWithSameName): Indexer can have more than
7951         1 argument.
7952
7953 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7954
7955         * expression.cs (LocalVariableReference.DoResolveLValue):
7956         Do not report warning 219 for out values.
7957         (EmptyExpression.Null): New member to avoid extra allocations.
7958
7959 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7960
7961         * cs-parser.jay: Fix wrong warning 642 report.
7962
7963         * cs-tokenizer.cs (CheckNextToken): New helper;
7964         Inspect next character if is same as expected.
7965
7966 2004-09-23  Martin Baulig  <martin@ximian.com>
7967
7968         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7969         (Convert.ImplicitReferenceConversionExists): Likewise.
7970
7971 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7972
7973         * class.cs (Operator.Define): Add error 448 and 559 report.
7974
7975 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7976
7977         * class.cs (MemberBase.IsTypePermitted): New protected
7978         method for checking error CS0610.
7979
7980 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7981
7982         * class.cs (TypeContainer.HasExplicitLayout): New property
7983         Returns whether container has StructLayout attribute set Explicit.
7984         (FieldMember): New abstract class for consts and fields.
7985         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7986         (Field): Reuse FieldMember.
7987
7988         * const.cs (Const): Reuse FieldMember.
7989
7990         * rootcontext.cs: EmitConstants call moved to class.
7991
7992 2004-09-22  Martin Baulig  <martin@ximian.com>
7993
7994         Thanks to Peter Sestoft for this bug report.
7995
7996         * expression.cs (Conditional): If both the `trueExpr' and the
7997         `falseExpr' is a NullLiteral, return a NullLiteral.
7998
7999 2004-09-22  Martin Baulig  <martin@ximian.com>
8000
8001         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8002         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8003         for the "get_Current" call.
8004
8005 2004-09-22  Martin Baulig  <martin@ximian.com>
8006
8007         Marek and me just fixed one of our oldest bugs: #28562 :-)
8008
8009         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8010
8011         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8012         we're an EnumConstant, just return that.
8013         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8014         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8015         to get the value which'll actually be written into the attribute.
8016         However, we have to use GetValue() to access the attribute's value
8017         in the compiler.        
8018
8019 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8020
8021         * constant.cs (Constant.IsNegative): New abstract property
8022         IsNegative.
8023
8024         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8025         (StackAlloc.DoResolve): Reused IsNegative.
8026
8027 2004-09-21  Martin Baulig  <martin@ximian.com>
8028
8029         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
8030         if we're used in an iterator, we may be called from different
8031         methods.
8032
8033         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
8034         we actually have an exception block.
8035
8036 2004-09-20  John Luke <jluke@cfl.rr.com>
8037
8038         * class.cs, cs-parser.jay: Improve the error report for 1520:
8039         report the actual line where the error happens, not where the
8040         class was declared.
8041
8042         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
8043         Pass location information that was available elsewhere.
8044
8045 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
8046
8047         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
8048         runtime to delay sign assemblies.
8049
8050 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8051
8052         * cs-parser.jay: Do not report the stack trace, this is barely
8053         used nowadays.
8054
8055 2004-08-22  John Luke  <john.luke@gmail.com>
8056  
8057         * driver.cs : check that a resource id is not already used
8058         before adding it, report CS1508 if it is, bug #63637
8059
8060 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
8061
8062         * ecore.cs: Removed dead code.
8063
8064 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
8065
8066         * class.cs: Do not report warning CS0067 on the interfaces.
8067
8068 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8069
8070         * cs-parser.jay: Add error 504 report.
8071
8072 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8073
8074         * rootcontext.cs: WarningLevel is 4 by default now.
8075
8076         * statement.cs (Fixed.Resolve): Do not null
8077         VariableInfo.
8078
8079 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
8080
8081         Fixed bug #55780
8082         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
8083         deep search when property is not virtual.
8084         (PropertyExpr.ResolveAccessors): Make one call for both
8085         accessors.
8086
8087 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8088
8089         Fixed bug #65766
8090         * statement.cs: Error 152 report constains also location.
8091
8092 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8093
8094         Fixed bug #65766
8095         * const.cs: Explicitly set constant as static.
8096
8097 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8098
8099         Fixed bug #64226
8100         * cs-parser.jay: Add error 1017 report.
8101
8102 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
8103
8104         Fixed bug #59980, #64224
8105         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
8106
8107         * typemanager.cs (IsSpecialMethod): Simplified
8108
8109 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8110
8111         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
8112         condition with better params.
8113
8114 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8115
8116         Fixed bug #65238
8117         * attribute.cs (Resolve): Property has to have both
8118         accessors.
8119
8120 2004-09-14  Martin Baulig  <martin@ximian.com>
8121
8122         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8123
8124 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8125
8126         Fixed bug #61902
8127         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8128         called and is obsolete then this member suppress message
8129         when call is inside next [Obsolete] method or type.
8130
8131         * expression.cs: Use TestObsoleteMethodUsage member.
8132
8133 2004-09-14  Martin Baulig  <martin@ximian.com>
8134
8135         * cs-parser.jay: Sync a bit with the GMCS version.
8136
8137 2004-09-14  Martin Baulig  <martin@ximian.com>
8138
8139         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
8140         (CSharpParser.yacc_verbose_flag): New public field.
8141
8142         * genericparser.cs: Removed.
8143
8144 2004-09-14  Raja R Harinath  <rharinath@novell.com>
8145
8146         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
8147
8148 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8149
8150         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8151
8152 2004-09-10  Martin Baulig  <martin@ximian.com>
8153
8154         Backported my MemberName changes from GMCS into MCS.
8155
8156         - we are now using a special `MemberName' class instead of using
8157         strings; in GMCS, the `MemberName' also contains the type
8158         arguments.
8159
8160         - changed the grammar rules a bit:
8161           * the old `member_name' is now a `namespace_or_type_name':
8162             The rule is that we use `namespace_or_type_name' everywhere
8163             where we expect either a "member name" (GetEnumerator) or a
8164             "member name" with an explicit interface name
8165             (IEnumerable.GetEnumerator).
8166             In GMCS, the explicit interface name may include type arguments
8167             (IEnumerable<T>.GetEnumerator).
8168           * we use `member_name' instead of just `IDENTIFIER' for
8169             "member names":
8170             The rule is that we use `member_name' wherever a member may
8171             have type parameters in GMCS.       
8172
8173         * decl.cs (MemberName): New public class.
8174         (MemberCore.MemberName): New public readonly field.
8175         (MemberCore.ctor): Take a `MemberName' argument, not a string.
8176         (DeclSpace): Likewise.
8177
8178         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
8179         * enum.cs (Enum.ctor): Likewise.
8180
8181         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
8182         MemberName.     
8183         (AliasEntry.ctor): Take a MemberName, not an Expression.
8184         (AliasEntry.UsingAlias): Likewise.
8185
8186         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
8187         (IMethodData.MemberName): Changed type from string to MemberName.
8188         (MemberBase.ExplicitInterfaceName): Likewise.
8189         (AbstractPropertyEventMethod.SetupName): Make this private.
8190         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8191         argument; compute the member name here.
8192         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8193         on the `member.MemberName' and the `prefix'.
8194
8195         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8196         not `type_name'.
8197         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8198         thus, we get a `MemberName' instead of a `string'.  These
8199         declarations may have type parameters in GMCS.
8200         (interface_method_declaration, delegate_declaration): Likewise.
8201         (class_declaration, interface_declaration): Likewise.
8202         (method_header): Use `namespace_or_type_name' instead of
8203         `member_name'.  We may be an explicit interface implementation.
8204         (property_declaration, event_declaration): Likewise.
8205         (member_name): This is now just an `IDENTIFIER', not a
8206         `namespace_or_type_name'.
8207         (type_name, interface_type): Removed.
8208         (namespace_or_type_name): Return a MemberName, not an Expression.
8209         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8210         call GetTypeExpression() on the MemberName to get an expression.
8211         (IndexerDeclaration.interface_type): Changed type from string to
8212         MemberName.
8213         (MakeName): Operate on MemberName's instead of string's.
8214
8215 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8216
8217         Fix bug #55770.
8218         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8219         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8220         lookup to avoid symbols introduced by 'using'.
8221         * rootcontext.cs (NamespaceLookup): Update.
8222
8223 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8224
8225         * class.cs (TypeContainer.DoDefineMembers): Do not call
8226         DefineDefaultConstructor for static classes.
8227
8228 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8229
8230         * attribute.cs (Attribute.Resolve): Add error 653 report.
8231
8232         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8233         report.
8234         (Method.ApplyAttributeBuilder): Add error 685 report.
8235         (Operator.Define): Add error 564 report.
8236
8237         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8238
8239         * expression.cs (Invocation.DoResolve): Add error
8240         245 and 250 report.
8241
8242         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8243         error 674 report.
8244
8245 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8246
8247         * class.cs (ConstructorInitializer.Resolve):
8248         Wrong error number (515->516).
8249
8250 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8251
8252         * class.cs (Indexer.Define): Add error 631 report.
8253
8254 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8255
8256         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8257
8258 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8259
8260         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8261
8262 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8263
8264         * cs-parser.jay: Added error CS0241 report.
8265
8266 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8267
8268         * cs-parser.jay (fixed_statement): Introduce a scope for the
8269         declaration in the 'fixed' statement.
8270
8271 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8272
8273         * cs-parser.jay: Added CS0230 error report.
8274
8275 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8276
8277         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8278
8279 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * expression.cs (Argument.Resolve): Added error CS0192 and
8282         CS0199 report.
8283
8284 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8285
8286         C# 2.0 #pragma warning feature
8287
8288         * cs-tokenizer.cs (PreProcessPragma): New method; 
8289         Handles #pragma directive.
8290
8291         * report.cs (WarningRegions): New class; Support
8292         class for #pragma warning directive. It tests whether
8293         warning is enabled for a given line.
8294
8295 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8296
8297         * const.cs: Add more descriptive error report, tahnks to
8298         Sebastien. 
8299
8300 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8301
8302         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8303
8304 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8305
8306         * expression.cs: Apply patch from Ben: Remove dead code from
8307         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8308         as that code just threw an exception anwyays.
8309
8310         * const.cs: Remove the call to the turnintoconstant, for details
8311         see bug: #63144
8312         
8313         * literal.cs: The type of the null-literal is the null type;  So
8314         we use a placeholder type (literal.cs:System.Null, defined here)
8315         for it.
8316
8317         * expression.cs (Conditional.DoResolve): Remove some old code that
8318         is no longer needed, conversions have been fixed.
8319
8320         (ArrayCreationExpression.DoResolve): Return false if we fail to
8321         resolve the inner expression.
8322
8323 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8324
8325         Fix test-290.cs.
8326         * cs-parser.jay (delegate_declaration): Record a delegate
8327         declaration as a type declaration.
8328         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8329
8330 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8331
8332         * parameter.cs: Do not crash if the type can not be resolved. 
8333
8334         * expression.cs: Report errors with unsafe pointers, fixes #64896
8335
8336 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8337
8338         * expression.cs: Pointer arith always needs to do a conv.i
8339         if the operand is a long. fix 65320
8340
8341 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8342
8343         Fixed cs0619-37.cs, cs0619-38.cs
8344
8345         * enum.cs (GetObsoleteAttribute): Removed.
8346
8347         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8348         on Enum member is double staged. The first is tested member
8349         and then enum.
8350
8351 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8352
8353         Fixed #56986, #63631, #65231
8354
8355         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8356         adds member to name container.
8357         (TypeContainer.AddToTypeContainer): New method, adds type to
8358         name container.
8359         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8360         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8361         AddOperator): Simplified by reusing AddToMemberContainer.
8362         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8363         instead of field.
8364         (Method.CheckForDuplications): Fixed implementation to test all
8365         possibilities.
8366         (MemberBase): Detection whether member is explicit interface
8367         implementation is now in constructor.
8368         (MemberBase.UpdateMemberName): Handles IndexerName.
8369         (Accessor): Changed to keep also location information.
8370         (AbstractPropertyEventMethod): Is derived from MemberCore.
8371         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8372         will be emited or not.
8373         (PropertyBase.AreAccessorsDuplicateImplementation):
8374         Tests whether accessors are not in collision with some method.
8375         (Operator): Is derived from MethodCore to simplify common
8376         operations.
8377
8378         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8379         must be performed.
8380         (DeclSpace.AddToContainer): Adds the member to defined_names
8381         table. It tests for duplications and enclosing name conflicts.
8382
8383         * enum.cs (EnumMember): Clean up to reuse the base structures
8384
8385 2004-09-03  Martin Baulig  <martin@ximian.com>
8386
8387         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8388         into TypeContainer, to make partial classes work again.
8389
8390 2004-09-03  Martin Baulig  <martin@ximian.com>
8391
8392         * rootcontext.cs (RootContext.V2): Removed.
8393
8394 2004-03-23  Martin Baulig  <martin@ximian.com>
8395
8396         * expression.cs (Invocation.OverloadResolve): Added `bool
8397         may_fail' argument and use it instead of the Location.IsNull() hack.
8398
8399 2004-09-03  Martin Baulig  <martin@ximian.com>
8400
8401         Merged latest changes into gmcs.  Please keep this comment in
8402         here, it makes it easier for me to see what changed in MCS since
8403         the last time I merged.
8404
8405 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8406
8407         Fix #61128.
8408         * expression.cs (BetterConversion): Don't allow either conversion 
8409         to be null.  Remove redundant implicit conversion test when 'q ==
8410         null' -- when this function is invoked, we already know that the
8411         implicit conversion exists.
8412         (BetterFunction): Assume that 'best' is non-null.  Remove
8413         redundant reimplementation of IsApplicable when 'best' is null.
8414         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8415         number of arguments.
8416         (IsAncestralType): Extract from OverloadResolve.
8417         (OverloadResolve): Make robust to the MethodGroupExpr being
8418         unsorted.  Implement all the logic of Section 14.5.5.1, and
8419         support overloading of methods from multiple applicable types.
8420         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8421
8422         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8423         (RealError, Warning): Append type of report to related symbol.
8424
8425 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8426
8427         * enum.cs: Fixed CLS-Compliance checks for enum members.
8428         Error tests cs3008-8.cs, cs3014-8.cs
8429
8430 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8431
8432         Fixed bug #62342, #63102
8433         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8434         like ImplementMethod.
8435
8436 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8437
8438         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8439         Fixed bug #65170.
8440
8441 2004-09-02  Martin Baulig  <martin@ximian.com>
8442
8443         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8444         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8445         on the MethodBase.
8446
8447 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8448
8449         C# 2.0 Static classes implemented
8450
8451         * class.cs (TypeContainer): instance_constructors,
8452         initialized_fields, initialized_static_fields,
8453         default_constructor, base_inteface_types are protected to be
8454         accessible from StaticClass.
8455         (TypeContainer.DefineDefaultConstructor): New virtual method
8456         for custom default constructor generating
8457         (StaticClass): New class to handle "Static classes" feature.
8458
8459         * cs-parser.jay: Handle static keyword on class like instance
8460         of StaticClass.
8461
8462         * driver.cs: Added "/langversion" command line switch with two
8463         options (iso-1, default).
8464
8465 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8466
8467         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8468
8469 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * delegate.cs: Style.
8472
8473 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8474
8475         * delegate.cs: Add seperate instance expr field for miguel.
8476
8477 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8478
8479         * PointerArithmetic (Resolve): make sure we are not doing
8480         pointer arith on void*. Also, make sure we are resolved
8481         by not setting eclass until resolve.
8482
8483         All callers: Make sure that PointerArithmetic gets resolved.
8484
8485 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8486
8487         * ArrayCreation (LookupType): If the type does not resolve 
8488         to an array, give an error.
8489
8490 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * statement.cs (Try.Resolve): Fixed bug #64222
8493
8494 2004-08-27  Martin Baulig  <martin@ximian.com>
8495
8496         * class.cs
8497         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8498         crash here.     
8499
8500 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8501
8502         * ecore.cs (Constantify): Get underlying type via
8503         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8504         Windows in special cases.
8505
8506 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8507
8508         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8509         for obtaining also private methods.
8510         (GetRemoveMethod): Used GetRemoveMethod (true)
8511         for obtaining also private methods.
8512
8513 2004-08-24  Martin Baulig  <martin@ximian.com>
8514
8515         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8516         MethodAttributes.HideBySig for operators.
8517
8518 2004-08-23  Martin Baulig  <martin@ximian.com>
8519
8520         Back to the old error reporting system :-)
8521
8522         * report.cs (Message): Removed.
8523         (Report.MessageData, ErrorData, WarningData): Removed.
8524         (Report.Error, Warning): Back to the old system.
8525
8526 2004-08-23  Martin Baulig  <martin@ximian.com>
8527
8528         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8529
8530         * class.cs (TypeContainer.ParentContainer): New public virtual
8531         method; replaces the explicit interface implementation.
8532         (ClassPart.ParentContainer): Override.
8533
8534 2004-08-23  Martin Baulig  <martin@ximian.com>
8535
8536         * statement.cs (Switch): Added support for constant switches; see
8537         #59428 or test-285.cs.
8538
8539 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8540
8541         Fixed bug #62740.
8542         * statement.cs (GetEnumeratorFilter): Removed useless
8543         logic because C# specs is strict. GetEnumerator must be
8544         public.
8545
8546 2004-08-22  Martin Baulig  <martin@ximian.com>
8547
8548         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8549         a switch and may break, reset the barrier.  Fixes #59867.
8550
8551 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8552
8553         CLS-Compliance speed up (~5% for corlib)
8554
8555         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8556         New method. Tests container for CLS-Compliant names
8557
8558         * class.cs (TypeContainer.VerifyClsName): New method.
8559         Checks whether container name is CLS Compliant.
8560         (Constructor): Implements IMethodData.
8561
8562         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8563         low-case table for CLS Compliance test.
8564         (MemberCache.VerifyClsParameterConflict): New method.
8565         Checks method parameters for CS3006 error.
8566
8567         * enum.cs (EnumMember): Is derived from MemberCore.
8568         (Enum.VerifyClsName): Optimized for better performance.
8569
8570 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8571
8572         * report.cs: Renamed Error_T to Error and changed all
8573         references.
8574
8575 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8576
8577         * class.cs (TypeContainer.IndexerArrayList): New inner class
8578         container for indexers.
8579         (TypeContainer.DefaultIndexerName): New constant for default
8580         indexer name. Replaced all "Item" with this constant.
8581         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8582
8583         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8584         DefaultMemberAttribute constructor.
8585
8586 2004-08-05  Martin Baulig  <martin@ximian.com>
8587
8588         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8589         Fix bug #59429.
8590
8591 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8592
8593         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8594         multi platforms problem.
8595
8596         * compiler.csproj: Included shared files.
8597
8598 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8599
8600         Fix bug 60333, 55971 in the more general way
8601         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8602         Added arg_type argument for constant conversion.
8603         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8604
8605 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8606
8607         Fix bug #59760
8608         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8609         OperatorArrayList, MethodCoreArrayList for typecontainer
8610         containers. Changed class member types to these new types.
8611         (MethodArrayList.DefineMembers): Added test for CS0659.
8612
8613 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8614
8615         * cfold.cs: Synchronize the folding with the code in expression.cs
8616         Binary.DoNumericPromotions for uint operands.
8617
8618         * attribute.cs: Revert patch from Raja, it introduced a regression
8619         while building Blam-1.2.1 (hard to isolate a test case).
8620
8621 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8622
8623         Fix for #55382
8624         * class.cs:
8625         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8626         name collision.
8627         (MethodCore.parent_method): New member. The method we're overriding
8628         if this is an override method.
8629         (MethodCore.CheckBase): Moved from Method class and made common.
8630         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8631         private.
8632         (MethodCore.CheckForDuplications): New abstract method. For custom
8633         member duplication search in a container
8634         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8635         method and its return type.
8636         (Event.conflict_symbol): New member. Symbol with same name in the
8637         parent class.
8638
8639         * decl.cs:
8640         (MemberCache.FindMemberWithSameName): New method. The method
8641         is looking for conflict with inherited symbols.
8642
8643 2004-08-04  Martin Baulig  <martin@ximian.com>
8644
8645         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8646
8647         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8648
8649 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8650
8651         * report.cs (Message): New enum for better error, warning reference in
8652         the code.
8653         (MessageData): New inner abstract class. It generally handles printing of
8654         error and warning messages.
8655         Removed unused Error, Warning, Message methods.
8656
8657 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8658
8659         Fix for cs0592-8.cs test
8660         * attribute.cs
8661         (Attributable.ValidAttributeTargets): Made public.
8662         (Attribute.ExplicitTarget): New member for explicit target value.
8663         (Attribute.CheckTargets): Now we translate explicit attribute
8664         target to Target here.
8665
8666 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8667
8668         * ecore.cs (MethodGroupExpr): new IsBase property.
8669
8670         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8671
8672         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8673         rather than an instance expr.
8674
8675         (DelegateCreation.Emit): Use the method group rather than
8676         the instance expression. Also, if you have base.Foo as the
8677         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8678
8679         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8680
8681         (NewDelegate.DoResolve): Only check for the existance of Invoke
8682         if the method is going to be needed. Use MethodGroupExpr.
8683
8684         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8685
8686         * expression.cs: For pointer arith., make sure to use
8687         the size of the type, not the size of the pointer to
8688         the type.
8689
8690 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8691
8692         Fix for #60722
8693         * class.cs (Class): Added error CS0502 test.
8694
8695 2004-08-03  John Luke  <jluke@cfl.rr.com>
8696             Raja R Harinath  <rharinath@novell.com>
8697
8698         Fix for #60997.
8699         * attribute.cs (Attribute.complained_before): New flag.
8700         (Attribute.ResolveType, Attribute.Resolve),
8701         (Attribute.DefinePInvokeMethod): Set it.
8702         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8703         
8704 2004-08-03  Martin Baulig  <martin@ximian.com>
8705
8706         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8707         use a user-defined operator; we still need to do numeric
8708         promotions in case one argument is a builtin type and the other
8709         one has an implicit conversion to that type.  Fixes #62322.
8710
8711 2004-08-02  Martin Baulig  <martin@ximian.com>
8712
8713         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8714         (LocalInfo.IsThis): New public property.
8715         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8716
8717 2004-08-01  Martin Baulig  <martin@ximian.com>
8718
8719         * class.cs (TypeContainer.GetClassBases): Don't set the default
8720         here since we may get called from GetPartialBases().
8721         (TypeContainer.DefineType): If GetClassBases() didn't return a
8722         parent, use the default one.
8723
8724 2004-07-30  Duncan Mak  <duncan@ximian.com>
8725
8726         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8727
8728 2004-07-30  Martin Baulig  <martin@ximian.com>
8729
8730         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8731
8732         * class.cs (SourceMethod): New public class, derive from the
8733         symbol writer's ISourceMethod.
8734         (Method): Use the new symbol writer API.
8735
8736         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8737         as argument and use the new symbol writer.
8738
8739         * location.cs
8740         (SourceFile): Implement the symbol writer's ISourceFile.
8741         (Location.SymbolDocument): Removed.
8742         (Location.SourceFile): New public property.
8743
8744         * symbolwriter.cs: Use the new symbol writer API.
8745
8746 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8747
8748         * Makefile (install-local): Remove.  Functionality moved to
8749         executable.make.
8750
8751 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8752
8753         * Makefile: Install mcs.exe.config file together with mcs.exe.
8754         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8755         correct runtime version.
8756         
8757 2004-07-25  Martin Baulig  <martin@ximian.com>
8758
8759         * class.cs
8760         (TypeContainer.RegisterOrder): Removed, this was unused.
8761         (TypeContainer, interface_order): Removed.
8762         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8763         TypeContainer as argument since we can also be called with a
8764         `PartialContainer' for a partial class/struct/interface.
8765         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8766         of checking whether we're an `Interface' - we could be a
8767         `PartialContainer'.
8768         (PartialContainer.Register): Override; call
8769         AddClass()/AddStruct()/AddInterface() on our parent.
8770
8771         * cs-parser.jay (interface_member_declaration): Add things to the
8772         `current_container', not the `current_class'.
8773
8774         * rootcontext.cs (RegisterOrder): The overloaded version which
8775         takes an `Interface' was unused, removed.
8776
8777         * typemanager.cs (TypeManager.LookupInterface): Return a
8778         `TypeContainer', not an `Interface'.
8779         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8780         contain a `PartialContainer' for an interface, so check it's
8781         `Kind' to figure out what it is.
8782
8783 2004-07-25  Martin Baulig  <martin@ximian.com>
8784
8785         * class.cs (Class.DefaultTypeAttributes): New public constant.
8786         (Struct.DefaultTypeAttributes): Likewise.
8787         (Interface.DefaultTypeAttributes): Likewise.
8788         (PartialContainer.TypeAttr): Override this and add the
8789         DefaultTypeAttributes.
8790
8791 2004-07-25  Martin Baulig  <martin@ximian.com>
8792
8793         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8794         we can just use the `Parent' field instead.
8795
8796 2004-07-25  Martin Baulig  <martin@ximian.com>
8797
8798         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8799
8800 2004-07-25  Martin Baulig  <martin@ximian.com>
8801
8802         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8803         our parts before defining any methods.
8804         (TypeContainer.VerifyImplements): Make this virtual.
8805         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8806         on our PartialContainer.
8807
8808 2004-07-25  Martin Baulig  <martin@ximian.com>
8809
8810         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8811
8812         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8813         argument, we can just use the `Parent' field instead.
8814
8815         * class.cs
8816         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8817         (MemberBase.DoDefine): Likewise.
8818
8819 2004-07-24  Martin Baulig  <martin@ximian.com>
8820
8821         * decl.cs (MemberCore.Parent): New public field.
8822         (DeclSpace.Parent): Moved to MemberCore.
8823
8824         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8825         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8826         parent's .ctor.
8827         (FieldBase, Field, Operator): Likewise.
8828         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8829         (EventField, Event): Likewise.
8830
8831 2004-07-23  Martin Baulig  <martin@ximian.com>
8832
8833         * class.cs (PartialContainer): New public class.
8834         (ClassPart): New public class.
8835         (TypeContainer): Added support for partial classes.
8836         (TypeContainer.GetClassBases): Splitted some of the functionality
8837         out into GetNormalBases() and GetPartialBases().
8838
8839         * cs-tokenizer.cs (Token.PARTIAL): New token.
8840         (Tokenizer.consume_identifier): Added some hacks to recognize
8841         `partial', but only if it's immediately followed by `class',
8842         `struct' or `interface'.
8843
8844         * cs-parser.jay: Added support for partial clases.
8845
8846 2004-07-23  Martin Baulig  <martin@ximian.com>
8847
8848         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8849         a `DeclSpace' and also made it readonly.
8850         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8851         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8852         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8853
8854         * cs-parser.jay: Pass the `current_class', not the
8855         `current_container' (at the moment, this is still the same thing)
8856         to a new Method, Property, Event, Indexer or Constructor.
8857
8858 2004-07-23  Martin Baulig  <martin@ximian.com>
8859
8860         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8861         and removed the `current_interface' one.
8862         (struct_declaration, class_declaration, interface_declaration):
8863         Set `current_class' to the newly created class/struct/interface;
8864         set their `Bases' and call Register() before parsing their body.
8865
8866 2004-07-23  Martin Baulig  <martin@ximian.com>
8867
8868         * class.cs (Kind): New public enum.
8869         (TypeContainer): Made this class abstract.
8870         (TypeContainer.Kind): New public readonly field.
8871         (TypeContainer.CheckDef): New public method; moved here from
8872         cs-parser.jay.
8873         (TypeContainer.Register): New public abstract method.
8874         (TypeContainer.GetPendingImplementations): New public abstract
8875         method.
8876         (TypeContainer.GetClassBases): Removed the `is_class' and
8877         `is_iface' parameters.
8878         (TypeContainer.DefineNestedTypes): Formerly known as
8879         DoDefineType().
8880         (ClassOrStruct): Made this class abstract.
8881
8882         * tree.cs (RootTypes): New public type. 
8883
8884 2004-07-20  Martin Baulig  <martin@ximian.com>
8885
8886         * tree.cs (Tree.RecordNamespace): Removed.
8887         (Tree.Namespaces): Removed.
8888
8889         * rootcontext.cs (RootContext.IsNamespace): Removed.
8890
8891         * cs-parser.jay (namespace_declaration): Just create a new
8892         NamespaceEntry here.
8893
8894 2004-07-20  Martin Baulig  <martin@ximian.com>
8895
8896         * statement.cs (ExceptionStatement): New abstract class.  This is
8897         now used as a base class for everyone who's using `finally'.
8898         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8899         our local variables before using them.
8900
8901         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8902         virtual method.  This is used by Yield.Resolve() to "steal" an
8903         outer block's `finally' clauses.
8904         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8905         argument.
8906
8907         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8908         version which takes an ExceptionStatement.  This version must be
8909         used to create exception branchings.
8910
8911         * iterator.cs
8912         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8913         (Iterator.EmitMoveNext): Added exception support; protect the
8914         block with a `fault' clause, properly handle 'finally' clauses.
8915         (Iterator.EmitDispose): Run all the `finally' clauses here.
8916
8917 2004-07-20  Martin Baulig  <martin@ximian.com>
8918
8919         * iterator.cs: This is the first of a set of changes in the
8920         iterator code.  Match the spec more closely: if we're an
8921         IEnumerable, then GetEnumerator() must be called.  The first time
8922         GetEnumerator() is called, it returns the current instance; all
8923         subsequent invocations (if any) must create a copy.
8924
8925 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8926
8927         * expression.cs: Resolve the constant expression before returning
8928         it. 
8929
8930 2004-07-19  Martin Baulig  <martin@ximian.com>
8931
8932         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8933         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8934         the return type of the new EmitContext.
8935
8936 2004-07-18  Martin Baulig  <martin@ximian.com>
8937
8938         * class.cs (Property.Define): Fix iterators.
8939
8940         * iterators.cs (Iterator.Define): Moved the
8941         `container.AddInterator (this)' call here from the .ctor; only do
8942         it if we resolved successfully.
8943
8944 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8945
8946         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8947         `true' for preprocessing directives that we parse.  The return
8948         value indicates whether we should return to regular tokenizing or
8949         not, not whether it was parsed successfully.
8950
8951         In the past if we were in: #if false ... #line #endif, we would
8952         resume parsing after `#line'.  See bug 61604.
8953
8954         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8955         building: IsEnumType should return true only for enums, not for
8956         enums or System.Enum itself.  This fixes #61593.
8957
8958         Likely what happened is that corlib was wrong: mcs depended on
8959         this bug in some places.  The bug got fixed, we had to add the
8960         hack, which caused bug 61593.
8961
8962         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8963         that was a workaround for the older conditions.
8964
8965 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8966
8967         * assign.cs: IAssignMethod has a new interface, as documented
8968         inline. All assignment code now uses this new api.
8969
8970         * ecore.cs, expression.cs: All classes which implement
8971         IAssignMethod now use the new interface.
8972
8973         * expression.cs (Invocation): add a hack to EmitCall so that
8974         IndexerAccess can be the target of a compound assignment without
8975         evaluating its arguments twice.
8976
8977         * statement.cs: Handle changes in Invocation api.
8978
8979 2004-07-16  Martin Baulig  <martin@ximian.com>
8980
8981         * iterators.cs: Rewrote this.  We're now using one single Proxy
8982         class for both the IEnumerable and the IEnumerator interface and
8983         `Iterator' derives from Class so we can use the high-level API.
8984
8985         * class.cs (TypeContainer.AddIterator): New method.
8986         (TypeContainer.DoDefineType): New protected virtual method, which
8987         is called from DefineType().
8988         (TypeContainer.DoDefineMembers): Call DefineType() and
8989         DefineMembers() on all our iterators.
8990         (TypeContainer.Emit): Call Emit() on all our iterators.
8991         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8992
8993         * codegen.cs (EmitContext.CurrentIterator): New public field.
8994
8995 2004-07-15  Martin Baulig  <martin@ximian.com>
8996
8997         * typemanager.cs
8998         (TypeManager.not_supported_exception_type): New type.   
8999
9000 2004-07-14  Martin Baulig  <martin@ximian.com>
9001
9002         * iterators.cs: Use real error numbers.
9003
9004 2004-07-14  Martin Baulig  <martin@ximian.com>
9005
9006         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9007         requires this to be a System.Collection.IEnumerable and not a
9008         class implementing that interface.
9009         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9010
9011 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9012
9013         * class.cs: Fixed previous fix, it broke some error tests.
9014
9015 2004-07-12  Martin Baulig  <martin@ximian.com>
9016
9017         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9018         Fixes #61293.
9019
9020 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9021
9022         * assign.cs (LocalTemporary): Add new argument: is_address,If
9023         `is_address' is true, then the value that we store is the address
9024         to the real value, and not the value itself.
9025         
9026         * ecore.cs (PropertyExpr): use the new local temporary
9027         stuff to allow us to handle X.Y += z (where X is a struct)
9028
9029 2004-07-08  Martin Baulig  <martin@ximian.com>
9030
9031         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9032         not always return, just like we're doing in Using.Resolve().
9033
9034 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9035
9036         * cs-parser.jay (fixed_statement): flag this as Pinned.
9037
9038 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9039
9040         * typemanager.cs (TypeManager): Removed MakePinned method, this
9041         mechanism is replaced with the .NET 2.x compatible mechanism of
9042         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9043
9044         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9045         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9046         `IsFixed' property which has a different meaning.
9047
9048 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9049
9050         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9051         visible from inside a nested class, not just the names of the
9052         immediately enclosing class.
9053         Fix for bug #60730.
9054
9055 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9056
9057         * expression.cs (BetterConversion): Remove buggy special-case
9058         handling of "implicit constant expression conversions".  At this
9059         point, we already know that the conversion is possible -- we're
9060         only checking to see which is better.
9061
9062 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9063
9064         * cs-parser.jay: Added error CS0210 test.
9065
9066 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9067
9068         * cs-parser.jay: Added error CS0134 test.
9069
9070 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9071
9072         Fix bug #52507
9073         * cs-parser.jay: Added error CS0145 test.
9074
9075 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9076
9077         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9078
9079 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9080         
9081         * expression.cs (StackAlloc.Resolve): The argument may not
9082         be a constant; deal with this case.
9083         
9084 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9085
9086         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9087         GetIndexerAttributeValue.
9088         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9089
9090         * class.cs (Indexer.Define): Added error tests for CS0415,
9091         CS0609.
9092
9093 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9094
9095         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9096         property code.
9097
9098 2004-06-23  Martin Baulig  <martin@ximian.com>
9099
9100         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9101         neither return nor throw, reset the barrier as well.  Fixes #60457.
9102
9103 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9104
9105         * class.cs : EventAttributes is now set to None by default.
9106           This fixes bug #60459.
9107
9108 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9109
9110         Fix bug #60219
9111         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9112         Don't throw exception but return null (it's sufficient now).
9113
9114 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9115
9116         * typemanager.cs (GetArgumentTypes): Faster implementation.
9117
9118 2004-06-18  Martin Baulig  <martin@ximian.com>
9119
9120         * attribute.cs (Attribute.Resolve): Check whether we're an
9121         EmptyCast which a Constant child.  Fixes #60333.
9122
9123 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9124
9125         * statement.cs (EmitCollectionForeach): Account for the fact that
9126         not all valuetypes are in areas which we can take the address of.
9127         For these variables, we store to a temporary variable. Also, make
9128         sure that we dont emit a `callvirt' on a valuetype method.
9129
9130 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9131
9132         * expression.cs (StackAlloc.DoReSolve): Added test for
9133         negative parameter (CS0247).
9134
9135 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9136
9137         Fix bug #59792
9138         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9139
9140 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9141
9142         Fix bug #59781
9143         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9144         ulong.
9145
9146 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9147
9148         Fix bug #58254 & cs1555.cs, cs1556.cs
9149         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9150
9151 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9152
9153         * cs-parser.jay: Added error CS1669 test for indexers.
9154
9155 2004-06-11  Martin Baulig  <martin@ximian.com>
9156
9157         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9158         call this twice: for params and varargs methods.
9159
9160 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9161
9162         * class.cs:
9163         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9164
9165 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9166
9167         * attribute.cs (Attribute.GetValidTargets): Made public.
9168
9169         * class.cs: 
9170         (AbstractPropertyEventMethod): New class for better code sharing.
9171         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9172         CS1667 report.
9173         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9174
9175 2004-06-11  Raja R Harinath  <rharinath@novell.com>
9176
9177         Fix bug #59477.
9178         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
9179         that the call to Resolve is part of a MemberAccess.
9180         (Expression.Resolve): Use it for SimpleName resolution.
9181         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
9182         Add 'intermediate' boolean argument.
9183         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
9184         error message when the SimpleName can be resolved ambiguously
9185         between an expression and a type.
9186         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
9187         public.
9188         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9189         call on the left-side.
9190
9191 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9192
9193         * class.cs:
9194         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9195
9196 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9197
9198         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9199
9200 2004-06-11  Martin Baulig  <martin@ximian.com>
9201
9202         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9203         varargs methods if applicable.
9204
9205 2004-06-11  Martin Baulig  <martin@ximian.com>
9206
9207         * expression.cs (Invocation.EmitCall): Don't use
9208         `method.CallingConvention == CallingConventions.VarArgs' since the
9209         method could also have `CallingConventions.HasThis'.
9210
9211 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9212
9213         * class.cs (Event.GetSignatureForError): Implemented.
9214         Fixed crash in error test cs3010.cs
9215
9216 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9217
9218         * cs-tokenizer.cs: Change the way we track __arglist to be
9219         consistent with the other keywords.
9220
9221 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9222
9223         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9224         tomorrow.
9225
9226 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9227
9228         * codegen.cs: Check that all referenced assemblies have a strongname
9229         before strongnaming the compiled assembly. If not report error CS1577.
9230         Fix bug #56563. Patch by Jackson Harper.
9231         * typemanager.cs: Added a method to return all referenced assemblies.
9232         Fix bug #56563. Patch by Jackson Harper.
9233
9234 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9235
9236         * class.cs:
9237         (Method.ApplyAttributeBuilder): Moved and added conditional
9238         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9239
9240         * delegate.cs:
9241         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9242
9243 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9244
9245         Fixed #59640
9246         * class.cs: (EventField.attribute_targets): Changed default target.
9247
9248 2004-06-08  Martin Baulig  <martin@ximian.com>
9249
9250         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9251
9252 2004-06-08  Martin Baulig  <martin@ximian.com>
9253
9254         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9255
9256 2004-06-07  Martin Baulig  <martin@ximian.com>
9257
9258         Added support for varargs methods.
9259
9260         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9261         keyword.
9262
9263         * cs-parser.jay: Added support for `__arglist'.
9264
9265         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9266
9267         * expression.cs (Argument.AType): Added `ArgList'.
9268         (Invocation): Added support for varargs methods.
9269         (ArglistAccess): New public class.
9270         (Arglist): New public class.
9271
9272         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9273
9274         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9275         a method's top-level block if the method has varargs.
9276
9277         * support.cs (ReflectionParameters, InternalParameters): Added
9278         support for varargs methods.    
9279
9280 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9281
9282         * class.cs: Provide location in indexer error report.
9283
9284         * driver.cs: Use standard names.
9285
9286         * namespace.cs: Catch the use of using after a namespace has been
9287         declared also on using aliases.
9288
9289 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9290
9291         Bug #50820.
9292         * typemanager.cs (closure_private_ok, closure_invocation_type)
9293         (closure_qualifier_type, closure_invocation_assembly)
9294         (FilterWithClosure): Move to ...
9295         (Closure): New internal nested class.
9296         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9297         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9298         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9299         (MemberLookup, MemberLookupFailed): Use it.
9300         * expression.cs (New.DoResolve): Treat the lookup for the
9301         constructor as being qualified by the 'new'ed type.
9302         (Indexers.GetIndexersForTypeOrInterface): Update.
9303
9304 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9305
9306         * attribute.cs
9307         (GetConditionalAttributeValue): New method. Returns
9308         condition of ConditionalAttribute.
9309         (SearchMulti): New method.  Returns all attributes of type 't'.
9310         Use it when attribute is AllowMultiple = true.
9311         (IsConditionalMethodExcluded): New method.
9312
9313         * class.cs
9314         (Method.IsExcluded): Implemented. Returns true if method has conditional
9315         attribute and the conditions is not defined (method is excluded).
9316         (IMethodData): Extended interface for ConditionalAttribute support.
9317         (PropertyMethod.IsExcluded): Implemented.
9318
9319         * decl.cs
9320         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9321
9322         * expression.cs
9323         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9324         on the method.
9325
9326 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9327
9328         * expression.cs (ArrayCreationExpression): Make this just an
9329         `expression'. It can't be a statement, so the code here was
9330         dead.
9331
9332 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9333
9334         Fixed #59072
9335         * typemanager.cs (GetFullNameSignature): New method for
9336         MethodBase types.
9337
9338 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9339
9340         Fixed #56452
9341         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9342         Use this method when MethodBuilder is null.
9343         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9344         Added test for error CS0626 (MONO reports error for this situation).
9345         (IMethodData.GetSignatureForError): Extended interface.
9346
9347 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9348
9349         * attribute.cs
9350         (AttributeTester.GetObsoleteAttribute): Returns instance of
9351         ObsoleteAttribute when type is obsolete.
9352
9353         * class.cs
9354         (TypeContainer.VerifyObsoleteAttribute): Override.
9355         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9356         (MethodCode.VerifyObsoleteAttribute): Override.
9357         (MemberBase.VerifyObsoleteAttribute): Override.
9358
9359         * decl.cs
9360         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9361         and report proper error.
9362
9363         *delegate.cs
9364         Delegate.VerifyObsoleteAttribute): Override.
9365
9366         * ecore.cs
9367         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9368         and report proper error.
9369         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9370
9371         * enum.cs
9372         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9373         and enum member.
9374
9375         * expression.cs
9376         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9377         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9378         Added test for ObsoleteAttribute.
9379
9380         * statement.cs
9381         (Catch): Derived from Statement.
9382
9383 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9384  
9385         Fixed bug #59071 & cs0160.cs
9386  
9387         * statement.cs (Try.Resolve): Check here whether order of catch
9388         clauses matches their dependencies.
9389
9390 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9391
9392         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9393         caused a regression: #59343.  Referencing nested classes from an
9394         assembly stopped working.
9395
9396 2004-05-31  Martin Baulig  <martin@ximian.com>
9397
9398         MCS is now frozen for beta 2.
9399
9400 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9401
9402         * convert.cs: add a trivial cache for overload operator resolution.
9403
9404 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9405
9406         * decl.cs: If possible, use lookuptypedirect here. We can only do
9407         this if there is no `.' after the namespace. Avoids using
9408         LookupType, which does lots of slow processing.
9409         (FindNestedType) New method, does what it says :-).
9410         * namespace.cs: use LookupTypeDirect.
9411         * rootcontext.cs: use membercache, if possible.
9412         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9413
9414 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9415
9416         * expression.cs:
9417         According to the spec, 
9418
9419         In a member access of the form E.I, if E is a single identifier,
9420         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9421         field, property, localvariable, or parameter with the same type as
9422         the meaning of E as a type-name (§3.8), then both possible
9423         meanings of E are permitted.
9424
9425         We did not check that E as a simple-name had the same type as E as
9426         a type name.
9427
9428         This trivial check gives us 5-7% on bootstrap time.
9429
9430 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9431
9432         * expression.cs (Invocation.OverloadResolve): Avoid the
9433         use of hashtables and boxing here by allocating on demand.
9434
9435 2004-05-30  Martin Baulig  <martin@ximian.com>
9436
9437         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9438         we're doing a silent lookup.  Don't try to lookup nested types in
9439         TypeManager.object_type (thanks to Ben Maurer).
9440
9441 2004-05-30  Martin Baulig  <martin@ximian.com>
9442
9443         Committing a patch from Ben Maurer.
9444
9445         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9446
9447 2004-05-29  Martin Baulig  <martin@ximian.com>
9448
9449         * class.cs (IMethodData.ShouldIgnore): New method.
9450
9451         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9452         `Location' argument, we don't need it anywhere.  Use
9453         `IMethodData.ShouldIgnore ()' instead of
9454         `MethodData.GetMethodFlags ()'.
9455         (TypeManager.AddMethod): Removed.
9456         (TypeManager.AddMethod2): Renamed to AddMethod.
9457
9458 2004-05-29  Martin Baulig  <martin@ximian.com>
9459
9460         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9461
9462         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9463         converting from a class type S to an interface type and we already
9464         have an object on the stack, don't box it again.  Fixes #52578.
9465
9466 2004-05-29  Martin Baulig  <martin@ximian.com>
9467
9468         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9469         Added support for `params' parameters.  Fixes #59267.
9470
9471 2004-05-29  Martin Baulig  <martin@ximian.com>
9472
9473         * literal.cs (NullPointer): Provide a private .ctor which sets
9474         `type' to TypeManager.object_type.  Fixes #59048.
9475
9476 2004-05-29  Martin Baulig  <martin@ximian.com>
9477
9478         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9479         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9480
9481         * ecore.cs (EventExpr.instance_expr): Make the field private.
9482
9483 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9484
9485         Fixed bug #50080 & cs0214-2.cs
9486         * expression.cs (Cast.DoResolve): Check unsafe context here.
9487         
9488         * statement.cs (Resolve.DoResolve): Likewise.
9489
9490 2004-05-26  Martin Baulig  <martin@ximian.com>
9491
9492         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9493
9494         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9495         (RootContext.LookupType): Pass down the `silent' flag.
9496
9497 2004-05-25  Martin Baulig  <martin@ximian.com>
9498
9499         * expression.cs
9500         (MethodGroupExpr.IdenticalTypeName): New public property.
9501         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9502         expression actually refers to a type.
9503
9504 2004-05-25  Martin Baulig  <martin@ximian.com>
9505
9506         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9507         for #56176 and made it actually work.
9508
9509 2004-05-25  Martin Baulig  <martin@ximian.com>
9510
9511         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9512         (FieldExpr, PropertyExpr): Override and implement
9513         CacheTemporaries.  Fixes #52279.
9514
9515 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9516
9517         * location.cs: In the new compiler listing a file twice is a
9518         warning, not an error.
9519
9520 2004-05-24  Martin Baulig  <martin@ximian.com>
9521
9522         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9523         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9524
9525 2004-05-24  Martin Baulig  <martin@ximian.com>
9526
9527         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9528         walking the `using' list.  Fixes #53921.
9529
9530 2004-05-24  Martin Baulig  <martin@ximian.com>
9531
9532         * const.cs (Const.LookupConstantValue): Added support for
9533         EmptyCast's; fixes #55251.
9534
9535 2004-05-24  Martin Baulig  <martin@ximian.com>
9536
9537         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9538         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9539         which does the CS0135 check.  The reason is that we first need to
9540         check whether the variable actually exists.
9541
9542 2004-05-24  Martin Baulig  <martin@ximian.com>
9543
9544         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9545         than RootContext.LookupType() to find the explicit interface
9546         type.  Fixes #58584.
9547
9548 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9549
9550         * Makefile: Simplify.  Use executable.make.
9551         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9552
9553 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9554
9555         * decl.cs:
9556         * enum.cs:
9557         Use the invariant culture when doing String.Compare for CLS case
9558         sensitivity.
9559         
9560 2004-05-23  Martin Baulig  <martin@ximian.com>
9561
9562         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9563         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9564
9565         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9566         
9567 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9568
9569         * class.cs (MemberBase.Define): Reuse MemberType member for 
9570         resolved type. Other methods can use it too.
9571
9572 2004-05-23  Martin Baulig  <martin@ximian.com>
9573
9574         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9575         the variable also exists in the current block (otherwise, we need
9576         to report a CS0103).  Fixes #58670.
9577
9578 2004-05-23  Martin Baulig  <martin@ximian.com>
9579
9580         * flowanalysis.cs (Reachability.Reachable): Compute this
9581         on-the-fly rather than storing it as a field.
9582
9583 2004-05-23  Martin Baulig  <martin@ximian.com>
9584
9585         * flowanalysis.cs (Reachability.And): Manually compute the
9586         resulting `barrier' from the reachability.      
9587        
9588 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9589
9590         Fix bug #57835
9591         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9592         instance of ObsoleteAttribute when symbol is obsolete.
9593
9594         * class.cs
9595         (IMethodData): Extended interface for ObsoleteAttribute support.
9596
9597 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9598
9599         * attribute.cs: Fix bug #55970
9600
9601 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9602
9603         Fix bug #52705
9604         * attribute.cs
9605         (GetObsoleteAttribute): New method. Creates the instance of
9606         ObsoleteAttribute.
9607         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9608         ObsoleteAttribute when member is obsolete.
9609         (AttributeTester.Report_ObsoleteMessage): Common method for
9610         Obsolete error/warning reporting.
9611
9612         * class.cs
9613         (TypeContainer.base_classs_type): New member for storing parent type.
9614
9615         * decl.cs
9616         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9617         for this MemberCore.
9618
9619 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9620
9621         * attribute.cs, const.cs: Fix bug #58590
9622
9623 2004-05-21  Martin Baulig  <martin@ximian.com>
9624
9625         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9626         out parameters if the end of the method is unreachable.  Fixes
9627         #58098. 
9628
9629 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9630
9631         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9632         Hari was right, why extra method.
9633
9634 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9635
9636         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9637
9638 2004-05-20  Martin Baulig  <martin@ximian.com>
9639
9640         Merged this back from gmcs to keep the differences to a minumum.
9641
9642         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9643         instead of a Declspace.
9644         (Attribute.ResolveType): Likewise.
9645         (Attributes.Search): Likewise.
9646         (Attributes.Contains): Likewise.
9647         (Attributes.GetClsCompliantAttribute): Likewise.
9648
9649         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9650         argument.
9651         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9652         DeclSpace.
9653
9654 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9655
9656         Fix bug #58688 (MCS does not report error when the same attribute
9657         is assigned twice)
9658
9659         * attribute.cs (Attribute.Emit): Distinction between null and default.
9660
9661 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9662
9663         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9664         of a top-level attribute without an attribute target.
9665         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9666         Make non-static.
9667         (Attribute.Conditional_GetConditionName), 
9668         (Attribute.Obsolete_GetObsoleteMessage): Update.
9669         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9670         part of ScanForIndexerName.
9671         (Attribute.CanIgnoreInvalidAttribute): New function.
9672         (Attribute.ScanForIndexerName): Move to ...
9673         (Attributes.ScanForIndexerName): ... here.
9674         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9675         (Attributes.Search): New internal variant that can choose not to
9676         complain if types aren't resolved.  The original signature now
9677         complains.
9678         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9679         complaints suppressed.
9680         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9681         only if it not useful.
9682         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9683         top-level for attributes that are shared between the assembly
9684         and a top-level class.
9685         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9686         * class.cs: Update to reflect changes.
9687         (DefineIndexers): Fuse loops.
9688         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9689         a couple more variants of attribute names.
9690
9691 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9692
9693         Fix bug #52585 (Implemented explicit attribute declaration)
9694
9695         * attribute.cs:
9696         (Attributable.ValidAttributeTargets): New abstract method. It gets
9697         list of valid attribute targets for explicit target declaration.
9698         (Attribute.Target): It holds target itself.
9699         (AttributeSection): Removed.
9700         (Attribute.CheckTargets): New method. It checks whether attribute
9701         target is valid for the current element.
9702
9703         * class.cs:
9704         (EventProperty): New class. For events that are declared like
9705         property (with add and remove accessors).
9706         (EventField): New class. For events that are declared like field.
9707         class.cs
9708
9709         * cs-parser.jay: Implemented explicit attribute target declaration.
9710
9711         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9712         Override ValidAttributeTargets.
9713
9714         * parameter.cs:
9715         (ReturnParameter): Class for applying custom attributes on 
9716         the return type.
9717         (ParameterAtribute): New class. Class for applying custom
9718         attributes on the parameter type.
9719
9720 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9721
9722         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9723         definitions. 
9724
9725         (Method): Allow UNSAFE here.
9726
9727         * modifiers.cs: Support unsafe reporting.
9728
9729 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9730
9731         * decl.cs: Fix bug #58478.
9732
9733 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9734
9735         * statement.cs: When checking for unreachable code on an EmptyStatement,
9736         set the location. Fixes bug #58488.
9737
9738 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9739
9740         * driver.cs: Add -pkg handling.
9741
9742         From Gonzalo: UseShelLExecute=false
9743
9744 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9745
9746         * attribute.cs:
9747         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9748         for attribute.
9749         (Attribute.IsClsCompliaceRequired): Moved to base for better
9750         accesibility.
9751         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9752         when attribute is AttributeUsageAttribute.
9753         (Attribute.GetValidTargets): Simplified.
9754         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9755         attribute for this type.
9756         (Attribute.ApplyAttributes): Method renamed to Emit and make
9757         non-static.
9758         (GlobalAttributeSection): New class for special handling of global
9759         attributes (assembly, module).
9760         (AttributeSection.Emit): New method.
9761
9762         * class.cs: Implemented Attributable abstract methods.
9763         (MethodCore.LabelParameters): Moved to Parameter class.
9764         (Accessor): Is back simple class.
9765         (PropertyMethod): Implemented Attributable abstract class.
9766         (DelegateMethod): Implemented Attributable abstract class.
9767         (Event): New constructor for disctintion between normal Event
9768         and Event with accessors.
9769
9770         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9771
9772         * codegen.cs, const.cs, decl.cs, delegate.cs:
9773         (CommonAssemblyModulClass): Implemented Attributable abstract class
9774         and simplified.
9775
9776         * enum.cs: Implement IAttributeSupport interface.
9777         (EnumMember): New class for emum members. Implemented Attributable
9778         abstract class
9779
9780         * parameter.cs:
9781         (ParameterBase): Is abstract.
9782         (ReturnParameter): New class for easier [return:] attribute handling.
9783
9784         * typemanager.cs: Removed builder_to_attr.
9785
9786 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9787
9788         Fix bug #57151.
9789         * attribute.cs (Attribute.GetPositionalValue): New function.
9790         * class.cs (TypeContainer.VerifyMembers): New function.
9791         (TypeContainer.Emit): Use it.
9792         (ClassOrStruct): New base class for Class and Struct.
9793         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9794         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9795         class.
9796         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9797         then each non-static field should have a FieldOffset attribute.
9798         Otherwise, none of the fields should have a FieldOffset attribute.
9799         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9800         and FieldOffset attributes.
9801         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9802         (TypeManager.field_offset_attribute_type): New core types.
9803         (TypeManager.InitCoreTypes): Initialize them.
9804
9805 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9806
9807         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9808         Return correct type.
9809         From bug #58270.
9810
9811 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9814         be implicitly converted to ulong.
9815         
9816         * expression.cs: The logic for allowing operator &, | and ^ worked
9817         was wrong, it worked before because we did not report an error in
9818         an else branch.  Fixes 57895.
9819
9820         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9821         allow volatile fields to be reference types.
9822
9823 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9824
9825         * driver.cs: Add support for /debug-
9826
9827 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9828
9829         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9830         Add a 'complain' parameter to silence errors.
9831         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9832         silently overlooked type-resolutions.
9833         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9834         to reflect changes.
9835         (Attributes.Search): New function.
9836         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9837         (Attributes.GetAttributeFullName): Remove hack.
9838         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9839         Update to reflect changes.
9840         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9841         Use Attributes.Search instead of nested loops.
9842
9843 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9844
9845         * decl.cs:
9846         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9847         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9848         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9849
9850         * report.cs: (Report.Warning): Renamed to Warning_T because of
9851         parameter collision.
9852
9853 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9854
9855         * expression.cs (MemberAccess.ResolveMemberAccess):
9856         Exit with non-zero status after Report.Error.
9857         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9858         Likewise.
9859         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9860
9861 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9862
9863         * support.cs: Don't hang when the file is empty.
9864
9865 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9866
9867         * support.cs: In SeekableStreamReader, compute the preamble size of the
9868           underlying stream. Position changes should take into account that initial
9869           count of bytes.
9870
9871 2004-05-03  Todd Berman  <tberman@sevenl.net>
9872
9873         * driver.cs: remove unused GetSysVersion function.
9874
9875 2004-05-03  Todd Berman  <tberman@sevenl.net>
9876
9877         * driver.cs: Remove the hack from saturday, as well as the hack
9878         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9879         link_paths to get that bit proper.
9880
9881 2004-05-01  Todd Berman  <tberman@sevenl.net>
9882
9883         * driver.cs: Try a LoadFrom before a Load, this checks the current
9884         path. This is currently a bug in mono that is be fixed, however, this
9885         provides a workaround for now. This will be removed when the bug
9886         is fixed.
9887
9888 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9889
9890         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9891         incomplete key pairs (#57941).
9892
9893 2004-05-01  Todd Berman  <tberman@sevenl.net>
9894
9895         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9896         from the GAC
9897
9898 2004-04-30  Jackson Harper  <jackson@ximian.com>
9899
9900         * codegen.cs: Open keys readonly.
9901         
9902 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9903
9904         * typemanager.cs: don't report cyclic struct layout when a struct
9905         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9906         which has 2 Pango.Rectangle fields.
9907
9908 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9909
9910         * expression.cs: Handle IntPtr comparisons with IL code
9911         rather than a method call.
9912
9913 2004-04-29  Martin Baulig  <martin@ximian.com>
9914
9915         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9916         the list of PropertyInfo's in class hierarchy and find the
9917         accessor.  Fixes #56013.
9918
9919 2004-04-29  Martin Baulig  <martin@ximian.com>
9920
9921         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9922
9923 2004-04-29  Martin Baulig  <martin@ximian.com>
9924
9925         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9926
9927         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9928
9929 2004-04-29  Martin Baulig  <martin@ximian.com>
9930
9931         * class.cs (ConstructorInitializer.Resolve): Check whether the
9932         parent .ctor is accessible.  Fixes #52146.
9933
9934 2004-04-29  Martin Baulig  <martin@ximian.com>
9935
9936         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9937
9938         * statement.cs (Using.EmitLocalVariableDecls): Use
9939         TypeManager.idisposable_type, not typeof (IDisposable).
9940         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9941
9942 2004-04-29  Martin Baulig  <martin@ximian.com>
9943
9944         * class.cs (Event.Define): Don't emit the field and don't set
9945         RTSpecialName and SpecialName for events on interfaces.  Fixes
9946         #57703. 
9947
9948 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9949
9950         Refactor Attribute.ApplyAttributes.
9951         * attribute.cs (Attributable): New base class for objects that can
9952         have Attributes applied on them.
9953         (Attribute): Make AttributeUsage fields public.
9954         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9955         (Attribute.IsInternalCall): New property.
9956         (Attribute.UsageAttr): Convert to a public read-only property.
9957         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9958         (Attribute.ResolveType, Attribute.Resolve)
9959         (Attribute.ScanForIndexerName): Update to reflect changes.
9960         (Attribute.CheckAttributeTarget): Re-format.
9961         (Attribute.ApplyAttributes): Refactor, to various
9962         Attributable.ApplyAttributeBuilder methods.
9963         * decl.cs (MemberCore): Make Attributable.
9964         * class.cs (Accessor): Make Attributable.
9965         (MethodData.ApplyAttributes): Use proper attribute types, not
9966         attribute names.
9967         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9968         (TypeContainer.ApplyAttributeBuilder)
9969         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9970         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9971         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9972         (Operator.ApplyAttributeBuilder): New factored-out methods.
9973         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9974         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9975         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9976         * parameter.cs (ParameterBase): New Attributable base class
9977         that can also represent Return types.
9978         (Parameter): Update to the changes.
9979
9980 2004-04-29  Jackson Harper  <jackson@ximian.com>
9981
9982         * driver.cs: Prefer the corlib system version when looking for
9983         assemblies in the GAC. This is still a hack, but its a better hack
9984         now.
9985         
9986 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9987
9988         * decl.cs, enum.cs: Improved error 3005 reporting.
9989   
9990         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9991         (related_symbols): New private member for list of symbols
9992         related to reported error/warning.
9993         
9994         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9995
9996 2004-04-29  Martin Baulig  <martin@ximian.com>
9997
9998         * ecore.cs (Expression.Constantify): If we're an enum and
9999         TypeManager.TypeToCoreType() doesn't give us another type, use
10000         t.UnderlyingSystemType.  Fixes #56178.  
10001
10002 2004-04-29  Martin Baulig  <martin@ximian.com>
10003
10004         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10005         interfaces and for each interface, only add members directly
10006         declared in that interface.  Fixes #53255.
10007
10008 2004-04-28  Martin Baulig  <martin@ximian.com>
10009
10010         * expression.cs (ConditionalLogicalOperator): Use a temporary
10011         variable for `left' to avoid that we evaluate it more than once;
10012         bug #52588.
10013
10014 2004-04-28  Martin Baulig  <martin@ximian.com>
10015
10016         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10017         `void[]' (CS1547).
10018
10019 2004-04-28  Martin Baulig  <martin@ximian.com>
10020
10021         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10022         void (CS1547).
10023
10024         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10025         whether the type is not void (CS1547).
10026
10027 2004-04-28  Martin Baulig  <martin@ximian.com>
10028
10029         * expression.cs (Unary.DoResolveLValue): Override this and report
10030         CS0131 for anything but Operator.Indirection.
10031
10032 2004-04-28  Martin Baulig  <martin@ximian.com>
10033
10034         Committing a patch from Ben Maurer; see bug #50820.
10035
10036         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10037         check for classes.
10038
10039         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10040         classes.        
10041
10042 2004-04-28  Martin Baulig  <martin@ximian.com>
10043
10044         Committing a patch from Ben Maurer; see bug #50820.
10045
10046         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10047         check for classes.
10048
10049         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10050         classes.        
10051
10052 2004-04-28  Martin Baulig  <martin@ximian.com>
10053
10054         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10055         (Block.AddLabel): Call DoLookupLabel() to only search in the
10056         current block.
10057
10058 2004-04-28  Martin Baulig  <martin@ximian.com>
10059
10060         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10061         comparing StringConstants and NullLiterals in Equality and Inequality.
10062
10063 2004-04-28  Jackson Harper  <jackson@ximian.com>
10064
10065         * driver.cs: Attempt to load referenced assemblies from the
10066         GAC. This is the quick and dirty version of this method that
10067         doesnt take into account versions and just takes the first
10068         canidate found. Will be good enough for now as we will not have more
10069         then one version installed into the GAC until I update this method.
10070
10071 2004-04-28  Martin Baulig  <martin@ximian.com>
10072
10073         * typemanager.cs (TypeManager.CheckStructCycles): New public
10074         static method to check for cycles in the struct layout.
10075
10076         * rootcontext.cs (RootContext.PopulateTypes): Call
10077         TypeManager.CheckStructCycles() for each TypeContainer.
10078         [Note: We only need to visit each type once.]
10079
10080 2004-04-28  Martin Baulig  <martin@ximian.com>
10081
10082         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10083
10084         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10085         success and added `out object value'.  Use a `bool resolved' field
10086         to check whether we've already been called rather than
10087         `ConstantValue != null' since this breaks for NullLiterals.
10088
10089 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10090
10091         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10092         setting of this flag, since the 'set' method may be non-public.
10093
10094 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10095
10096         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10097         check on current_vector.Block.
10098
10099 2004-04-27  Martin Baulig  <martin@ximian.com>
10100
10101         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10102         a field initializer.  Fixes #56459.
10103
10104 2004-04-27  Martin Baulig  <martin@ximian.com>
10105
10106         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10107         we're not attempting to use an indexer.  Fixes #52154.
10108
10109 2004-04-27  Martin Baulig  <martin@ximian.com>
10110
10111         * statement.cs (Return): Don't create a return label if we don't
10112         need it; reverts my change from January 20th.  Thanks to Ben
10113         Maurer for this.
10114
10115 2004-04-27  Martin Baulig  <martin@ximian.com>
10116
10117         According to the spec, `goto' can only leave a nested scope, but
10118         never enter it.
10119
10120         * statement.cs (Block.LookupLabel): Only lookup in the current
10121         block, don't recurse into parent or child blocks.
10122         (Block.AddLabel): Check in parent and child blocks, report
10123         CS0140/CS0158 if we find a duplicate.
10124         (Block): Removed this indexer for label lookups.
10125         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10126         this already does the error reporting for us.
10127
10128         * flowanalysis.cs
10129         (FlowBranching.UsageVector.Block): New public variable; may be null.
10130         (FlowBranching.CreateSibling): Added `Block' argument.
10131         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10132         label for the target of a `goto' and check whether we're not
10133         leaving a `finally'.
10134
10135 2004-04-27  Martin Baulig  <martin@ximian.com>
10136
10137         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10138         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10139         just for returns).
10140
10141 2004-04-27  Martin Baulig  <martin@ximian.com>
10142
10143         * statement.cs (Block.AddLabel): Also check for implicit blocks
10144         and added a CS0158 check.
10145
10146 2004-04-27  Martin Baulig  <martin@ximian.com>
10147
10148         * flowanalysis.cs (FlowBranchingLoop): New class.
10149         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10150         UsageVector's instead of an ArrayList.
10151         (FlowBranching.Label): Likewise.
10152         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10153         (FlowBranching.AddBreakVector): New method.
10154
10155 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * attribute.cs: Small regression fix: only convert the type if we
10158         the type is different, fixes System.Drawing build.
10159
10160 2004-04-27  Martin Baulig  <martin@ximian.com>
10161
10162         * attribute.cs (Attribute.Resolve): If we have a constant value
10163         for a named field or property, implicity convert it to the correct
10164         type.
10165
10166 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10167
10168         * statement.cs (Block.Block): Implicit blocks share
10169         'child_variable_names' fields with parent blocks.
10170         (Block.AddChildVariableNames): Remove.
10171         (Block.AddVariable): Mark variable as "used by a child block" in
10172         every surrounding block.
10173         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10174         been used in a child block, complain about violation of "Invariant
10175         meaning in blocks" rule.
10176         * cs-parser.jay (declare_local_variables): Don't use
10177         AddChildVariableNames.
10178         (foreach_statement): Don't create an implicit block: 'foreach'
10179         introduces a scope.
10180
10181 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10182
10183         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10184         converting from 0L to ulong.  Fixes 57522.
10185
10186 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10187
10188         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10189         derived class hides via 'new' keyword field from base class (test-242.cs).
10190         TODO: Handle this in the more general way.
10191         
10192         * class.cs (CheckBase): Ditto.
10193
10194 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10195
10196         * decl.cs (caching_flags): New member for storing cached values
10197         as bit flags.
10198         (MemberCore.Flags): New enum where bit flags for caching_flags
10199         are defined.
10200         (MemberCore.cls_compliance): Moved to caching_flags.
10201         (DeclSpace.Created): Moved to caching_flags.
10202
10203         * class.cs: Use caching_flags instead of DeclSpace.Created
10204         
10205 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10208         if we are only a derived class, not a nested class.
10209
10210         * typemanager.cs: Same as above, but do this at the MemberLookup
10211         level (used by field and methods, properties are handled in
10212         PropertyExpr).   Allow for the qualified access if we are a nested
10213         method. 
10214
10215 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10216
10217         * class.cs: Refactoring.
10218         (IMethodData): New inteface; Holds links to parent members
10219         to avoid member duplication (reduced memory allocation).
10220         (Method): Implemented IMethodData interface.
10221         (PropertyBase): New inner classes for get/set methods.
10222         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10223         (Event): New inner classes for add/remove methods.
10224         (Event.DelegateMethod): Implemented IMethodData interface.
10225
10226         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10227         EmitContext (related to class.cs refactoring).
10228
10229 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10230
10231         * delegate.cs (Delegate.VerifyApplicability): If the number of
10232         arguments are the same as the number of parameters, first try to
10233         verify applicability ignoring  any 'params' modifier on the last
10234         parameter.
10235         Fixes #56442.
10236
10237 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10238
10239         * class.cs (TypeContainer.AddIndexer): Use
10240         'ExplicitInterfaceName' to determine if interface name was
10241         explicitly specified.  'InterfaceType' is not initialized at this time.
10242         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10243         Indexers array is already in the required order.  Initialize
10244         'IndexerName' only if there are normal indexers.
10245         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10246         (TypeContainer.Emit): Emit DefaultMember attribute only if
10247         IndexerName is initialized.
10248         Fixes #56300.
10249
10250 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10251
10252         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10253         Fixes #57007
10254
10255 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10256
10257         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10258         attributes.
10259         Fix for #56456.
10260
10261         * attribute.cs (Attribute.Resolve): Check for duplicate named
10262         attributes.
10263         Fix for #56463.
10264
10265 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10266
10267         * iterators.cs (MarkYield): track whether we are in an exception,
10268         and generate code accordingly.  Use a temporary value to store the
10269         result for our state.
10270
10271         I had ignored a bit the interaction of try/catch with iterators
10272         since their behavior was not entirely obvious, but now it is
10273         possible to verify that our behavior is the same as MS .NET 2.0
10274
10275         Fixes 54814
10276
10277 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * iterators.cs: Avoid creating temporaries if there is no work to
10280         do. 
10281
10282         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10283         Enumerations, use TypeManager.EnumToUnderlying and call
10284         recursively. 
10285
10286         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10287         bug #57013
10288
10289         (This.Emit): Use EmitContext.EmitThis to emit our
10290         instance variable.
10291
10292         (This.EmitAssign): Ditto.
10293
10294         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10295         codepaths, we will move all the functionality into
10296         Mono.CSharp.This 
10297
10298         (FieldExpr.EmitAssign): Ditto.
10299
10300         This fixes several hidden bugs that I uncovered while doing a code
10301         review of this today.
10302
10303         * codegen.cs (EmitThis): reworked so the semantics are more clear
10304         and also support value types "this" instances.
10305
10306         * iterators.cs: Changed so that for iterators in value types, we
10307         do not pass the value type as a parameter.  
10308
10309         Initialization of the enumerator helpers is now done in the caller
10310         instead of passing the parameters to the constructors and having
10311         the constructor set the fields.
10312
10313         The fields have now `assembly' visibility instead of private.
10314
10315 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10316
10317         * expression.cs (Argument.Resolve): Check if fields passed as ref
10318         or out are contained in a MarshalByRefObject.
10319
10320         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10321         another compiler type.
10322
10323 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10324
10325         * class.cs (Indexer.Define): use the new name checking method.
10326         Also, return false on an error.
10327         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10328         (is_identifier_[start/part]_character): make static.
10329
10330 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10331
10332         * expression.cs (Binary.ResolveOperator): Do no append strings
10333         twice: since we can be invoked more than once (array evaluation)
10334         on the same concatenation, take care of this here.  Based on a fix
10335         from Ben (bug #56454)
10336
10337 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10338
10339         * codegen.cs: Fix another case where CS1548 must be reported (when 
10340         delay-sign isn't specified and no private is available #56564). Fix
10341         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10342         error when MCS is used on the MS runtime and we need to delay-sign 
10343         (which seems unsupported by AssemblyBuilder - see #56621).
10344
10345 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10346
10347         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10348         (TypeManager.ComputeNamespaces): Faster implementation for
10349         Microsoft runtime.
10350
10351         * compiler.csproj: Updated AssemblyName to mcs.
10352
10353 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10354
10355         * rootcontext.cs: Add new types to the boot resolution.
10356
10357         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10358         MulticastDelegate is not allowed.
10359
10360         * typemanager.cs: Add new types to lookup: System.TypedReference
10361         and ArgIterator.
10362
10363         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10364         check for TypedReference or ArgIterator, they are not allowed. 
10365
10366         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10367         makes us properly catch 1510 in some conditions (see bug 56016 for
10368         details). 
10369
10370 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10371
10372         * CryptoConvert.cs: update from corlib version
10373         with endian fixes.
10374
10375 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10376
10377         * class.cs (Indexer.Define): Check indexername declaration
10378
10379 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10380
10381         * attribute.cs (IsClsCompliant): Fixed problem with handling
10382         all three states (compliant, not-compliant, undetected).
10383
10384 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10385
10386         * attribute.cs (Attribute): Location is now public.
10387         (Resolve): Store resolved arguments (pos_values) in attribute class.
10388         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10389         (GetClsCompliantAttributeValue): New method that gets
10390         CLSCompliantAttribute value.
10391         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10392         if exists else null.
10393         (AttributeTester): New class for CLS-Compliant verification routines.
10394
10395         * class.cs (Emit): Add CLS-Compliant verification.
10396         (Method.GetSignatureForError): Implemented.
10397         (Constructor.GetSignatureForError): Implemented
10398         (Constructor.HasCompliantArgs): Returns if constructor has
10399         CLS-Compliant arguments.
10400         (Constructor.Emit): Override.
10401         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10402         is needed to test only parameters.
10403         (FieldBase.GetSignatureForError): Implemented.
10404         (TypeContainer): New member for storing base interfaces.
10405         (TypeContainer.FindMembers): Search in base interfaces too.
10406
10407         * codegen.cs (GetClsComplianceAttribute): New method that gets
10408         assembly or module CLSCompliantAttribute value.
10409         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10410         for assembly.
10411         (ModuleClass.Emit): Add error 3012 test.
10412
10413         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10414
10415         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10416         state for all decl types.
10417         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10418         if CLS-Compliant tests are required.
10419         (IsClsCompliaceRequired): New method. Analyze whether code
10420         must be CLS-Compliant.
10421         (IsExposedFromAssembly): New method. Returns true when MemberCore
10422         is exposed from assembly.
10423         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10424         value or gets cached value.
10425         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10426         is explicitly marked with CLSCompliantAttribute.
10427         (IsIdentifierClsCompliant): New abstract method. This method is
10428         used to testing error 3005.
10429         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10430         for identifier and parameters CLS-Compliant testing.
10431         (VerifyClsCompliance): New method. The main virtual method for
10432         CLS-Compliant verifications.
10433         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10434         null. I don't know why is null (too many public members !).
10435         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10436         and get value of first CLSCompliantAttribute that found.
10437
10438         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10439         (VerifyClsCompliance): Override and add extra tests.
10440
10441         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10442         clscheck- disable CLS-Compliant verification event if assembly is has
10443         CLSCompliantAttribute(true).
10444
10445         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10446         ApllyAttribute is now called in emit section as in the other cases.
10447         Possible future Emit integration.
10448         (IsIdentifierClsCompliant): New override.
10449         (VerifyClsCompliance): New override.
10450         (GetEnumeratorName): Returns full enum name.
10451
10452         * parameter.cs (GetSignatureForError): Implemented.
10453
10454         * report.cs (WarningData): New struct for Warning message information.
10455         (LocationOfPreviousError): New method.
10456         (Warning): New method. Reports warning based on the warning table.
10457         (Error_T): New method. Reports error based on the error table.
10458
10459         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10460         verifications are done here.
10461
10462         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10463
10464         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10465         CLSCompliantAttribute.
10466         (all_imported_types): New member holds all imported types from other
10467         assemblies.
10468         (LoadAllImportedTypes): New method fills static table with exported types
10469         from all referenced assemblies.
10470         (Modules): New property returns all assembly modules.
10471
10472 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10473
10474         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10475         throwing a parser error.
10476
10477         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10478         which removes the hardcoded get_/set_ prefixes for properties, as
10479         IL allows for the properties to be named something else.  
10480
10481         Bug #56013
10482
10483         * expression.cs: Do not override operand before we know if it is
10484         non-null.  Fix 56207
10485
10486 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10487
10488         * typemanager.cs: support for pinned variables.
10489
10490 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10491
10492         * decl.cs, typemanager.cs: Avoid using an arraylist
10493         as a buffer if there is only one result set.
10494
10495 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10496
10497         * expression.cs: Make sure you cant call a static method
10498         with an instance expression, bug #56174.
10499
10500 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10501
10502         * class.cs (IsDuplicateImplementation): Improve error reporting to
10503         flag 663 (method only differs in parameter modifier).
10504
10505         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10506         in preprocessor directives.
10507
10508         * location.cs (LookupFile): Allow for the empty path.
10509
10510         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10511         better approach for some of that patch, but its failing with the
10512         CharSet enumeration.  For now try/catch will do.
10513
10514         * typemanager.cs: Do not crash if a struct does not have fields.
10515         Fixes 56150.
10516
10517 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10518
10519         * expression.cs: cs0213, cant fix a fixed expression.
10520         fixes 50231.
10521
10522 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10523
10524         * cs-parser.jay: detect invalid embeded statements gracefully.
10525         bug #51113.
10526
10527 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10528
10529         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10530         As a regex:
10531         s/
10532         the invocation type may not be a subclass of the tye of the item/
10533         The type of the item must be a subclass of the invocation item.
10534         /g
10535
10536         Fixes bug #50820.
10537
10538 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10539
10540         * attribute.cs: Added methods to get a string and a bool from an
10541         attribute. Required to information from AssemblyKeyFileAttribute,
10542         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10543         * codegen.cs: Modified AssemblyName creation to include support for
10544         strongnames. Catch additional exceptions to report them as CS1548.
10545         * compiler.csproj: Updated include CryptoConvert.cs.
10546         * compiler.csproj.user: Removed file - user specific configuration.
10547         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10548         Mono.Security assembly. The original class is maintained and tested in
10549         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10550         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10551         like CSC 8.0 (C# v2) supports.
10552         * Makefile: Added CryptoConvert.cs to mcs sources.
10553         * rootcontext.cs: Added new options for strongnames.
10554
10555 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10556
10557         * driver.cs: For --expect-error, report error code `2'
10558         if the program compiled with no errors, error code `1' if
10559         it compiled with an error other than the one expected.
10560
10561 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10562
10563         * compiler.csproj: Updated for Visual Studio .NET 2003.
10564         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10565         * compiler.sln: Updated for Visual Studio .NET 2003.
10566
10567 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10568
10569         * expression.cs: Fix bug #47234. We basically need to apply the
10570         rule that we prefer the conversion of null to a reference type
10571         when faced with a conversion to 'object' (csc behaviour).
10572
10573 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10574
10575         * statement.cs: Shorter form for foreach, eliminates
10576         a local variable. r=Martin.
10577
10578 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10579
10580         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10581         checks if we can use brtrue/brfalse to test for 0.
10582         * expression.cs: use the above in the test for using brtrue/brfalse.
10583         cleanup code a bit.
10584
10585 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10586
10587         * expression.cs: Rewrite string concat stuff. Benefits:
10588
10589         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10590         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10591         rather than a concat chain.
10592
10593         * typemanager.cs: Add lookups for more concat overloads.
10594
10595 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10596
10597         * expression.cs: Emit shorter il code for array init.
10598
10599         newarr
10600         dup
10601         // set 1
10602
10603         // set 2
10604
10605         newarr
10606         stloc.x
10607
10608         ldloc.x
10609         // set 1
10610
10611         ldloc.x
10612         // set 2
10613
10614 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10615
10616         * statement.cs: Before, two switch blocks would be merged if the
10617         total size of the blocks (end_item - begin_item + 1) was less than
10618         two times the combined sizes of the blocks.
10619
10620         Now, it will only merge if after the merge at least half of the
10621         slots are filled.
10622
10623         fixes 55885.
10624
10625 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10626
10627         * class.cs : csc build fix for GetMethods(). See bug #52503.
10628
10629 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10630
10631         * expression.cs: Make sure fp comparisons work with NaN.
10632         This fixes bug #54303. Mig approved this patch a long
10633         time ago, but we were not able to test b/c the runtime
10634         had a related bug.
10635
10636 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10639
10640 2004-03-19  Martin Baulig  <martin@ximian.com>
10641
10642         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10643         error here and not in our caller.
10644
10645 2004-03-19  Martin Baulig  <martin@ximian.com>
10646
10647         * interface.cs: Completely killed this file.
10648         (Interface): We're now a TypeContainer and live in class.cs.
10649
10650         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10651         argument; we're now also called for interfaces.
10652         (TypeContainer.DefineMembers): Allow this method being called
10653         multiple times.
10654         (TypeContainer.GetMethods): New public method; formerly known as
10655         Interface.GetMethod().  This is used by PendingImplementation.
10656         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10657         it's now private and non-static.
10658         (Interface): Moved this here; it's now implemented similar to
10659         Class and Struct.
10660         (Method, Property, Event, Indexer): Added `bool is_interface'
10661         argument to their .ctor's.
10662         (MemberBase.IsInterface): New public field.
10663
10664         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10665         instances instead of InterfaceMethod, InterfaceProperty, etc.
10666         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10667         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10668
10669 2004-03-19  Martin Baulig  <martin@ximian.com>
10670
10671         * class.cs (MethodCore.IsDuplicateImplementation): New private
10672         method which does the CS0111 checking.
10673         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10674         Use IsDuplicateImplementation().
10675
10676 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10677
10678         * decl.cs (FindMemberToOverride): New method to find the correct
10679         method or property to override in the base class.
10680         * class.cs
10681             - Make Method/Property use the above method to find the
10682               version in the base class.
10683             - Remove the InheritableMemberSignatureCompare as it is now
10684               dead code.
10685
10686         This patch makes large code bases much faster to compile, as it is
10687         O(n) rather than O(n^2) to do this validation.
10688
10689         Also, it fixes bug 52458 which is that nested classes are not
10690         taken into account when finding the base class member.
10691
10692         Reviewed/Approved by Martin.
10693
10694 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10695
10696         * interface.cs: In all interface classes removed redundant
10697         member initialization.
10698
10699 2004-03-16  Martin Baulig  <martin@ximian.com>
10700
10701         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10702
10703 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * decl.cs (DefineTypeAndParents): New helper method to define a
10706         type's containers before the type itself is defined;  This is a
10707         bug exposed by the recent changes to Windows.Forms when an
10708         implemented interface was defined inside a class that had not been
10709         built yet.   
10710
10711         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10712
10713         (Check): Loop correctly to report errors modifiers
10714         (UNSAFE was not in the loop, since it was the same as TOP).
10715
10716         * interface.cs: Every interface member now takes a ModFlags,
10717         instead of a "is_new" bool, which we set on the base MemberCore. 
10718
10719         Every place where we called "UnsafeOk" in the interface, now we
10720         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10721         the unsafe settings from the member declaration instead of the
10722         container interface. 
10723
10724         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10725
10726         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10727         `set_indexer_name' to the pending bits (one per type).
10728
10729         We fixed a bug today that was picking the wrong method to
10730         override, since for properties the existing InterfaceMethod code
10731         basically ignored the method name.  Now we make sure that the
10732         method name is one of the valid indexer names.
10733
10734 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10735  
10736         * support.cs (SeekableStreamReader): Keep track of stream byte
10737         positions and don't mix them with character offsets to the buffer.
10738
10739         Patch from Gustavo Giráldez
10740
10741 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10742
10743         * interface.cs (InterfaceSetGetBase): Removed double member
10744         initialization, base class does it as well.
10745
10746 2004-03-13  Martin Baulig  <martin@ximian.com>
10747
10748         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10749         when compiling corlib.
10750
10751 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10752
10753         * convert.cs (ExplicitConversion): We were reporting an error on
10754         certain conversions (object_type source to a value type, when the
10755         expression was `null') before we had a chance to pass it through
10756         the user defined conversions.
10757
10758         * driver.cs: Replace / and \ in resource specifications to dots.
10759         Fixes 50752
10760
10761         * class.cs: Add check for duplicate operators.  Fixes 52477
10762
10763 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10764
10765         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10766         that are in the middle of the statements, not only at the end.
10767         Fixes #54987
10768
10769         * class.cs (TypeContainer.AddField): No longer set the
10770         `HaveStaticConstructor' flag, now we call it
10771         `UserDefineStaticConstructor' to diferentiate the slightly
10772         semantic difference.
10773
10774         The situation is that we were not adding BeforeFieldInit (from
10775         Modifiers.TypeAttr) to classes that could have it.
10776         BeforeFieldInit should be set to classes that have no static
10777         constructor. 
10778
10779         See:
10780
10781         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10782
10783         And most importantly Zoltan's comment:
10784
10785         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10786
10787         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10788          before its static fields are used', i.e. initialization does not need
10789          to be triggered by the first access to the type. Setting this flag
10790          helps the JIT to compile better code, since it can run the static
10791          constructor at JIT time, and does not need to generate code to call it
10792          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10793          this flag for lots of classes like String. 
10794          
10795          csc sets this flag if the type does not have an explicit static 
10796          constructor. The reasoning seems to be that if there are only static
10797          initalizers for a type, and no static constructor, then the programmer
10798          does not care when this initialization happens, so beforefieldinit
10799          can be used.
10800          
10801          This bug prevents the AOT compiler from being usable, since it 
10802          generates so many calls to mono_runtime_class_init that the AOT code
10803          is much slower than the JITted code. The JITted code is faster, 
10804          because it does not generate these calls if the vtable is type is
10805          already initialized, which is true in the majority of cases. But the
10806          AOT compiler can't do this."
10807
10808 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10809
10810         * class.cs (MethodData.Emit): Refactor the code so symbolic
10811         information is generated for destructors;  For some reasons we
10812         were taking a code path that did not generate symbolic information
10813         before. 
10814
10815 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10816
10817         * class.cs: Create a Constructor.CheckBase method that
10818         takes care of all validation type code. The method
10819         contains some code that was moved from Define.
10820
10821         It also includes new code that checks for duplicate ctors.
10822         This fixes bug #55148.
10823
10824 2004-03-09  Joshua Tauberer <tauberer@for.net>
10825
10826         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10827         a { ... }-style array creation invokes EmitStaticInitializers
10828         which is not good for reference-type arrays.  String, decimal
10829         and now null constants (NullCast) are not counted toward
10830         static initializers.
10831
10832 2004-03-05  Martin Baulig  <martin@ximian.com>
10833
10834         * location.cs (SourceFile.HasLineDirective): New public field;
10835         specifies whether the file contains or is referenced by a "#line"
10836         directive.
10837         (Location.DefineSymbolDocuments): Ignore source files which
10838         either contain or are referenced by a "#line" directive.        
10839
10840 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10841
10842         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10843         direct access to our parent, so check the method inline there.
10844
10845 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10846
10847         * expression.cs (Invocation.EmitCall): Miguel's last commit
10848         caused a regression. If you had:
10849
10850             T t = null;
10851             t.Foo ();
10852
10853         In Foo the implict this would be null.
10854
10855 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * expression.cs (Invocation.EmitCall): If the method is not
10858         virtual, do not emit a CallVirt to it, use Call.
10859
10860         * typemanager.cs (GetFullNameSignature): Improve the method to
10861         cope with ".ctor" and replace it with the type name.
10862
10863         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10864         as an argument the ConstructorBuilder where it is being defined,
10865         to catch the recursive constructor invocations.
10866
10867 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10868
10869         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10870         routines to check if a type is an enumerable/enumerator allow
10871         classes that implement the IEnumerable or IEnumerator interfaces.
10872
10873         * class.cs (Property, Operator): Implement IIteratorContainer, and
10874         implement SetYields.
10875
10876         (Property.Define): Do the block swapping for get_methods in the
10877         context of iterators.   We need to check if Properties also
10878         include indexers or not.
10879
10880         (Operator): Assign the Block before invoking the
10881         OperatorMethod.Define, so we can trigger the Iterator code
10882         replacement. 
10883
10884         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10885         Property and Operator classes are not created when we parse the
10886         declarator but until we have the block completed, so we use a
10887         singleton SimpleIteratorContainer.Simple to flag whether the
10888         SetYields has been invoked.
10889
10890         We propagate this setting then to the Property or the Operator to
10891         allow the `yield' to function.
10892
10893 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10894
10895         * codegen.cs: Implemented attribute support for modules.
10896         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10897         Assembly/Module functionality.
10898
10899         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10900         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10901         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10902
10903 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10904
10905         * interface.cs (FindMembers): The operation is performed on all base
10906         interfaces and not only on the first. It is required for future CLS Compliance patch.
10907
10908 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10909
10910         * statement.cs, codegen.cs:
10911         This patch deals with patterns such as:
10912
10913         public class List : IEnumerable {
10914
10915                 public MyEnumerator GetEnumerator () {
10916                         return new MyEnumerator(this);
10917                 }
10918
10919                 IEnumerator IEnumerable.GetEnumerator () {
10920                         ...
10921                 }
10922                 
10923                 public struct MyEnumerator : IEnumerator {
10924                         ...
10925                 }
10926         }
10927
10928         Before, there were a few things we did wrong:
10929         1) we would emit callvirt on a struct, which is illegal
10930         2) we emited ldarg when we needed to emit ldarga
10931         3) we would mistakenly call the interface methods on an enumerator
10932         type that derived from IEnumerator and was in another assembly. For example:
10933
10934         public class MyEnumerator : IEnumerator
10935
10936         Would have the interface methods called, even if there were public impls of the
10937         method. In a struct, this lead to invalid IL code.
10938
10939 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10940
10941         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10942           renamed to Emit.
10943
10944         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10945
10946 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * cs-parser.jay: Fix small regression: we were not testing V2
10949         compiler features correctly.
10950
10951         * interface.cs: If the emit context is null, then create one
10952
10953 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10954
10955         * decl.cs (GetSignatureForError): New virtual method to get full name
10956           for error messages.
10957
10958         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10959           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10960
10961         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10962           Duplicated members and code in these classes has been removed.
10963           Better encapsulation in these classes.
10964
10965 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * assign.cs (Assign.DoResolve): When dealing with compound
10968         assignments, there is a new rule in ECMA C# 2.4 (might have been
10969         there before, but it is documented here) that states that in:
10970
10971         a op= b;
10972
10973         If b is of type int, and the `op' is a shift-operator, then the
10974         above is evaluated as:
10975
10976         a = (int) a op b 
10977
10978         * expression.cs (Binary.ResolveOperator): Instead of testing for
10979         int/uint/long/ulong, try to implicitly convert to any of those
10980         types and use that in pointer arithmetic.
10981
10982         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10983         method to print information for from the type, not from the
10984         null-method we were given.
10985
10986 2004-02-01  Duncan Mak  <duncan@ximian.com>
10987
10988         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10989         parsing for cmd, fixes bug #53694.
10990
10991 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10992
10993         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10994         in the member name duplication tests. Property and operator name duplication
10995         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10996
10997 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10998
10999         * interface.cs (PopulateMethod): Fixed crash when interface method
11000         returns not existing type (error test cs0246-3.cs).
11001
11002 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11003
11004         * cs-parser.jay (interface_accessors): Re-write actions to also
11005         store attributes attached to get and set methods. Fix spelling
11006         while at it.
11007
11008         (inteface_property_declaration): Modify accordingly.
11009
11010         (InterfaceAccessorInfo): New helper class to store information to pass
11011         around between rules that use interface_accessors.
11012
11013         * interface.cs (Emit): Apply attributes on the get and set
11014         accessors of properties and indexers too.
11015
11016         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11017         right MethodBuilder when applying attributes to the get and set accessors.
11018
11019 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11020
11021         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11022
11023 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11024
11025         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11026
11027 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11030         changes that treat `yield' specially when present before `break'
11031         or `return' tokens.
11032
11033         * cs-tokenizer.cs: yield is no longer a keyword.
11034
11035 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11036
11037         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11038         setting for default constructors.
11039         For default constructors are almost every time set wrong Modifier. The
11040         generated IL code has been alright. But inside mcs this values was
11041         wrong and this was reason why several of my CLS Compliance tests
11042         failed.
11043
11044 2004-01-22  Martin Baulig  <martin@ximian.com>
11045
11046         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11047         not a QualifiedIdentifier.  This is what `type_name_expression'
11048         was previously doing.
11049         (type_name_expression): Removed; the code is now in
11050         `namespace_or_type_name'.
11051         (qualified_identifier): Removed, use `namespace_or_type_name'
11052         instead.
11053         (QualifiedIdentifier): Removed this class.      
11054
11055 2004-01-22  Martin Baulig  <martin@ximian.com>
11056
11057         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11058         not a string as alias name.
11059
11060 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11061
11062         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11063         #52730 bug, and instead compute correctly the need to use a
11064         temporary variable when requesting an address based on the
11065         static/instace modified of the field and the constructor.
11066  
11067 2004-01-21  Martin Baulig  <martin@ximian.com>
11068
11069         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11070         class and namespace before looking up aliases.  Fixes #52517.
11071
11072 2004-01-21  Martin Baulig  <martin@ximian.com>
11073
11074         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11075         assinged in a 'try'; fixes exception4.cs.
11076
11077 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11078         * class.cs : Implemented parameter-less constructor for TypeContainer
11079
11080         * decl.cs: Attributes are now stored here. New property OptAttributes
11081
11082         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11083
11084         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11085
11086 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11087
11088         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11089           (CSharpSignature): New method for indexer and property signature.
11090
11091 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11092
11093         * pending.cs (IsVirtualFilter): Faster implementation.
11094
11095 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11096
11097         * typemanager.cs: Avoid inclusion of same assembly more than once.
11098
11099 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11100
11101         * cs-parser.jay: Fixed problem where the last assembly attribute
11102           has been applied also to following declaration (class, struct, etc.)
11103           
11104 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11105
11106         * class.cs: Added error CS0538, CS0539 reporting.
11107         Fixed crash on Microsoft runtime when field type is void.
11108
11109         * cs-parser.jay: Added error CS0537 reporting.
11110
11111         * pending.cs: Added error CS0535 reporting.
11112         Improved error report for errors CS0536, CS0534.
11113
11114 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11115
11116         Merge a few bits from the Anonymous Method MCS tree.
11117
11118         * statement.cs (ToplevelBlock): New class for toplevel methods,
11119         will hold anonymous methods, lifted variables.
11120
11121         * cs-parser.jay: Create toplevel blocks for delegates and for
11122         regular blocks of code. 
11123
11124 2004-01-20  Martin Baulig  <martin@ximian.com>
11125
11126         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11127         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11128         and `NeedExplicitReturn'; added `IsLastStatement'.
11129         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11130         have a `ReturnLabel' or we're not unreachable.
11131
11132         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11133         child's reachability; don't just override ours with it.  Fixes
11134         #58058 (lluis's example).
11135         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11136         InFinally(), InLoop(), InSwitch() and
11137         BreakCrossesTryCatchBoundary() methods.
11138
11139         * statement.cs (Return): Do all error checking in Resolve().
11140         Unless we are the last statement in a top-level block, always
11141         create a return label and jump to it.
11142         (Break, Continue): Do all error checking in Resolve(); also make
11143         sure we aren't leaving a `finally'.
11144         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11145         statement in a top-level block.
11146         (Block.Flags): Added `IsDestructor'.
11147         (Block.IsDestructor): New public property.
11148
11149 2004-01-20  Martin Baulig  <martin@ximian.com>
11150
11151         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11152
11153 2004-01-20  Martin Baulig  <martin@ximian.com>
11154
11155         * statement.cs (Statement.ResolveUnreachable): New public method.
11156         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11157         (Block.Resolve): Resolve unreachable statements.
11158
11159 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11160
11161         * expression.cs: We need to fix the case where we do
11162         not have a temp variable here.
11163
11164         * assign.cs: Only expression compound assignments need
11165         temporary variables.
11166
11167 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11168
11169         * flowanalysis.cs: Reduce memory allocation in a few ways:
11170           - A block with no variables should not allocate a bit
11171             vector for itself.
11172           - A method with no out parameters does not need any tracking
11173             for assignment of the parameters, so we need not allocate
11174             any data for it.
11175           - The arrays:
11176                 public readonly Type[] VariableTypes;
11177                 public readonly string[] VariableNames;
11178             Are redundant. The data is already stored in the variable
11179             map, so we need not allocate another array for it.
11180           - We need to add alot of checks for if (params | locals) == null
11181             due to the first two changes.
11182
11183 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11184
11185         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11186         implement IMemoryLocation, we store a copy on a local variable and
11187         take the address of it.  Patch from Benjamin Jemlich
11188
11189         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11190         to use a special "type_name_expression" rule which reduces the
11191         number of "QualifiedIdentifier" classes created, and instead
11192         directly creates MemberAccess expressions.
11193
11194 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11195
11196         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11197         that fixes #52853.  Null literal assignment to ValueType
11198
11199         * class.cs (MethodData.Emit): Instead of checking the name of the
11200         method to determine if its a destructor, create a new derived
11201         class from Method called Destructor, and test for that.  
11202
11203         * cs-parser.jay: Create a Destructor object instead of a Method.  
11204
11205         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11206
11207         Fixes: 52933
11208
11209 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11210
11211         * expression.cs (Binary.ResolveOperator): Perform an implicit
11212         conversion from MethodGroups to their delegate types on the
11213         Addition operation.
11214
11215         * delegate.cs: Introduce a new class DelegateCreation that is the
11216         base class for `NewDelegate' and `ImplicitDelegateCreation',
11217         factor some code in here.
11218
11219         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11220         conversion from MethodGroups to compatible delegate types. 
11221
11222         * ecore.cs (Expression.Resolve): Do not flag error 654
11223         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11224         we allow conversions from MethodGroups to delegate types now.
11225
11226         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11227         assignments in v2 either.
11228
11229 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11230
11231         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11232         static read-only fields in ctors.
11233
11234         Applied patch from Benjamin Jemlich 
11235
11236         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11237
11238 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11239
11240         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11241         here to return true, as they can be used like this:
11242
11243                 (XXX) int.MEMBER ()
11244
11245         Fixed 49836 and all the other dups
11246
11247 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11248
11249         * driver.cs: Implement /win32res and /win32icon.
11250
11251 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * cs-parser.jay: Add a rule to improve error handling for the
11254         common mistake of placing modifiers after the type.
11255
11256 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11257
11258         * cs-parser.jay (interface_event_declaration): Catch
11259         initialization of events on interfaces, and report cs0068
11260
11261         * cs-parser.jay (interface_event_declaration): Catch
11262         initialization of events. 
11263
11264         * ecore.cs: Better report missing constructors.
11265
11266         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11267         the error reporting done in the wrong place.  Fix.
11268
11269         * expression.cs (Binary.ResolveOperator): Catch the 
11270         operator + (E x, E y) error earlier, and later allow for implicit
11271         conversions in operator +/- (E e, U x) from U to the underlying
11272         type of E.
11273
11274         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11275         52596, if the container class is abstract, the default constructor
11276         is protected otherwise its public (before, we were always public).
11277
11278         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11279         fixed statement.
11280
11281         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11282         Jemlich that fixes bug #52597, MCS was generating invalid code for
11283         idisposable structs.   Thanks to Ben for following up with this
11284         bug as well.
11285
11286 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11287
11288         * driver.cs: Allow assemblies without code to be generated, fixes
11289         52230.
11290
11291 2004-01-07  Nick Drochak <ndrochak@gol.com>
11292
11293         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11294
11295 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11296
11297         * cs-parser.jay: Add rules to improve error reporting if fields or
11298         methods are declared at the namespace level (error 116)
11299
11300         * Add rules to catch event add/remove
11301
11302 2004-01-04  David Sheldon <dave-mono@earth.li>
11303
11304   * expression.cs: Added matching ")" to error message for 
11305   CS0077
11306
11307 2004-01-03 Todd Berman <tberman@gentoo.org>
11308
11309         * ecore.cs, attribute.cs:
11310         Applying fix from #52429.
11311
11312 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11313
11314         * ecore.cs, expression.cs, statement.cs:
11315         Total rewrite of how we handle branching. We
11316         now handle complex boolean expressions with fewer
11317         jumps. As well if (x == 0) no longer emits a ceq.
11318
11319         if (x is Foo) is much faster now, because we generate
11320         better code.
11321
11322         Overall, we get a pretty big improvement on our benchmark
11323         tests. The code we generate is smaller and more readable.
11324
11325         I did a full two-stage bootstrap. The patch was reviewed
11326         by Martin and Miguel.
11327
11328 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11329
11330         * cs-parser.jay: Make primary_expression not take a QI.
11331         we dont need this because the member_access rule covers
11332         us here. So we replace the rule with just IDENTIFIER.
11333
11334         This has two good effects. First, we remove a s/r conflict.
11335         Second, we allocate many fewer QualifiedIdentifier objects.
11336
11337 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11338
11339         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11340         set the correct information via SRE. This prevents
11341         hanging on the MS runtime. Fixes #29374.
11342
11343 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11344
11345         * convert.cs: correctly handle conversions to value types
11346         from Enum and ValueType as unboxing conversions.
11347
11348         Fixes bug #52569. Patch by Benjamin Jemlich.
11349
11350 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11351
11352         * expression.cs (BetterConversion): Prefer int -> uint
11353         over int -> ulong (csc's behaviour). This fixed bug #52046.
11354
11355 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11356
11357         * decl.cs (MemberCache.FindMembers): now returns a
11358         MemberInfo [].
11359
11360         * typemanager.cs: In general, go with with ^^.
11361         (CopyNewMethods): take an IList.
11362         (RealMemberLookup): Only allocate an arraylist
11363         if we copy from two sets of methods.
11364
11365         This change basically does two things:
11366         1) Fewer array lists allocated due to CopyNewMethods.
11367         2) the explicit cast in MemberList costed ALOT.
11368
11369 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11370
11371         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11372         a hashtable to avoid needless string allocations when an identifier is
11373         used more than once (the common case).
11374
11375 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11376
11377         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11378         is broken, it will not return anything. So, we
11379         have to use the information we have in mcs to
11380         do the task.
11381
11382         * typemanager.cs: Add a cache for GetInterfaces,
11383         since this will now be used more often (due to ^^)
11384
11385         (GetExplicitInterfaces) New method that gets the
11386         declared, not effective, interfaces on a type
11387         builder (eg, if you have interface IFoo, interface
11388         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11389         { IBar }.
11390
11391         This patch makes MCS able to bootstrap itself on
11392         Windows again.
11393
11394 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11395
11396         * expression.cs: Remove the Nop's that Miguel put
11397         in by mistake.
11398
11399 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11400
11401         * report.cs, codegen.cs: Give the real stack trace to
11402         the error when an exception is thrown.
11403
11404 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11405
11406         * decl.cs: only allocate hashtables for ifaces if 
11407         it is an iface!
11408
11409 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11410
11411         * expression.cs: fix the error from cs0121-2.cs
11412         (a parent interface has two child interfaces that
11413         have a function with the same name and 0 params
11414         and the function is called through the parent).
11415
11416 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11417
11418         * class.cs, rootcontext.cs, typmanager.cs: do not
11419         leak pointers.
11420
11421 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11422
11423         * codegen.cs: remove stack for the ec flow branching.
11424         It is already a linked list, so no need.
11425
11426 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11427
11428         * Makefile: Allow custom profiler here.
11429
11430 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11431
11432         * typemanager.cs (LookupType):
11433           - Use a static char [], because split takes
11434             a param array for args, so it was allocating
11435             every time.
11436           - Do not store true in a hashtable, it boxes.
11437
11438 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11439
11440         * flowanalysis.cs: bytify common enums.
11441
11442 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11443
11444         * modifiers.cs: Add a new set of flags for the
11445         flags allowed on explicit interface impls.
11446         * cs-parser.jay: catch the use of modifiers in
11447         interfaces correctly.
11448         * class.cs: catch private void IFoo.Blah ().
11449
11450         All related to bug #50572.
11451
11452 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11453
11454         * decl.cs: Rewrite the consistant accessability checking.
11455         Accessability is not linear, it must be implemented in
11456         a tableish way. Fixes #49704.
11457
11458 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11459
11460         * expression.cs: Handle negation in a checked context.
11461         We must use subtraction from zero. Fixes #38674.
11462
11463 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11464
11465         * class.cs: Ignore static void main in DLLs.
11466         * rootcontext.cs: Handle the target type here,
11467         since we are have to access it from class.cs
11468         * driver.cs: account for the above.
11469
11470 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11471
11472         * report.cs: Give line numbers and files if available.
11473
11474 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11475
11476         * driver.cs: Implement /addmodule.
11477
11478         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11479         ModuleBuilders.
11480
11481 2003-12-20  Martin Baulig  <martin@ximian.com>
11482
11483         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11484         (FieldBase.IsAssigned): Removed this field.
11485         (FieldBase.SetAssigned): New public method.
11486         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11487
11488 2003-12-20  Martin Baulig  <martin@ximian.com>
11489
11490         * expression.cs (LocalVariableReference.DoResolve): Don't set
11491         `vi.Used' if we're called from DoResolveLValue().
11492
11493         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11494         returns the usage vector it just merged into the current one -
11495         pass this one to UsageWarning().
11496         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11497         of the `EmitContext', don't call this recursively on our children.
11498
11499 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11500
11501         * driver.cs: Implement /target:module.
11502
11503 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11504
11505         * support.cs (CharArrayHashtable): New helper class.
11506
11507         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11508         char arrays, not strings, so we can avoid creating a string in
11509         consume_identifier if the identifier is a keyword.
11510
11511 2003-12-16  Martin Baulig  <martin@ximian.com>
11512
11513         * statement.cs (LocalInfo.Assigned): Removed this property.
11514         (LocalInfo.Flags): Removed `Assigned'.
11515         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11516         and uses flow analysis.
11517         (Block.UsageWarning): Made this method private.
11518         (Block.Resolve): Call UsageWarning() if appropriate.
11519
11520         * expression.cs (LocalVariableReference.DoResolve): Always set
11521         LocalInfo.Used here.
11522
11523 2003-12-13  Martin Baulig  <martin@ximian.com>
11524
11525         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11526         any value here; we're now using flow analysis to figure out
11527         whether a statement/block returns a value.
11528
11529 2003-12-13  Martin Baulig  <martin@ximian.com>
11530
11531         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11532         working again.
11533         (FlowBranching.MergeFinally): Don't call
11534         `branching.CheckOutParameters()' here, this is called in
11535         MergeTopBlock().
11536         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11537         when adding the `finally' vector.       
11538
11539 2003-12-13  Martin Baulig  <martin@ximian.com>
11540
11541         * flowanalysis.cs
11542         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11543         actually work and also fix #48962.
11544
11545 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11546
11547         * decl.cs: Do not check System.Object for nested types,
11548         since we know it does not have any. Big bang for buck:
11549
11550         BEFORE:
11551            Run 1:   8.35 seconds
11552            Run 2:   8.32 seconds
11553            corlib:  17.99 seconds
11554         AFTER:
11555            Run 1:   8.17 seconds
11556            Run 2:   8.17 seconds
11557            corlib:  17.39 seconds
11558
11559 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11560
11561         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11562         time we are returning 0 members, so we save alot here.
11563
11564 2003-12-11  Martin Baulig  <martin@ximian.com>
11565
11566         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11567         `MergeChild()', also just take the `FlowBranching' as argument;
11568         call Merge() on it and return the result.
11569         (FlowBranching.Merge): We don't need to do anything if we just
11570         have one sibling.
11571
11572 2003-12-11  Martin Baulig  <martin@ximian.com>
11573
11574         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11575         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11576         Maurer for this idea.
11577
11578 2003-12-11  Martin Baulig  <martin@ximian.com>
11579
11580         * flowanalysis.cs (MergeResult): This class is now gone; we now
11581         use the `UsageVector' for this.  The reason for this is that if a
11582         branching just has one sibling, we don't need to "merge" them at
11583         all - that's the next step to do.
11584         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11585         `MergeResult'.
11586
11587 2003-12-11  Martin Baulig  <martin@ximian.com>
11588
11589         Reworked flow analyis and made it more precise and bug-free.  The
11590         most important change is that we're now using a special `Reachability'
11591         class instead of having "magic" meanings of `FlowReturns'.  I'll
11592         do some more cleanups and optimizations and also add some more
11593         documentation this week.
11594
11595         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11596         largely reworked this class.
11597         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11598         the new `Reachability' class instead of having "magic" values here.
11599         (FlowBranching): We're now using an instance of `Reachability'
11600         instead of having separate `Returns', `Breaks' etc. fields.
11601
11602         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11603         based on flow analysis; ignore the return value of block.Emit ().
11604
11605 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11606
11607         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11608         if they are private.
11609
11610 2003-12-09  Martin Baulig  <martin@ximian.com>
11611
11612         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11613         call them directly on the UsageVector.
11614
11615 2003-12-09  Martin Baulig  <martin@ximian.com>
11616
11617         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11618         Changed return type from `FlowReturns' to `Reachability'.
11619
11620 2003-12-09  Martin Baulig  <martin@ximian.com>
11621
11622         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11623         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11624         `Reachable' fields with a single `Reachability' one.
11625
11626 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11627
11628         * class.cs (FindMembers): Remove foreach's.
11629
11630         Bootstrap times:
11631
11632         BEFORE
11633                 Run 1:   8.74 seconds
11634                 Run 2:   8.71 seconds
11635
11636         AFTER
11637                 Run 1:   8.64 seconds
11638                 Run 2:   8.58 seconds
11639
11640
11641 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11642
11643         * cs-parser.jay:
11644         * gen-treedump.cs:
11645         * statement.cs:
11646         This patch does a few things:
11647                 1. EmptyStatement is now a singleton, so it is never reallocated.
11648                 2. All blah is EmptyStatement constructs have been changed to
11649                    blah == EmptyStatement.Value, which is much faster and valid
11650                    now that EmptyStatement is a singleton.
11651                 3. When resolving a block, rather than allocating a new array for
11652                    the non-empty statements, empty statements are replaced with
11653                    EmptyStatement.Value
11654                 4. Some recursive functions have been made non-recursive.
11655         Mainly the performance impact is from (3), however (1) and (2) are needed for
11656         this to work. (4) does not make a big difference in normal situations, however
11657         it makes the profile look saner.
11658
11659         Bootstrap times:
11660
11661         BEFORE
11662         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11663         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11664         Total memory allocated: 56397 KB
11665
11666         AFTER
11667         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11668         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11669         Total memory allocated: 55666 KB
11670
11671 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11672
11673         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11674         than the hashtable in a hashtable version
11675
11676         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11677         we always end up concating a string. This results in a huge perf
11678         loss, because many strings have to be tracked by the GC. In this
11679         patch, we first use a hashtable that works with two keys, so that
11680         the strings do not need to be concat'ed.
11681
11682         Bootstrap times:
11683         BEFORE
11684                 Run 1:   8.74 seconds
11685                 Run 2:   8.71 seconds
11686
11687         AFTER
11688                 Run 1:   8.65 seconds
11689                 Run 2:   8.56 seconds
11690
11691 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11692
11693         * Makefile: Add a new target `do-time' that does a quick and simple
11694         profile, leaving easy to parse output.
11695
11696 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11697
11698         * codegen.cs (Init): Create the dynamic assembly with 
11699         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11700
11701 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11702
11703         * support.cs: Make the PtrHashtable use only one
11704         instance of its comparer.
11705
11706 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11707
11708         * typemanager.cs: Fix lookup of GetNamespaces.
11709
11710 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11711
11712         * expression.cs: Removed redundant line.
11713
11714         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11715         ArrayLists, use for loops with bounds.  
11716
11717         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11718         arraylist.
11719
11720         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11721         arraylists, use for loop with bounds.
11722
11723         The above three changes give us a 0.071 second performance
11724         improvement out of 3.294 seconds down to 3.223.  On my machine
11725         the above changes reduced the memory usage by 1,387 KB during
11726         compiler bootstrap.
11727
11728         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11729         QualifiedIdentifiers.  Before we created a new string through
11730         concatenation, and mostly later on, the result would be
11731         manipulated by DecomposeQI through string manipulation.
11732
11733         This reduced the compiler memory usage for bootstrapping from
11734         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11735         compile times in 0.05 seconds.
11736
11737 2003-11-28  Dick Porter  <dick@ximian.com>
11738
11739         * support.cs: Do string compares with the Invariant culture.
11740
11741         * rootcontext.cs: 
11742         * gen-treedump.cs: 
11743         * expression.cs: 
11744         * driver.cs: 
11745         * decl.cs: 
11746         * codegen.cs: 
11747         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11748         the comparison is done with the Invariant culture.
11749
11750 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11751
11752         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11753         GetEnumerator method.
11754
11755         (ProbeCollectionType): Iterate starting at the most specific type
11756         upwards looking for a GetEnumerator
11757
11758         * expression.cs: Shift count can be up to 31 for int/uint and 63
11759         for long/ulong.
11760
11761 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11762
11763         * statement.cs (Block.LookupLabel): Also look for the label on the
11764         children blocks.  Use a hash table to keep track of visited
11765         nodes. 
11766
11767         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11768         we actually did transform the other operand, otherwise fall back
11769         to the common codepath that casts to long.
11770
11771         * cs-tokenizer.cs: Use the same code pattern as the int case.
11772         Maybe I should do the parsing myself, and avoid depending on the
11773         Parse routines to get this done.
11774
11775 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11778         which fixes bug 51347.  This time test it.
11779
11780         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11781         attributes for example can not tell the difference between these.
11782         The difference was only a syntax feature of the language. 
11783
11784         * attribute.cs: Apply attributes to delegates.
11785
11786         * delegate.cs: Call the apply attributes method.
11787
11788 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11789
11790         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11791         comparing 0 vs Byte.MinValue, not the value
11792
11793         (ImplicitConversionRequired): When reporting a conversion error,
11794         use error 31 to print out the constant error instead of the
11795         simpler 29.
11796
11797         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11798         which fixes bug 51347.
11799
11800 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11801
11802         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11803         which fixes the -warnaserror command line option.
11804
11805 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11806
11807         * cfold.cs (DoNumericPromotions): During constant folding of
11808         additions on UIntConstant, special case intconstants with
11809         IntConstants like we do on the expression binary operator. 
11810
11811 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * convert.cs (ImplicitReferenceConversion): We were missing a case
11814         (System.Enum are not value types or class types, so we need to
11815         classify them separatedly).
11816
11817         * driver.cs: We do not support error 2007.
11818
11819 2003-11-12 Jackson Harper <jackson@ximian.com>
11820
11821         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11822         system directory. Also use the full file name so users can
11823         libraries names mscorlib-o-tron.dll in a non system dir.
11824
11825 2003-11-10  Martin Baulig  <martin@ximian.com>
11826
11827         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11828         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11829         calling `ResolveType()' on them, directly assign their `Type'.
11830
11831 2003-11-08  Martin Baulig  <martin@ximian.com>
11832
11833         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11834         return value and the `out parent' parameter.
11835         (TypeContainer.DefineType): Moved the CS0644 check into
11836         GetClassBases().  Don't pass the interface types to the
11837         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11838         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11839
11840         * ecore.cs (TypeExpr.IsAttribute): New property.
11841         (TypeExpr.GetInterfaces): New method.
11842
11843         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11844         TypeExpr instead of a Type.
11845         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11846         (Interface.DefineType): Don't pass the interface types to the
11847         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11848         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11849
11850         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11851         instead of a `Type[]'.
11852         (TypeManager.RegisterBuilder): Likewise.
11853         (TypeManager.AddUserInterface): Likewise.
11854         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11855         `Type[]' and also return a `TypeExpr[]'.
11856         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11857
11858 2003-11-08  Martin Baulig  <martin@ximian.com>
11859
11860         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11861         Expression.     
11862
11863 2003-11-08  Martin Baulig  <martin@ximian.com>
11864
11865         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11866         TypeManager.ResolveExpressionTypes().
11867
11868         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11869         instead of an Expression.
11870         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11871         (TypeExpression): New public class; formerly known as `TypeExpr'.
11872
11873         * expression.cs (ComposedCast): Derive from TypeExpr.
11874
11875         * typemanager.cs (TypeManager.system_*_expr): These are now
11876         TypExpr's instead of Expression's.
11877         (TypeManager.ResolveExpressionTypes): New public static function;
11878         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11879         of them.        
11880
11881 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11882
11883         * expression.cs (New.DoResolve): Do not dereference value that
11884         might be a null return.
11885
11886         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11887         sure that the constant value has the right type.  Fixes an
11888         unreported bug, similar to 50425.
11889
11890         * const.cs (Const.LookupConstantValue): Call
11891         ImplicitStandardConversionExists before doing a conversion to
11892         avoid havng the TypeManager.ChangeType do conversions.
11893
11894         Reduced the number of casts used
11895
11896         (Const.ChangeType): New routine to enable reuse of the constant
11897         type changing code from statement.
11898
11899         * typemanager.cs (ChangeType): Move common initialization to
11900         static global variables.
11901
11902         Fixes #50425.
11903
11904         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11905         every value type to go through, even if it was void.  Fix that. 
11906
11907         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11908         character of the define, and the is_identifier_part_character for
11909         the rest of the string.
11910
11911 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11912
11913         * expression.cs (UnaryMutator.EmitCode): When I updated
11914         LocalVariableReference.DoResolve, I overdid it, and dropped an
11915         optimization done on local variable references.
11916
11917 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11918
11919         * ecore.cs: Convert the return from Ldlen into an int.
11920
11921 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11922
11923         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11924         the accessibility, this is a special case for toplevel non-public
11925         classes (internal for instance).
11926
11927 2003-10-20  Nick Drochak <ndrochak@gol.com>
11928
11929         * ecore.cs: Fix typo and build.  Needed another right paren.
11930
11931 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11932
11933         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11934         `internal' case regular and protected, but not allowing protected
11935         to be evaluated later.  Bug 49840
11936
11937 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11938
11939         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11940         to kb.Nlast, and not the kb.nFirst to isolate the switch
11941         statement.
11942
11943         Extract the underlying type, so enumerations of long/ulong are
11944         treated like long/ulong.
11945
11946 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11947
11948         * expression.cs (New): Overload the meaning of RequestedType to
11949         track the possible creation of the NewDelegate type, since
11950         DoResolve is invoked more than once for new constructors on field
11951         initialization.
11952
11953         See bugs: #48800 and #37014
11954
11955         * cs-parser.jay (declare_local_constants): Take an arraylist
11956         instead of a single constant.
11957
11958         (local_constant_declaration): It should take a
11959         constant_declarators, not a constant_declarator.  Fixes 49487
11960
11961         * convert.cs: Fix error report.
11962
11963 2003-10-13 Jackson Harper <jackson@ximian.com>
11964
11965         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11966         bug #49611
11967
11968 2003-10-09  Martin Baulig  <martin@ximian.com>
11969
11970         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11971         to the .ctor.
11972         (MethodCore.DoDefineParameters): Removed the TypeContainer
11973         argument; use the DeclSpace which was passed to the .ctor instead.
11974         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11975         TypeContainer; we only need a DeclSpace here.
11976
11977 2003-10-09  Martin Baulig  <martin@ximian.com>
11978
11979         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11980         to the .ctor.
11981         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11982         EmitContext's .ctor.    
11983
11984 2003-10-09  Martin Baulig  <martin@ximian.com>
11985
11986         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11987         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11988         AsAccessible(), moved them as well.
11989
11990         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11991
11992 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11993
11994         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11995
11996 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11997
11998         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11999         generation for >=, as spotted by Paolo, bug 48679.  
12000         Patch from David Waite.
12001
12002         * cs-tokenizer.cs: Add handling for #pragma.
12003
12004         * cs-parser.jay: Allow for both yield and yield return in the
12005         syntax.  The anti-cobolization of C# fight will go on!
12006
12007         * class.cs (TypeBuilder.DefineType): Catch error condition here
12008         (Parent.DefineType erroring out and returning null).
12009
12010         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12011         coping with enumerations variables, we were mistakenly processing
12012         them as a regular value type instead of built-in types.  Fixes the
12013         bug #48063
12014
12015         * typemanager.cs (IsBuiltinOrEnum): New method.
12016
12017 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12018
12019         * cs-parser.jay: Upgrade: yield now needs the return clause.
12020
12021 2003-09-19  Martin Baulig  <martin@ximian.com>
12022
12023         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12024         `MemberCache parent' argument.  Normally, an interface doesn't
12025         have a parent type except System.Object, but we use this in gmcs
12026         for generic type parameters.
12027
12028 2003-09-18  Martin Baulig  <martin@ximian.com>
12029
12030         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12031         on `type.IsInterface'; don't check whether the type has a parent
12032         to determine whether it's an interface.
12033
12034 2003-09-15  Martin Baulig  <martin@ximian.com>
12035
12036         * class.cs (TypeContainer.DefineType): Added an error flag to
12037         avoid reporting duplicate CS0146's ("class definition is
12038         circular.").
12039
12040         * driver.cs (Driver.MainDriver): Abort if
12041         RootContext.ResolveTree() reported any errors.
12042
12043 2003-09-07  Martin Baulig  <martin@ximian.com>
12044
12045         * report.cs (Error, Warning): Added overloaded versions which take
12046         a `params object[] args' and call String.Format().
12047
12048 2003-09-07  Martin Baulig  <martin@ximian.com>
12049
12050         * decl.cs (DeclSpace..ctor): Don't call
12051         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12052         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12053         (DeclSpace.RecordDecl): New method.
12054
12055         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12056
12057 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12058
12059         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12060         value attributes to be applied to ParameterBuilders.
12061
12062         * class.cs (MethodCore.LabelParameters): Make static and more
12063         generic so that it can be used from other places - like interface
12064         methods, for instance.
12065
12066         * interface.cs (Interface.Emit): Call LabelParameters before
12067         emitting attributes on the InterfaceMethod.
12068
12069 2003-08-26  Martin Baulig  <martin@ximian.com>
12070
12071         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12072         resolving aliases; fixes #47927.
12073
12074 2003-08-26  Martin Baulig  <martin@ximian.com>
12075
12076         * statement.cs (Using.DoResolve): This is internally emitting a
12077         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12078         do not always return.  Fixes #47681.
12079
12080 2003-08-26  Martin Baulig  <martin@ximian.com>
12081
12082         * decl.cs (MemberCore): Moved WarningNotHiding(),
12083         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12084         into MemberBase.
12085         (AdditionResult): Make this nested in DeclSpace.
12086         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12087         argument; call NamespaceEntry.Define() unless we're nested in a
12088         class or struct.
12089
12090         * namespace.cs (Namespace.DefineName): New public function.  This
12091         is called from DeclSpace's .ctor to add 
12092         (Namespace.Lookup): Include DeclSpaces in the lookup.
12093
12094         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12095
12096         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12097
12098 2003-08-25  Martin Baulig  <martin@ximian.com>
12099
12100         * convert.cs (Convert.ExplicitReferenceConversion): When
12101         converting from an interface type to a class, unbox if the target
12102         type is a struct type.  Fixes #47822.
12103
12104 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12105
12106         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12107         #47854.
12108
12109 2003-08-22  Martin Baulig  <martin@ximian.com>
12110
12111         * class.cs (TypeManager.DefineType): When defining a nested type,
12112         call DefineType() on our parent; fixes #47801.
12113
12114 2003-08-22  Martin Baulig  <martin@ximian.com>
12115
12116         * class.cs (MethodData.Define): While checking if a method is an
12117         interface implementation, improve the test a bit more to fix #47654.
12118
12119 2003-08-22  Martin Baulig  <martin@ximian.com>
12120
12121         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12122         correctly; fixes #47722.
12123
12124 2003-08-22  Martin Baulig  <martin@ximian.com>
12125
12126         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12127         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12128
12129         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12130
12131 2003-08-22  Martin Baulig  <martin@ximian.com>
12132
12133         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12134         can only be assigned in static constructors.  Fixes #47161.
12135
12136 2003-08-22  Martin Baulig  <martin@ximian.com>
12137
12138         Rewrote and improved the flow analysis code.
12139
12140         * flowbranching.cs (FlowBranching): Make this class abstract.
12141         (FlowBranching.CreateBranching): New static function to create a
12142         new flow branching.
12143         (FlowBranchingBlock, FlowBranchingException): New classes.
12144         (FlowBranching.UsageVector.Type): New public readonly field.
12145         (FlowBranching.UsageVector.Breaks): Removed the setter.
12146         (FlowBranching.UsageVector.Returns): Removed the setter.
12147         (FlowBranching.UsageVector): Added Break(), Return(),
12148         NeverReachable() and Throw() methods to modify the reachability.
12149         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12150         done by FlowBranching.Merge().
12151         (FlowBranching.UsageVector.MergeChild): New method; merges the
12152         merge result into the current vector.
12153         (FlowBranching.Merge): New abstract method to merge a branching.
12154
12155 2003-08-12  Martin Baulig  <martin@ximian.com>
12156
12157         * expression.cs (Indirection.CacheTemporaries): Create the
12158         LocalTemporary with the pointer type, not its element type.
12159
12160 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12161
12162         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12163         token was a keyword or not.
12164
12165         Add `error' options where an IDENTIFIER was expected;  Provide
12166         CheckToken and CheckIdentifierToken convenience error reporting
12167         functions. 
12168
12169         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12170
12171         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12172         NameSpaceEntry NameSpaceEntry.
12173
12174         (LookupInterfaceOrClass): Avoid creating a full qualified name
12175         from namespace and name: avoid doing lookups when we know the
12176         namespace is non-existant.   Use new Tree.LookupByNamespace which
12177         looks up DeclSpaces based on their namespace, name pair.
12178
12179         * driver.cs: Provide a new `parser verbose' to display the
12180         exception thrown during parsing.  This is turned off by default
12181         now, so the output of a failure from mcs is more graceful.
12182
12183         * namespace.cs: Track all the namespaces defined in a hashtable
12184         for quick lookup.
12185
12186         (IsNamespace): New method
12187
12188 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12189
12190         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12191         we know that we need to concatenate (full typename can never be
12192         null). 
12193
12194         * class.cs: ditto.
12195
12196         * statement.cs: Use a bitfield;  Do not initialize to null things
12197         which are done by the constructor by default.
12198
12199         * cs-parser.jay: bug fix, parameter was 4, not 3.
12200
12201         * expression.cs: Just use the property;
12202
12203         * statement.cs: No need for GetVariableInfo method.
12204
12205 2003-08-08  Martin Baulig  <martin@ximian.com>
12206
12207         * flowanalysis.cs (FlowReturns): This is now nested in the
12208         `FlowBranching' class.
12209         (MyBitVector): Moved this here from statement.cs.
12210         (FlowBranching.SiblingType): New enum type.
12211         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12212
12213 2003-08-07  Martin Baulig  <martin@ximian.com>
12214
12215         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12216         `FlowBranching' class and called `BranchingType'.
12217
12218 2003-08-07  Martin Baulig  <martin@ximian.com>
12219
12220         * flowanalysis.cs: Moved all the control flow analysis code into
12221         its own file.
12222
12223 2003-08-07  Martin Baulig  <martin@ximian.com>
12224
12225         * assign.cs (Assign.DoResolve): `target' must either be an
12226         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12227         #37319.
12228
12229 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * expression.cs (BinaryMethod): This kind of expression is created by the
12232         Binary class if it determines that the operator has to be handled
12233         by a method.
12234
12235         (BinaryDelegate): This kind of expression is created if we are
12236         dealing with a + or - operator on delegates.
12237
12238         (Binary): remove method, argumetns, and DelegateOperator: when
12239         dealing with methods, 
12240
12241         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12242
12243         * statement.cs (Block): use bitfields for the three extra booleans
12244         we had in use.   Remove unused topblock parameter.
12245
12246         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12247
12248         * assign.cs: Drop extra unneeded tests.
12249
12250 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12251
12252         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12253
12254         * statement.cs (Foreach): Use VariableStorage instead of
12255         LocalBuilders.   
12256
12257         * codegen.cs (VariableStorage): New class used by clients that
12258         require a variable stored: locals or fields for variables that
12259         need to live across yield.
12260
12261         Maybe provide a convenience api for EmitThis+EmitLoad?
12262
12263         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12264         these bad boys.
12265
12266 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12269         RemapParameterLValue): New methods that are used to turn a
12270         precomputed FieldInfo into an expression like this:
12271
12272                 instance.FieldInfo
12273
12274         The idea is to use this instead of making LocalVariableReference
12275         have more than one meaning.
12276
12277         * cs-parser.jay: Add error production to BASE.
12278
12279         * ecore.cs: Deal with TypeManager.GetField returning null, which
12280         is now a valid return value.
12281
12282         (FieldExprNoAddress): New expression for Fields whose address can
12283         not be taken.
12284
12285         * expression.cs (LocalVariableReference): During the resolve
12286         phases, create new expressions if we are in a remapping context.
12287         Remove code that dealt with remapping here.
12288
12289         (ParameterReference): same.
12290
12291         (ProxyInstance): New expression, like the `This' expression, but
12292         it is born fully resolved.  We know what we are doing, so remove
12293         the errors that are targeted to user-provided uses of `this'.
12294
12295         * statement.cs (Foreach): our variable is now stored as an
12296         Expression;  During resolution, follow the protocol, dont just
12297         assume it will return this.
12298
12299 2003-08-06  Martin Baulig  <martin@ximian.com>
12300
12301         * support.cs (SeekableStreamReader.cs): New public class.
12302
12303         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12304         SeekableStreamReader instead of the normal StreamReader.
12305
12306 2003-08-04  Martin Baulig  <martin@ximian.com>
12307
12308         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12309         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12310         deambiguate casts and delegate invocations.
12311         (parenthesized_expression): Use the new tokens to ensure this is
12312         not a cast of method invocation.
12313
12314         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12315         when reading a `)' and Deambiguate_CloseParens () was previously
12316         called.
12317
12318         * expression.cs (ParenthesizedExpression): New class.  This is
12319         just used for the CS0075 test.
12320         (Binary.DoResolve): Check for CS0075.   
12321
12322 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12323
12324         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12325         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12326         reference comparison.
12327
12328         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12329         examine the ReturnType for equality - this is necessary in the
12330         cases of implicit and explicit operators whose signature also
12331         includes the return type.
12332
12333 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12334
12335         * namespace.cs: Cache the result of the namespace computation,
12336         instead of computing it every time.
12337
12338 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12339
12340         * decl.cs: Use a global arraylist that we reuse over invocations
12341         to avoid excesive memory consumption.  Reduces memory usage on an
12342         mcs compile by one meg (45 average).
12343
12344         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12345         private, work around that.
12346
12347 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12348
12349         * literal.cs (IntLiteral): Define Zero and One static literals. 
12350
12351         * cs-parser.jay (integer_literal): use static literals to reduce
12352         memory usage for the most used literals (0, 1 and -1).  211kb
12353         reduced in memory usage.
12354
12355         Replace all calls to `new ArrayList' with `new
12356         ArrayList(4)' which is a good average number for most allocations,
12357         and also requires only 16 bytes of memory for its buffer by
12358         default. 
12359
12360         This reduced MCS memory usage in seven megabytes for the RSS after
12361         bootstrapping.
12362
12363 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12364
12365         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12366         handle params methods the correct way by forming only one
12367         applicable set with params and normal methods in them. Earlier we
12368         were looking at params methods only if we found no normal methods
12369         which was not the correct thing to do.
12370
12371         (Invocation.BetterFunction): Take separate arguments indicating
12372         when candidate and the best method are params methods in their
12373         expanded form.
12374
12375         This fixes bugs #43367 and #46199.
12376
12377         * attribute.cs: Documentation updates.
12378
12379         (CheckAttribute): Rename to CheckAttributeTarget.
12380         (GetValidPlaces): Rename to GetValidTargets.
12381
12382         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12383         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12384
12385         Fixes bug #44468.
12386
12387 2003-07-28  Martin Baulig  <martin@ximian.com>
12388
12389         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12390         name when looking up the base class of a nested class.  Fixes #46977.
12391
12392 2003-07-26  Martin Baulig  <martin@ximian.com>
12393
12394         * expression.cs (Indexers.Indexer): New nested struct; contains
12395         getter, setter and the indexer's type.
12396         (Indexers.Properties): This is now an ArrayList of
12397         Indexers.Indexer's.
12398         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12399         indexer doesn't have any getters.
12400
12401         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12402         for embedded property and indexer assignments.
12403
12404 2003-07-26  Martin Baulig  <martin@ximian.com>
12405
12406         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12407         preprocessor directive is not the first non-whitespace character
12408         on a line.
12409
12410 2003-07-26  Martin Baulig  <martin@ximian.com>
12411
12412         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12413         namespace parsing, follow the spec more closely.
12414
12415         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12416         NamespaceEntry.Lookup().
12417
12418 2003-07-25  Martin Baulig  <martin@ximian.com>
12419
12420         * MethodCore.cs (OverridesSomething): New public field; it's set
12421         from TypeContainer.DefineMembers if this method overrides
12422         something (which doesn't need to be a method).  Fix #39462.
12423
12424 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12425
12426         * typemanager.cs (GetMembers): Ensure that the list of members is
12427         reversed. This keeps things in sync.
12428
12429         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12430         find an AttributeUsage attribute.
12431
12432         * expression.cs (Invocation.OverloadResolve): Perform the check
12433         which disallows Invoke to be directly called on a Delegate.
12434
12435         (Error_InvokeOnDelegate): Report error cs1533.
12436
12437 2003-07-25  Martin Baulig  <martin@ximian.com>
12438
12439         * expression.cs (Indexers.GetIndexersForType): Only look in the
12440         interface hierarchy if the requested type is already an
12441         interface.  Fixes #46788 while keeping #46502 fixed.
12442
12443 2003-07-25  Martin Baulig  <martin@ximian.com>
12444
12445         * class.cs (TypeContainer.DefineMembers): Check whether all
12446         readonly fields have been assigned and report warning CS0649 if
12447         not.
12448
12449         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12450         a valuetype.
12451
12452 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12453
12454         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12455         returned from GetMethods to make things consistent with the
12456         assumptions MCS makes about ordering of methods.
12457
12458         This should comprehensively fix bug #45127 and it does :-)
12459
12460         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12461         ordering is actually reverse.
12462
12463         * Clean up some debug messages I left lying around.
12464
12465         * interface.cs (Populate*): Get rid of code which emits attributes
12466         since the stage in which we emit attributes is the 'Emit' stage,
12467         not the define stage.
12468
12469         (Emit): Move attribute emission for interface members here.
12470
12471 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12472
12473         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12474         closely: we eliminate methods in base types when we have an
12475         applicable method in a top-level type.
12476
12477         Please see section 14.5.5.1 for an exact description of what goes
12478         on. 
12479
12480         This fixes bug #45127 and a host of other related to corlib compilation.
12481
12482         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12483         array is the method corresponding to the top-level type (this is
12484         because of the changes made to icall.c) so we change this
12485         accordingly.
12486
12487         (MethodGroupExpr.Name): This too.
12488
12489         * typemanager.cs (GetElementType): New method which does the right
12490         thing when compiling corlib. 
12491
12492         * everywhere: Make use of the above in the relevant places.
12493
12494 2003-07-22  Martin Baulig  <martin@ximian.com>
12495
12496         * cs-parser.jay (invocation_expression): Moved
12497         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12498         `cast_expression', but create a InvocationOrCast which later
12499         resolves to either an Invocation or a Cast.
12500
12501         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12502         method; call this before EmitStatement() to make sure that this
12503         expression can be used as a statement.
12504
12505         * expression.cs (InvocationOrCast): New class; resolves to either
12506         an Invocation or a Cast.
12507
12508         * statement.cs (StatementExpression): Call ResolveStatement() on
12509         the ExpressionStatement before emitting it.
12510
12511 2003-07-21  Martin Baulig  <martin@ximian.com>
12512
12513         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12514         `ref' and `out' attributes match; fixes #46220.
12515         (MemberAccess.ResolveMemberAccess): You can't reference a type
12516         through an expression; fixes #33180.
12517         (Indexers.GetIndexersForType): Don't return the indexers from
12518         interfaces the class implements; fixes #46502.
12519
12520 2003-07-21  Martin Baulig  <martin@ximian.com>
12521
12522         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12523         CS0661 checks; fixes bug #30442.
12524
12525 2003-07-21  Martin Baulig  <martin@ximian.com>
12526
12527         * decl.cs (AdditionResult): Added `Error'.
12528
12529         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12530
12531         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12532         makes cs0031.cs actually work.
12533
12534 2003-07-20  Martin Baulig  <martin@ximian.com>
12535
12536         * namespace.cs: Fixed that bug which caused a crash when compiling
12537         the debugger's GUI.
12538
12539 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12540
12541         * typemanager.cs (LookupTypeReflection): Never expose types which
12542         are NotPublic, NestedPrivate, NestedAssembly, or
12543         NestedFamANDAssem.  We used to return these, and later do a check
12544         that would report a meaningful error, but the problem is that we
12545         would not get the real match, if there was a name override.
12546
12547 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12548
12549         * namespace.cs (Namespace, Name): Do not compute the namespace
12550         name dynamically, compute it in the constructor.  This reduced
12551         memory usage by 1697 KB.
12552
12553         * driver.cs: Use --pause to pause at the end.
12554
12555 2003-07-17  Peter Williams  <peter@newton.cx>
12556
12557         * Makefile: Change the name of the test target so that it doesn't
12558         conflict with the recursive test target.
12559
12560 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12563         AddressOf): Do not use EmitThis, that was wrong, use the actual
12564         this pointer.
12565
12566 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12567
12568         * class.cs (MethodData.Define): While checking if a method is an
12569         interface implementation, improve the test: If we are not public
12570         (use new test here: use the computed MethodAttributes directly,
12571         instead of the parsed modifier flags) check if the `implementing'
12572         method comes from an interface or not.
12573
12574         * pending.cs (VerifyPendingMethods): Slightly better error
12575         message.
12576
12577         * makefile: add test target that does the mcs bootstrap.
12578
12579 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12580
12581         * interface.cs (Define): Do nothing here since there are no
12582         members to populate etc. Move the attribute emission out of here
12583         since this was just totally the wrong place to put it. Attribute
12584         application happens during the 'Emit' phase, not in the 'Define'
12585         phase.
12586
12587         (Emit): Add this method and move the attribute emission here
12588
12589         * rootcontext.cs (EmitCode): Call the Emit method on interface
12590         types too.
12591
12592 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12593
12594         * expression.cs (OverloadResolve): Report error only if Location
12595         is not 'Null' which means that there was a probe going on.
12596
12597 2003-07-14  Martin Baulig  <martin@ximian.com>
12598
12599         * expression.cs (ConditionalLogicalOperator): New public class to
12600         implement user defined conditional logical operators.
12601         This is section 14.11.2 in the spec and bug #40505.
12602
12603 2003-07-14  Martin Baulig  <martin@ximian.com>
12604
12605         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12606
12607 2003-07-14  Martin Baulig  <martin@ximian.com>
12608
12609         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12610
12611         * ecore.cs (IVariable.VerifyFixed): New interface method.
12612
12613         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12614         operator, check whether the variable is actually fixed.  Fixes bug
12615         #36055.  Set a variable definitely assigned when taking its
12616         address as required by the spec.
12617
12618         * statement.cs (LocalInfo.IsFixed): New field.
12619         (LocalInfo.MakePinned): Set `IsFixed' to true.
12620
12621 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12622
12623         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12624         for .ctors, ensure that we only ask for members declared in the
12625         attribute type (BindingFlags.DeclaredOnly).
12626
12627         Fixes bug #43632.
12628
12629         * expression.cs (Error_WrongNumArguments): Report error 1501
12630         correctly the way CSC does.
12631
12632 2003-07-13  Martin Baulig  <martin@ximian.com>
12633
12634         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12635         lookup on the fully qualified name, to make things like "X.X" work
12636         where "X.X" is a fully qualified type name, but we also have a
12637         namespace "X" in the using list.  Fixes #41975.
12638
12639 2003-07-13  Martin Baulig  <martin@ximian.com>
12640
12641         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12642         function. If we're a CompoundAssign, we need to create an embedded
12643         CompoundAssign, not an embedded Assign.
12644         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12645         Fixes #45854.
12646
12647 2003-07-13  Martin Baulig  <martin@ximian.com>
12648
12649         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12650         work to fix bug #46088.
12651
12652 2003-07-13  Ravi Pratap <ravi@ximian.com>
12653
12654         * class.cs (Operator.Emit): Do not emit attributes here - it is
12655         taken care of by the Method class that we delegate too. This takes
12656         care of bug #45876.
12657
12658 2003-07-10  Martin Baulig  <martin@ximian.com>
12659
12660         * expression.cs (TypeOfVoid): New class.
12661         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12662
12663 2003-07-10  Martin Baulig  <martin@ximian.com>
12664
12665         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12666         bug #35957.
12667
12668 2003-07-10  Martin Baulig  <martin@ximian.com>
12669
12670         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12671         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12672
12673         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12674
12675         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12676
12677 2003-07-10  Martin Baulig  <martin@ximian.com>
12678
12679         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12680         of decimal.  Fixes #42850.
12681
12682         NOTE: I also fixed the created byte blob, but this doesn't work on
12683         the MS runtime and csc never produces any byte blobs for decimal
12684         arrays.
12685
12686 2003-07-10  Martin Baulig  <martin@ximian.com>
12687
12688         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12689         structs; fixes #32068.
12690         (Block.AddChildVariableNames): Fixed #44302.
12691
12692 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12693
12694         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12695
12696 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12697
12698         * attribute.cs: And this test is onger needed.
12699
12700 2003-07-08  Martin Baulig  <martin@ximian.com>
12701
12702         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12703         inaccessible types.  Fixes #36313.
12704
12705         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12706
12707         * namespace.cs (NamespaceEntry): Create implicit entries for all
12708         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12709         implicit entries for N1.N2 and N1.
12710
12711 2003-07-08  Martin Baulig  <martin@ximian.com>
12712
12713         Rewrote the handling of namespaces to fix a lot of the issues
12714         wrt. `using' aliases etc.
12715
12716         * namespace.cs (Namespace): Splitted this class into a
12717         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12718
12719         * typemanager.cs (TypeManager.IsNamespace): Removed.
12720         (TypeManager.ComputeNamespaces): Only compute namespaces from
12721         loaded assemblies here, not the namespaces from the assembly we're
12722         currently compiling.
12723
12724 2003-07-08  Martin Baulig  <martin@ximian.com>
12725
12726         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12727
12728 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12729
12730         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12731         already fixed it.  
12732
12733         I thought about the memory savings here, but LookupTypeReflection
12734         is used under already very constrained scenarios.  Compiling
12735         corlib or mcs only exposes one hit, so it would not really reduce
12736         any memory consumption.
12737
12738 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12739
12740         * typemanager.cs: fixes bug #45889 by only adding public types from
12741         other assemblies to the list of known types.
12742
12743 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12746         on the type we resolved.
12747
12748 2003-07-05  Martin Baulig  <martin@ximian.com>
12749
12750         * pending.cs (PendingImplementation.ParentImplements): Don't
12751         create the proxy if the parent is abstract.
12752
12753         * class.cs (TypeContainer.DefineIndexers): Process explicit
12754         interface implementations first.  Fixes #37714.
12755
12756 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12759         defined recursively;  but since we modify the input parameters
12760         (left is set to `this' temporarily), we reset this value if the
12761         left_is_explicit is false, which gives the original semantics to
12762         the code.  
12763
12764         * literal.cs (NullPointer): new class used to represent a null
12765         literal in a pointer context.
12766
12767         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12768         type is a pointer, use a NullPointer object instead of a
12769         NullLiteral.   Closes 43687
12770
12771         (ExplicitConversion): Convert pointer values using
12772         the conv opcode to the proper type.
12773
12774         * ecore.cs (New): change ValueTypeVariable property into a method,
12775         that returns whether the valuetype is suitable for being used.
12776
12777         * expression.cs (Binary.DoNumericPromotions): Only return if we
12778         the int constant was a valid uint, and we can return both left and
12779         right as uints.  If not, we continue processing, to trigger the
12780         type conversion.  This fixes 39018.
12781
12782         * statement.cs (Block.EmitMeta): During constant resolution, set
12783         the CurrentBlock property on the emitcontext, so that we resolve
12784         constants propertly.
12785
12786 2003-07-02  Martin Baulig  <martin@ximian.com>
12787
12788         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12789         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12790
12791         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12792         than emitting it here.
12793
12794         * statement.cs: Fixed some more flow analysis bugs.
12795
12796 2003-07-02  Martin Baulig  <martin@ximian.com>
12797
12798         * class.cs (MethodData.Define): When implementing interface
12799         methods, set Final unless we're Virtual.
12800
12801         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12802         check work for interface methods.
12803
12804 2003-07-01  Martin Baulig  <martin@ximian.com>
12805
12806         * ecore.cs (EmitContext.This): Replaced this property with a
12807         GetThis() method which takes a Location argument.  This ensures
12808         that we get the correct error location for a CS0188.
12809
12810 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12811
12812         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12813         ImplicitStandardConversion.
12814
12815         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12816
12817 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12818
12819         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12820         optimization.
12821
12822 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12823
12824         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12825         constructors.
12826
12827         (MethodData.Define): Turn off initlocals for unsafe methods.
12828
12829 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12830
12831         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12832         complete;  Fixes #37521.
12833
12834         * delegate.cs: Use Modifiers.TypeAttr to compute the
12835         TypeAttributes, instead of rolling our own.  This makes the flags
12836         correct for the delegates.
12837
12838 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12839
12840         * class.cs (Constructor.Define): Set the private flag for static
12841         constructors as well.
12842
12843         * cs-parser.jay (statement_expression): Set the return value to
12844         null, to avoid a crash when we catch an error.
12845
12846 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12847
12848         * cs-parser.jay: Applied patch from Jackson that adds support for
12849         extern and unsafe modifiers to destructor declarations.
12850
12851         * expression.cs: Report error 21 if the user is trying to index a
12852         System.Array.
12853
12854         * driver.cs: Add an error message, suggested by the bug report.
12855
12856         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12857         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12858
12859 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * namespace.cs: Add some information to reduce FAQs.
12862
12863 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12866         underlying enumeration types.  Fixes #43915.
12867
12868         * expression.cs: Treat ushort/short as legal values to be used in
12869         bitwise operations.
12870
12871 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12872
12873         * delegate.cs: transfer custom attributes for paramenters from
12874         the delegate declaration to Invoke and BeginInvoke.
12875
12876 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12877
12878         * attribute.cs: handle custom marshalers and emit marshal info
12879         for fields, too.
12880
12881 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12882
12883         * makefile.gnu: Added anonymous.cs to the compiler sources.
12884
12885 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12886
12887         * iterators.cs: Change the name of the proxy class to include two
12888         underscores.
12889
12890         * cs-parser.jay: Update grammar to include anonymous methods.
12891
12892         * anonymous.cs: new file.
12893
12894 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12895
12896         * class.cs (Field.Define): Add missing test for pointers and
12897         safety. 
12898
12899 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12900
12901         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12902         we use the stobj opcode.
12903
12904         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12905         since it wasn't the correct fix. 
12906
12907         It still is puzzling that we are required to use stobj for IntPtr
12908         which seems to be a ValueType.
12909
12910 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12911
12912         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12913         during regular simple name resolution.   Now, the trick is that
12914         instead of returning for processing the simplename, we do a
12915         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12916         contextual lookup type).   If a match is found, return that, if
12917         not, return for further composition.
12918
12919         This fixes long-standing 30485.
12920
12921         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12922         using the address to initialize an object, do an Stobj instead of
12923         using the regular Stelem.
12924
12925         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12926         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12927         Because if we are a BaseIndexerAccess that value will be true.
12928         Fixes 43643.
12929
12930         * statement.cs (GotoCase.Resolve): Return after reporting an
12931         error, do not attempt to continue. 
12932
12933         * expression.cs (PointerArithmetic.Emit): If our operand is a
12934         long, convert our constants to match the operand before
12935         multiplying.  Convert to I type before adding.   Fixes 43670.
12936
12937 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12938
12939         * enum.cs (ImplicitConversionExists) : Rename to
12940         ImplicitEnumConversionExists to remove ambiguity. 
12941
12942         * ecore.cs (NullCast): New type of cast expression class which
12943         basically is very similar to EmptyCast with the difference being
12944         it still is a constant since it is used only to cast a null to
12945         something else
12946         (eg. (string) null)
12947
12948         * convert.cs (ImplicitReferenceConversion): When casting a null
12949         literal, we return a NullCast.
12950
12951         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12952         should be around anymore.
12953
12954         The renaming (reported was slightly wrong). Corrections:
12955
12956         ConvertImplicitStandard -> ImplicitConversionStandard
12957         ConvertExplicitStandard -> ExplicitConversionStandard
12958
12959         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12960         before passing them in !
12961
12962         * convert.cs (ImplicitConversionStandard): When comparing for
12963         equal expr and target types, ensure that expr is not a
12964         NullLiteral.
12965
12966         In general, we must not be checking (expr_type ==
12967         target_type) in the top level conversion methods
12968         (ImplicitConversion, ExplicitConversion etc). This checking is
12969         done in the methods that they delegate to.
12970
12971 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12972
12973         * convert.cs: Move Error_CannotConvertType,
12974         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12975         ImplicitNumericConversion, ImplicitConversionExists,
12976         ImplicitUserConversionExists, StandardConversionExists,
12977         FindMostEncompassedType, FindMostSpecificSource,
12978         FindMostSpecificTarget, ImplicitUserConversion,
12979         ExplicitUserConversion, GetConversionOperators,
12980         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12981         TryImplicitIntConversion, Error_CannotConvertImplicit,
12982         ConvertImplicitRequired, ConvertNumericExplicit,
12983         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12984         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12985         its own file.
12986
12987         Perform the following renames:
12988
12989         StandardConversionExists -> ImplicitStandardConversionExists
12990         ConvertImplicit -> ImplicitConversion
12991         ConvertImplicitStandard -> ImplicitStandardConversion
12992         TryImplicitIntConversion -> ImplicitIntConversion
12993         ConvertImplicitRequired -> ImplicitConversionRequired
12994         ConvertNumericExplicit -> ExplicitNumericConversion
12995         ConvertReferenceExplicit -> ExplicitReferenceConversion
12996         ConvertExplicit -> ExplicitConversion
12997         ConvertExplicitStandard -> ExplicitStandardConversion
12998
12999 2003-05-19  Martin Baulig  <martin@ximian.com>
13000
13001         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13002         (TypeInfo): Added support for structs having structs as fields.
13003
13004         * ecore.cs (FieldExpr): Implement IVariable.
13005         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13006         VariableInfo for the field.
13007
13008 2003-05-18  Martin Baulig  <martin@ximian.com>
13009
13010         * expression.cs (This.DoResolve): Report a CS0027 if we're
13011         emitting a field initializer.
13012
13013 2003-05-18  Martin Baulig  <martin@ximian.com>
13014
13015         * expression.cs (This.ResolveBase): New public function.
13016         (This.DoResolve): Check for CS0188.
13017
13018         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13019         This.Resolve().
13020
13021         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13022         `instance_expression' to null if we don't have any non-static
13023         methods.
13024
13025 2003-05-18  Martin Baulig  <martin@ximian.com>
13026
13027         Reworked the way how local variables and parameters are handled by
13028         the flow analysis code.
13029
13030         * statement.cs (TypeInfo, VariableMap): New public classes.
13031         (VariableInfo): New public class.  This is now responsible for
13032         checking whether a variable has been assigned.  It is used for
13033         parameters and local variables.
13034         (Block.EmitMeta): Take the InternalParameters as argument; compute
13035         the layout of the flow vectors here.
13036         (Block.LocalMap, Block.ParameterMap): New public properties.
13037         (FlowBranching): The .ctor doesn't get the InternalParameters
13038         anymore since Block.EmitMeta() now computes the layout of the flow
13039         vector.
13040         (MyStructInfo): This class is now known as `StructInfo' and nested
13041         in `TypeInfo'; we don't access this directly anymore.
13042
13043         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13044         property and removed IsAssigned(), IsFieldAssigned(),
13045         SetAssigned() and SetFieldAssigned(); we now call them on the
13046         VariableInfo so we don't need to duplicate this code everywhere.
13047
13048         * expression.cs (ParameterReference): Added `Block block' argument
13049         to the .ctor.
13050         (LocalVariableReference, ParameterReference, This): The new
13051         VariableInfo class is now responsible for all the definite
13052         assignment stuff.
13053
13054         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13055         IsParameterAssigned, SetParameterAssigned): Removed.
13056
13057 2003-05-18  Martin Baulig  <martin@ximian.com>
13058
13059         * typemanager.cs (InitCoreTypes): Try calling
13060         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13061         the 3-args-version.  Corlib now also needs our `void_type'.
13062         (GetMethod): Added overloaded version which takes an optional
13063         `bool report_errors' to allow lookups of optional methods.
13064
13065 2003-05-12  Martin Baulig  <martin@ximian.com>
13066
13067         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13068         only used for locals and not for parameters.
13069
13070 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13071
13072         * support.cs (InternalParameters.ParameterType): Return the
13073         ExternalType of the parameter.
13074
13075         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13076         they were unused.
13077
13078 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13079
13080         * class.cs (MethodData.Define): Do not set the `newslot' on
13081         interface members, if they are also flagged as "override".
13082
13083         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13084         better code for ++i and i++.  This only works for static fields
13085         and local variables.
13086
13087         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13088         want to pull the DeclSpace out of the builder_to_declspace instead
13089         of the TypeBuilder (like in TypeContainer.FindMembers).
13090
13091         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13092         instead of LookupTypeContainer.  Fixes the crash on .NET for
13093         looking up interface members.
13094
13095         * const.cs: Create our own emit context during the Definition
13096         stage, so that constants are evaluated in the proper context, when
13097         a recursive definition happens.
13098
13099 2003-05-11  Martin Baulig  <martin@ximian.com>
13100
13101         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13102         new block for a switch section.
13103         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13104         the adding/lookup in the switch block.  Fixes #39828.
13105
13106 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13109         functionality: I needed to convert the data after I had performed
13110         the add/sub operation into the operands type size.
13111
13112         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13113         pass the type for the box operation, otherwise the resulting
13114         object would have been of type object.
13115
13116         (BoxedCast): Add constructor to specify the type to box as.
13117
13118 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13119
13120         * iterators.cs: I was reusing the `count' variable inadvertently,
13121         take steps to not allow this to happen.
13122
13123 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13124
13125         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13126         by creating an array at the point where the params starts and
13127         putting all those arguments there, then adjusting the size of the
13128         array.
13129
13130 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13131
13132         * expression.cs (New.AddressOf): Implement interface
13133         IMemoryLocation.  This is used when the `new' operator is used in
13134         the context of an invocation to a method on a value type.
13135
13136         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13137         example. 
13138
13139         * namespace.cs: Also check the using aliases here.
13140
13141         * driver.cs: Move the test for using validity after the types have
13142         been entered, so we do a single pass that also includes the using
13143         aliases. 
13144
13145         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13146         in the regular case.   CreateSiblingForFinally is doing extra
13147         error checking.
13148
13149         * attribute.cs (GetAttributeArgumentExpression): Store the result
13150         on an out value, and use the return value to indicate failure
13151         instead of using null (which is a valid return for Constant.GetValue).
13152
13153         * statement.cs: Perform the analysis flow for the increment
13154         portion after the statement, because this will be the real flow of
13155         execution.  Fixes #42385
13156
13157         * codegen.cs (EmitContext.EmitArgument,
13158         EmitContext.EmitStoreArgument): New helper functions when the
13159         RemapToProxy flag is set.
13160
13161         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13162         function.
13163
13164         Add support for remapping parameters. 
13165
13166         * iterators.cs: Propagate parameter values;  Store parameter
13167         values in the proxy classes.
13168
13169 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13170
13171         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13172         need a proxy reference;  I do not know what I was thinking
13173
13174         * cs-parser.jay (constructor_initializer): catch another error,
13175         and display nice message.
13176
13177         (field_declaration): catch void field declaration
13178         to flag a better error. 
13179
13180         * class.cs (MemberBase.CheckBase): Report an error instead of a
13181         warning if a new protected member is declared in a struct. 
13182         (Field.Define): catch the error of readonly/volatile.
13183
13184         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13185
13186         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13187         volatile variable is taken
13188
13189 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13190
13191         * statement.cs (Fixed.Resolve): Report an error if we are not in
13192         an unsafe context.
13193
13194 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13195
13196         * typemanager.cs: reuse the code that handles type clashes for
13197         delegates and enumerations.
13198
13199         * class.cs (Report28): Always report.
13200
13201         * expression.cs (EncodeAsAttribute): Allow nulls here.
13202
13203 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13204
13205         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13206         the functionality for testing whether an expression is valid for
13207         an attribute here.  Also handle the case of arrays of elements
13208         being stored. 
13209
13210         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13211         encoding a linear array into an array of objects that are suitable
13212         to be passed to an CustomAttributeBuilder.
13213
13214         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13215
13216         * ecore.cs: (FieldExpr): Handle field remapping here.
13217
13218         * iteratators.cs: Pass the instance variable (if the method is an
13219         instance method) to the constructors, so we can access the field
13220         variables on the class.
13221
13222         TODO: Test this with structs.  I think the THIS variable on
13223         structs might have to be a pointer, and not a refenrece
13224
13225 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13228         local variables to fields in a proxy class.
13229
13230         * iterators.cs (PopulateProxy): Rename our internal fields to
13231         <XXX>.  
13232         Create a <THIS> field if we are an instance method, so we can
13233         reference our parent container variables.
13234         (MapVariable): Called back from the EmitContext code to enter a
13235         new variable to field mapping into the proxy class (we just create
13236         a FieldBuilder).
13237
13238         * expression.cs
13239         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13240         for using the remapped locals to fields.
13241
13242         I placed the code here, because that gives the same semantics to
13243         local variables, and only changes the Emit code.
13244
13245         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13246         statements inside iterators.
13247         (VariableInfo): Add a FieldBuilder for the cases when we are
13248         remapping local variables to fields in a proxy class
13249
13250         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13251         current_block != null.
13252
13253         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13254         not cope with strings, as it has been moved to the
13255         TableSwitchEmit.  Fixed bug in switch generation.
13256
13257         * expression.cs (New.DoResolve): Provide more context for the user
13258         when reporting an error.
13259
13260         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13261         pointers. 
13262
13263         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13264         check the permissions for it.  Note than in a type-resolution
13265         context the check was already present in DeclSpace.ResolveType,
13266         but was missing from the MemberAccess.
13267
13268         (ArrayCreation.CheckIndices): warn if the user has
13269         more nested levels of expressions, but there are no more
13270         dimensions specified.  Avoids crash on bug 41906.
13271
13272 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13273
13274         * statement.cs (Block): replace Implicit bool, for a generic
13275         flags.   
13276         New flag: `Unchecked'.  This is used during the EmitMeta phase
13277         (which is out-of-line with the regular Resolve/Emit process for a
13278         statement, as this is done ahead of time, but still gets a chance
13279         to call constant resolve).
13280
13281         (Block.Flags): new enum for adding a new flag.
13282
13283         (Block.EmitMeta): track the state of unchecked.
13284
13285         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13286         to enable constant resolution to work there as well.
13287
13288 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13289
13290         * typemanager.cs (ienumerable_type): Also look up
13291         System.Collections.IEnumerable. 
13292
13293 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13294
13295         TODO: Test more than one conditional per method.
13296
13297         * class.cs (Indexer.Define): Report the location where the user is
13298         referencing the unsupported feature.
13299
13300         (MethodData): Overload the use of `conditionals' to
13301         minimize the creation of needless ArrayLists.   This saves roughly
13302         212kb on my machine.
13303
13304         (Method): Implement the new IIteratorContainer interface.
13305         (Method.SetYields): Implement the method by setting the ModFlags
13306         to contain METHOD_YIELDS.
13307
13308         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13309         which just got set to null.
13310
13311         * iterators.cs: New file.
13312
13313         (Yield, YieldBreak): New statements.
13314
13315         * statement.cs (Return.Resolve): Flag an error if we are used in
13316         an iterator method.
13317
13318         * codegen.cs (InIterator): New flag set if the code is being
13319         compiled in an iterator method.
13320
13321         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13322         internal modifier, and we just use it to avoid adding extra
13323         fields, as this is seldom used.  
13324
13325         * cs-parser.jay: Add yield_statement (yield and yield break).
13326
13327         * driver.cs: New flag -v2 to turn on version 2 features. 
13328
13329         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13330         hashtable when v2 is enabled.
13331
13332 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13335         there is already a namespace defined with this name.
13336
13337         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13338         people upgraded their corlibs.
13339
13340         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13341         always use fully qualified types, no need to use the compiler
13342         front end.
13343
13344         (TypeManager.IsNamespace): Use binarysearch.
13345
13346         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13347         AddDelegate): I did not quite use the new IsValid API properly: I
13348         have to pass the short-name and the fullname.  I was passing only
13349         the basename instead of the fullname sometimes. 
13350
13351         (TypeContainer.DefineType): call NamespaceClash.
13352
13353         * interface.cs (Interface.DefineType): use NamespaceClash before
13354         defining the type.
13355
13356         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13357         defining the type.
13358
13359         * enum.cs: (Enum.DefineType): use NamespaceClash before
13360         defining the type.
13361
13362         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13363         speed increase.  First, use the negative_hits cache when we get a
13364         negative.  Second, add the type with its full original name
13365         instead of the new . and + encoded name (reflection uses + to
13366         separate type from a nested type).  Use LookupTypeReflection
13367         directly which bypasses the type->name hashtable (that we already
13368         know does not contain the type.
13369
13370         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13371         location/container type. 
13372
13373         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13374
13375 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13378
13379         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13380         method is being referenced in the method group from a static
13381         context, and report error 120 if so.
13382
13383         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13384         Error118. 
13385
13386         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13387         is created, we create the A namespace).
13388
13389         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13390         Fixes #41591
13391
13392 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13393
13394         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13395         invocation to ModuleBuilder.GetType with the same values will
13396         return a new type instance, so we need to cache its return
13397         values. 
13398
13399         * expression.cs (Binary.ResolveOperator): Only allow the compare
13400         operators on enums if they are of the same type.
13401
13402         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13403         types of ValueType on their own case.  Before we were giving them
13404         the same treatment as objects.
13405
13406         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13407         fullname.  Short name is used to compare against container name.
13408         Fullname is used to check against defined namespace names.
13409
13410         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13411         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13412
13413         (Method.CheckBase): Call parent.
13414         (MemberBase.CheckBase): Check for protected members on sealed
13415         classes.
13416         (PropertyBase.CheckBase): Call parent.
13417         (Field.Define): Call parent.
13418
13419         * report.cs: Negative error codes are now mapped to 8000 - code,
13420         so that the display is render more nicely.
13421
13422         * typemanager.cs: Do not use try/catch, instead report a regular
13423         error. 
13424
13425         (GetPointerType, GetReferenceType): These methods provide
13426         mechanisms to obtain the T* and T& from a T.  We had the code
13427         previously scattered around the code base, and it also used
13428         TypeManager.LookupType that would go through plenty of caches.
13429         This one goes directly to the type source.
13430
13431         In some places we did the Type.GetType followed by
13432         ModuleBuilder.GetType, but not in others, so this unifies the
13433         processing as well.
13434
13435         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13436         statements now that we have namespace information.
13437
13438         * typemanager.cs (IsNamespace): New method, returns whether the
13439         string presented is a namespace or not.
13440
13441         (ComputeNamespaces): New public entry point, computes the list of
13442         available namespaces, using the GetNamespaces API call in Mono, or
13443         the slower version in MS.NET.   
13444
13445         Now before we start the semantic analysis phase, we have a
13446         complete list of namespaces including everything that the user has
13447         provided.
13448
13449         Deleted old code to cache namespaces in .nsc files.
13450
13451 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13452
13453         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13454         class/struct location definition Location for the implicit
13455         constructor location.
13456
13457         (Operator.Define): Use the location of the operator for the
13458         implicit Method definition.
13459
13460         (Constructor.Emit): use the constructor location for the implicit
13461         base initializer constructor.
13462
13463         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13464         and the Expression class now contains two new methods:
13465
13466         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13467         isolate type lookup from the rest of the resolution process.
13468
13469         Since we use Expressions to hold type definitions due to the way
13470         we parse the input we have historically overloaded Resolve to
13471         perform the Type lookups if a special flag is passed.  Now this is
13472         eliminated and two methods take their place. 
13473
13474         The differences in the two methods between xStep and xTerminal is
13475         that xStep is involved in our current lookup system that uses
13476         SimpleNames to compose a name, while xTerminal is used just to
13477         catch the case where the simplename lookup failed.
13478
13479 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13480
13481         * expression.cs (ResolveMemberAccess): Remove redundant code.
13482         TypeExpr expressions are always born fully resolved.
13483
13484         * interface.cs (PopulateMethod): Do not lookup the types twice.
13485         We were doing it once during SemanticAnalysis and once during
13486         PopulateMethod.
13487
13488         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13489         in local variable type definitions, were being returned as a
13490         SimpleName (we decomposed everything into a string), that is
13491         because primary_expression was being used instead of a type in the
13492         grammar (reduce/reduce conflicts).
13493
13494         The part that was wrong is that we converted the expression into a
13495         string (an oversimplification in one hand, compounded with primary
13496         expressions doing string concatenation).
13497
13498         So things like:
13499
13500         A.B.C [] x;
13501
13502         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13503         using clauses from working on this particular context.  And a type
13504         was being matched directly against "A.B.C[]".
13505
13506         We now use the correct approach, and allow for ComposedCast to be
13507         part of the unary expression.  So the "A.B.C []" become a composed
13508         cast of "A.B.C" (as a nested group of MemberAccess with a
13509         SimpleName at the end) plus the rank composition "[]". 
13510
13511         Also fixes 35567
13512
13513 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13514
13515         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13516         for the access level checking.
13517
13518         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13519         `TypeContainer container', because I kept getting confused when I
13520         was debugging this code.
13521
13522         * expression.cs (Indexers): Instead of tracking getters/setters,
13523         we now track them in parallel.  We create one arraylist less, but
13524         most importantly it is possible now for the LValue code to find a
13525         matching get for a set.
13526
13527         (IndexerAccess.DoResolveLValue): Update the code.
13528         GetIndexersForType has been modified already to extract all the
13529         indexers from a type.  The code assumed it did not.
13530
13531         Also make the code set the correct return type for the indexer.
13532         This was fixed a long time ago for properties, but was missing for
13533         indexers.  It used to be void_type.
13534
13535         (Binary.Emit): Test first for doubles instead of
13536         floats, as they are more common.
13537
13538         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13539         when dealing with floats and the <=, >= operators.  This fixes bug
13540         #39314 
13541
13542         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13543         to load the array value by emitting a load on the foreach variable
13544         type.  This was incorrect.  
13545
13546         We now emit the code to load an element using the the array
13547         variable type, and then we emit the conversion operator.
13548
13549         Fixed #40176
13550
13551 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13552
13553         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13554
13555 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13556
13557         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13558         test for protection before we test for signatures. 
13559
13560         (MethodSignature.ToString): implement.
13561
13562         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13563         to the case where we reduced into a LongConstant.
13564
13565         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13566         depend on whether the information is acurrate, because the
13567         Microsoft runtime will always claim that the array type is public,
13568         regardless of the real state.
13569
13570         If the type is a pointer, another problem happens: the type is
13571         reported as non-public in Microsoft.  
13572
13573         In both cases we have to call CheckAccessLevel recursively with
13574         the underlying type as the argument to be tested.
13575
13576 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * assign.cs (Assign.Emit): If we are dealing with a compound
13579         assignment expression, we should use the code path that stores the
13580         intermediate result in a temporary value.  This fixes #40903.
13581
13582         *expression.cs (Indirection.ToString): Provide ToString method for
13583         debugging. 
13584
13585 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13586
13587         * class.cs: Null out fields holding references to Block objects so
13588         they can be garbage collected.
13589
13590         * expression.cs (OverloadResolve): Remove unused local.
13591
13592 2003-04-07  Martin Baulig  <martin@ximian.com>
13593
13594         * codegen.cs (EmitContext.CurrentFile): New public field.
13595         (EmitContext.Mark): Use the CurrentFile to check whether the
13596         location is in the correct file.
13597         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13598
13599 2003-04-07  Martin Baulig  <martin@ximian.com>
13600
13601         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13602
13603         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13604         location.  [FIXME: The location argument which gets passed to this
13605         method is sometimes wrong!]
13606
13607 2003-04-07  Nick Drochak <ndrochak@gol.com>
13608
13609         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13610
13611 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13612
13613         * expression.cs (Indirection.EmitAssign): We were using the
13614         temporary, but returning immediately instead of continuing the
13615         EmitAssing flow.
13616
13617 2003-04-06  Martin Baulig  <martin@ximian.com>
13618
13619         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13620         if it's a nested child, but also deriving from the outer class.
13621         See test 190.cs.
13622
13623         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13624         nested child, but also deriving from the outer class.  See
13625         test-190.cs.
13626         (FilterWithClosure): We may access private members of the outer
13627         class if we're a nested child and deriving from the outer class.
13628         (RealMemberLookup): Only set `closure_private_ok' if the
13629         `original_bf' contained BindingFlags.NonPublic.
13630
13631 2003-04-05  Martin Baulig  <martin@ximian.com>
13632
13633         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13634
13635 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * class.cs (Event.Define): Do not allow abstract events to have
13638         initializers. 
13639
13640 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13641
13642         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13643         block in event declarations.
13644
13645         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13646         value type, get its address.
13647
13648         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13649         leaving a class on the stack instead of a boolean value (int
13650         0/1).  Change the code so we compare against null, and then the
13651         result against zero.
13652
13653         * class.cs (TypeContainer.GetClassBases): We were checking for the
13654         parent class being sealed too late.
13655
13656         * expression.cs (Binary.Emit): For <= and >= when dealing with
13657         floating point values, use cgt.un and clt.un instead of cgt and
13658         clt alone.
13659
13660 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13661
13662         * statement.cs: Apply the same optimization as MS: skip the 
13663         GetEnumerator returning an IEnumerator, and use the one returning a 
13664         CharEnumerator instead. This allows us to avoid the try-finally block 
13665         and the boxing.
13666
13667 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13668
13669         * cs-parser.jay: Attributes cannot be applied to
13670                          namespaces. Fixes #40473
13671
13672 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13673
13674         * class.cs:
13675         (Add*): check if the name is valid using the full name for constants,
13676         fields, properties and events.
13677
13678 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13679
13680         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13681         char constants to be part of the enumeration.
13682
13683         * expression.cs (Conditional.DoResolve): Add support for operator
13684         true. Implements the missing functionality from 14.12
13685
13686         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13687         operator true/false as required by the spec.
13688
13689         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13690         implicit conversion to boolean.
13691
13692         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13693         also one where the type implements `operator true'. 
13694
13695         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13696         get an expression that will invoke operator true based on an
13697         expression.  
13698
13699         (GetConversionOperators): Removed the hack that called op_True
13700         here.  
13701
13702         (Expression.ResolveBoolean): Move this from Statement.
13703
13704 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13705
13706         * ecore.cs (FieldExpr): do not allow initialization of initonly
13707         fields on derived classes
13708
13709 2003-03-13  Martin Baulig  <martin@ximian.com>
13710
13711         * statement.cs (Block.Emit): Call ig.BeginScope() and
13712         ig.EndScope() when compiling with debugging info; call
13713         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13714
13715 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13716
13717         * expression.cs (Indexers): Do not construct immediately, allow
13718         for new members to be appended as we go.  Fixes 38143
13719
13720 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13721
13722         * expression.cs: save/restore context when resolving an unchecked
13723         expression.
13724
13725 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13726
13727         * cfold.cs: Catch division by zero in modulus operator during
13728         constant folding.
13729
13730 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13731
13732         * interface.cs (Interface.DefineMembers): Avoid defining members
13733         twice. 
13734
13735 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13736
13737         * driver.cs: handle the +/- options for -noconfig
13738
13739         * statement.cs (Unckeched.Resolve): Also track the state of
13740         unchecked in the Resolve phase.
13741
13742 2003-02-27  Martin Baulig  <martin@ximian.com>
13743
13744         * ecore.cs (Expression.MemberLookup): Don't create a
13745         MethodGroupExpr for something which is not a method.  Fixes #38291.
13746
13747 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * class.cs (MemberBase.CheckParameters): Also check that the type
13750         is unmanaged if it is a pointer.
13751
13752         * expression.cs (SizeOf.Resolve): Add location information.
13753
13754         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13755         a managed type is declared.
13756
13757         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13758         parameter modifiers as well.  Fixes bug 38606
13759
13760         * class.cs: Very sad.  Am backing out the speed up changes
13761         introduced by the ArrayList -> Array in the TypeContainer, as they
13762         were not actually that much faster, and introduced a bug (no error
13763         reports on duplicated methods).
13764
13765         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13766         source first, this will guarantee that we have a valid expression
13767         before calling in lower levels functions that will require a
13768         resolved object.  Then use this original_source in the
13769         target.ResolveLValue instead of the original source that was
13770         passed to us.
13771
13772         Another change.  Use target.Resolve instead of LValueResolve.
13773         Although we are resolving for LValues, we will let the Assign code
13774         take care of that (it will be called again from Resolve).  This
13775         basically allows code like this:
13776
13777         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13778         class Y { void A (X x) { x [0] += o; }
13779
13780         The problem was that the indexer was trying to resolve for
13781         set_Item (idx, object o) and never finding one.  The real set_Item
13782         was set_Item (idx, X).  By delaying the process we get the right
13783         semantics. 
13784
13785         Fixes bug 36505
13786
13787 2003-02-23  Martin Baulig  <martin@ximian.com>
13788
13789         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13790         while calling DoEmit ().
13791
13792         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13793         source files; if you use the #line directive inside a method, the
13794         compiler stops emitting line numbers for the debugger until it
13795         reaches the end of the method or another #line directive which
13796         restores the original file.
13797
13798 2003-02-23  Martin Baulig  <martin@ximian.com>
13799
13800         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13801
13802 2003-02-23  Martin Baulig  <martin@ximian.com>
13803
13804         * statement.cs (Block.AddChildVariableNames): We need to call this
13805         recursively, not just for our immediate children.
13806
13807 2003-02-23  Martin Baulig  <martin@ximian.com>
13808
13809         * class.cs (Event.Define): Always make the field private, like csc does.
13810
13811         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13812         actually work, fixes bug #37521.
13813
13814 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13815
13816         * delegate.cs: When creating the various temporary "Parameters"
13817         classes, make sure that we call the ComputeAndDefineParameterTypes
13818         on those new parameters (just like we do with the formal ones), to
13819         allow them to be resolved in the context of the DeclSpace.
13820
13821         This fixes the bug that Dick observed in Bugzilla #38530.
13822
13823 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * expression.cs (ResolveMemberAccess): When resolving a constant,
13826         do not attempt to pull a constant if the value was not able to
13827         generate a valid constant.
13828
13829         * const.cs (LookupConstantValue): Do not report more errors than required.
13830
13831 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13832
13833         * expression.cs: fixes bug #38328.
13834
13835 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13836
13837         * class.cs: Changed all the various members that can be part of a
13838         class from being an ArrayList to be an Array of the right type.
13839         During the DefineType type_list, interface_list, delegate_list and
13840         enum_list are turned into types, interfaces, delegates and enums
13841         arrays.  
13842
13843         And during the member population, indexer_list, event_list,
13844         constant_list, field_list, instance_constructor_list, method_list,
13845         operator_list and property_list are turned into their real arrays.
13846
13847         Although we could probably perform this operation earlier, for
13848         good error reporting we need to keep the lists and remove the
13849         lists for longer than required.
13850
13851         This optimization was triggered by Paolo profiling the compiler
13852         speed on the output of `gen-sample-program.pl' perl script. 
13853
13854         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13855         not crash in methods like MemberLookupFailed that use this field.  
13856
13857         This problem arises when the compiler fails to resolve a type
13858         during interface type definition for example.
13859
13860 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13863         inherit from System.Object, so we have to stop at null, not only
13864         when reaching System.Object.
13865
13866 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13867
13868         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13869         DeclaredOnly because the parent indexer might have had a different
13870         name, but did not loop until the top of the hierarchy was reached.
13871
13872         The problem this one fixes is 35492: when a class implemented an
13873         indexer from an interface, we were getting the interface method
13874         (which was abstract) and we were flagging an error (can not invoke
13875         abstract method).
13876
13877         This also keeps bug 33089 functioning, and test-148 functioning.
13878
13879         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13880         out if a method is special is to see if it is declared in a
13881         property or event, or whether it is one of the predefined operator
13882         names.   This should fix correctly #36804.
13883
13884 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13885
13886         The goal here is to remove the dependency on EmptyCast.Peel ().
13887         Killing it completely.
13888
13889         The problem is that currently in a number of places where
13890         constants are expected, we have to "probe" for an EmptyCast, and
13891         Peel, which is not the correct thing to do, as this will be
13892         repetitive and will likely lead to errors. 
13893
13894         The idea is to remove any EmptyCasts that are used in casts that
13895         can be reduced to constants, so we only have to cope with
13896         constants. 
13897
13898         This bug hunt was triggered by Bug 37363 and the desire to remove
13899         the duplicate pattern where we were "peeling" emptycasts to check
13900         whether they were constants.  Now constants will always be
13901         constants.
13902
13903         * ecore.cs: Use an enumconstant here instead of wrapping with
13904         EmptyCast.  
13905
13906         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13907         throwing me off.  By handling this we can get rid of a few hacks.
13908
13909         * statement.cs (Switch): Removed Peel() code.
13910
13911 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * class.cs: Location information for error 508
13914
13915         * expression.cs (New.DoResolve): Add a guard against double
13916         resolution of an expression.  
13917
13918         The New DoResolve might be called twice when initializing field
13919         expressions (see EmitFieldInitializers, the call to
13920         GetInitializerExpression will perform a resolve on the expression,
13921         and later the assign will trigger another resolution
13922
13923         This leads to bugs (#37014)
13924
13925         * delegate.cs: The signature for EndInvoke should contain any ref
13926         or out parameters as well.  We were not doing this in the past. 
13927
13928         * class.cs (Field.Define): Do not overwrite the type definition
13929         inside the `volatile' group.  Turns out that volatile enumerations
13930         were changing the type here to perform a validity test, which
13931         broke conversions. 
13932
13933 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13934
13935         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13936         and structs, we do not want to load the instance variable
13937
13938         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13939         enum_type has to be handled like an object reference (implicit
13940         conversions exists from this to object), but the regular IsClass
13941         and IsValueType tests will never return true for this one.
13942
13943         Also we use TypeManager.IsValueType instead of type.IsValueType,
13944         just for consistency with the rest of the code (this is only
13945         needed if we ever use the construct exposed by test-180.cs inside
13946         corlib, which we dont today).
13947
13948 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13949
13950         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13951         just InternalCall.
13952
13953 2003-02-09  Martin Baulig  <martin@ximian.com>
13954
13955         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13956         (Namespace.DefineNamespaces): New static public method; this is
13957         called when we're compiling with debugging to add all namespaces
13958         to the symbol file.
13959
13960         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13961         pass it to the Namespace's .ctor.
13962
13963         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13964         and MethodBase arguments; pass the namespace ID to the symwriter;
13965         pass the MethodBase instead of the token to the symwriter.
13966         (SymbolWriter.DefineNamespace): New method to add a namespace to
13967         the symbol file.
13968
13969 2003-02-09  Martin Baulig  <martin@ximian.com>
13970
13971         * symbolwriter.cs: New file.  This is a wrapper around
13972         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13973         methods here in near future.
13974
13975 2003-02-09  Martin Baulig  <martin@ximian.com>
13976
13977         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13978         ILGenerator.MarkSequencePoint() which are actually used by the
13979         symbol writer.
13980
13981 2003-02-09  Martin Baulig  <martin@ximian.com>
13982
13983         * location.cs (SourceFile): New public sealed class.  This
13984         contains the name and an index which is used in the location's token.
13985         (Location): Reserve an appropriate number of bits in the token for
13986         the source file instead of walking over that list, this gives us a
13987         really huge performance improvement when compiling with debugging.
13988
13989         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13990         `SourceFile' argument instead of a string.
13991         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13992         but don't parse/tokenize here, we need to generate the list of all
13993         source files before we do that.
13994         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13995         the files.
13996
13997         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13998         instead of a string.
13999
14000         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14001         of a string.
14002
14003 2003-02-09  Martin Baulig  <martin@ximian.com>
14004
14005         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14006         filename on `#line default'.
14007
14008 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14009
14010         * statement.cs: don't clear the pinned var when the fixed statement
14011         returns from the method (fixes bug#37752).
14012
14013 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14014
14015         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14016         to IsValueType.
14017
14018 2003-02-07  Martin Baulig  <martin@ximian.com>
14019
14020         * driver.cs: Removed the `--debug-args' command line argument.
14021
14022         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14023         automatically by the AsssemblyBuilder.
14024         (CodeGen.InitializeSymbolWriter): We don't need to call any
14025         initialization function on the symbol writer anymore.  This method
14026         doesn't take any arguments.
14027
14028 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14029
14030         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14031         from referenced assemblies as well.
14032
14033 2003-02-02  Martin Baulig  <martin@ximian.com>
14034
14035         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14036
14037 2003-02-02  Martin Baulig  <martin@ximian.com>
14038
14039         * class.cs (Constructor.Emit): Open the symbol writer before
14040         emitting the constructor initializer.
14041         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14042         single-stepping through constructor initializers.
14043
14044 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14045
14046         * class.cs: Handle error 549: do not allow virtual methods in
14047         sealed classes. 
14048
14049 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14050
14051         * decl.cs: Check access levels when resolving types
14052
14053 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14054
14055         * statement.cs: Add parameters and locals set in catch blocks that might 
14056         return to set vector
14057
14058 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14059
14060         * class.cs (Operator): Set the SpecialName flags for operators.
14061
14062         * expression.cs (Invocation.DoResolve): Only block calls to
14063         accessors and operators on SpecialName methods.
14064
14065         (Cast.TryReduce): Handle conversions from char constants.
14066
14067
14068 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14069
14070         * statement.cs: small memory and time optimization in FlowBranching.
14071
14072 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14073
14074         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14075         problem that the last fix but in the other sid (Set).
14076
14077         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14078         access when there is no indexer in the hierarchy.
14079
14080 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14081
14082         * class.cs: Combine some if statements.
14083
14084 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14085
14086         * driver.cs: fixed bug #37187.
14087
14088 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14089
14090         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14091         any indexer, it's needed to build a list with all the indexers in the
14092         hierarchy (AllGetters), else we have problems. Fixes #35653.
14093
14094 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14095
14096         * class.cs (MethodData.Define): It is wrong for an interface
14097         implementation to be static in both cases: explicit and implicit.
14098         We were only handling this in one case.
14099
14100         Improve the if situation there to not have negations.
14101
14102         * class.cs (Field.Define): Turns out that we do not need to check
14103         the unsafe bit on field definition, only on usage.  Remove the test.
14104
14105 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14106
14107         * driver.cs: use assembly.Location instead of Codebase (the latest
14108         patch made mcs fail when using MS assemblies).
14109
14110 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14111
14112         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14113         get the path to *corlib.dll.
14114
14115 2003-01-21  Nick Drochak <ndrochak@gol.com>
14116
14117         * cs-tokenizer.cs:
14118         * pending.cs:
14119         * typemanager.cs: Remove compiler warnings
14120
14121 2003-01-20  Duncan Mak  <duncan@ximian.com>
14122
14123         * AssemblyInfo.cs: Bump the version number to 0.19.
14124
14125 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14126
14127         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14128
14129 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14130
14131         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14132
14133 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14134
14135         * cs-parser.jay: Small fix: we were not comparing the constructor
14136         name correctly.   Thanks to Zoltan for the initial pointer.
14137
14138 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14139
14140         * cs-tokenizer.cs: Set file name when specified with #line
14141
14142 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14143
14144         * cs-parser.jay: Only perform the constructor checks here if we
14145         are named like the class;  This will help provider a better
14146         error.  The constructor path is taken when a type definition is
14147         not found, but most likely the user forgot to add the type, so
14148         report that rather than the constructor error.
14149
14150 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14151
14152         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14153         allocations.
14154
14155 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14156
14157         * cs-parser.jay: Add cleanup call.
14158
14159 2003-01-13  Duncan Mak  <duncan@ximian.com>
14160
14161         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14162         consistent with other methods.
14163
14164 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14165
14166         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14167
14168 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14169
14170         * attribute.cs: only set GuidAttr to true when we have a
14171         GuidAttribute.
14172
14173 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14174
14175         * ecore.cs:
14176         * expression.cs:
14177         * typemanager.cs: fixes to allow mcs compile corlib with the new
14178         Type.IsSubclassOf fix.
14179
14180 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * expression.cs (LocalVariableReference.DoResolve): Classify a
14183         constant as a value, not as a variable.   Also, set the type for
14184         the variable.
14185
14186         * cs-parser.jay (fixed_statement): take a type instead of a
14187         pointer_type, so we can produce a better error message later.
14188
14189         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14190         as an error.  
14191
14192         (For.DoEmit): Make inifinite loops have a
14193         non-conditional branch back.
14194
14195         (Fixed.DoEmit): First populate the pinned variables, then emit the
14196         statement, then clear the variables.  Before I was emitting the
14197         code once for each fixed piece.
14198
14199
14200 2003-01-08  Martin Baulig  <martin@ximian.com>
14201
14202         * statement.cs (FlowBranching.MergeChild): A break in a
14203         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14204
14205 2003-01-08  Martin Baulig  <martin@ximian.com>
14206
14207         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14208         lives in the same number space than `param_map'.  Fixes #36154.
14209
14210 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14211
14212         * cs-parser.jay (constructor_declaration): Set the
14213         Constructor.ModFlags before probing for it.  This makes the
14214         compiler report 514, 515 and 132 (the code was there, but got
14215         broken). 
14216
14217         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14218         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14219         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14220
14221 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14222
14223         * enum.cs: create the enum static fields using the enum type.
14224
14225 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14226
14227         * class.cs: don't try to create the ParamBuilder for the return
14228         type if it's not needed (and handle it breaking for the ms runtime
14229         anyway).
14230
14231 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14232
14233         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14234
14235 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14238         the command.   This showed up while compiling the JANET source
14239         code, which used \r as its only newline separator.
14240
14241 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14242
14243         * class.cs (Method.Define): If we are an operator (because it
14244         reuses our code), then set the SpecialName and HideBySig.  #36128
14245
14246 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14247
14248         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14249         exception, report error 120 `object reference required'.
14250
14251         * driver.cs: Add --pause option, used during to measure the size
14252         of the process as it goes with --timestamp.
14253
14254         * expression.cs (Invocation.DoResolve): Do not allow methods with
14255         SpecialName to be invoked.
14256
14257 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14260         number before adding it.
14261
14262 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14263
14264         * ecore.cs (StandardImplicitConversion): When in an unsafe
14265         context, we allow conversion between void * to any other pointer
14266         type. This fixes bug #35973.
14267
14268 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14269
14270         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14271         is not thrown when extensionless outputs are used 
14272
14273 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14274
14275         * rootcontext.cs: fixed compilation of corlib.
14276
14277 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14278
14279         * attribute.cs (Attributes.Contains): Add new method.
14280
14281         * class.cs (MethodCore.LabelParameters): if the parameter is an
14282         `out' parameter, check that no attribute `[In]' has been passed.
14283
14284         * enum.cs: Handle the `value__' name in an enumeration.
14285
14286 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14287
14288         * decl.cs: Added special case to allow overrides on "protected
14289         internal" methods
14290
14291 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14292
14293         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14294         since it makes much more sense.
14295
14296         (Attributes.ctor): Don't require a Location parameter.
14297
14298         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14299
14300         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14301         since we already have that information per attribute.
14302
14303         * everywhere : make appropriate changes.
14304
14305         * class.cs (LabelParameters): Write the code which actually
14306         applies attributes to the return type. We can't do this on the MS
14307         .NET runtime so we flag a warning in the case an exception is
14308         thrown.
14309
14310 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14311
14312         * const.cs: Handle implicit null conversions here too.
14313
14314 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14315
14316         * class.cs (MethodCore.LabelParameters): Remove the extra
14317         Type [] parameter since it is completely unnecessary. Instead
14318         pass in the method's attributes so that we can extract
14319         the "return" attribute.
14320
14321 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14322
14323         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14324         of ignoring it and letting the compile continue.
14325
14326         * typemanager.cs (ChangeType): use an extra argument to return an
14327         error condition instead of throwing an exception.
14328
14329 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14330
14331         * expression.cs (Unary.TryReduce): mimic the code for the regular
14332         code path.  Perform an implicit cast in the cases where we can
14333         implicitly convert to one of the integral types, and then reduce
14334         based on that constant.   This fixes bug #35483.
14335
14336 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14337
14338         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14339
14340 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14341
14342         * namespace.cs: fixed bug #35489.
14343
14344 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14345
14346         * class.cs: Remove some dead code.
14347
14348         * cs-parser.jay: Estimate the number of methods needed
14349         (RootContext.MethodCount);
14350
14351         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14352         numbers instead of StringBuilders.
14353
14354         * support.cs (PtrHashtable): Add constructor with initial size;
14355         We can now reduce reallocations of the method table.
14356
14357 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14358
14359         * attribute.cs (ApplyAttributes): Keep track of the emitted
14360         attributes on a per-target basis. This fixes bug #35413.
14361
14362 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14363
14364         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14365         default to the Windows 1252 encoding.
14366
14367         (UnixParseOption): Support version, thanks to Alp for the missing
14368         pointer. 
14369
14370         * AssemblyInfo.cs: Add nice assembly information.
14371
14372         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14373         (bug 35169).
14374
14375         * cs-parser.jay: Allow a trailing comma before the close bracked
14376         in the attribute_section production.
14377
14378         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14379         address of the instance was being taken, I will take this out,
14380         because we take the address of the object immediately here.
14381
14382 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14383
14384         * typemanager.cs (AreMultipleAllowed): Take care of the most
14385         obvious case where attribute type is not in the current assembly -
14386         stupid me ;-)
14387
14388 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14389
14390         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14391         definitions, instead of doing that afterwards.  
14392
14393         Also we use a nice little hack, depending on the constructor, we
14394         know if we are a "composed" name or a simple name.  Hence, we
14395         avoid the IndexOf test, and we avoid 
14396
14397         * codegen.cs: Add code to assist in a bug reporter to track down
14398         the source of a compiler crash. 
14399
14400 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14401
14402         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14403         types have been emitted for a given element and flag an error
14404         if something which does not have AllowMultiple set is used more
14405         than once.
14406
14407         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14408         attribute types and their corresponding AllowMultiple properties
14409
14410         (AreMultipleAllowed): Check the property for a given type.
14411
14412         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14413         property in the case we have a TypeContainer.
14414
14415         (Attributes.AddAttribute): Detect duplicates and just skip on
14416         adding them. This trivial fix catches a pretty gross error in our
14417         attribute emission - global attributes were being emitted twice!
14418
14419         Bugzilla bug #33187 is now fixed.
14420
14421 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14422
14423         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14424         instead of pp_and).
14425
14426         * expression.cs (Binary.ResolveOperator): I can only use the
14427         Concat (string, string, string) and Concat (string, string,
14428         string, string) if the child is actually a concatenation of
14429         strings. 
14430
14431 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14434         context where we need a 2-character lookahead.
14435
14436         * pending.cs (PendingImplementation): Rework so we can keep track
14437         of interface types all the time, and flag those which were
14438         implemented by parents as optional.
14439
14440 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * expression.cs (Binary.ResolveOperator): Use
14443         String.Concat(string,string,string) or
14444         String.Concat(string,string,string,string) when possible. 
14445
14446         * typemanager: More helper methods.
14447
14448
14449 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14450
14451         * pending.cs: remove the bogus return from GetMissingInterfaces()
14452         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14453
14454 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14455
14456         * namespace.cs: avoid duplicated 'using xxx' being added to
14457         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14458         when we get more than one 'using' statement for the same namespace.
14459         Report a CS0105 warning for it.
14460
14461 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14462
14463         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14464         of calling getChar/putback, uses internal knowledge of it.    
14465
14466         (xtoken): Reorder tokenizer so most common patterns are checked
14467         first.  This reduces the compilation time in another 5% (from 8.11s
14468         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14469
14470         The parsing time is 22% of the compilation in mcs, and from that
14471         64% is spent on the tokenization process.  
14472
14473         I tried using a binary search for keywords, but this is slower
14474         than the hashtable.  Another option would be to do a couple of
14475         things:
14476
14477                 * Not use a StringBuilder, instead use an array of chars,
14478                   with a set value.  Notice that this way we could catch
14479                   the 645 error without having to do it *afterwards*.
14480
14481                 * We could write a hand-parser to avoid the hashtable
14482                   compares altogether.
14483
14484         The identifier consumption process takes 37% of the tokenization
14485         time.  Another 15% is spent on is_number.  56% of the time spent
14486         on is_number is spent on Int64.Parse:
14487
14488                 * We could probably choose based on the string length to
14489                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14490                   computations. 
14491
14492         Another 3% is spend on wrapping `xtoken' in the `token' function.
14493
14494         Handle 0xa0 as whitespace (#34752)
14495
14496 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14497
14498         * typemanager.cs (IsCLRType): New routine to tell whether a type
14499         is one of the builtin types.  
14500
14501         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14502         typecode in more places instead of doing pointer comparissions.
14503         We could leverage some knowledge about the way the typecodes are
14504         laid out.
14505
14506         New code to cache namespaces in assemblies, it is currently not
14507         invoked, to be used soon.
14508
14509         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14510
14511         * expression.cs (Binary.ResolveOperator): specially handle
14512         strings, and do not perform user-defined operator overloading for
14513         built-in types.
14514
14515 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14516
14517         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14518         internalcall as it is a pretty simple operation;  Avoid whenever
14519         possible to call Char.IsLetter.
14520
14521         (consume_identifier): Cut by half the number of
14522         hashtable calls by merging the is_keyword and GetKeyword behavior.
14523
14524         Do not short-circuit, because if we do, we
14525         report errors (ie, #if false && true would produce an invalid
14526         directive error);
14527
14528
14529 2002-11-24  Martin Baulig  <martin@ximian.com>
14530
14531         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14532         check constant ranges and report a CS0221.  Fixes #33186.
14533
14534 2002-11-24  Martin Baulig  <martin@ximian.com>
14535
14536         * cs-parser.jay: Make this work for uninitialized variable
14537         declarations in the `for' initializer.  Fixes #32416.
14538
14539 2002-11-24  Martin Baulig  <martin@ximian.com>
14540
14541         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14542         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14543
14544 2002-11-24  Martin Baulig  <martin@ximian.com>
14545
14546         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14547         argument; if true, we also check for user-defined conversions.
14548         This is only needed if both arguments are of a user-defined type.
14549         Fixes #30443, added test-175.cs.
14550         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14551
14552         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14553
14554 2002-11-24  Martin Baulig  <martin@ximian.com>
14555
14556         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14557         function to get the store opcode.
14558         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14559         only emit the Ldelema if the store opcode is Stobj.  You must run
14560         both test-34 and test-167 to test this.  Fixes #34529.
14561
14562 2002-11-23  Martin Baulig  <martin@ximian.com>
14563
14564         * ecore.cs (Expression.MemberLookup): Added additional
14565         `qualifier_type' argument which is used when we're being called
14566         from MemberAccess.DoResolve() and null if we're called from a
14567         SimpleName lookup.
14568         (Expression.MemberLookupFailed): New method to report errors; this
14569         does the CS1540 check and reports the correct error message.
14570
14571         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14572         argument for the CS1540 check and redone the way how we're dealing
14573         with private members.  See the comment in the source code for details.
14574         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14575         `closure_start_type' to `closure_qualifier_type' and check whether
14576         it's not null.  It was not this filter being broken, it was just
14577         being called with the wrong arguments.
14578
14579         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14580         and pass it the correct `qualifier_type'; this also does the error
14581         handling for us.
14582
14583 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14584
14585         * expression.cs (Invocation.EmitParams): If the we are dealing
14586         with a non-built-in value type, load its address as well.
14587
14588         (ArrayCreation): Use a a pretty constant instead
14589         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14590         static initializers.  
14591
14592         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14593         because they are not really value types, just glorified integers. 
14594
14595         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14596
14597         * ecore.cs: Remove redundant code for enumerations, make them use
14598         the same code path as everything else, fixes the casting issue
14599         with enumerations in Windows.Forms.
14600
14601         * attribute.cs: Do only cast to string if it is a string, the
14602         validation happens later.
14603
14604         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14605         people upgrade their corlibs.
14606
14607         * ecore.cs: Oops, enumerations were not following the entire code path
14608
14609 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14610
14611         * typemanager.cs (FilterWithClosure): Commented out the test for
14612         1540 in typemanager.cs, as it has problems when accessing
14613         protected methods from a parent class (see test-174.cs). 
14614
14615         * attribute.cs (Attribute.ValidateGuid): new method.
14616         (Attribute.Resolve): Use above.
14617
14618 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14621
14622         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14623         handling for enumerations, as we only needed the TypeContainer
14624         functionality to begin with (this is required for the fix below to
14625         work for enums that reference constants in a container class for
14626         example). 
14627
14628         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14629
14630         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14631         a valid TypeBuilder to perform lookups on.o
14632
14633         * class.cs (InheritableMemberSignatureCompare): Use true in the
14634         call to GetGetMethod and GetSetMethod, because we are comparing
14635         the signature, and we need to get the methods *even* if they are
14636         private. 
14637
14638         (PropertyBase.CheckBase): ditto.
14639
14640         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14641         GotoCase.Resolve): Use Peel on EmpytCasts.
14642
14643         * ecore.cs (EmptyCast): drop child, add Peel method.
14644
14645 2002-11-17  Martin Baulig  <martin@ximian.com>
14646
14647         * ecore.cs (EmptyCast.Child): New public property.
14648
14649         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14650         label resolved to an EmptyCast.  Fixes #34162.
14651         (GotoCase.Resolve): Likewise.
14652         (Block.EmitMeta): Likewise.
14653
14654 2002-11-17  Martin Baulig  <martin@ximian.com>
14655
14656         * expression.cs (Invocation.BetterConversion): Prefer int over
14657         uint; short over ushort; long over ulong for integer literals.
14658         Use ImplicitConversionExists instead of StandardConversionExists
14659         since we also need to check for user-defined implicit conversions.
14660         Fixes #34165.  Added test-173.cs.
14661
14662 2002-11-16  Martin Baulig  <martin@ximian.com>
14663
14664         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14665         with the `true' and `false' literals.  Fixes #33151.
14666
14667 2002-11-16  Martin Baulig  <martin@ximian.com>
14668
14669         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14670         October 22nd; don't do the cs1540 check for static members.
14671
14672         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14673         now using our own filter here and doing the cs1540 check again.
14674
14675 2002-11-16  Martin Baulig  <martin@ximian.com>
14676
14677         * support.cs (InternalParameters): Don't crash if we don't have
14678         any fixed parameters.  Fixes #33532.
14679
14680 2002-11-16  Martin Baulig  <martin@ximian.com>
14681
14682         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14683         when looking up static methods to make this work on Windows.
14684         Fixes #33773.
14685
14686 2002-11-16  Martin Baulig  <martin@ximian.com>
14687
14688         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14689         a setter rather than using PropertyInfo.CanWrite.
14690
14691 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14692
14693         * class.cs: Allow acces to block member by subclasses. Fixes build
14694         breaker.
14695
14696 2002-11-14  Martin Baulig  <martin@ximian.com>
14697
14698         * class.cs (Constructor.Emit): Added the extern/block check.
14699         Fixes bug #33678.
14700
14701 2002-11-14  Martin Baulig  <martin@ximian.com>
14702
14703         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14704         iteration while looking for indexers, this is needed because the
14705         indexer may have a different name in our base classes.  Fixed the
14706         error reporting (no indexers at all, not get accessor, no
14707         overloaded match).  Fixes bug #33089.
14708         (IndexerAccess.DoResolveLValue): Likewise.
14709
14710 2002-11-14  Martin Baulig  <martin@ximian.com>
14711
14712         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14713         indexers.  Fixes the first part of bug #33089.
14714         (MethodSignature.InheritableMemberSignatureCompare): Added support
14715         for properties.
14716
14717 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14718
14719         * attribute.cs (Attribute.Resolve): Catch the
14720         NullReferenceException and report it since it isn't supposed to
14721         happen. 
14722
14723 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14724
14725         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14726         LogicalOr and LogicalAnd that can benefit from recursively
14727         handling EmitBranchable.  The code now should be nice for Paolo.
14728
14729 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14730
14731         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14732         the Type lookups, as we perform quite a number of lookups on
14733         non-Types.  This can be removed once we can deterministically tell
14734         whether we have a type or a namespace in advance.
14735
14736         But this might require special hacks from our corlib.
14737
14738         * TODO: updated.
14739
14740         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14741         and double which avoids a conversion from an integer to a double.
14742
14743         * expression.cs: tiny optimization, avoid calling IsConstant,
14744         because it effectively performs the lookup twice.
14745
14746 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14747
14748         But a bogus return here to keep the semantics of the old code
14749         until the Mono runtime is fixed.
14750
14751         * pending.cs (GetMissingInterfaces): New method used to remove all
14752         the interfaces that are already implemented by our parent
14753         classes from the list of pending methods. 
14754
14755         * interface.cs: Add checks for calls after ResolveTypeExpr.
14756
14757 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * class.cs (Class.Emit): Report warning 67: event not used if the
14760         warning level is beyond 3.
14761
14762         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14763         being a NullLiteral.
14764
14765         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14766         specifiers. 
14767
14768         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14769         path that might fail if a type can not be resolved.
14770
14771         * expression.cs (Binary.Emit): Emit unsigned versions of the
14772         operators. 
14773
14774         * driver.cs: use error 5.
14775
14776 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14777
14778         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14779
14780 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14781
14782         * cs-parser.jay (switch_section): A beautiful patch from Martin
14783         Baulig that fixed 33094.
14784
14785 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14786
14787         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14788         Check whether the base is abstract and report an error if so.
14789
14790         * expression.cs (IndexerAccess.DoResolveLValue,
14791         IndexerAccess.DoResolve): ditto. 
14792
14793         (Invocation.DoResolve): ditto.
14794
14795         (Invocation.FullMethodDesc): Improve the report string.
14796
14797         * statement.cs (Block): Eliminate IsVariableDefined as it is
14798         basically just a wrapper for GetVariableInfo.
14799
14800         * ecore.cs (SimpleName): Use new 
14801
14802         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14803         type, as we return the actual parameter ref/unref state on a
14804         different call.
14805
14806 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14807
14808         * support.cs: Return proper flags REF/OUT fixing the previous
14809         commit.  
14810
14811         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14812         not used to mean `ref' but `ref or out' in ParameterReference
14813
14814         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14815         full type signature instead of calling TypeManger.CSharpName
14816         ourselves. 
14817
14818         * support.cs (InternalParameters.ParameterDesc): Do not compare
14819         directly to the modflags, because REF/OUT will actually be bitsets
14820         if set. 
14821
14822         * delegate.cs (VerifyMethod): Check also the modifiers.
14823
14824         * cs-tokenizer.cs: Fix bug where floating point values with an
14825         exponent where a sign was missing was ignored.
14826
14827         * driver.cs: Allow multiple assemblies to be specified in a single
14828         /r: argument
14829
14830 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14831
14832         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14833         because identifiers after a parenthesis would end up in this kind
14834         of production, and we needed to desamiguate it for having casts
14835         like:
14836
14837                 (UserDefinedType *) xxx
14838
14839 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14840
14841         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14842         we should set on the Bindingflags.NonPublic, but not turn on
14843         private_ok.  private_ok controls whether a Private member is
14844         returned (this is chekced on the filter routine), while the
14845         BindingFlags.NonPublic just controls whether private/protected
14846         will be allowed.   This fixes the problem part of the problem of
14847         private properties being allowed to be used in derived classes.
14848
14849         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14850         so we can call the children DoResolveLValue method (this will
14851         properly signal errors on lvalue assignments to base properties)
14852
14853         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14854         getter are null, and we have a property info, we know that this
14855         happened because the lookup failed, so we report an error 122 for
14856         protection level violation.
14857
14858         We also silently return if setter and getter are null in the
14859         resolve functions, this condition only happens if we have flagged
14860         the error before.  This is the other half of the problem. 
14861
14862         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14863         not have accessibility information, that is why we were returning
14864         true in the filter function in typemanager.cs.
14865
14866         To properly report 122 (property is inaccessible because of its
14867         protection level) correctly, we report this error in ResolveAccess
14868         by failing if both the setter and the getter are lacking (ie, the
14869         lookup failed). 
14870
14871         DoResolve and DoLResolve have been modified to check for both
14872         setter/getter being null and returning silently, the reason being
14873         that I did not want to put the knowledge about this error in upper
14874         layers, like:
14875
14876         int old = Report.Errors;
14877         x = new PropertyExpr (...);
14878         if (old != Report.Errors)
14879                 return null;
14880         else
14881                 return x;
14882
14883         So the property expr is returned, but it is invalid, so the error
14884         will be flagged during the resolve process. 
14885
14886         * class.cs: Remove InheritablePropertySignatureCompare from the
14887         class, as we no longer depend on the property signature to compute
14888         whether it is possible to implement a method or not.
14889
14890         The reason is that calling PropertyInfo.GetGetMethod will return
14891         null (in .NET, in Mono it works, and we should change this), in
14892         cases where the Get Method does not exist in that particular
14893         class.
14894
14895         So this code:
14896
14897         class X { public virtual int A { get { return 1; } } }
14898         class Y : X { }
14899         class Z : Y { public override int A { get { return 2; } } }
14900
14901         Would fail in Z because the parent (Y) would not have the property
14902         defined.  So we avoid this completely now (because the alternative
14903         fix was ugly and slow), and we now depend exclusively on the
14904         method names.
14905
14906         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14907         reference method, instead of using the property.
14908
14909         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14910         routines are gone now.
14911
14912         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14913         names, they were incorrectly named.
14914
14915         * cs-tokenizer.cs: Return are more gentle token on failure. 
14916
14917         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14918         had an out-of-sync index variable, which caused it to remove from
14919         the list of pending methods the wrong method sometimes.
14920
14921 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14922
14923         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14924         CanWrite, because those refer to this particular instance of the
14925         property, and do not take into account the fact that we can
14926         override single members of a property.
14927
14928         Constructor requires an EmitContext.  The resolution process does
14929         not happen here, but we need to compute the accessors before,
14930         because the resolution does not always happen for properties.
14931
14932         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14933         subclass, before we did not update this flag, but we did update
14934         bindingflags. 
14935
14936         (GetAccessors): Drop this routine, as it did not work in the
14937         presence of partially overwritten set/get methods. 
14938
14939         Notice that this broke the cs1540 detection, but that will require
14940         more thinking. 
14941
14942 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14943
14944         * class.cs:
14945         * codegen.cs:
14946         * driver.cs: issue a warning instead of an error if we don't support
14947         debugging for the platform. Also ignore a couple of errors that may
14948         arise when trying to write the symbols. Undo my previous patch.
14949
14950 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14951
14952         * driver.cs: ignore /debug switch except for Unix platforms.
14953
14954 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14955
14956         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14957
14958 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * driver.cs: Do not make mcs-debug conditional, so we do not break
14961         builds that use it.
14962
14963         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14964         review this patch.  But basically after all the children variables
14965         have been merged, the value of "Breaks" was not being set to
14966         new_breaks for Switch blocks.  I think that it should be set after
14967         it has executed.  Currently I set this to the value of new_breaks,
14968         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14969         conservative, but I do not understand this code very well.
14970
14971         I did not break anything in the build, so that is good ;-)
14972
14973         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14974
14975 2002-10-20  Mark Crichton  <crichton@gimp.org>
14976
14977         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14978
14979 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14980
14981         * cfold.cs: Fixed compile blocker.
14982
14983 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * driver.cs: I was chekcing the key, not the file.
14986
14987 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14988
14989         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14990         message that we were generating - we just need to silently return
14991         a null.
14992
14993 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14994
14995         * class.cs (Event.Define): Change my previous commit, as this
14996         breaks the debugger.  This is a temporary hack, as it seems like
14997         the compiler is generating events incorrectly to begin with.
14998
14999         * expression.cs (Binary.ResolveOperator): Added support for 
15000         "U operator - (E x, E y)"
15001
15002         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15003         y)".
15004
15005         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15006         init-only variables, but this path did not take into account that
15007         there might be also instance readonly variables.  Correct this
15008         problem. 
15009
15010         This fixes bug 32253
15011
15012         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15013         delegates as well.
15014
15015         * driver.cs: Change the extension for modules to `netmodule'
15016
15017         * cs-parser.jay: Improved slightly the location tracking for
15018         the debugger symbols.
15019
15020         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15021         modifiers that were specified instead of the hardcoded value
15022         (FamAndAssem).  This was basically ignoring the static modifier,
15023         and others.  Fixes 32429.
15024
15025         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15026         fixed a bug in the process (32476)
15027
15028         * expression.cs (ArrayAccess.EmitAssign): Patch from
15029         hwang_rob@yahoo.ca that fixes bug 31834.3
15030
15031 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * driver.cs: Make the module extension .netmodule.
15034
15035 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * driver.cs: Report an error if the resource file is not found
15038         instead of crashing.
15039
15040         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15041         false, like Emit does.
15042
15043 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15044
15045         * typemanager.cs: Remove unused private member.  Also reported mcs
15046         bug to report this as a warning like csc.
15047
15048 2002-10-15  Martin Baulig  <martin@gnome.org>
15049
15050         * statement.cs (Statement.Emit): Made this a virtual method; emits
15051         the line number info and calls DoEmit().
15052         (Statement.DoEmit): New protected abstract method, formerly knows
15053         as Statement.Emit().
15054
15055         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15056
15057 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15060         have fixed a remaining problem: not every AddXXXX was adding a
15061         fully qualified name.  
15062
15063         Now everyone registers a fully qualified name in the DeclSpace as
15064         being defined instead of the partial name.  
15065
15066         Downsides: we are slower than we need to be due to the excess
15067         copies and the names being registered this way.  
15068
15069         The reason for this is that we currently depend (on the corlib
15070         bootstrap for instance) that types are fully qualified, because
15071         we dump all the types in the namespace, and we should really have
15072         types inserted into the proper namespace, so we can only store the
15073         basenames in the defined_names array.
15074
15075 2002-10-10  Martin Baulig  <martin@gnome.org>
15076
15077         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15078         from bug #31834, see the bug report for a testcase which is
15079         miscompiled.
15080
15081 2002-10-10  Martin Baulig  <martin@gnome.org>
15082
15083         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15084         flow analysis code for this.
15085
15086         * statement.cs (Do, While, For): Tell the flow analysis code about
15087         infinite loops.
15088         (FlowBranching.UsageVector): Added support for infinite loops.
15089         (Block.Resolve): Moved the dead code elimination here and use flow
15090         analysis to do it.
15091
15092 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * class.cs (Field.Define): Catch cycles on struct type
15095         definitions. 
15096
15097         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15098         fields if the fields are static.  We only need to check instance
15099         fields. 
15100
15101         * expression.cs (As.DoResolve): Test for reference type.
15102
15103         * statement.cs (Using.ResolveExpression): Use
15104         ConvertImplicitRequired, not ConvertImplicit which reports an
15105         error on failture
15106         (Using.ResolveLocalVariableDecls): ditto.
15107
15108         * expression.cs (Binary.ResolveOperator): Report errors in a few
15109         places where we had to.
15110
15111         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15112
15113 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15114
15115         * expression.cs: Use StoreFromPtr instead of extracting the type
15116         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15117
15118         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15119         an enumeration value to a System.Enum, but System.Enum is not a
15120         value type, but an class type, so we need to box.
15121
15122         (Expression.ConvertExplicit): One codepath could return
15123         errors but not flag them.  Fix this.  Fixes #31853
15124
15125         * parameter.cs (Resolve): Do not allow void as a parameter type.
15126
15127 2002-10-06  Martin Baulig  <martin@gnome.org>
15128
15129         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15130         if it's a class type and not a struct.  Fixes #31815.
15131
15132 2002-10-06  Martin Baulig  <martin@gnome.org>
15133
15134         * statement.cs: Reworked the flow analysis code a bit to make it
15135         usable for dead code elimination.
15136
15137 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15138
15139         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15140
15141 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15144         to fix the test 165, will investigate deeper.
15145
15146 2002-10-04  Martin Baulig  <martin@gnome.org>
15147
15148         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15149         finally blocks actually work.
15150         (Try.Resolve): We don't need to create a sibling for `finally' if
15151         there is no finally block.
15152
15153 2002-10-04  Martin Baulig  <martin@gnome.org>
15154
15155         * class.cs (Constructor.Define): The default accessibility for a
15156         non-default constructor is private, not public.
15157
15158 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * class.cs (Constructor): Make AllowedModifiers public, add
15161         EXTERN.
15162
15163         * cs-parser.jay: Perform the modifiers test here, as the
15164         constructor for the Constructor class usually receives a zero
15165         because of the way we create it (first we create, later we
15166         customize, and we were never checking the modifiers).
15167
15168         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15169         is a version of LookupTypeReflection that includes the type-name
15170         cache.  This can be used as a fast path for functions that know
15171         the fully qualified name and are only calling into *.GetType() to
15172         obtain a composed type.
15173
15174         This is also used by TypeManager.LookupType during its type
15175         composition.
15176
15177         (LookupType): We now also track the real type name, as sometimes
15178         we can get a quey for the real type name from things like
15179         ComposedCast.  This fixes bug 31422.
15180
15181         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15182         complete type fullname, it does not have to go through the type
15183         resolution system to obtain the composed version of the type (for
15184         obtaining arrays or pointers).
15185
15186         (Conditional.Emit): Use the EmitBoolExpression to
15187         generate nicer code, as requested by Paolo.
15188
15189         (ArrayCreation.CheckIndices): Use the patch from
15190         hwang_rob@yahoo.ca to validate the array initializers. 
15191
15192 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * class.cs (ConstructorInitializer.Emit): simplify code by using
15195         Invocation.EmitCall, and at the same time, fix the bugs in calling
15196         parent constructors that took variable arguments. 
15197
15198         * ecore.cs (Expression.ConvertNumericExplicit,
15199         Expression.ImplicitNumericConversion): Remove the code that
15200         manually wrapped decimal (InternalTypeConstructor call is now gone
15201         as well).
15202
15203         * expression.cs (Cast.TryReduce): Also handle decimal types when
15204         trying to perform a constant fold on the type.
15205
15206         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15207
15208         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15209         that only turned off an error report, and did nothing else. 
15210
15211 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15212
15213         * driver.cs: Handle and ignore /fullpaths
15214
15215 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15216
15217         * expression.cs (Binary.ResolveOperator): Catch the case where
15218         DoNumericPromotions returns true, 
15219
15220         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15221
15222 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15225         report error 70.
15226
15227 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15228
15229         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15230         conversion exists, but it is also required that the conversion be
15231         performed.  This manifested in "(Type64Enum) 2".  
15232
15233         * class.cs (TypeManager.AddMethod): The fix is not to change
15234         AddEnum, because that one was using a fully qualified name (every
15235         DeclSpace derivative does), but to change the AddMethod routine
15236         that was using an un-namespaced name.  This now correctly reports
15237         the duplicated name.
15238
15239         Revert patch until I can properly fix it.  The issue
15240         is that we have a shared Type space across all namespaces
15241         currently, which is wrong.
15242
15243         Options include making the Namespace a DeclSpace, and merge
15244         current_namespace/current_container in the parser.
15245
15246 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * cs-parser.jay: Improve error reporting when we get a different
15249         kind of expression in local_variable_type and
15250         local_variable_pointer_type. 
15251
15252         Propagate this to avoid missleading errors being reported.
15253
15254         * ecore.cs (ImplicitReferenceConversion): treat
15255         TypeManager.value_type as a target just like object_type.   As
15256         code like this:
15257
15258         ValueType v = 1;
15259
15260         Is valid, and needs to result in the int 1 being boxed before it
15261         is assigned to the value type v.
15262
15263         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15264         to validate the enumeration name.
15265
15266         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15267         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15268         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15269
15270         * ecore.cs (TryImplicitIntConversion): When doing an
15271         implicit-enumeration-conversion, check if the type is 64-bits and
15272         perform a conversion before passing to EnumConstant.
15273
15274 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15275
15276         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15277         report ambiguous type references.  Unlike the MS version, we
15278         report what the ambiguity is.   Innovation at work ;-)
15279
15280         (DeclSpace.FindType): Require a location argument to
15281         display when we display an ambiguous error.
15282
15283         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15284
15285         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15286
15287         * expression.cs (EmitDynamicInitializers): Apply patch from
15288         hwang_rob@yahoo.ca that fixes the order in which we emit our
15289         initializers. 
15290
15291 2002-09-21  Martin Baulig  <martin@gnome.org>
15292
15293         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15294         delegate takes no arguments.
15295
15296 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15299         from integers.
15300
15301         * expression.cs: Extract the underlying type.
15302
15303         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15304
15305         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15306
15307 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15308
15309         * class.cs (TypeContainer.DefineType): We can not use the nice
15310         PackingSize with the size set to 1 DefineType method, because it
15311         will not allow us to define the interfaces that the struct
15312         implements.
15313
15314         This completes the fixing of bug 27287
15315
15316         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15317         means also structs.  This fixes part of the problem. 
15318         (Expresion.ImplicitReferenceConversionExists): ditto.
15319
15320         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15321         error if there were no errors reported during the type lookup
15322         process, to avoid duplicates or redundant errors.  Without this
15323         you would get an ambiguous errors plus a type not found.  We have
15324         beaten the user enough with the first error.  
15325
15326         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15327         reference. 
15328
15329         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15330         during the resolution process, stop the lookup, this avoids
15331         repeated error reports (same error twice).
15332
15333         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15334
15335         * typemanager.cs (LookupType): Redo the type lookup code to match
15336         the needs of System.Reflection.  
15337
15338         The issue is that System.Reflection requires references to nested
15339         types to begin with a "+" sign instead of a dot.  So toplevel
15340         types look like: "NameSpace.TopLevelClass", and nested ones look
15341         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15342         levels. 
15343
15344 2002-09-19  Martin Baulig  <martin@gnome.org>
15345
15346         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15347         says that a method always returns or always throws an exception,
15348         don't report the CS0161.
15349
15350         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15351         set `Returns = new_returns'.
15352
15353 2002-09-19  Martin Baulig  <martin@gnome.org>
15354
15355         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15356         to an enum constant, check for a CS0176.
15357
15358 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15359
15360         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15361         for operators that must be in pairs and report errors.
15362
15363         * ecore.cs (SimpleName.DoResolveType): During the initial type
15364         resolution process, when we define types recursively, we must
15365         check first for types in our current scope before we perform
15366         lookups in the enclosing scopes.
15367
15368         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15369
15370         (Invocation.VerifyArgumentsCompat): Call
15371         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15372         I thought we were supposed to always call this, but there are a
15373         few places in the code where we dont do it.
15374
15375 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15376
15377         * driver.cs: Add support in -linkres and -resource to specify the
15378         name of the identifier.
15379
15380 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15381
15382         * ecore.cs (StandardConversionExists): Sync with the conversion
15383         code: allow anything-* to void* conversions.
15384
15385         (FindMostSpecificSource): Use an Expression argument
15386         instead of a Type, because we might be handed over a Literal which
15387         gets a few more implicit conversions that plain types do not.  So
15388         this information was being lost.
15389
15390         Also, we drop the temporary type-holder expression when not
15391         required.
15392
15393 2002-09-17  Martin Baulig  <martin@gnome.org>
15394
15395         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15396         this is an explicit interface implementation.
15397
15398 2002-09-17  Martin Baulig  <martin@gnome.org>
15399
15400         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15401         different `IndexerName' attributes.
15402
15403         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15404         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15405         virtual CommonResolve().
15406
15407 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15408
15409         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15410         and convert that to the UnderlyingType.
15411
15412         * statement.cs (Foreach.Resolve): Indexers are just like variables
15413         or PropertyAccesses.
15414
15415         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15416         inside quoted strings, we were not doing this before.
15417
15418 2002-09-16  Martin Baulig  <martin@gnome.org>
15419
15420         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15421         resolve it.  This is needed for the definite assignment check of the
15422         instance expression, fixes bug #29846.
15423         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15424
15425 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15426
15427         * parameter.cs: Fix compile error.  Cannot reference static member
15428         from an instance object.  Is this an mcs bug?
15429
15430 2002-09-14  Martin Baulig  <martin@gnome.org>
15431
15432         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15433         multiple times.  Fixes bug #30295, added test-166.cs.
15434
15435 2002-09-14  Martin Baulig  <martin@gnome.org>
15436
15437         * statement.cs (Block.Emit): Don't emit unreachable code.
15438         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15439         `break' statements.
15440         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15441
15442 2002-09-14  Martin Baulig  <martin@gnome.org>
15443
15444         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15445         is set.
15446
15447 2002-09-14  Martin Baulig  <martin@gnome.org>
15448
15449         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15450         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15451         be false on the ms runtime.
15452
15453 2002-09-13  Martin Baulig  <martin@gnome.org>
15454
15455         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15456         the CS0038 error message.
15457
15458 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15459
15460         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15461         constant inside, return it.
15462
15463 2002-09-12  Martin Baulig  <martin@gnome.org>
15464
15465         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15466         implicit conversion can be done between enum types.
15467
15468         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15469         check whether an implicit conversion to the current enum's UnderlyingType
15470         exists and report an error if not.
15471
15472         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15473         without debugging support.
15474
15475         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15476         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15477
15478 2002-09-12  Martin Baulig  <martin@gnome.org>
15479
15480         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15481
15482         * ecore.cs (IMemberExpr.DeclaringType): New property.
15483         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15484         nonstatic member of an outer type (CS0038).
15485
15486 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15487
15488         * driver.cs: Activate the using-error detector at warning level
15489         4 (at least for MS-compatible APIs).
15490
15491         * namespace.cs (VerifyUsing): Small buglett fix.
15492
15493         * pending.cs (PendingImplementation): pass the container pointer. 
15494
15495         * interface.cs (GetMethods): Allow for recursive definition.  Long
15496         term, I would like to move every type to support recursive
15497         definitions, not the current ordering mechanism that we have right
15498         now.
15499
15500         The situation is this: Attributes are handled before interfaces,
15501         so we can apply attributes to interfaces.  But some attributes
15502         implement interfaces, we will now handle the simple cases
15503         (recursive definitions will just get an error).  
15504
15505         * parameter.cs: Only invalidate types at the end if we fail to
15506         lookup all types.  
15507
15508 2002-09-09  Martin Baulig  <martin@gnome.org>
15509
15510         * ecore.cs (PropertyExpr.Emit): Also check for
15511         TypeManager.system_int_array_get_length so this'll also work when
15512         compiling corlib.  Fixes #30003.
15513
15514 2002-09-09  Martin Baulig  <martin@gnome.org>
15515
15516         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15517         and throw an exception if we can't get the type's size.  Fixed #30040,
15518         added test-165.cs.
15519
15520 2002-09-09  Martin Baulig  <martin@gnome.org>
15521
15522         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15523
15524         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15525         context.  Fixes bug #30027.
15526
15527         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15528         virtual functions.  Fixes bug #30043, added test-164.cs.
15529
15530 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15531
15532         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15533
15534 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15535
15536         * driver.cs: Use an object to get the windows codepage since it's not a
15537         static property.
15538
15539 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * statement.cs (For.Emit): for infinite loops (test == null)
15542         return whether there is a break inside, not always "true".
15543
15544         * namespace.cs (UsingEntry): New struct to hold the name of the
15545         using definition, the location where it is defined, and whether it
15546         has been used in a successful type lookup.
15547
15548         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15549         strings.
15550
15551         * decl.cs: ditto.
15552
15553 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15554
15555         * attribute.cs : Fix incorrect code which relied on catching
15556         a NullReferenceException to detect a null being passed in
15557         where an object was expected.
15558
15559 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15560
15561         * statement.cs (Try): flag the catch variable as assigned
15562
15563         * expression.cs (Cast): Simplified by using ResolveType instead of
15564         manually resolving.
15565
15566         * statement.cs (Catch): Fix bug by using ResolveType.
15567
15568 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15569
15570         * expression.cs (BetterConversion): Special case for when we have
15571         a NullLiteral as the argument and we have to choose between string
15572         and object types - we choose string the way csc does.
15573
15574         * attribute.cs (Attribute.Resolve): Catch the
15575         NullReferenceException and report error #182 since the Mono
15576         runtime no more has the bug and having this exception raised means
15577         we tried to select a constructor which takes an object and is
15578         passed a null.
15579
15580 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15581
15582         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15583         message (1502, 1503) when we can't locate a method after overload
15584         resolution. This is much more informative and closes the bug
15585         Miguel reported.
15586
15587         * interface.cs (PopulateMethod): Return if there are no argument
15588         types. Fixes a NullReferenceException bug.
15589
15590         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15591         expressions too. Previously we were checking only in one place for
15592         positional arguments leaving out named arguments.
15593
15594         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15595         type to the enum type is not allowed. Remove code corresponding to
15596         that.
15597
15598         (ConvertNumericExplicit): Allow explicit conversions from
15599         the underlying type to enum type. This precisely follows the spec
15600         and closes a bug filed by Gonzalo.
15601
15602 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15603
15604         * compiler.csproj:
15605         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15606
15607 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15610         it was important that we stored the right value after the
15611         reduction in `converted'.
15612
15613 2002-09-04  Martin Baulig  <martin@gnome.org>
15614
15615         * location.cs (Location.SymbolDocument): Use full pathnames for the
15616         source files.
15617
15618 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15619
15620         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15621         of the expression resolve mechanism, because that will catch the
15622         SimpleName error failures.
15623
15624         (Conditional): If we can not resolve the
15625         expression, return, do not crash.
15626
15627 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15628
15629         * cs-tokenizer.cs:
15630         (location): display token name instead of its number.
15631
15632 2002-08-28  Martin Baulig  <martin@gnome.org>
15633
15634         * expression.cs (Binary.ResolveOperator): Don't silently return
15635         but return an error if an operator cannot be applied between two
15636         enum types.
15637
15638 2002-08-28  Martin Baulig  <martin@gnome.org>
15639
15640         * class.cs (Constructor.Define): Set the permission attributes
15641         correctly instead of making all constructors public.
15642
15643 2002-08-28  Martin Baulig  <martin@gnome.org>
15644
15645         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15646         for private members before reporting a CS0103; if we find anything,
15647         it's a CS0122.
15648
15649 2002-08-28  Martin Baulig  <martin@gnome.org>
15650
15651         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15652         to check whether `closure_start_type == closure_invocation_type',
15653         we also need to check whether `m.DeclaringType == closure_invocation_type'
15654         before bypassing the permission checks.  We might be accessing
15655         protected/private members from the base class.
15656         (TypeManager.RealMemberLookup): Only set private_ok if private
15657         members were requested via BindingFlags.NonPublic.
15658
15659         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15660
15661         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15662         MethodGroupExpr.IsExplicitImpl if appropriate.
15663         (Invocation.DoResolve): Don't report the CS0120 for explicit
15664         interface implementations.
15665
15666 2002-08-27  Martin Baulig  <martin@gnome.org>
15667
15668         * expression.cs (Invocation.DoResolve): If this is a static
15669         method and we don't have an InstanceExpression, we must report
15670         a CS0120.
15671
15672 2002-08-25  Martin Baulig  <martin@gnome.org>
15673
15674         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15675         `==' between a valuetype and an object.
15676
15677 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15678
15679         * ecore.cs (TypeExpr): Provide a ToString method.
15680
15681 2002-08-24  Martin Baulig  <martin@gnome.org>
15682
15683         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15684         now called proggie.dbg and it's a binary file.
15685
15686 2002-08-23  Martin Baulig  <martin@gnome.org>
15687
15688         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15689
15690 2002-08-23  Martin Baulig  <martin@gnome.org>
15691
15692         * struct.cs (MyStructInfo.ctor): Make this work with empty
15693         structs; it's not allowed to use foreach() on null.
15694
15695 2002-08-23  Martin Baulig  <martin@gnome.org>
15696
15697         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15698         writer the full pathname of the generated assembly.
15699
15700 2002-08-23  Martin Baulig  <martin@gnome.org>
15701
15702         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15703         A `finally' block never returns or breaks; improved handling of
15704         unreachable code.
15705
15706 2002-08-23  Martin Baulig  <martin@gnome.org>
15707
15708         * statement.cs (Throw.Resolve): Allow `throw null'.
15709
15710 2002-08-23  Martin Baulig  <martin@gnome.org>
15711
15712         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15713         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15714         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15715         MemberLookup would return a wrong event if this is an explicit
15716         interface implementation and the class has an event with the same
15717         name.
15718
15719 2002-08-23  Martin Baulig  <martin@gnome.org>
15720
15721         * statement.cs (Block.AddChildVariableNames): New public method.
15722         (Block.AddChildVariableName): Likewise.
15723         (Block.IsVariableNameUsedInChildBlock): Likewise.
15724         (Block.AddVariable): Check whether a variable name has already
15725         been used in a child block.
15726
15727         * cs-parser.jay (declare_local_variables): Mark all variable names
15728         from the current block as being used in a child block in the
15729         implicit block.
15730
15731 2002-08-23  Martin Baulig  <martin@gnome.org>
15732
15733         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15734         find the symbol writer.
15735
15736         * driver.cs: csc also allows the arguments to /define being
15737         separated by commas, not only by semicolons.
15738
15739 2002-08-23  Martin Baulig  <martin@gnome.org>
15740
15741         * interface.cs (Interface.GetMembers): Added static check for events.
15742
15743 2002-08-15  Martin Baulig  <martin@gnome.org>
15744
15745         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15746         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15747
15748         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15749         why the MethodData.EmitDestructor() change was necessary.
15750
15751 2002-08-20  Martin Baulig  <martin@gnome.org>
15752
15753         * class.cs (TypeContainer.FindMembers): Added static check for events.
15754
15755         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15756
15757         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15758         use Type.GetEvents(), not Type.FindMembers().
15759
15760 2002-08-20  Martin Baulig  <martin@gnome.org>
15761
15762         * decl.cs (MemberCache): Added a special method cache which will
15763         be used for method-only searched.  This ensures that a method
15764         search will return a MethodInfo with the correct ReflectedType for
15765         inherited methods.      
15766
15767 2002-08-20  Martin Baulig  <martin@gnome.org>
15768
15769         * decl.cs (DeclSpace.FindMembers): Made this public.
15770
15771 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15772
15773         * delegate.cs: fixed build on windows.
15774         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15775
15776 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15777
15778         * ecore.cs (StandardConversionExists): Return a false
15779         if we are trying to convert the void type to anything else
15780         since that is not allowed.
15781
15782         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15783         we flag error 70 in the event an event is trying to be accessed
15784         directly from outside the declaring type.
15785
15786 2002-08-20  Martin Baulig  <martin@gnome.org>
15787
15788         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15789         MemberCache from typemanager.cs to decl.cs.
15790
15791 2002-08-19  Martin Baulig  <martin@gnome.org>
15792
15793         * class.cs (TypeContainer): Implement IMemberContainer.
15794         (TypeContainer.DefineMembers): Create the MemberCache.
15795         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15796         return public members if BindingFlags.Public was given, check
15797         whether members are static.
15798
15799 2002-08-16  Martin Baulig  <martin@gnome.org>
15800
15801         * decl.cs (DeclSpace.Define): Splitted this in Define and
15802         DefineMembers.  DefineMembers is called first and initializes the
15803         MemberCache.
15804
15805         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15806         DefineMembers() on all our DeclSpaces.
15807
15808         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15809         but call DefineMembers() on all nested interfaces.  We call their
15810         Define() in our new Define() function.
15811
15812         * interface.cs (Interface): Implement IMemberContainer.
15813         (Interface.Define): Moved all code except the attribute stuf to
15814         DefineMembers().
15815         (Interface.DefineMembers): Initialize the member cache.
15816
15817         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15818         need this anymore since we can use MemberCache.FindMembers directly.
15819
15820 2002-08-19  Martin Baulig  <martin@gnome.org>
15821
15822         * typemanager.cs (MemberCache): When creating the cache for an
15823         interface type, add all inherited members.
15824         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15825         to `out bool used_cache' and documented it.
15826         (TypeManager.MemberLookup): If we already used the cache in the first
15827         iteration, we don't need to do the interfaces check.
15828
15829 2002-08-19  Martin Baulig  <martin@gnome.org>
15830
15831         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15832         here from IMemberFinder and don't implement this interface anymore.
15833         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15834
15835         * typemanager.cs (IMemberFinder): This interface is now only used by
15836         classes which actually support the member cache.
15837         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15838         since we only put DeclSpaces into this Hashtable.
15839         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15840         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15841
15842 2002-08-16  Martin Baulig  <martin@gnome.org>
15843
15844         * typemanager.cs (ICachingMemberFinder): Removed.
15845         (IMemberFinder.MemberCache): New property.
15846         (TypeManager.FindMembers): Merged this with RealFindMembers().
15847         This function will never be called from TypeManager.MemberLookup()
15848         so we can't use the cache here, just the IMemberFinder.
15849         (TypeManager.MemberLookup_FindMembers): Check whether the
15850         IMemberFinder has a MemberCache and call the cache's FindMembers
15851         function.
15852         (MemberCache): Rewrote larger parts of this yet another time and
15853         cleaned it up a bit.
15854
15855 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * driver.cs (LoadArgs): Support quoting.
15858
15859         (Usage): Show the CSC-like command line arguments.
15860
15861         Improved a few error messages.
15862
15863 2002-08-15  Martin Baulig  <martin@gnome.org>
15864
15865         * typemanager.cs (IMemberContainer.Type): New property.
15866         (IMemberContainer.IsInterface): New property.
15867
15868         The following changes are conditional to BROKEN_RUNTIME, which is
15869         defined at the top of the file.
15870
15871         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15872         class'es members, but add all members from TypeHandle.ObjectType
15873         if we're an interface.
15874         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15875         is the current type.
15876         (MemberCache.CacheEntry.Container): Removed this field.
15877         (TypeHandle.GetMembers): Include inherited members.
15878
15879 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15880
15881         * typemanager.cs: fixed compilation and added a comment on a field that
15882         is never used.
15883
15884 2002-08-15  Martin Baulig  <martin@gnome.org>
15885
15886         * class.cs (ConstructorInitializer.Resolve): In the
15887         Expression.MemberLookup call, use the queried_type as
15888         invocation_type.
15889
15890         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15891         declared' attribute, it's always true.
15892         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15893         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15894         temporary wrapper for FindMembers which tells MemberLookup whether
15895         members from the base classes are included in the return value.
15896         This will go away soon.
15897         (TypeManager.MemberLookup): Use this temporary hack here; once the
15898         new MemberCache is completed, we don't need to do the DeclaredOnly
15899         looping here anymore since the MemberCache will take care of this.
15900         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15901         (MemberCache): When creating the MemberCache for a class, get
15902         members from the current class and all its base classes.
15903         (MemberCache.CacheEntry.Container): New field.  This is a
15904         temporary hack until the Mono runtime is fixed to distinguish
15905         between ReflectedType and DeclaringType.  It allows us to use MCS
15906         with both the MS runtime and the unfixed Mono runtime without
15907         problems and without accecting performance.
15908         (MemberCache.SearchMembers): The DeclaredOnly looping from
15909         TypeManager.MemberLookup is now done here.      
15910
15911 2002-08-14  Martin Baulig  <martin@gnome.org>
15912
15913         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15914         Type.GetFields on dynamic types but get the fields from the
15915         corresponding TypeContainer.
15916         (MyStructInfo.GetStructInfo): Added check for enum types.
15917
15918         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15919         (MemberList.SyncRoot): Implemented.
15920         (TypeManager.FilterWithClosure): No need to check permissions if
15921         closure_start_type == closure_invocation_type, don't crash if
15922         closure_invocation_type is null.
15923
15924 2002-08-13  Martin Baulig  <martin@gnome.org>
15925
15926         Rewrote TypeContainer.FindMembers to use a member cache.  This
15927         gives us a speed increase of about 35% for the self-hosting MCS
15928         build and of about 15-20% for the class libs (both on GNU/Linux).
15929
15930         * report.cs (Timer): New class to get enhanced profiling.  This
15931         whole class is "TIMER" conditional since it remarkably slows down
15932         compilation speed.
15933
15934         * class.cs (MemberList): New class.  This is an IList wrapper
15935         which we're now using instead of passing MemberInfo[]'s around to
15936         avoid copying this array unnecessarily.
15937         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15938         (ICachingMemberFinder, IMemberContainer): New interface.
15939         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15940         has already been checked, otherwise use it for the name comparision.
15941         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15942         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15943         if possible.  Returns a MemberList, not a MemberInfo [].
15944         (TypeHandle): New class, implements IMemberContainer.  We create
15945         one instance of this class per type, it contains a MemberCache
15946         which is used to do the member lookups.
15947         (MemberCache): New class.  Each instance of this class contains
15948         all members of a type and a name-based hash table.
15949         (MemberCache.FindMembers): This is our new member lookup
15950         function.  First, it looks up all members of the requested name in
15951         the hash table.  Then, it walks this list and sorts out all
15952         applicable members and returns them.
15953
15954 2002-08-13  Martin Baulig  <martin@gnome.org>
15955
15956         In addition to a nice code cleanup, this gives us a performance
15957         increase of about 1.4% on GNU/Linux - not much, but it's already
15958         half a second for the self-hosting MCS compilation.
15959
15960         * typemanager.cs (IMemberFinder): New interface.  It is used by
15961         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15962         Enum, Delegate or Interface.
15963         (TypeManager.finder_to_member_finder): New PtrHashtable.
15964         (TypeManager.finder_to_container): Removed.
15965         (TypeManager.finder_to_delegate): Removed.
15966         (TypeManager.finder_to_interface): Removed.
15967         (TypeManager.finder_to_enum): Removed.
15968
15969         * interface.cs (Interface): Implement IMemberFinder.
15970
15971         * delegate.cs (Delegate): Implement IMemberFinder.
15972
15973         * enum.cs (Enum): Implement IMemberFinder.
15974
15975         * class.cs (TypeContainer): Implement IMemberFinder.
15976
15977 2002-08-12  Martin Baulig  <martin@gnome.org>
15978
15979         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15980
15981 2002-08-12  Martin Baulig  <martin@gnome.org>
15982
15983         * ecore.cs (ITypeExpression): New interface for expressions which
15984         resolve to a type.
15985         (TypeExpression): Renamed to TypeLookupExpression.
15986         (Expression.DoResolve): If we're doing a types-only lookup, the
15987         expression must implement the ITypeExpression interface and we
15988         call DoResolveType() on it.
15989         (SimpleName): Implement the new ITypeExpression interface.
15990         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15991         hack, the situation that we're only looking up types can't happen
15992         anymore when this method is called.  Moved the type lookup code to
15993         DoResolveType() and call it.
15994         (SimpleName.DoResolveType): This ITypeExpression interface method
15995         is now doing the types-only lookup.
15996         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15997         (ResolveFlags): Added MaskExprClass.
15998
15999         * expression.cs (MemberAccess): Implement the ITypeExpression
16000         interface.
16001         (MemberAccess.DoResolve): Added support for a types-only lookup
16002         when we're called via ITypeExpression.DoResolveType().
16003         (ComposedCast): Implement the ITypeExpression interface.
16004
16005         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16006         Expression.Resolve() with ResolveFlags.Type instead.
16007
16008 2002-08-12  Martin Baulig  <martin@gnome.org>
16009
16010         * interface.cs (Interface.Define): Apply attributes.
16011
16012         * attribute.cs (Attribute.ApplyAttributes): Added support for
16013         interface attributes.
16014
16015 2002-08-11  Martin Baulig  <martin@gnome.org>
16016
16017         * statement.cs (Block.Emit): Only check the "this" variable if we
16018         do not always throw an exception.
16019
16020         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16021         whether the property has a set accessor.
16022
16023 2002-08-11  Martin Baulig  <martin@gnome.org>
16024
16025         Added control flow analysis support for structs.
16026
16027         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16028         with control flow analysis turned off.
16029         (IVariable): New interface.
16030         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16031         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16032         (FieldExpr.DoResolve): Resolve the instance expression with flow
16033         analysis turned off and do the definite assignment check after the
16034         resolving when we know what the expression will resolve to.
16035
16036         * expression.cs (LocalVariableReference, ParameterReference):
16037         Implement the new IVariable interface, only call the flow analysis
16038         code if ec.DoFlowAnalysis is true.
16039         (This): Added constructor which takes a Block argument.  Implement
16040         the new IVariable interface.
16041         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16042         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16043         This does the definite assignment checks for struct members.
16044
16045         * class.cs (Constructor.Emit): If this is a non-static `struct'
16046         constructor which doesn't have any initializer, call
16047         Block.AddThisVariable() to tell the flow analysis code that all
16048         struct elements must be initialized before control returns from
16049         the constructor.
16050
16051         * statement.cs (MyStructInfo): New public class.
16052         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16053         argument to this indexer.  If non-zero, check an individual struct
16054         member, not the whole struct.
16055         (FlowBranching.CheckOutParameters): Check struct members.
16056         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16057         overloaded versions of these methods which take an additional
16058         `int field_idx' argument to check struct members.
16059         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16060         overloaded versions of these methods which take an additional
16061         `string field_name' argument to check struct member.s
16062         (VariableInfo): Implement the IVariable interface.
16063         (VariableInfo.StructInfo): New public property.  Returns the
16064         MyStructInfo instance of the variable if it's a struct or null.
16065         (Block.AddThisVariable): New public method.  This is called from
16066         Constructor.Emit() for non-static `struct' constructor which do
16067         not have any initializer.  It creates a special variable for the
16068         "this" instance variable which will be checked by the flow
16069         analysis code to ensure that all of the struct's fields are
16070         initialized before control returns from the constructor.
16071         (UsageVector): Added support for struct members.  If a
16072         variable/parameter is a struct with N members, we reserve a slot
16073         in the usage vector for each member.  A struct is considered fully
16074         initialized if either the struct itself (slot 0) or all its
16075         members are initialized.
16076
16077 2002-08-08  Martin Baulig  <martin@gnome.org>
16078
16079         * driver.cs (Driver.MainDriver): Only report an error CS5001
16080         if there were no compilation errors.
16081
16082         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16083         `UnsafeContext' property to determine whether the parent is in
16084         unsafe context rather than checking the parent's ModFlags:
16085         classes nested in an unsafe class are unsafe as well.
16086
16087 2002-08-08  Martin Baulig  <martin@gnome.org>
16088
16089         * statement.cs (UsageVector.MergeChildren): Distinguish between
16090         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16091         we return.  Added test17() and test18() to test-154.cs.
16092
16093 2002-08-08  Martin Baulig  <martin@gnome.org>
16094
16095         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16096         Family access, make sure the invoking type isn't a subclass of the
16097         queried type (that'd be a CS1540).
16098
16099         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16100         this method which takes an additional `Type invocation_type'.
16101
16102         * expression.cs (BaseAccess.DoResolve): Use the base type as
16103         invocation and query type.
16104         (MemberAccess.DoResolve): If the lookup failed and we're about to
16105         report a CS0122, try a lookup with the ec.ContainerType - if this
16106         succeeds, we must report a CS1540.
16107
16108 2002-08-08  Martin Baulig  <martin@gnome.org>
16109
16110         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16111         (MethodGroupExpr): Implement the IMemberExpr interface.
16112
16113         * expression (MemberAccess.ResolveMemberAccess): No need to have
16114         any special code for MethodGroupExprs anymore, they're now
16115         IMemberExprs.   
16116
16117 2002-08-08  Martin Baulig  <martin@gnome.org>
16118
16119         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16120         Family, FamANDAssem and FamORAssem permissions.
16121         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16122
16123 2002-08-08  Martin Baulig  <martin@gnome.org>
16124
16125         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16126         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16127         or loop block.
16128
16129 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16130
16131         * driver.cs: implemented /resource option to embed managed resources.
16132
16133 2002-08-07  Martin Baulig  <martin@gnome.org>
16134
16135         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16136         (FieldBase.HasFieldInitializer): New public property.
16137         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16138         returns the field initializer and makes sure it is only resolved once.
16139         (TypeContainer.EmitFieldInitializers): Call
16140         FieldBase.GetInitializerExpression to get the initializer, this ensures
16141         that it isn't resolved multiple times.
16142
16143         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16144         the resolving process (SimpleName/MemberLookup) that we're currently
16145         emitting a field initializer (which must not access any instance members,
16146         this is an error CS0236).
16147
16148         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16149         argument, if the `IsFieldInitializer' flag is set, we must report and
16150         error CS0236 and not an error CS0120.   
16151
16152 2002-08-07  Martin Baulig  <martin@gnome.org>
16153
16154         * ecore.cs (IMemberExpr): New public interface.
16155         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16156         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16157         if the expression is an IMemberExpr.
16158
16159         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16160         to be null, implicitly default to `this' if we're non-static in
16161         this case.  Simplified the code a lot by using the new IMemberExpr
16162         interface.  Also fixed bug #28176 here.
16163
16164 2002-08-06  Martin Baulig  <martin@gnome.org>
16165
16166         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16167         ParameterReferences during semantic analysis so that we can do a
16168         type-only search when resolving Cast, TypeOf and SizeOf.
16169         (block): Pass the `current_local_parameters' to the Block's
16170         constructor.
16171
16172         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16173         argument to the constructor.
16174         (ConstructorInitializer.Resolve): Create a temporary implicit
16175         block with the parameters.
16176
16177         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16178         references here if we aren't doing a type-only search.
16179
16180         * statement.cs (Block): Added constructor which takes a
16181         `Parameters parameters' argument.
16182         (Block.Parameters): New public property.
16183
16184         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16185         to `Parameters' and made it public readonly.
16186
16187 2002-08-06  Martin Baulig  <martin@gnome.org>
16188
16189         * ecore.cs (Expression.Warning): Made this public as well.
16190
16191         * report.cs (Report.Debug): Print the contents of collections.
16192
16193 2002-08-06  Martin Baulig  <martin@gnome.org>
16194
16195         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16196         used to tell Resolve() which kinds of expressions it may return.
16197         (Expression.Resolve): Added overloaded version of this method which
16198         takes a `ResolveFlags flags' argument.  This can be used to tell
16199         Resolve() which kinds of expressions it may return.  Reports a
16200         CS0118 on error.
16201         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16202         ResolveFlags.SimpleName.
16203         (Expression.Error118): Added overloaded version of this method which
16204         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16205         which kinds of expressions are allowed.
16206
16207         * expression.cs (Argument.ResolveMethodGroup): New public method.
16208         Resolves an argument, but allows a MethodGroup to be returned.
16209         This is used when invoking a delegate.
16210
16211         * TODO: Updated a bit.
16212
16213 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16214
16215         Fixed compilation with csc.
16216
16217         * ecore.cs: Expression.Error made public. Is this correct? Should
16218         Warning be made public too?
16219
16220         * expression.cs: use ea.Location instead of ea.loc.
16221         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16222
16223 2002-08-06  Martin Baulig  <martin@gnome.org>
16224
16225         * ecore.cs (Expression.loc): Moved the location here instead of
16226         duplicating it in all derived classes.
16227         (Expression.Location): New public property.
16228         (Expression.Error, Expression.Warning): Made them non-static and
16229         removed the location argument.
16230         (Expression.Warning): Added overloaded version which takes an
16231         `int level' argument.
16232         (Expression.Error118): Make this non-static and removed the
16233         expression and location arguments.
16234         (TypeExpr): Added location argument to the constructor.
16235
16236         * expression.cs (StaticCallExpr): Added location argument to
16237         the constructor.
16238         (Indirection, PointerArithmetic): Likewise.
16239         (CheckedExpr, UnCheckedExpr): Likewise.
16240         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16241         (StringPtr): Likewise.
16242
16243
16244 2002-08-05  Martin Baulig  <martin@gnome.org>
16245
16246         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16247
16248         * assign.cs (Assign.DoResolve): Check whether the source
16249         expression is a value or variable.
16250
16251         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16252         while resolving the corresponding blocks.
16253
16254         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16255         an error, don't silently return null.
16256
16257         * statement.cs (Block.AddVariable): Do the error reporting here
16258         and distinguish between CS0128 and CS0136.
16259         (Block.DoResolve): Report all unused labels (warning CS0164).
16260         (LabeledStatement): Pass the location to the constructor.
16261         (LabeledStatement.HasBeenReferenced): New property.
16262         (LabeledStatement.Resolve): Set it to true here.
16263
16264         * statement.cs (Return.Emit): Return success even after reporting
16265         a type mismatch error (CS0126 or CS0127), this is what csc does and
16266         it avoids confusing the users with any consecutive errors.
16267
16268 2002-08-05  Martin Baulig  <martin@gnome.org>
16269
16270         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16271
16272         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16273
16274         * expression.cs (MemberAccess.DoResolve): Silently return if an
16275         error has already been reported.
16276
16277         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16278         error has already been reported.
16279
16280 2002-08-05  Martin Baulig  <martin@gnome.org>
16281
16282         * statement.cs (UsageVector): Only initialize the `parameters'
16283         vector if we actually have any "out" parameters.
16284
16285 2002-08-05  Martin Baulig  <martin@gnome.org>
16286
16287         * expression.cs (Binary.ResolveOperator): When combining delegates,
16288         they must have the same type.
16289
16290 2002-08-05  Martin Baulig  <martin@gnome.org>
16291
16292         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16293         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16294         work with the ms runtime and we also don't need it: if we're a
16295         PropertyBuilder and not in the `indexer_arguments' hash, then we
16296         are a property and not an indexer.
16297
16298         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16299         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16300         since the latter one doesn't work with the ms runtime.
16301
16302 2002-08-03  Martin Baulig  <martin@gnome.org>
16303
16304         Fixed bugs #27998 and #22735.
16305
16306         * class.cs (Method.IsOperator): New public field.
16307         (Method.CheckBase): Report CS0111 if there's already a method
16308         with the same parameters in the current class.  Report CS0508 when
16309         attempting to change the return type of an inherited method.
16310         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16311         and it's not marked abstract or extern.
16312         (PropertyBase): New abstract base class for Property and Indexer.
16313         (PropertyBase.CheckBase): Moved here from Property and made it work
16314         for indexers.
16315         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16316         the same so we can reuse it there.
16317         (Property, Indexer): Derive from PropertyBase.
16318         (MethodSignature.inheritable_property_signature_filter): New delegate
16319         to find properties and indexers.
16320
16321         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16322         argument and improved error reporting.
16323
16324         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16325         EmptyReadOnlyParameters and made it a property.
16326
16327         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16328         version of this method which takes a `PropertyInfo indexer'.
16329         (TypeManager.RegisterIndexer): New method.
16330
16331         * class.cs: Added myself as author of this file :-)
16332
16333 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16334
16335         * class.cs: fixed compilation on windoze.
16336
16337 2002-08-03  Martin Baulig  <martin@gnome.org>
16338
16339         * interface.cs (Interface.GetInterfaceBases): Check whether all
16340         base interfaces are at least as accessible than the current one.
16341
16342         * class.cs (TypeContainer.GetClassBases): Check whether base types
16343         are at least as accessible than the current type.
16344         (TypeContainer.AsAccessible): Implemented and made non-static.
16345         (MemberBase.CheckParameters): Report errors if the accessibility
16346         checks fail.
16347
16348         * delegate.cs (Delegate.Delegate): The default visibility is
16349         internal for top-level types and private for nested types.
16350         (Delegate.Define): Report errors if the accessibility checks fail.
16351
16352         * enum.cs (Enum.Enum): The default visibility is internal for
16353         top-level types and private for nested types.
16354         (Enum.DefineType): Compute the correct visibility.
16355
16356         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16357         function which takes a `bool is_toplevel' instead of a TypeContainer.
16358
16359         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16360         builtin type.
16361
16362 2002-08-02  Martin Baulig  <martin@gnome.org>
16363
16364         * expression.cs (LocalVariableReferenc): Added constructor which
16365         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16366         (LocalVariableReference.IsReadOnly): New property.
16367         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16368         variable is readonly, use our own readonly flag to do this; you can
16369         use the new constructor to get a writable reference to a read-only
16370         variable.
16371
16372         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16373         reference to the local variable.
16374
16375 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * rootcontext.cs (ResolveCore): Also include System.Exception
16378
16379         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16380         we reach an EmptyStatement.
16381
16382         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16383         is also fine.
16384
16385         * expression.cs (Binary.ResolveOperator): Check error result in
16386         two places.
16387
16388         use brtrue/brfalse directly and avoid compares to null.
16389
16390 2002-08-02  Martin Baulig  <martin@gnome.org>
16391
16392         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16393         Fixes bug #28407, added test-155.cs.
16394
16395 2002-08-01  Martin Baulig  <martin@gnome.org>
16396
16397         * class.cs (Event.EmitDefaultMethod): Make this work with static
16398         events.  Fixes #28311, added verify-3.cs.
16399
16400 2002-08-01  Martin Baulig  <martin@gnome.org>
16401
16402         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16403         `is_disposable' fields.
16404         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16405         `hm.is_disposable' if we're using the collection pattern.
16406         (Foreach.EmitCollectionForeach): Use the correct type for the
16407         enumerator's local variable, only emit the try/finally block if
16408         necessary (fixes #27713).
16409
16410 2002-08-01  Martin Baulig  <martin@gnome.org>
16411
16412         * ecore.cs (Expression.report118): Renamed to Error118 and made
16413         it public static.
16414
16415         * statement.cs (Throw.Resolve): Check whether the expression is of
16416         the correct type (CS0118) and whether the type derives from
16417         System.Exception (CS0155).
16418         (Catch.Resolve): New method.  Do the type lookup here and check
16419         whether it derives from System.Exception (CS0155).
16420         (Catch.CatchType, Catch.IsGeneral): New public properties.
16421
16422         * typemanager.cs (TypeManager.exception_type): Added.
16423
16424 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16425
16426         * driver.cs: Updated About function.
16427
16428 2002-07-31  Martin Baulig  <martin@gnome.org>
16429
16430         Implemented Control Flow Analysis.
16431
16432         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16433         (EmitContext.CurrentBranching): Added.
16434         (EmitContext.StartFlowBranching): Added.
16435         (EmitContext.EndFlowBranching): Added.
16436         (EmitContext.KillFlowBranching): Added.
16437         (EmitContext.IsVariableAssigned): Added.
16438         (EmitContext.SetVariableAssigned): Added.
16439         (EmitContext.IsParameterAssigned): Added.
16440         (EmitContext.SetParameterAssigned): Added.
16441         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16442         Added control flow analysis stuff here.
16443
16444         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16445         resolve the expression as lvalue.
16446         (LocalVariableReference.DoResolve): Check whether the variable has
16447         already been assigned.
16448         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16449         the parameter as assigned here.
16450         (ParameterReference.DoResolve): Check whether the parameter has already
16451         been assigned.
16452         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16453         expression as lvalue.
16454
16455         * statement.cs (FlowBranching): New class for the flow analysis code.
16456         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16457         (LabeledStatement.IsDefined): New public property.
16458         (LabeledStatement.AddUsageVector): New public method to tell flow
16459         analyis that the label may be reached via a forward jump.
16460         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16461         flow analysis.
16462         (VariableInfo.Number): New public field.  This is used by flow analysis
16463         to number all locals of a block.
16464         (Block.CountVariables): New public property.  This is the number of
16465         local variables in this block (including the locals from all parent
16466         blocks).
16467         (Block.EmitMeta): Number all the variables.
16468
16469         * statement.cs: Added flow analysis support to all classes.
16470
16471 2002-07-31  Martin Baulig  <martin@gnome.org>
16472
16473         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16474         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16475         then use this argument.
16476
16477         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16478
16479         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16480         use this to specify /define options.
16481
16482 2002-07-29  Martin Baulig  <martin@gnome.org>
16483
16484         * statement.cs (Fixed): Moved all code that does variable lookups
16485         and resolvings from Emit to Resolve.
16486
16487         * statement.cs (For): Moved all code that does variable lookups
16488         and resolvings from Emit to Resolve.
16489
16490         * statement.cs (Using): Moved all code that does variable lookups
16491         and resolvings from Emit to Resolve.
16492
16493 2002-07-29  Martin Baulig  <martin@gnome.org>
16494
16495         * attribute.cs (Attribute.Resolve): Explicitly catch a
16496         System.NullReferenceException when creating the
16497         CustromAttributeBuilder and report a different warning message.
16498
16499 2002-07-29  Martin Baulig  <martin@gnome.org>
16500
16501         * support.cs (ParameterData.ParameterName): Added method to
16502         get the name of a parameter.
16503
16504         * typemanager.cs (TypeManager.IsValueType): New public method.
16505
16506 2002-07-29  Martin Baulig  <martin@gnome.org>
16507
16508         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16509         is a flag which specifies that it's either ref or out.
16510         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16511         the out parameter to `out Parameter.Modifier mod', also set the
16512         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16513
16514         * support.cs (InternalParameters.ParameterModifier): Distinguish
16515         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16516         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16517
16518         * expression.cs (Argument.GetParameterModifier): Distinguish
16519         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16520         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16521
16522 2002-07-29  Martin Baulig  <martin@gnome.org>
16523
16524         * expression.cs (ParameterReference.ParameterReference): Added
16525         `Location loc' argument to the constructor.
16526
16527         * cs-parser.jay: Pass location to ParameterReference.
16528
16529 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16530
16531         * statement.cs (Try): Initialize the location.
16532
16533         * cs-parser.jay: pass location to Try.
16534
16535         * expression.cs (Unary.Reduce): Change the prototype to return
16536         whether a constant fold could be performed or not.  The result is
16537         returned in an out parameters.  In the case of Indirection and
16538         AddressOf, we want to perform the full tests.
16539
16540 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * statement.cs (Statement.Emit): Flag dead code.
16543
16544 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16545
16546         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16547
16548 2002-07-27  Martin Baulig  <martin@gnome.org>
16549
16550         * class.cs (MethodData.Define): Put back call to
16551         TypeManager.AddMethod(), accidentally commented this out.
16552
16553         * report.cs (Debug): New public method to print debugging information,
16554         this is `[Conditional ("DEBUG")]'.
16555
16556 2002-07-26  Martin Baulig  <martin@gnome.org>
16557
16558         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16559         (switch_statement): Push the current_block to the switch_stack and
16560         pop it again when we're done with the switch.
16561         (switch_section): The new block is a child of the current_block.
16562         Fixes bug #24007, added test-152.cs.
16563
16564 2002-07-27  Martin Baulig  <martin@gnome.org>
16565
16566         * expression.cs (Invocation.EmitArguments): When calling a varargs
16567         function with only its fixed arguments, we need to pass an empty
16568         array.
16569
16570 2002-07-27  Martin Baulig  <martin@gnome.org>
16571
16572         Mono 0.13 has been released.
16573
16574 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16575
16576         * driver.cs: Rename --resource to --linkres, because that is what
16577         we do currently, we dont support --resource yet.
16578
16579         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16580
16581 2002-07-25  Martin Baulig  <martin@gnome.org>
16582
16583         * class.cs (MethodData): New public class.  This is a `method builder'
16584         class for a method or one accessor of a Property/Indexer/Event.
16585         (MethodData.GetMethodFlags): Moved here from MemberBase.
16586         (MethodData.ApplyAttributes): Likewise.
16587         (MethodData.ApplyObsoleteAttribute): Likewise.
16588         (MethodData.ApplyConditionalAttribute): Likewise.
16589         (MethodData.ApplyDllImportAttribute): Likewise.
16590         (MethodData.CheckAbstractAndExternal): Likewise.
16591         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16592         (MethodData.Emit): Formerly known as Method.Emit().
16593         (MemberBase): Moved everything which was specific to a single
16594         accessor/method to MethodData.
16595         (Method): Create a new MethodData and call Define() and Emit() on it.
16596         (Property, Indexer, Event): Create a new MethodData objects for each
16597         accessor and call Define() and Emit() on them.
16598
16599 2002-07-25  Martin Baulig  <martin@gnome.org>
16600
16601         Made MethodCore derive from MemberBase to reuse the code from there.
16602         MemberBase now also checks for attributes.
16603
16604         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16605         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16606         as virtual.
16607         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16608         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16609         (MemberBase.ApplyAttributes): New virtual method; applies the
16610         attributes to a method or accessor.
16611         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16612         (MemberBase.ApplyConditionalAttribute): Likewise.
16613         (MemberBase.ApplyDllImportAttribute): Likewise.
16614         (MemberBase.CheckAbstractAndExternal): Likewise.
16615         (MethodCore.ParameterTypes): This is now a property instead of a
16616         method, it's initialized from DoDefineParameters().
16617         (MethodCore.ParameterInfo): Removed the set accessor.
16618         (MethodCore.DoDefineParameters): New protected virtual method to
16619         initialize ParameterTypes and ParameterInfo.
16620         (Method.GetReturnType): We can now simply return the MemberType.
16621         (Method.GetMethodFlags): Override the MemberBase version and add
16622         the conditional flags.
16623         (Method.CheckBase): Moved some code from Define() here, call
16624         DoDefineParameters() here.
16625         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16626         here to avoid some larger code duplication.
16627         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16628         ensure that abstract and external accessors don't declare a body.
16629
16630         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16631         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16632         lookup in the attribute's parent classes, so we need to abort as soon
16633         as we found the first match.
16634         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16635         the attribute has no arguments.
16636
16637         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16638         of a Method.
16639
16640 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16641
16642         * cs-parser.jay: reverted previous patch.
16643
16644 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16645
16646         * cs-parser.jay: fixed bug #22119.
16647
16648 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16649
16650         * attribute.cs: fixed compilation. The error was:
16651         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16652         be assigned to before control leaves the current method."
16653         [FIXME:  Filed as bug #28186: MCS must report this error.]
16654
16655 2002-07-25  Martin Baulig  <martin@gnome.org>
16656
16657         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16658         method to pull the condition name ouf of a Conditional attribute.
16659         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16660         the obsolete message and error flag out of an Obsolete attribute.
16661
16662         * class.cs (Method.GetMethodFlags): New public method to get the
16663         TypeManager.MethodFlags for this method.
16664         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16665         private methods.
16666         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16667         if we're overriding a virtual function, set the new private variable
16668         `parent_method'; call the new TypeManager.AddMethod().
16669
16670         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16671         the MethodBuilder and the Method in a PtrHashtable.
16672         (TypeManager.builder_to_method): Added for this purpose.
16673         (TypeManager.MethodFlags): Added IsObsoleteError.
16674         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16675         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16676         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16677         the message from the attribute.
16678
16679 2002-07-24  Martin Baulig  <martin@gnome.org>
16680
16681         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16682         preprocessor directives, ensure that the argument to #define/#undef is
16683         exactly one identifier and that it's actually an identifier.
16684
16685         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16686         did not work ....
16687
16688 2002-07-24  Martin Baulig  <martin@gnome.org>
16689
16690         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16691         initialize it to TypeManager.object_type in the constructor.
16692         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16693         of the `hm.get_current' method if we're using the collection pattern.
16694         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16695         for the explicit conversion to make it work when we're using the collection
16696         pattern and the `Current' property has a different return type than `object'.
16697         Fixes #27713.
16698
16699 2002-07-24  Martin Baulig  <martin@gnome.org>
16700
16701         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16702         does not match, but don't report any errors.  This method is called in
16703         order for all methods in a MethodGroupExpr until a matching method is
16704         found, so we don't want to bail out if the first method doesn't match.
16705         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16706         matches, report the 123.  Fixes #28070.
16707
16708 2002-07-24  Martin Baulig  <martin@gnome.org>
16709
16710         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16711         TypeManager.TypeToCoreType() to the top of the method so the
16712         following equality checks will work.  Fixes #28107.
16713
16714 2002-07-24  Martin Baulig  <martin@gnome.org>
16715
16716         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16717         operand is of type uint, and the other operand is of type sbyte,
16718         short or int, the operands are converted to type long." -
16719         Actually do what this comment already told us.  Fixes bug #28106,
16720         added test-150.cs.
16721
16722 2002-07-24  Martin Baulig  <martin@gnome.org>
16723
16724         * class.cs (MethodBase): New abstract class.  This is now a base
16725         class for Property, Indexer and Event to avoid some code duplication
16726         in their Define() and DefineMethods() methods.
16727         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16728         generic methods for Define() and DefineMethods().
16729         (FieldBase): Derive from MemberBase, not MemberCore.
16730         (Property): Derive from MemberBase, not MemberCore.
16731         (Property.DefineMethod): Moved all the code from this method to the
16732         new MethodBase.DefineAccessor(), just call it with appropriate
16733         argumetnts.
16734         (Property.Define): Call the new Property.DoDefine(), this does some
16735         sanity checks and we don't need to duplicate the code everywhere.
16736         (Event): Derive from MemberBase, not MemberCore.
16737         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16738         accessors, this will also make them work with interface events.
16739         (Indexer): Derive from MemberBase, not MemberCore.
16740         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16741         (Indexer.Define): Use the new MethodBase functions.
16742
16743         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16744         argument to the constructor.
16745         (Interface.FindMembers): Added support for interface events.
16746         (Interface.PopluateEvent): Implemented.
16747
16748         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16749
16750 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16753         but this is required to check for a method name being the same as
16754         the containing class.  
16755
16756         Handle this now.
16757
16758 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16759
16760         * interface.cs: initialize variable.
16761
16762 2002-07-23  Martin Baulig  <martin@gnome.org>
16763
16764         Implemented the IndexerName attribute in interfaces.
16765
16766         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16767         name if this is an explicit interface implementation.
16768         (Indexer.InterfaceIndexerName): New public variable.  If we're
16769         implementing an interface indexer, this is the IndexerName in that
16770         interface.  Otherwise, it's the IndexerName.
16771         (Indexer.DefineMethod): If we're implementing interface indexer,
16772         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16773         and Pending.ImplementIndexer methods.
16774         (Indexer.Define): Also define the PropertyBuilder if we're
16775         implementing an interface indexer and this is neither an explicit
16776         interface implementation nor do the IndexerName match the one in
16777         the interface.
16778
16779         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16780         If a method is defined here, then we always need to create a proxy
16781         for it.  This is used when implementing interface indexers.
16782         (Pending.IsInterfaceIndexer): New public method.
16783         (Pending.ImplementIndexer): New public method.
16784         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16785         This is used when implementing interface indexers to define a proxy
16786         if necessary.
16787         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16788         define a proxy if necessary.
16789
16790         * interface.cs (Interface.IndexerName): New public variable.
16791         (Interface.PopulateIndexer): Set the IndexerName.
16792         (Interface.DefineIndexers): New private method.  Populate all the
16793         indexers and make sure their IndexerNames match.
16794
16795         * typemanager.cs (IndexerPropertyName): Added support for interface
16796         indexers.
16797
16798 2002-07-22  Martin Baulig  <martin@gnome.org>
16799
16800         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16801         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16802         ret if HasReturnLabel.
16803         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16804         variables.
16805
16806         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16807         and set the ec.LoopBeginTryCatchLevel.
16808         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16809         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16810         the current ec.TryCatchLevel, the branch goes out of an exception
16811         block.  In this case, we need to use Leave and not Br.
16812
16813 2002-07-22  Martin Baulig  <martin@gnome.org>
16814
16815         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16816         block unless the block does not always return or it is contained in
16817         another try { ... } catch { ... } block.  Fixes bug #26506.
16818         Added verify-1.cs to the test suite.
16819
16820 2002-07-22  Martin Baulig  <martin@gnome.org>
16821
16822         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16823         then we do not always return.  Fixes bug #24985.
16824
16825 2002-07-22  Martin Baulig  <martin@gnome.org>
16826
16827         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16828         lookup on a per-class level; ie. walk up the class hierarchy until we
16829         found at least one applicable method, then choose the best among them.
16830         Fixes bug #24463 and test-29.cs.
16831
16832 2002-07-22  Martin Baulig  <martin@gnome.org>
16833
16834         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16835         return types of the methods.  The return type is not part of the
16836         signature and we must not check it to make the `new' modifier work.
16837         Fixes bug #27999, also added test-147.cs.
16838         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16839
16840         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16841         on the method's return type.
16842
16843 2002-07-21  Martin Baulig  <martin@gnome.org>
16844
16845         * assign.cs: Make this work if the rightmost source is a constant and
16846         we need to do an implicit type conversion.  Also adding a few more tests
16847         to test-38.cs which should have caught this.
16848
16849         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16850         target in the makefile for this.  The makefile.gnu is primarily intended
16851         for end-users who don't want to debug the compiler.
16852
16853 2002-07-21  Martin Baulig  <martin@gnome.org>
16854
16855         * assign.cs: Improved the Assign class so it can now handle embedded
16856         assignments (X = Y = Z = something).  As a side-effect this'll now also
16857         consume less local variables.  test-38.cs now passes with MCS, added
16858         a few new test cases to that test.
16859
16860 2002-07-20  Martin Baulig  <martin@gnome.org>
16861
16862         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16863         instructions.  Fixes bug #27977, also added test-146.cs.
16864
16865 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16866
16867         * cs-tokenizer.cs: fixed getHex ().
16868
16869 2002-07-19  Martin Baulig  <martin@gnome.org>
16870
16871         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16872         not Type.GetType() to lookup the array type.  This is needed when
16873         we're constructing an array of a user-defined type.
16874         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16875         single-dimensional arrays, but also for single-dimensial arrays of
16876         type decimal.
16877
16878 2002-07-19  Martin Baulig  <martin@gnome.org>
16879
16880         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16881         this function is called, it's not allowed to share LocalBuilders
16882         among ILGenerators.
16883
16884 2002-07-19  Martin Baulig  <martin@gnome.org>
16885
16886         * expression.cs (Argument.Resolve): Report an error 118 when trying
16887         to pass a type as argument.
16888
16889 2002-07-18  Martin Baulig  <martin@gnome.org>
16890
16891         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16892         Conv_R_Un for the signed `long' type.
16893
16894 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16897         `expr' for the temporary result, as that will fail if we do
16898         multiple resolves on the same expression.
16899
16900 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16903         ec.TypeContainer for looking up aliases. 
16904
16905         * class.cs (TypeContainer): Remove LookupAlias from here.
16906
16907         * decl.cs (DeclSpace); Move here.
16908
16909 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16910
16911         * class.cs (FindMembers): Only call filter if the constructor
16912         bulider is not null.
16913
16914         Also handle delegates in `NestedTypes' now.  Now we will perform
16915         type lookups using the standard resolution process.  This also
16916         fixes a bug.
16917
16918         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16919         This uses Expressions (the limited kind that can be parsed by the
16920         tree) instead of strings.
16921
16922         * expression.cs (ComposedCast.ToString): Implement, used to flag
16923         errors since now we have to render expressions.
16924
16925         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16926         FormArrayType. 
16927
16928         * ecore.cs (SimpleName.ToString): ditto.
16929
16930         * cs-parser.jay: Instead of using strings to assemble types, use
16931         Expressions to assemble the type (using SimpleName, ComposedCast,
16932         MemberAccess).  This should fix the type lookups in declarations,
16933         because we were using a different code path for this.
16934
16935         * statement.cs (Block.Resolve): Continue processing statements
16936         even when there is an error.
16937
16938 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16939
16940         * class.cs (Event.Define): Also remove the `remove' method from
16941         the list of pending items.
16942
16943         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16944         generate more compact code. 
16945
16946 2002-07-17  Martin Baulig  <martin@gnome.org>
16947
16948         * const.cs (Const.LookupConstantValue): Add support for constant
16949         `unchecked' and `checked' expressions.
16950         Also adding test case test-140.cs for this.
16951
16952 2002-07-17  Martin Baulig  <martin@gnome.org>
16953
16954         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16955         check whether mi.ReturnType implements the IEnumerator interface; the
16956         `==' and the IsAssignableFrom() will fail in this situation.
16957
16958 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16959
16960         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16961         here too.
16962
16963 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16964
16965         * expression.cs: fixed bug #27811.
16966
16967 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16968
16969         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16970         Molaro: when we are a ref, the value already contains a pointer
16971         value, do not take the address of it.
16972
16973 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16974         * removed mb-parser.jay and mb-tokenizer.cs
16975
16976 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16977
16978         * expression.cs: check against the building corlib void type.
16979
16980 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16981
16982         * ecore.cs: fix for valuetype static readonly fields: when 
16983         initializing them, we need their address, not the address of a copy.
16984
16985 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16986
16987         * typemanager.cs: register also enum_type in corlib.
16988
16989 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16990
16991         * class.cs: allow calling this (but not base) initializers in structs.
16992
16993 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16994
16995         * ecore.cs: make sure we compare against the building base types
16996         in GetTypeSize ().
16997
16998 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16999
17000         * typemanager.cs: fix TypeToCoreType() to handle void and object
17001         (corlib gets no more typerefs after this change).
17002
17003 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * expression.cs (ArrayCreation.EmitArrayArguments): use
17006         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17007
17008         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17009         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17010         array indexes, the runtime actually forbids them.
17011
17012         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17013         for array arguments here.
17014
17015         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17016         instead of the default for ValueTypes.
17017
17018         (New.DoEmit): Use IsValueType instead of
17019         IsSubclassOf (value_type)
17020         (New.DoResolve): ditto.
17021         (Invocation.EmitCall): ditto.
17022
17023         * assign.cs (Assign): ditto.
17024
17025         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17026         Statements *are* currently doing part of their resolution during
17027         Emit.  
17028
17029         Expressions do always resolve during resolve, but statements are
17030         only required to propagate resolution to their children.
17031
17032 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17035
17036         (LoadAssembly): Do not add the dll if it is already specified
17037
17038         (MainDriver): Add the System directory to the link path at the end,
17039         after all the other -L arguments. 
17040
17041         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17042         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17043         ldelem.u1) and using the opposite for sbytes.
17044
17045         This fixes Digger, and we can finally run it.
17046
17047         * driver.cs (UnixParseOption): Move the option parsing here.  
17048         (CSCParseOption): Implement CSC-like parsing of options.
17049
17050         We now support both modes of operation, the old Unix way, and the
17051         new CSC-like way.  This should help those who wanted to make cross
17052         platform makefiles.
17053
17054         The only thing broken is that /r:, /reference: and /lib: are not
17055         implemented, because I want to make those have the same semantics
17056         as the CSC compiler has, and kill once and for all the confussion
17057         around this.   Will be doing this tomorrow.
17058
17059         * statement.cs (Unsafe.Resolve): The state is checked during
17060         resolve, not emit, so we have to set the flags for IsUnsfe here.
17061
17062 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17063
17064         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17065         not catch the Error_ObjectRefRequired in SimpleName (as it is
17066         possible to have a class/instance variable name that later gets
17067         deambiguated), we have to check this here.      
17068
17069 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17070
17071         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17072         make static and put into Expression.
17073
17074         (Event.Define): Register the private field of the event with the 
17075         TypeManager so that GetFieldFromEvent can get at it.
17076
17077         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17078         keep track of the private field associated with an event which
17079         has no accessors.
17080
17081         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17082         private field.
17083
17084         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17085
17086 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17087
17088         * expression.cs (Binary.EmitBranchable): this routine emits the
17089         Binary expression in a branchable context.  This basically means:
17090         we need to branch somewhere, not just get the value on the stack.
17091
17092         This works together with Statement.EmitBoolExpression.
17093
17094         * statement.cs (Statement.EmitBoolExpression): Use
17095         EmitBranchable. 
17096
17097 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17098
17099         * statement.cs (For): Reduce the number of jumps in loops.
17100
17101         (For): Implement loop inversion for the For statement.
17102
17103         (Break): We can be breaking out of a Try/Catch controlled section
17104         (foreach might have an implicit try/catch clause), so we need to
17105         use Leave instead of Br.
17106
17107         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17108         now).  If the instace expression supports IMemoryLocation, we use
17109         the AddressOf method from the IMemoryLocation to extract the
17110         address instead of emitting the instance.
17111
17112         This showed up with `This', as we were emitting the instance
17113         always (Emit) instead of the Address of This.  Particularly
17114         interesting when This is a value type, as we dont want the Emit
17115         effect (which was to load the object).
17116
17117 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17118
17119         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17120
17121         * statement.cs (Checked): Set the CheckedState during the resolve
17122         process too, as the ConvCast operations track the checked state on
17123         the resolve process, and not emit.
17124
17125         * cs-parser.jay (namespace_member_declaration): Flag that we have
17126         found a declaration when we do.  This is used to flag error 1529
17127
17128         * driver.cs: Report ok when we display the help only.
17129
17130 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17131
17132         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17133
17134 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17135
17136         * cs-tokenizer.cs (define): We also have to track locally the
17137         defines.  AllDefines is just used for the Conditional Attribute,
17138         but we also need the local defines for the current source code. 
17139
17140 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17141
17142         * statement.cs (While, For, Do): These loops can exit through a
17143         Break statement, use this information to tell whether the
17144         statement is the last piece of code.
17145
17146         (Break): Flag that we break.
17147
17148         * codegen.cs (EmitContexts): New `Breaks' state variable.
17149
17150 2002-07-03  Martin Baulig  <martin@gnome.org>
17151
17152         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17153         modifiers in method declarations in structs.  Otherwise, you won't
17154         be able to override things like Object.Equals().
17155
17156 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17157
17158         * class.cs (Method, Property, Indexer): Do not allow the public
17159         modifier to be used in explicit interface implementations.
17160
17161         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17162         override modifiers in method declarations in structs
17163
17164 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17165
17166         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17167         integer or real overflow, report an error
17168
17169 2002-07-02  Martin Baulig  <martin@gnome.org>
17170
17171         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17172         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17173         to tell the runtime about our newly created System.Object and
17174         System.ValueType types.
17175
17176 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17177
17178         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17179         struct instead of Ldarg/Starg.
17180
17181 2002-07-02  Martin Baulig  <martin@gnome.org>
17182
17183         * expression.cs (Indirection.Indirection): Call
17184         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17185
17186 2002-07-02  Martin Baulig  <martin@gnome.org>
17187
17188         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17189         ValueType, call TypeManager.TypeToCoreType() on it.
17190         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17191         the OpCodes.Newarr argument.
17192
17193 2002-07-02  Martin Baulig  <martin@gnome.org>
17194
17195         * expression.cs (Invocation.EmitCall): When compiling corlib,
17196         replace all calls to the system's System.Array type to calls to
17197         the newly created one.
17198
17199         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17200         System.Array methods.
17201         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17202         from the system's System.Array type which must be replaced.
17203
17204 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17205
17206         * typemanager.cs: load unverifiable_code_ctor so we can build
17207         corlib using the correct type. Avoid using GetTypeCode() with
17208         TypeBuilders.
17209         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17210         TypeManager.object_type to allow building corlib.
17211
17212 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17213
17214         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17215
17216 2002-07-01  Martin Baulig  <martin@gnome.org>
17217
17218         * class.cs: Make the last change actually work, we need to check
17219         whether `ifaces != null' to avoid a crash.
17220
17221 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17222
17223         * class.cs: when we build structs without fields that implement
17224         interfaces, we need to add the interfaces separately, since there is
17225         no API to both set the size and add the interfaces at type creation
17226         time.
17227
17228 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17229
17230         * expression.cs: the dimension arguments to the array constructors
17231         need to be converted if they are a long.
17232
17233 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17234
17235         * class.cs: don't emit ldarg.0 if there is no parent constructor
17236         (fixes showstopper for corlib).
17237
17238 2002-06-29  Martin Baulig  <martin@gnome.org>
17239
17240         MCS now compiles corlib on GNU/Linux :-)
17241
17242         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17243         ie. check for MethodImplOptions.InternalCall.
17244
17245         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17246         and TypeManager.attribute_type are null, so we must explicitly check
17247         whether parent is not null to find out whether it's an attribute type.
17248         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17249         and SetBuilder, not only if the property is neither abstract nor external.
17250         This is necessary to set the MethodImplOptions on the accessor methods.
17251         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17252         SetBuilder, see Property.Emit().
17253
17254         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17255         populate "System.Object", "System.ValueType" and "System.Attribute" since
17256         they've already been populated from BootCorlib_PopulateCoreTypes().
17257
17258 2002-06-29  Martin Baulig  <martin@gnome.org>
17259
17260         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17261         is the NullLiteral, we also need to make sure that target_type is not
17262         an enum type.   
17263
17264 2002-06-29  Martin Baulig  <martin@gnome.org>
17265
17266         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17267         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17268         before calling BootstrapCorlib_ResolveDelegate ().
17269
17270 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17271
17272         * statement.cs: fixed build-breaker. All tests passed ok.
17273
17274 2002-06-27  Martin Baulig  <martin@gnome.org>
17275
17276         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17277         for System.Decimal when compiling corlib.
17278
17279 2002-06-27  Martin Baulig  <martin@gnome.org>
17280
17281         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17282         switch blocks which contain nothing but a default clause.
17283
17284 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17285
17286        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17287
17288 2002-06-27  Martin Baulig  <martin@gnome.org>
17289
17290         * ecore.cs (PropertyExpr.PropertyExpr): Call
17291         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17292
17293         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17294         is already a TypeBuilder.
17295
17296 2002-06-27  Martin Baulig  <martin@gnome.org>
17297
17298         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17299         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17300         the "from an array-type to System.Array" case.  This makes it work
17301         when compiling corlib.
17302
17303 2002-06-27  Martin Baulig  <martin@gnome.org>
17304
17305         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17306         non-static PropertyExpr, set its InstanceExpression.  This makes
17307         the `ICollection.Count' property work in System/Array.cs.
17308
17309 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17310
17311         * driver.cs: Made error handling more consistent.  Errors now
17312         tracked by Report class, so many methods which used to return int
17313         now return void.  Main() now prints success/failure and 
17314         errors/warnings message.
17315
17316         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17317         the magic number return values (123 and 124).  Now, if the
17318         expected error occurs, the compiler exits with success (exit value
17319         0).  If the compilation completes without seeing that particular
17320         error, the compiler exits with failure (exit value 1).  The
17321         makefile in mcs/errors has been changed to handle the new behaviour.
17322
17323         * report.cs: Made 'expected error' number a property and renamed
17324         it from 'Probe' to 'ExpectedError'.
17325
17326         * genericparser.cs: Removed error handling support, since it is
17327         now all done by Report class.
17328
17329         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17330         class, so parse() no longer returns an int.
17331
17332         * namespace.cs: Use Report.Error instead of GenericParser.error
17333
17334 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17335
17336         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17337         TypeContainer.AddOperator): At the front of the list put the
17338         explicit implementations, so they get resolved/defined first. 
17339
17340 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17341
17342         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17343         interface type is implemented by this TypeContainer.  Used during
17344         explicit interface implementation.
17345
17346         (Property.Define, Indexer.Define, Method.Define): Validate that
17347         the given interface in the explicit implementation is one of the
17348         base classes for the containing type.
17349
17350         Also if we are explicitly implementing an interface, but there is
17351         no match in the pending implementation table, report an error.
17352
17353         (Property.Define): Only define the property if we are
17354         not explicitly implementing a property from an interface.  Use the
17355         correct name also for those properties (the same CSC uses,
17356         although that is really not needed).
17357
17358         (Property.Emit): Do not emit attributes for explicitly implemented
17359         properties, as there is no TypeBuilder.
17360
17361         (Indexer.Emit): ditto.
17362
17363         Hiding then means that we do not really *implement* a pending
17364         implementation, which makes code fail.
17365
17366 2002-06-22  Martin Baulig  <martin@gnome.org>
17367
17368         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17369         the return value of Object.GetType().  [FIXME: we need to do this whenever
17370         we get a type back from the reflection library].
17371
17372 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17373
17374         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17375
17376 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17377
17378         * attribute.cs: Return null if we can not look up the type.
17379
17380         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17381         the interface types found.
17382
17383         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17384         interface types found.
17385
17386         * typemanager.cs (GetInterfaces): Make this routine returns alll
17387         the interfaces and work around the lame differences between
17388         System.Type and System.Reflection.Emit.TypeBuilder in the results
17389         result for GetInterfaces.
17390
17391         (ExpandInterfaces): Given an array of interface types, expand and
17392         eliminate repeated ocurrences of an interface.  This expands in
17393         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17394         be IA, IB, IC.
17395
17396 2002-06-21  Martin Baulig  <martin@gnome.org>
17397
17398         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17399         on System.Enum.
17400
17401 2002-06-21  Martin Baulig  <martin@gnome.org>
17402
17403         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17404         and called with one of the core types, return the corresponding typebuilder for
17405         that type.
17406
17407         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17408         element type.
17409
17410 2002-06-21  Martin Baulig  <martin@gnome.org>
17411
17412         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17413         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17414         (Expression.ConvertReferenceExplicit): Likewise.
17415
17416         * expression.cs (ElementAccess.DoResolve): Likewise.
17417         (ElementAccess.DoResolveLValue): Likewise.
17418
17419 2002-06-10  Martin Baulig  <martin@gnome.org>
17420
17421         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17422         add the "value" parameter to the parameter list.
17423
17424         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17425         to our caller.
17426
17427 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17430         the argument to an int, uint, long or ulong, per the spec.  Also
17431         catch negative constants in array creation.
17432
17433 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17434
17435         * class.cs: do not allow the same interface to appear twice in
17436         the definition list.
17437
17438 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17439
17440         * ecore.cs: don't use ldlen with System.Array.
17441
17442 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17443
17444         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17445
17446 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17447
17448         * modifiers.cs: produce correct field attributes for protected
17449         internal. Easy fix so miguel can work on ther harder stuff:-)
17450
17451 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17452
17453         * pending.cs: New file.  Move the code from class.cs here.
17454         Support clearning the pending flag for all methods (when not doing
17455         explicit interface implementation).
17456
17457 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17458
17459         * rootcontext.cs: added a couple more types needed to bootstrap.
17460
17461 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17462
17463         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17464         constructor in the type, instead of any constructor in the type
17465         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17466         a bug in the Mono runtime when applying the params attribute). 
17467
17468 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17469         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17470
17471 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17472
17473         * expression.cs (Unary.ResolveOperator): Use TypeManager
17474         to resolve the type.
17475
17476 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17477
17478         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17479         attached.
17480
17481         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17482         with each member too.
17483
17484         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17485         field builders too - this takes care of the enum member case.
17486
17487 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17488
17489         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17490         address-of operator on both value types and pointers.
17491
17492 2002-06-10  Martin Baulig  <martin@gnome.org>
17493
17494         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17495         PropertyBuilder to the `property_builders' list.
17496
17497         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17498         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17499         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17500         find any indexers which are inherited from an interface.
17501
17502 2002-06-09  Martin Baulig  <martin@gnome.org>
17503
17504         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17505         the same type as the constant if necessary.  There's also a test-130.cs
17506         for this.
17507
17508         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17509
17510         * typemanager.cs (TypeManager.ChangeType): Previously known as
17511         Enum.ChangeEnumType().
17512
17513 2002-06-09  Martin Baulig  <martin@gnome.org>
17514
17515         * expression.cs (Cast.TryReduce): Added support for consts.
17516
17517 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17518
17519         * class.cs (Accessor): Hold attributes information so we can pass
17520         it along.
17521
17522         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17523         Modify to pass in attributes attached to the methods.
17524
17525         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17526
17527         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17528         to handle the Accessor kind :-)
17529
17530         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17531
17532 2002-06-08  Martin Baulig  <martin@gnome.org>
17533
17534         * expression.cs (Unary.TryReduceNegative): Added support for
17535         ULongConstants.
17536
17537 2002-06-08  Martin Baulig  <martin@gnome.org>
17538
17539         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17540         name can't be found in the `defined_names' - the caller will do a
17541         MemberLookup in this case and thus find methods in System.Enum
17542         such as Enum.IsDefined().
17543
17544 2002-06-08  Martin Baulig  <martin@gnome.org>
17545
17546         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17547         Convert.ChangeType() which works with TypeBuilder created types.
17548         (Enum.LookupEnumValue, Enum.Define): Use it here.
17549
17550         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17551         `TypeBuilder.BaseType != null' check.
17552         (TypeContainer.FindMembers): Only lookup parent members if we
17553         actually have a parent.
17554         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17555         (ConstructorInitializer.Resolve): Likewise.
17556
17557         * interface.cs (Interface.FindMembers): Added
17558         `TypeBuilder.BaseType != null' check.
17559
17560         * rootcontext.cs (RootContext.ResolveCore): Added
17561         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17562         classes_second_stage.
17563
17564         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17565         debug_type and trace_type when compiling with --nostdlib.       
17566
17567 2002-06-07  Martin Baulig  <martin@gnome.org>
17568
17569         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17570         (AddField): Set it to true when adding a non-static field.
17571         (DefineType): Use `have_nonstatic_fields' to find out whether we
17572         have non-static fields, not `Fields != null'.
17573
17574 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17575
17576         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17577         dereferencing a null on the static-field code path)
17578
17579 2002-05-30  Martin Baulig  <martin@gnome.org>
17580
17581         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17582         to take command line arguments.  Use reflection to call the new
17583         custom `Initialize' function on the symbol writer and pass it the
17584         command line arguments.
17585
17586         * driver.cs (--debug-args): New command line argument to pass command
17587         line arguments to the symbol writer.
17588
17589 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17590
17591         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17592         the target type for indexers and properties.  Thanks to Joe for
17593         catching this.
17594
17595 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17596
17597         * typemanager.cs (MethodFlags): returns the method flags
17598         (Obsolete/ShouldIgnore) that control warning emission and whether
17599         the invocation should be made, or ignored. 
17600
17601         * expression.cs (Invocation.Emit): Remove previous hack, we should
17602         not do this on matching a base type, we should do this based on an attribute
17603
17604         Only emit calls to System.Diagnostics.Debug and
17605         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17606         on the command line.
17607
17608         * rootcontext.cs: Global settings for tracing and debugging.
17609
17610         * cs-tokenizer.cs (define): New utility function to track
17611         defines.   Set the global settings for TRACE and DEBUG if found.
17612
17613 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17614
17615         * interface.cs (Populate*): Pass in the TypeContainer as well as
17616         the DeclSpace as parameters so that we can create EmitContexts and
17617         then use that to apply attributes etc.
17618
17619         (PopulateMethod, PopulateEvent, PopulateProperty)
17620         (PopulateIndexer): Apply attributes everywhere.
17621
17622         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17623         etc.
17624
17625         (ApplyAttributes): Update accordingly.
17626
17627         We now apply interface attributes for all members too.
17628
17629 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17630
17631         * class.cs (Indexer.Define); Correctly check if we are explicit
17632         implementation (instead of checking the Name for a ".", we
17633         directly look up if the InterfaceType was specified).
17634
17635         Delay the creation of the PropertyBuilder.
17636
17637         Only create the PropertyBuilder if we are not an explicit
17638         interface implementation.   This means that explicit interface
17639         implementation members do not participate in regular function
17640         lookups, and hence fixes another major ambiguity problem in
17641         overload resolution (that was the visible effect).
17642
17643         (DefineMethod): Return whether we are doing an interface
17644         implementation. 
17645
17646         * typemanager.cs: Temporary hack until we get attributes in
17647         interfaces (Ravi is working on that) and we get IndexerName
17648         support in interfaces.
17649
17650         * interface.cs: Register the indexers as properties.
17651
17652         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17653         warning, I have verified that this is a bug in the .NET runtime
17654         (JavaScript suffers of the same problem).
17655
17656         * typemanager.cs (MemberLookup): When looking up members for
17657         interfaces, the parent of an interface is the implicit
17658         System.Object (so we succeed in searches of Object methods in an
17659         interface method invocation.  Example:  IEnumerable x;  x.ToString
17660         ()) 
17661
17662 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * class.cs (Event): Events should also register if they do
17665         implement the methods that an interface requires.
17666
17667         * typemanager.cs (MemberLookup); use the new GetInterfaces
17668         method. 
17669
17670         (GetInterfaces): The code used to lookup interfaces for a type is
17671         used in more than one place, factor it here. 
17672
17673         * driver.cs: Track the errors at the bottom of the file, we kept
17674         on going.
17675
17676         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17677         instance if the method we are calling is static!
17678
17679 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17680
17681         * attribute.cs (ApplyAttributes): Make this function filter out
17682         the IndexerName attribute (as that attribute in reality is never
17683         applied) and return the string constant for the IndexerName
17684         attribute. 
17685
17686         * class.cs (TypeContainer.Emit): Validate that all the indexers
17687         have the same IndexerName attribute, and if so, set the
17688         DefaultName attribute on the class. 
17689
17690         * typemanager.cs: The return value might contain other stuff (not
17691         only methods).  For instance, consider a method with an "Item"
17692         property and an Item method.
17693
17694         * class.cs: If there is a problem with the parameter types,
17695         return. 
17696
17697 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17698
17699         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17700         looks at user defined conversion after making a call to 
17701         StandardConversionExists - we need this for overload resolution.
17702
17703         * expression.cs : Update accordingly the various method calls.
17704
17705         This fixes 2 bugs filed against implicit user defined conversions 
17706
17707 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17708
17709         * statement.cs: Track the result of the assignment.
17710
17711 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17712
17713         * expression.cs (MemberAccess): Improved error reporting for
17714         inaccessible members.
17715
17716 2002-05-22  Martin Baulig  <martin@gnome.org>
17717
17718         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17719         itself with debugging support.
17720
17721 2002-05-22  Martin Baulig  <martin@gnome.org>
17722
17723         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17724         Removed, this isn't needed anymore.
17725
17726 2002-05-20  Martin Baulig  <martin@gnome.org>
17727
17728         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17729         be underlying type for an enum.
17730
17731 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17732
17733         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17734         that splits out the loading of just the core types.
17735
17736         * rootcontext.cs (ResolveCore): Split the struct resolution in
17737         two, so we can load the enumeration underlying types before any
17738         enums are used.
17739
17740         * expression.cs (Is): Bandaid until we fix properly Switch (see
17741         bug #24985 for details).
17742
17743         * typemanager.cs (ImplementsInterface): The hashtable will contain
17744         a null if there are no interfaces implemented.
17745
17746 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17747
17748         * cs-parser.jay (indexer_declarator): It is fine to have array
17749         parameters
17750
17751 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17752
17753         * typemanager.cs: (RegisterBuilder): New function used to register
17754         TypeBuilders that implement interfaces.  Since
17755         TypeBuilder.GetInterfaces (as usual) does not work with lame
17756         Reflection.Emit. 
17757         (AddUserType): register interfaces.
17758
17759         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17760         dealing with TypeBuilder.  Also, arrays are showing up as
17761         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17762         methods can not be invoked on them!
17763
17764         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17765         (ImplicitReferenceConversionExists): Split out from
17766         StandardConversionExists. 
17767
17768         * expression.cs (As): We were only implementing one of the three
17769         cases for the as operator.  We now implement them all.
17770         (Is): Implement the various other cases for Is as well.
17771
17772         * typemanager.cs (CACHE): New define used to control if we want or
17773         not the FindMembers cache.  Seems to have a negative impact on
17774         performance currently
17775
17776         (MemberLookup): Nested types have full acess to
17777         enclosing type members
17778
17779         Remove code that coped with instance/static returns for events, we
17780         now catch this in RealFindMembers.
17781
17782         (RealFindMembers): only perform static lookup if the instance
17783         lookup did not return a type or an event.  
17784
17785 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17786
17787         * assign.cs (CompoundAssign): We pass more semantic information
17788         now to Compound Assignments than we did before: now we have all
17789         the information at hand, and now we resolve the target *before* we
17790         do the expression expansion, which allows the "CacheValue" method
17791         to have the effect we intended (before, a [x] += 1 would generate
17792         two differen ArrayAccess expressions from the ElementAccess,
17793         during the resolution process).
17794
17795         (CompoundAssign.DoResolve): Resolve target and original_source here.
17796
17797 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17798
17799         * expression.cs (ArrayAccess): dropped debugging information. 
17800
17801         * typemanager.cs: Small bug fix: I was always returning i_members,
17802         instead of one of i_members or s_members (depending on which had
17803         the content).
17804
17805         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17806         method is invoked before any code generation takes place, and it
17807         is a mechanism to inform that the expression will be invoked more
17808         than once, and that the method should use temporary values to
17809         avoid having side effects
17810
17811         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17812
17813         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17814         implementation.
17815
17816         * expression.cs (Indirection, ArrayAccess): Add support for
17817         CacheTemporaries in these two bad boys. 
17818
17819         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17820         ldobj or ldind_ref.  
17821         (StoreFromPtr): Handle stobj as well.
17822
17823         * expression.cs (UnaryMutator): Share more code.
17824
17825         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17826         down: I was not tracking the Filter function as well, which
17827         was affecting the results of the cache.
17828
17829 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17830
17831         * attribute.cs: Remove the hack to handle the CharSet property on
17832         StructLayouts. 
17833
17834 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * attribute.cs (DoResolve): More uglyness, we now only try to
17837         resolve the attribute partially, to extract the CharSet
17838         information (only if we are a StructLayout attribute).  Otherwise 
17839
17840         (GetExtraTypeInfo): Add some code to conditionally kill in the
17841         future this.   I am more and more convinced that the .NET
17842         framework has special code to handle the attribute setting on
17843         certain elements.
17844
17845         * expression.cs (IsParamsMethodApplicable): Revert my previous
17846         foreach change here, it was wrong.
17847
17848 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17849
17850         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17851         (pp_expr): do not abort on unknown input, just return.
17852         (eval): abort if there are pending chars.
17853
17854         * attribute.cs (Attribute.Resolve): Positional parameters are
17855         optional.  Deal with that case.
17856
17857         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17858         the Ansi/Unicode/Auto information for the type.
17859
17860         (TypeContainer.DefineType): instantiate the EmitContext here, as
17861         we will be using it during the type definition (to resolve
17862         attributes) and during the emit phase.
17863
17864         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17865         to pull type information out of the attributes
17866
17867         (Attribute.Resolve): track the constructor builder, and allow for
17868         multiple invocations (structs and classes will use this).
17869
17870         * ecore.cs (MemberLookupFinal): new version with all the
17871         parameters customizable.
17872
17873         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17874         constructors.  Return if the result value is null (as the error
17875         would have been flagged already by MemberLookupFinal)
17876
17877         Do not allow instances of abstract classes or interfaces to be
17878         created.
17879
17880         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17881         We have to compare the assembly property here when dealing with
17882         FamANDAssem and Assembly access modifiers, because we might be
17883         creating an assembly from *modules* (that means that we are not
17884         getting TypeBuilders for types defined in other modules that are
17885         part of this assembly).
17886
17887         (Method.Emit): If the method is marked abstract and has a body,
17888         emit an error. 
17889
17890         (TypeContainer.DefineMembers): If both the defined member and the
17891         parent name match are methods, then do not emit any warnings: let
17892         the Method.Define routine take care of flagging warnings.  But if
17893         there is a mismatch (method overrides something else, or method is
17894         overriwritten by something, then emit warning).
17895
17896         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17897         set to null, this means `do not check for the return type on the
17898         signature'. 
17899
17900         (Method.Define): set the return type for the method signature to
17901         null, so that we get methods with the same name and parameters and
17902         different return types.  This is used to flag warning 114 (you are
17903         hiding a method, and you probably want to use the new/override
17904         keywords instead).
17905
17906         * typemanager.cs (MemberLookup): Implemented proper access
17907         control, closing a long standing set of bug reports.  The problem
17908         was that the Framework only has two bits: Public and NonPublic,
17909         and NonPublic includes private and protected methods, but we need
17910         to enforce the FamANDAssem, FamOrAssem and Family. 
17911
17912 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17913
17914         * statement.cs (GotoCase): Return true: Ammounts to giving up
17915         knowledge on whether we return or not, and letting the other case
17916         be responsible for it.
17917
17918 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * driver.cs: Do not load directories for each file processed, only
17921         do it if there is a pattern.
17922
17923         * ecore.cs: Report readonly assigns here as well, as we might have
17924         been resolved only by MemberAccess.
17925
17926         (SimpleName.SimpleNameResolve): Also be useful for LValue
17927         resolution.   We need this to propagate assign to local readonly variables
17928
17929         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17930         do not want to reuse potential criteria memory.
17931
17932         * class.cs (MyEventBuilder): Set reflected_type;
17933
17934         * ecore.cs (Constantify): Added support for constifying bools.
17935
17936         (RootContext.LookupType): Added a cache for values looked up in
17937         the declaration space.
17938
17939         * typemanager.cs (FindMembers): Now is a front-end to
17940         RealFindMembers, and provides a two-level hashtable-based cache to
17941         the request.  
17942
17943         15% performance improvement: from 22.5 to 19.2 seconds.
17944
17945         * expression.cs (IsParamsMethodApplicable): use foreach.
17946         (Invocation.DoResolve): ditto.
17947         (New.DoResolve): ditto.
17948         (ArrayCreation.DoResolve): ditto.
17949
17950         * ecore.cs (FindMostEncompassingType): use foreach.
17951
17952         * delegate.cs (NewDelegate.DoResolve): Use foreach
17953
17954         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17955         (RemoveMethods): use foreach.
17956
17957         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17958         nested foreach statements instead of for, and also break out of
17959         the inner loop once a match is found.
17960
17961         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17962
17963 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17964
17965         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17966         we actually unwrap the expression to allow for extra information
17967         to be extracted. 
17968
17969         * expression.cs: Use Shr_Un on unsigned operations. 
17970
17971 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17972
17973         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17974         applicable operators was not being considered correctly. This closes
17975         the bug Miguel reported.
17976
17977 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17978
17979         * attribute.cs: check that the type derives from System.Attribute
17980         and report the correct error in that case (moved the duplicate code to
17981         its own method, too).
17982
17983 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17984
17985         * attribute.cs: lookup attribute type name as the spec says: first the
17986         bare attribute name and then name + "Attribute" (nant compiles with
17987         mcs after this fix).
17988
17989 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17992         Because of the way we parse things, we should try to see if a
17993         UIntConstant can fit in an integer.
17994
17995 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17996
17997         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17998         when we are in an explicit context.
17999
18000         (ConvertReferenceExplicit): When converting from Iface type S to Class
18001         T make sure the rules are implemented as an OR.
18002
18003         * parameter.cs (ParameterType): Make it a property for now although the
18004         purpose really isn't anything immediate.
18005
18006         * expression.cs (Is*Applicable): Do better checking on the parameter type
18007         of a ref/out parameter. The ones from the system assemblies are already 
18008         marked with the correct type so we don't need to do any correction.
18009
18010         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18011         the object type is standard too so include that.
18012
18013 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18014
18015         * ecore.cs (StandardConversionExists): Augment with missing code:
18016         deal with IntConstant, LongConstants and Enumerations.
18017
18018         * assign.cs: Report the error, instead of failing silently
18019
18020         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18021         typecontainer that they are declared, because the
18022         typecontainer/namespace will have the list of using clauses that
18023         need to be applied.
18024
18025         Assembly Attributes were escaping the normal registration
18026         mechanism. 
18027
18028         (EmitCode): Apply attributes within an EmitContext that represents
18029         the container they were declared on.
18030
18031         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18032
18033 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18034
18035         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18036         Revamp completely - make much cleaner as we now operate only
18037         on a set of Types.
18038
18039         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18040         to implement the logic detailed in the spec more correctly.
18041
18042         (UserDefinedConversion): Update accordingly.
18043
18044 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18045
18046         * statement.cs: Return flow analysis information up.
18047
18048         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18049         and the default.
18050
18051         (token): Do not consume an extra character before calling
18052         decimal_digits.
18053
18054 2002-05-06  Piers Haken <piersh@friskit.com>
18055
18056         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18057
18058 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18059
18060         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18061         EmitContext during the instance constructor initializer
18062         resolution, to stop access to instance variables.
18063
18064         This is mandated by the spec, last paragraph of the `constructor
18065         initializers' section. 
18066
18067 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * cs-parser.jay, class.cs (Accessor): new class used to represent
18070         an accessor (get or set).  In the past we used `null' to represent
18071         a missing accessor.  But this is ambiguous because there was no
18072         way to tell in abstract indexers/properties if one of them was
18073         specified.
18074
18075         Now there is a way of addressing that.
18076
18077         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18078         instead of FindMembers.
18079
18080         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18081         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18082
18083         * attribute.cs: Treat indexers and properties as the same in terms
18084         of applying attributes
18085
18086         * ecore.cs (FindMostEncompassedType): Use statically initialized
18087         EmptyExpressions()s like we do elsewhere to avoid creating useless
18088         objects (and we take this out of the tight loop).
18089
18090         (GetConversionOperators): Move the code to extract the actual
18091         operators to a separate routine to clean things up.
18092
18093 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18094
18095         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18096         events are always registered FieldBuilders.
18097
18098         * class.cs (FieldBase): New class shared by Fields 
18099
18100         * delegate.cs: If we are a toplevel delegate, use our full name.
18101         If we are a nested delegate, then only use our tail name.
18102
18103 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18104
18105         * expression.cs (IsApplicable): Ensure that we add the "&" to
18106         ref/out types before comparing it with the type of the argument.
18107
18108         (IsParamsMethodApplicable): Ditto.
18109
18110         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18111         silly me ;-)
18112
18113         * delegate.cs : Handle the case when we have more than one applicable
18114         method. Flag an error only when we finish checking all.
18115
18116 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18117
18118         * expression.cs: Add support for boolean static initializers.
18119
18120 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18121
18122         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18123
18124         * parameter.cs (ComputeParameterTypes,
18125         ComputeAndDefineParameterTypes): Better error handling: now we
18126         clear the `types' cache if we fail during any of the type lookups.
18127         We also return the status code correctly to our caller
18128
18129         * delegate.cs: If we fail to define a delegate, abort the extra
18130         steps. 
18131
18132         * expression.cs (Binary.ResolveOperator): for
18133         operator==(object,object) and operator !=(object, object) we also
18134         have to verify that there is an implicit conversion from one to
18135         the other.
18136
18137         (ArrayAccess.DoResolve): Array Access can operate on
18138         non-variables. 
18139
18140 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18141
18142         * assign.cs (CompoundAssign): A new class used as a "flag" that
18143         the assignment actually is happening as part of a compound
18144         assignment operator.
18145
18146         During compound assignment, a few new rules exist to enable things
18147         like:
18148
18149         byte b |= 1 + 2
18150
18151         From the spec:
18152
18153         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18154         to the type of x) if y is implicitly convertible to the type of x,
18155         and the operator is a builtin operator and the return type of the
18156         operator is explicitly convertible to the type of x. 
18157
18158         * rootcontext.cs: Reset warning level to 2.  4 catches various
18159         "interesting" features in mcs, we must clean this up at some
18160         point, but currently am trying to kill other bugs ;-)
18161
18162         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18163         in container classes as well.  
18164
18165         * expression.cs (Binary.ResolveOperator): Handle string case
18166         before anything else (as operator overloading does emit an error
18167         before doing anything else).
18168
18169         This code could go away when we move to a table driven model, but
18170         i could not come up with a good plan last night.
18171
18172 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18173
18174         * typemanager.cs (CSharpName): reimplementation using regex.
18175         * class.cs: added null check for fields in Emit
18176         * rootcontext.cs: set warninglevel to 4
18177
18178 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18179
18180         * typemanager.cs (CSharpName): reimplemented with Lupus
18181         suggestion.
18182
18183 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18184
18185         * statement.cs (If): correclty implement Resolve, because we were
18186         not catching sem errors in there.  The same process is needed
18187         everywhere else. 
18188         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18189
18190
18191         (Statement.Warning_DeadCodeFound): Factorize code.
18192         (While): Report dead code here too.
18193
18194         (Statement): Added Resolve virtual method to allow
18195         for resolution split from the emit code.
18196
18197 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18198
18199         * statement.cs (EmitBoolExpression): No longer try to resolve the
18200         expression here.    
18201         (MakeBoolean): New utility function that resolve, implicitly
18202         converts to boolean and tags the expression. 
18203
18204
18205         (If, Do): Implement dead code elimination.
18206         (While): Implement loop inversion
18207
18208         (Do, While, For, If): Resolve the expression prior to calling our
18209         code generation.
18210
18211 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18212
18213         * class.cs:
18214           - added method Report28 (warning: program has more than one entry point)
18215           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18216           - modified method Method.Define, the part at the end of the method
18217
18218         * rootcontext.cs: added static public Location EntryPointLocation;
18219           
18220         * ../errors/cs0028.cs : Add test case for the above warning.              
18221
18222         * typemanager.cs:
18223           - modified method CSharpName to allow arrays of primitive type to
18224             be printed nicely (e.g. instead of System.Int32[][] it now prints
18225             int[][])
18226           - added method CSharpSignature: returns the signature of a method
18227             in string format to be used in reporting errors, warnings, etc.
18228
18229         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18230         with String.Empty.
18231
18232 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18233
18234         * delegate.cs (Define): Fix extremely silly bug where I was
18235         setting the type of the 'object' parameter of the BeginInvoke
18236         method to System.IAsyncResult instead of System.Object ;-)
18237
18238 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18239
18240         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18241         here. 
18242
18243         (Constructor.Emit): return if we fail to initialize the
18244         constructor.  Another door closed!  
18245
18246         * expression.cs (New.DoResolve): Improve error message (from -6 to
18247         1501).  Use DeclaredOnly lookup to find the exact constructor.
18248
18249         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18250         loop.  This is useful.
18251
18252         * cs-parser.jay: Adjust the default parameters so that destructors
18253         have the proper signature.
18254
18255 2002-04-26  Martin Baulig  <martin@gnome.org>
18256
18257         * driver.cs (LoadAssembly): If `assembly' contains any characters
18258         which are only valid in path names and not in assembly names
18259         (currently slash, backslash and point), use Assembly.LoadFrom ()
18260         instead of Assembly.Load () on the `assembly' (before iteration
18261         over the link_paths).
18262
18263 2002-04-26  Martin Baulig  <martin@gnome.org>
18264
18265         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18266
18267 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * class.cs (Property): use the new typemanager.MemberLookup
18270
18271         (TypeContainer.MemberLookup): Implement using the
18272         TypeManager.MemberLookup now. 
18273
18274         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18275         and return MemberInfos, so that these can be used without an
18276         EmitContext (what we had before).
18277
18278 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * expression.cs: Fix the case where the argument to params if the
18281         type of the params.  I omitted handling this before.   Fixed
18282
18283 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18284
18285         * driver.cs: Call BootCorlib_PopulateCoreType
18286
18287         * class.cs (Property.CheckBase): Check for properties only, not
18288         for all members. 
18289
18290         * interface.cs: Temporary hack: try/catch around the
18291         CustomAttributeBuilder, because I am getting an exception that I
18292         do not understand.
18293
18294         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18295         types whose definitions are required to be there (attributes are
18296         defined before standard types).
18297
18298         Compute definitions as we boot the various types, as they are used
18299         immediately (value_type class will need object_type, but if we do
18300         not initialize object_type, we will pass a null, which will let
18301         the runtime pick the System.Object from the existing corlib, which
18302         is not what we want).
18303
18304 2002-04-22  Patrik Torstensson <totte@labs2.com>
18305
18306         * cs-tokenizer.cs: fixed a number of trim() issues.
18307
18308 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18309
18310         * expression.cs (Argument.Type): Ensure that we return the correct
18311         type when we have out or ref parameters [in which case we 
18312         append a "&"].
18313
18314 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18315
18316         * class.cs (Property, Indexer): Allow extern modifier in there. 
18317
18318         * typemanager.cs (InitBaseTypes): Initializes object_type and
18319         value_type, since those will be used early on during the bootstrap
18320         process to compile corlib.
18321
18322         (InitCoreTypes): Move code from here to InitBaseTypes.
18323
18324 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18325
18326         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18327         single-dimension arrays as using the ldlen opcode.  
18328
18329         Daniel Lewis discovered this optimization.  
18330
18331         * typemanager.cs: Add signature for System.Array::get_Length
18332
18333 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18334
18335         * statement.cs: report the error when the foreach does not apply to an
18336         array nor a collection.
18337
18338 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * expression.cs: Add implicit conversions to the operator ~.
18341
18342         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18343
18344         * typemanager.cs: Locate the decimal constructor.
18345
18346 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18347
18348         * attribute.cs: use the new property of TypeOf.
18349         * expression.cs: added 'get' property around typearg.
18350
18351         These changes fix a build breaker reported by NickD. Is this the
18352         correct way to fix?  If not, please, revert my changes and make it
18353         work :-).
18354
18355 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * attribute.cs: Add support for typeof in attribute invocations.
18358         I am not sure that this is right though.
18359
18360 2002-04-14  Duncan Mak  <duncan@ximian.com>
18361
18362         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18363         Binary.Operator.Division case.
18364
18365 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18366
18367         * class.cs (DefineType): Ensure that we do a proper check on
18368         attribute types and also register it with the TypeManager.
18369
18370         (TypeContainer.Targets): The default for attribute types is
18371         AttributeTargets.All.
18372
18373         * attribute.cs (ApplyAttributes): Registering the attribute type
18374         is done elsewhere, not when we discover we have a Usage attribute.
18375
18376 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18377
18378         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18379         and get rid of is_delegate parameter.
18380
18381         * everywhere : update.
18382
18383 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18384
18385         * cs-parser.jay (compilation_unit): Revamp completely to use
18386         some new ideas that I got from Rhys' grammar to solve the problems
18387         with assembly level attributes.
18388
18389         (outer_declaration): New grammar production.
18390
18391         (attribute_sections): Add.
18392
18393         (opt_attributes): Base on attribute_sections
18394
18395         (namespace_declaration): Allow opt_attributes to tackle the case
18396         when we have assembly level attributes - we are clever in this
18397         regard now ;-)
18398
18399         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18400         attributes in the non-global context.
18401
18402         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18403         instead of SetGlobalAttributes.
18404
18405         * class.cs, rootcontext.cs : Ensure we define and generate 
18406         attribute types before anything else.
18407
18408         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18409         and flag the new error -20 for the case when the attribute type
18410         does not have valid targets specified. csc does not catch this.
18411
18412         * ../errors/errors.txt : update for error # -20
18413
18414 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18415
18416         * support.cs (InternalParameters.ParameterModifier): Do some null
18417         checking and return sane values.
18418
18419         * class.cs (Method.Define): If we are a PInvoke method, ensure
18420         that we are static and extern. Report error # 601
18421
18422         * ../errors/cs0601.cs : Add test case for the above error.
18423
18424 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18425
18426         * rootcontext.cs (attribute_types): We need to keep type of
18427         all attribute types separately and emit code for them first.
18428
18429         (RegisterAttribute) : Implement.
18430
18431         * class.cs (DefineType): Check if the current Type is a custom
18432         attribute type and register it accordingly.
18433
18434         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18435         adding the first attribute twice and rename to
18436
18437         (SetGlobalAttributes): this.
18438
18439         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18440         lookups.
18441
18442         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18443         if we are processing global arguments. Hmm, I am unsure of this.
18444
18445 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18446
18447         * expression.cs: added static array of strings to avoid calling
18448         Enum.ToString () for Operator in Binary. Significant recover of
18449         performance.
18450
18451 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * class.cs (FindMembers): Allow the Builders of the various
18454         members to be null.  If they are skip them.  This only happens
18455         during the PInvoke declaration.
18456
18457 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18458
18459         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18460         failure, so we do not keep going afterwards.
18461
18462         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18463         wanted to pass `false' as the `is_delegate' argument.  If this is
18464         the case, why not use delegate_type == null to mean `is_delegate =
18465         false' and anything else as is_delegate = true.
18466
18467 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18468
18469         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18470         code for the section, not the beginning of the tests.
18471
18472 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18473
18474         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18475
18476         * expression.cs (Binary): same.  Warn about errors where we have
18477         Enum/Enum in operator + as well.
18478
18479 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18480
18481         * statement.cs:
18482                 - added support for switch(bool)
18483                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18484                 - add TableSwitchEmit() to handle table-based switch statements
18485
18486 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18487
18488         * expression.cs (Invocation.OverloadResolve): Factor out code which
18489         does parameter compatibility checking with arguments so that we can 
18490         re-use the code even from Delegate.VerifyApplicability
18491
18492         (VerifyArgumentsCompat): Move above code here.
18493
18494         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18495         and instead make a call to the above method.
18496
18497 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18498
18499         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18500         We use it to keep track of classes which are attribute types.
18501
18502 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18503
18504         * delegate.cs (Delegate.Define): Correctly define the types in the
18505         presence of fixed and array parameters.
18506
18507         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18508         doing FindMembers.
18509
18510         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18511         include NonPublic after the first iteration.
18512
18513         * class.cs (Indexer.CheckBase): Only check if both parents are
18514         non-null. 
18515
18516         * cs-parser.jay (accessor_body): If empty, set to null.
18517
18518         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18519         same code path here to resolve constants names that we did have in
18520         MemberAccess.DoResolve.  There is too much code duplicated here.
18521
18522 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18525
18526         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18527         to MakeUnionSet.
18528
18529         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18530         tokens, numbers and strings.
18531
18532         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18533         parenthesis.
18534
18535         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18536         asyncronous parameters and the regular parameters.  
18537
18538         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18539         specify the target directory.
18540
18541         * expression.cs: (This.DoResolve): Simplify
18542         (As.Emit): Optimize, do not generate IsInst if the expression is
18543         always of the given type.
18544
18545         (Is.DoResolve): Bug fix, we were reporting both always/never for
18546         the is expression.
18547
18548         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18549         creating too many unnecessary arrays.
18550
18551 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18552
18553         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18554         fields instead of rolling our own initializer.   Takes care of all
18555         implicit conversions, and drops unnecessary static checks/argument.
18556
18557 2002-03-31  Dick Porter  <dick@ximian.com>
18558
18559         * driver.cs: use the GetDirectories() return values properly, and
18560         use "/" as path separator.
18561
18562 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18563
18564         * expression.cs (Unary): Optimize - - expr into expr.
18565         (Binary): Optimize a + (-b) into a -b.
18566
18567         * codegen.cs (CodeGen): Made all methods static.
18568
18569 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18570
18571         * rootcontext.cs: 
18572
18573         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18574         TypeBuilder property.
18575
18576         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18577         instead. 
18578
18579         * tree.cs: Removed the various RecordXXXX, and replaced with a
18580         single RecordDecl.  Removed all the accessor methods, and just
18581         left a single access point Type 
18582
18583         * enum.cs: Rename DefineEnum to DefineType.
18584
18585         * decl.cs: New abstract method `DefineType' used to unify the
18586         Defines for Enumerations, Interfaces, TypeContainers and
18587         Delegates.
18588
18589         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18590         LookupBaseClasses method that used to live in class.cs and
18591         interface.cs here, and renamed to FindType.
18592
18593         * delegate.cs: Implement DefineType.  Take advantage of the
18594         refactored pattern for locating the parent builder without taking
18595         the parent_builder argument (which we know does not work if we are
18596         nested, and triggering a toplevel definition).
18597
18598 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18599
18600         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18601         accessibility of a member has changed during override and report
18602         an error if so.
18603
18604         * class.cs (Method.Define, Property.Define): Only complain on
18605         overrides if the method is private, any other accessibility is
18606         fine (and since we just checked the permission is the same, we are
18607         good to go).
18608
18609         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18610         and elif are processed always.  The other pre-processing
18611         directives are only processed if we are "taking" the path
18612
18613 2002-03-29  Martin Baulig  <martin@gnome.org>
18614
18615         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18616         current location is not Null.
18617
18618         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18619         a separate method so we can profile it.
18620
18621         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18622         `span.Seconds' are just seconds, but no minutes or hours.
18623         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18624
18625 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18626
18627         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18628         Remove the gratuitous set of Final:
18629
18630                                 // If an interface implementation, then we can set Final.
18631                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18632                                     implementing.DeclaringType.IsInterface)
18633                                         flags |= MethodAttributes.Final;
18634
18635         I do not know what I was smoking when I used that.
18636
18637
18638         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18639         step into fixing the name resolution issues for delegates and
18640         unifying the toplevel name resolution.
18641
18642 2002-03-28  Martin Baulig  <martin@gnome.org>
18643
18644         * class.cs (Method.Emit): If we have a symbol writer, call its
18645         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18646         tell it about the current method.
18647
18648         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18649         writer that we're going to emit the first byte of IL code for a new
18650         statement (a new source line).
18651         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18652         EmitContext.Mark() before emitting any code.
18653
18654         * location.cs (SymbolDocument): Return null when we're Null.
18655
18656         * statement.cs (Statement): Moved the `Location loc' variable here.
18657         (Statement.EmitBoolExpression): If we have a symbol writer, call
18658         ec.Mark() before emitting any code to tell it that we're at the
18659         beginning of a new statement.
18660         (StatementExpression): Added `Location' argument to the constructor.
18661         (Block): Added public readonly variable `StartLocation' and public
18662         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18663         (Block): Added constructor which takes a start and end location.
18664         (Block.SetEndLocation): New method. This sets the end location.
18665         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18666         local variables we create.
18667         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18668         each statement and do also mark the begin and end of the block.
18669
18670         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18671         tell it the current lexer.Location, use Location.Null for the end of the
18672         block.
18673         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18674         current block, set its end location using SetEndLocation().
18675         (statement_expression): StatementExpression constructor now takes the
18676         lexer.Location as additional argument.
18677         (for_statement, declare_local_variables): Likewise.
18678         (declare_local_variables): When creating a new implicit block, use the
18679         new Block constructor and pass it the lexer.Location.
18680
18681 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18682
18683         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18684         members also on the parent interfaces recursively.
18685
18686 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * report.cs: Use new formats, since Gonzalo finished the missing
18689         bits. 
18690
18691         * expression.cs (Binary.ResolveOperator): added missing operator|
18692         operator& and operator^ for bool/bool.
18693
18694         * cs-parser.jay: CheckDef now takes a Location argument that is
18695         used to report errors more precisly (instead of reporting the end
18696         of a definition, we try to track something which is a lot closer
18697         to the source of the problem).
18698
18699         * cs-tokenizer.cs: Track global token use, so we can properly flag
18700         the use of #define/#undef after the first token has been seen.
18701
18702         Also, rename the reportXXXX to Error_DescriptiveName
18703
18704         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18705         TypeContainer, so that Enum and Interface can use this too.
18706
18707         * class.cs (TypeContainer.LookupInterfaceOrClass,
18708         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18709         `builder' argument.  Typically this was used to pass the parent
18710         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18711         the definition).  
18712
18713         The problem is that a nested class could trigger the definition of
18714         a toplevel class, and the builder would be obviously wrong in that
18715         case. 
18716
18717         So we drop this argument, and we compute dynamically the
18718         TypeBuilder/ModuleBuilder (the correct information was available
18719         to us anyways from DeclSpace.Parent)
18720
18721         * interface.cs (Interface.DefineInterface): Drop builder
18722         parameter cleanup like class.cs
18723
18724         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18725         like class.cs
18726
18727         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18728         values. 
18729
18730         (Try.Emit): Propagate the returns value from the statement.
18731
18732         (Return.Emit): Even if we are leavning 
18733
18734         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18735
18736         * modifiers.cs: Fix the computation of MethodAttributes flags.
18737
18738 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18739
18740         * driver.cs: allow compilation of files that start with '/'.
18741         Add a default case when checking the argument of --target.
18742
18743 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * interface.cs: Implement the same search algorithm for types in
18746         the interface code.
18747
18748         * delegate.cs: Do not allow multiple definition.
18749
18750         * Recovered ChangeLog that got accidentally amputated
18751
18752         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18753
18754         * rootcontext.cs: Load manually enum to allow core classes to
18755         contain enumerations.
18756
18757         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18758         Update to new static methods in TypeManager.
18759
18760         * typemanager.cs (GetMethod, GetConstructor): Use our
18761         implementation of FindMembers to find the members, since during
18762         corlib compilation, the types are TypeBuilders and GetMethod and
18763         GetConstructor do not work.
18764
18765         Make all methods in TypeManager static.
18766
18767         (InitCodeHelpers): Split the functionality from
18768         the InitCodeTypes function.
18769
18770         * driver.cs: Call InitCodeHelpers after we have populated the
18771         types. 
18772
18773         * cs-parser.jay (delegate_declaration): we did not used to compute
18774         the delegate name correctly for void delegates.
18775
18776 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * rootcontext.cs (RootContext): Init the interface_resolve_order
18779         and type_container_resolve_order always.
18780
18781         (ResolveCore, BootstrapCorlib_ResolveClass,
18782         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18783         compiler when compiling with --nostdlib
18784
18785         * class.cs (TypeContainer.DefineType): Check that our parent is
18786         not null.  This test is most important when we are bootstraping
18787         the core types.
18788
18789         * codegen.cs: Split out the symbol writing code.
18790
18791 2002-03-25  Martin Baulig  <martin@gnome.org>
18792
18793         * driver.cs (-g): Made -g an alias for --debug.
18794
18795 2002-03-24  Martin Baulig  <martin@gnome.org>
18796
18797         * codegen.cs (SymbolWriter): New public variable. Returns the
18798         current symbol writer.
18799         (CodeGen): Added `bool want_debugging_support' argument to the
18800          constructor. If true, tell the ModuleBuild that we want debugging
18801         support and ask it for the ISymbolWriter.
18802         (Save): If we have a symbol writer, call it's Close() method after
18803         saving the assembly.
18804
18805         * driver.c (--debug): New command line argument to create a
18806         debugger information file.
18807
18808         * location.cs (SymbolDocument): New public property. Returns an
18809         ISymbolDocumentWriter object for the current source file or null
18810         if we don't have a symbol writer.
18811
18812 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18813
18814         * driver.cs (LoadAssembly): Correctly return when all the paths
18815         have been tried and not before.
18816
18817         * statement.cs (Switch.Emit): return the actual coverage for this
18818         statement (returns/not-returns)
18819
18820         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18821         switch of the statement if we are the last switch section.  That
18822         kills two problems: try/catch problems (we used to emit an empty
18823         nop at the end) and switch statements where all branches would
18824         return. 
18825
18826 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18827
18828         * driver.cs: Add default assemblies (the equivalent to the
18829         Microsoft CSC.RSP file)
18830
18831         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18832         also update tokens_seen and set it to false.
18833
18834         * driver.cs: Implement --recurse for Mike.
18835
18836         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18837         correctly splitting out the paths.
18838
18839 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18840
18841         * interface.cs (Interface.PopulateProperty): Instead of using
18842         `parent' as the declaration space for the set parameters, use
18843         `this' 
18844
18845         * support.cs (InternalParameters): InternalParameters constructor
18846         takes a DeclSpace instead of a TypeContainer.
18847
18848         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18849         types are being initialized, load the address of it before calling
18850         the function.  
18851
18852         (New): Provide a mechanism to disable the generation of local
18853         value type temporaries when the caller will be providing us with
18854         an address to store it.
18855
18856         (ArrayCreation.EmitDynamicInitializers): Use it.
18857
18858 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18859
18860         * expression.cs (Invocation.EmitArguments): Only probe for array
18861         property if there is more than one argument.  Sorry about that.
18862
18863         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18864         empty param arrays.
18865
18866         * class.cs (Method.LabelParameters): Fix incorrect code path that
18867         prevented the `ParamArrayAttribute' from being applied to the
18868         params attribute.
18869
18870 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * support.cs (ReflectionParameters): Correctly compute whether the
18873         last argument is a params array.  Fixes the problem with
18874         string.Split ('a')
18875
18876         * typemanager.cs: Make the assemblies array always be non-null
18877         (empty, but non-null)
18878
18879         * tree.cs (RecordDecl): New function that abstracts the recording
18880         of names.  This reports error 101, and provides a pointer to the
18881         previous declaration.  Fixes a crash in the compiler.
18882
18883         * cs-parser.jay (constructor_declaration): Update to new grammar,
18884         and provide a constructor_body that can be empty.
18885
18886 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18887
18888         * driver.cs: Add support for --resources.
18889
18890         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18891         Make all types for the various array helper methods be integer.
18892
18893         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18894         CheckState to ConvCast.
18895
18896         (ConvCast): Now it takes a `checked' state argument, to avoid
18897         depending on the emit context for the conversion, and just using
18898         the resolve time setting.
18899
18900         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18901         instead of Invocation.EmitArguments.  We do not emit the original
18902         arguments, instead we emit those which have been converted to
18903         unsigned int expressions.
18904
18905         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18906
18907         * codegen.cs: ditto.
18908
18909         * expression.cs (LocalVariableReference): Drop the use of the
18910         Store function that depended on the variable index.
18911
18912         * statement.cs (VariableInfo): Drop the `Idx' property from this
18913         class, as this is not taking into account the indexes for
18914         temporaries tat we generate during the execution, getting the
18915         indexes wrong.
18916
18917         * class.cs: First emit class initializers, then call the parent
18918         constructor. 
18919
18920         * expression.cs (Binary): Fix opcode emision.
18921         (UnaryMutator.EmitCode): Support checked code generation
18922
18923         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18924         matches for events for both the Static and Instance scans,
18925         pointing to the same element.   Fix that.
18926
18927 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18928
18929         * rootcontext.cs (ResolveTree): Always set the
18930         interface_resolve_order, because nested interfaces will be calling
18931         into us.
18932
18933         * class.cs (GetInterfaceOrClass): Track the same resolution
18934         process used by TypeManager.LookupType.  This fixes the nested
18935         type lookups in class declarations (separate path from
18936         LookupType). 
18937
18938         (TypeContainer.DefineType): Also define nested interfaces.
18939         (TypeContainer.RegisterOrder): New public function used to
18940         register the order in which child interfaces need to be closed.
18941
18942         Nested interfaces need to be closed after their parents have been
18943         created. 
18944
18945         * interface.cs (InterfaceAttr): Put all the logic for computing
18946         the interface attribute here. 
18947
18948         (DefineInterface): Register our interface order with the
18949         RootContext or with the TypeContainer depending on the case.
18950
18951 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18952
18953         * cs-parser.jay: rework foreach statement to work with the new
18954         changes to the policy on SimpleNames.
18955
18956         * report.cs: support Stacktrace on warnings as well.
18957
18958         * makefile: drop --unsafe and /unsafe from the compile.
18959
18960 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18961
18962         * ecore.cs (StandardConversionExists): Modify to take an Expression
18963         as the first parameter. Ensure we do null -> reference type conversion
18964         checking.
18965
18966         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18967         temporary Expression objects.
18968
18969 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18970
18971         * interface.cs: workaround bug in method overloading resolution
18972         (there is already a bugzilla bug for it).
18973
18974 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18975
18976         We could also solve this problem by having a separate path for
18977         performing type lookups, instead of DoResolve, we could have a
18978         ResolveType entry point, and only participating pieces of the
18979         production (simplename, deref, array) would implement this. 
18980
18981         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18982         signal SimpleName to only resolve type names and not attempt to
18983         resolve anything else.
18984
18985         * expression.cs (Cast): Set the flag.
18986
18987         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18988
18989         * class.cs: Only report 108 if there is no `new' modifier.
18990
18991         * cs-parser.jay: rework foreach statement to work with the new
18992         changes to the policy on SimpleNames.
18993
18994         * report.cs: support Stacktrace on warnings as well.
18995
18996         * makefile: drop --unsafe and /unsafe from the compile.
18997
18998 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18999
19000         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19001         lookups here, instead of doing that at parse time.  This means
19002         that our grammar will not introduce `LocalVariableReferences' as
19003         expressions at this point.  That solves the problem of code like
19004         this:
19005
19006         class X {
19007            static void Main ()
19008            { int X = 1;
19009             { X x = null }}}
19010
19011         This is only half the fix.  The full fix requires parameters to
19012         also be handled in this way.
19013
19014         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19015         makes the use more obvious of the DeclSpace.  The
19016         ec.TypeContainer.TypeBuilder is now only used to pull the
19017         TypeBuilder for it.
19018
19019         My theory is that I can get rid of the TypeBuilder completely from
19020         the EmitContext, and have typecasts where it is used (from
19021         DeclSpace to where it matters).  
19022
19023         The only pending problem is that the code that implements Aliases
19024         is on TypeContainer, and probably should go in DeclSpace.
19025
19026         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19027         lookups here, instead of doing that at parse time.  This means
19028         that our grammar will not introduce `LocalVariableReferences' as
19029         expressions at this point.  That solves the problem of code like
19030         this:
19031
19032         class X {
19033            static void Main ()
19034            { int X = 1;
19035             { X x = null }}}
19036
19037         This is only half the fix.  The full fix requires parameters to
19038         also be handled in this way.
19039
19040         * class.cs (Property.DefineMethod): When implementing an interface
19041         method, set newslot, when implementing an abstract method, do not
19042         set the flag (before we tried never setting it, or always setting
19043         it, which is the difference).
19044         (Indexer.DefineMethod): same.
19045         (Method.DefineMethod): same.
19046
19047         * ecore.cs: Only set the status used flag if we get back a Field.
19048
19049         * attribute.cs: Temporary hack, so Paolo can keep working.
19050
19051 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19052
19053         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19054         the unmanaged type in the case we have a MarshalAs attribute.
19055
19056         (Resolve): Handle the case when we are parsing the special MarshalAs
19057         attribute [we need to store the unmanaged type to use later]
19058
19059         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19060         MarshalAs Attribute.
19061
19062         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19063         on parameters and accordingly set the marshalling info.
19064
19065 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19066
19067         * class.cs: Optimizing slightly by removing redundant code after
19068         we switched to the `NoTypes' return value.
19069         (Property.DefineMethod): use NoTypes here too.
19070
19071         This fixes the bug I introduced in my last batch of changes.
19072
19073 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19074
19075         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19076
19077         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19078         Enums since those are types too. 
19079
19080         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19081
19082         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19083         thanks to a call during the lookup process.
19084
19085 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19086
19087         * statement.cs (Foreach): Lots of work to accomodate a particular
19088         kind of foreach statement that I had not kept in mind.  It is
19089         possible to have foreachs on classes that provide a GetEnumerator
19090         method that return objects that implement the "pattern" for using
19091         a foreach, there is no need to support GetEnumerator
19092         specifically. 
19093
19094         This is needed to compile nant.
19095
19096         * decl.cs: Only report 114 if the member is not `Finalize' and if
19097         the warning level is at least 2.
19098
19099         * class.cs: Moved the compare function from Method to
19100         MethodSignature. 
19101
19102         (MethodSignature.InheritableMemberSignatureCompare): Add new
19103         filter function that is used to extract inheritable methods from a
19104         class. 
19105
19106         (Method.Define): Use the new `inheritable_method_signature_filter'
19107         delegate
19108
19109         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19110         command. 
19111
19112 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19115
19116         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19117
19118         * expression.cs: Pass location information to
19119         ConvertImplicitStandard. 
19120
19121         * class.cs: Added debugging code to track return values from
19122         interfaces. 
19123
19124 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19125
19126         * expression.cs (Is.DoResolve): If either side of the `is' is an
19127         interface, do not flag the warning.
19128
19129         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19130         for interfaces
19131
19132         * report.cs: Allow for --fatal to be used with --probe.
19133
19134         * typemanager.cs (NoTypes): Move the definition for the empty Type
19135         array here. 
19136
19137         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19138         properties. 
19139         (TypeContainer.DefineProxy): New function used to proxy to parent
19140         implementations when implementing interfaces.
19141         (TypeContainer.ParentImplements): used to lookup if our parent
19142         implements a public function that is required by an interface.
19143         (TypeContainer.VerifyPendingMethods): Hook this up.
19144
19145         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19146         `modules' and `assemblies' arraylists into arrays.  We only grow
19147         these are the very early start up of the program, so this improves
19148         the speedof LookupType (nicely measured).
19149
19150         * expression.cs (MakeByteBlob): Replaced unsafe code with
19151         BitConverter, as suggested by Paolo.
19152
19153         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19154         folding of string concatenation, but if either side is a string,
19155         and the other is not, then return null, and let the runtime use
19156         the concatenation on the string plus the object (using
19157         `Object.ToString'). 
19158
19159 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19160
19161         Constant Folding has been implemented now.
19162
19163         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19164         the error instead on types that are not supported in one's
19165         complement. 
19166
19167         * constant.cs (Constant and all children): New set of functions to
19168         perform implict and explicit conversions.
19169
19170         * ecore.cs (EnumConstant): Implement the new functions to perform
19171         conversion by proxying to the child expression.
19172
19173         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19174         own separate setting that can not be turned off from the command
19175         line using --unchecked or --checked and is only controlled using
19176         the checked/unchecked statements and expressions.  This setting is
19177         used by the constant folder to flag errors.
19178
19179         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19180         ConstantCheckState as well.   
19181
19182         During Resolve, they also have to flag the state, because the
19183         constant folder runs completely in the Resolve phase.
19184
19185         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19186         well.
19187
19188 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * cfold.cs: New file, this file contains the constant folder.
19191
19192         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19193         argument to track whether we are using the resulting address to
19194         load or store a value and provide better error messages. 
19195
19196         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19197         new AddressOf arguments.
19198
19199         * statement.cs (Foreach.EmitCollectionForeach): Update
19200
19201         * expression.cs (Argument.Emit): Call AddressOf with proper
19202         arguments to track usage.
19203
19204         (New.DoEmit): Call AddressOf with new arguments.
19205
19206         (Unary.Emit): Adjust AddressOf call.
19207
19208 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19209
19210         * cs-parser.jay (member_access): Change the case for pre-defined types
19211         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19212         this suggestion.
19213
19214         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19215         a method body.
19216
19217         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19218         essentially like methods and apply attributes like MethodImplOptions to them too.
19219
19220         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19221         not being null.
19222
19223         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19224         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19225         is the DeclSpace.
19226
19227         * Update code everywhere accordingly.
19228
19229         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19230
19231         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19232
19233 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19234
19235         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19236         try performing lookups against those instead of jumping straight into using
19237         the 'using' clauses.
19238
19239         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19240
19241         (LookupType): Perform lookups in implicit parents too.
19242
19243         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19244         sequence as RootContext.LookupType. 
19245
19246         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19247         the various cases of namespace lookups into this method.
19248
19249 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19250
19251         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19252         in positional arguments)
19253
19254         * class.cs (Operator): Update the AllowedModifiers to contain
19255         extern. 
19256
19257         * cs-parser.jay: Update operator declaration to allow for the
19258         operator body to be empty.
19259
19260         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19261         values. 
19262
19263 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19264
19265         * class.cs (Method.Emit): Label parameters.
19266
19267         * driver.cs: Return 1 or 0 as the program exit code.
19268
19269 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * expression.cs: Special case the `null' object when trying to
19272         auto-compute the type, as anything can be explicitly converted to
19273         that. 
19274
19275         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19276         spotting this Paolo.
19277
19278         (Expression.ImplicitNumericConversion): Perform comparissions of
19279         the type using the underlying type in the case of an enumeration
19280         rather than using the enumeration type for the compare.
19281
19282         Cope with the underlying == type case, which is not possible to
19283         catch before. 
19284
19285         (Expression.ConvertNumericExplicit): Perform comparissions of
19286         the type using the underlying type in the case of an enumeration
19287         rather than using the enumeration type for the compare.
19288
19289         * driver.cs: If the user does not supply an extension, assume .exe
19290
19291         * cs-parser.jay (if_statement): Rewrote so that we can track the
19292         location for the if statement.
19293
19294         * expression.cs (Binary.ConstantFold): Only concat strings when
19295         the operation is "+", not everything ;-)
19296
19297         * statement.cs (Statement.EmitBoolExpression): Take a location
19298         argument. 
19299         (If, While, Do): Track location.
19300
19301         * expression.cs (Binary.ResolveOperator): In the object + string
19302         case, I was missing a call to ConvertImplicit
19303
19304 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19305
19306         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19307         Location arguments. Ensure we use RootContext.LookupType to do our work
19308         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19309
19310         * interface.cs (PopulateMethod): Handle the type of the parameter being
19311         null gracefully.
19312
19313         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19314         have a params method with no fixed arguments and a call is made with no
19315         arguments.
19316
19317 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19320         the verbatim-string-literal
19321
19322         * support.cs (InternalParameters.ParameterModifier): handle null
19323         fixed parameters.
19324         (InternalParameters.ParameterType): ditto.
19325
19326         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19327         duplicating the name of the variable parameter.
19328         (GetParameterByName): Fix bug where we were not looking up array
19329         paramters if they were the only present (thanks Paolo!).
19330         (GetParameterInfo): We only have an empty set of types if both
19331         fixed and array are set to null.
19332         (GetParameterInfo-idx): Handle FixedParameter == null
19333
19334         * cs-parser.jay: Handle the case where there is no catch
19335         statements (missing null test).
19336
19337 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19338
19339         * driver.cs (MainDriver): Be conservative on our command line
19340         handling.
19341
19342         Catch DirectoryNotFoundException when calling GetFiles.
19343
19344         (SplitPathAndPattern): Used to split the input specification into
19345         a path and a pattern that we can feed to Directory.GetFiles.
19346
19347 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19348
19349         * statement.cs (Fixed): Implement the last case of the Fixed
19350         statement (string handling).
19351
19352         * expression.cs (StringPtr): New class used to return a char * to
19353         a string;  Used by the Fixed statement.
19354
19355         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19356
19357         * expression.cs (Binary.ResolveOperator): Remove redundant
19358         MemberLookup pn parent type.
19359         Optimize union call, we do not need a union if the types are the same.
19360         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19361         type.
19362
19363         Specialize the use of MemberLookup everywhere, instead of using
19364         the default settings. 
19365
19366         (StackAlloc): Implement stackalloc keyword.
19367
19368         * cs-parser.jay: Add rule to parse stackalloc.
19369
19370         * driver.cs: Handle /h, /help, /?
19371
19372         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19373         before we supported unsafe code.
19374
19375         * makefile: add --unsafe to the self compilation of mcs.
19376
19377 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * expression.cs (PointerArithmetic): New class that is used to
19380         perform pointer arithmetic.
19381         (Binary.Resolve): Handle pointer arithmetic
19382         Handle pointer comparission.
19383         (ArrayPtr): Utility expression class that is used to take the
19384         address of an array.
19385
19386         (ElementAccess): Implement array access for pointers
19387
19388         * statement.cs (Fixed): Implement fixed statement for arrays, we
19389         are missing one more case before we are done.
19390
19391         * expression.cs (Indirection): Implement EmitAssign and set the
19392         ExprClass to Variable.  This allows pointer dereferences to be
19393         treated as variables, and to have values assigned to them.
19394
19395         * ecore.cs (Expression.StoreFromPtr): New utility function to
19396         store values dereferencing.
19397
19398 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19399
19400         * expression.cs (Binary.ResolveOperator): Ensure that we are
19401         not trying to operate on a void type - this fixes the reported
19402         bug.
19403
19404         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19405         the parent implementation is sealed.
19406
19407         * ../errors/cs0239.cs : Add.
19408
19409         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19410
19411         * typemanager.cs (unverifiable_code_type): Corresponds to 
19412         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19413         which have unsafe code in them.
19414
19415         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19416         unsafe context.
19417
19418 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19419
19420         * cs-tokenizer.cs: Add support for @"litreal strings"
19421
19422         Make tokenizer accept pre-processor directives
19423         on any column (remove the old C-like limitation). 
19424
19425         * rootcontext.cs (EmitCode): Emit any global attributes.
19426         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19427
19428         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19429
19430         * cs-parser.jay: Add support for global attributes.  
19431
19432 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19433
19434         * expression.cs (Indirection): New helper class.  Unary will
19435         create Indirection classes to be able to implement the
19436         IMemoryLocation interface on it.
19437
19438 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * cs-parser.jay (fixed_statement): reference the right statement.
19441
19442         * statement.cs (Fixed.Emit): Finish implementing the fixed
19443         statement for the &x case.
19444
19445 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19446
19447         * class.cs (Property.Define, Method.Define): Remove newslot when
19448         `implementing'.  
19449
19450         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19451         wrong.  NewSlot should only be used if the `new' keyword is present.
19452
19453         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19454         locating our system dir.  Sorry about this.
19455
19456 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19457
19458         * driver.cs (GetSystemDir): Compute correctly the location of our
19459         system assemblies.  I was using the compiler directory instead of
19460         the library directory.
19461
19462 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19463
19464         * expression.cs (BetterFunction): Put back in what Miguel commented out
19465         since it is the correct fix. The problem is elsewhere ;-)
19466
19467         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19468         parameters of the parms method are themselves compatible or not !
19469
19470         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19471         to check that a class implements an interface before saying that an implicit
19472         conversion was allowed. Use ImplementsInterface to do the checking.
19473
19474 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * class.cs (Method.Define): Track whether we are an explicit
19477         implementation or not.  And only call DefineMethodOverride if we
19478         are an explicit implementation.
19479
19480         (Property.DefineMethod): Ditto.
19481
19482 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19483
19484         * expression.cs (BetterFunction): Catch hideous bug which was
19485          preventing us from detecting ambiguous calls due to implicit casts i.e
19486         cs0121.
19487
19488 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19489
19490         * support.cs (Pair): Remove un-needed method.  I figured why I was
19491         getting the error in cs-parser.jay, the variable in a foreach loop
19492         is readonly, and the compiler does not really treat this as a variable.
19493
19494         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19495         instead of EQUALS in grammar.  
19496
19497         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19498
19499         * expression.cs (Unary.DoResolve): Check whether the argument is
19500         managed or not.
19501
19502 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * support.cs: Api for Pair to set a value.  Despite the fact that
19505         the variables are public the MS C# compiler refuses to compile
19506         code that accesses the field if the variable is part of a foreach
19507         statement. 
19508
19509         * statement.cs (Fixed): Begin implementation of the fixed
19510         statement.
19511
19512         (Block.AddVariable): Return the VariableInfo on success and null
19513         on failure instead of true/false. 
19514
19515         * cs-parser.jay (foreach): Catch errors on variables already
19516         defined (we were ignoring this value before) and properly unwind
19517         the block hierarchy
19518
19519         (fixed_statement): grammar for the fixed statement.
19520
19521 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19524         pointer types to be incretemented.
19525
19526         (SizeOf): Implement.
19527
19528         * cs-parser.jay (pointer_member_access): Implement
19529         expr->IDENTIFIER production.
19530
19531         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19532         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19533         on safe contexts.
19534
19535         (Unary): Implement indirection.
19536
19537         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19538         use in non-unsafe context).
19539
19540         (SimpleName.DoResolve): Check for pointers in field access on safe
19541         contexts. 
19542
19543         (Expression.LoadFromPtr): Factor the load-indirect code in this
19544         function.  This was duplicated in UnboxCast and ParameterReference
19545
19546 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19547
19548         * expression.cs (ComposedCast): report an error if a pointer cast
19549         is used in a safe region.
19550
19551         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19552         pointer type casts in unsafe context.
19553
19554         * codegen.cs (EmitContext): Set up IsUnsafe.
19555
19556         * cs-parser.jay (non_expression_type): Add productions for pointer
19557         casts. 
19558
19559         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19560         code.  We should not use force into static mode if the method is
19561         not virtual.  Fixes bug in MIS
19562
19563         * statement.cs (Do.Emit, While.Emit, For.Emit,
19564         Statement.EmitBoolExpression): Add support to Do and While to
19565         propagate infinite loop as `I do return' semantics.
19566
19567         Improve the For case to also test for boolean constants.
19568
19569         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19570         to the list of attributes we can add.
19571
19572         Remove `EmitContext' argument.
19573
19574         * class.cs (Method.Define): Apply parameter attributes.
19575         (Constructor.Define): Apply parameter attributes.
19576         (MethodCore.LabelParameters): Move here the core of labeling
19577         parameters. 
19578
19579         * support.cs (ReflectionParameters.ParameterModifier,
19580         InternalParameters.ParameterModifier): Use IsByRef on the type and
19581         only return the OUT bit for these parameters instead of in/out/ref
19582         flags.
19583
19584         This is because I miss-understood things.  The ParameterInfo.IsIn
19585         and IsOut represent whether the parameter has the [In] and [Out]
19586         attributes set.  
19587
19588 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * ecore.cs (FieldExpr.Emit): Release temporaries.
19591
19592         * assign.cs (LocalTemporary.Release): new function.
19593
19594         * codegen.cs (EmitContext.GetTemporaryStorage,
19595         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19596         temporary storage.  Now we can "put back" localbuilders when we
19597         are done with them
19598
19599 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19602         need to make a copy of the variable to generate verifiable code.
19603
19604 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * driver.cs: Compute dynamically the system directory.
19607
19608         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19609         Slower, but more generally useful.  Used by the abstract
19610         registering implementation. 
19611
19612         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19613         the rules for the special rule on Type/instances.  First check if
19614         we have the same name, and if so, try that special static path
19615         rather than the instance path.
19616
19617 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19618
19619         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19620         for, while and if.
19621
19622         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19623         Enum, ValueType, Delegate or Array for non-corlib compiles.
19624
19625         * cs-tokenizer.cs: Catch long identifiers (645)
19626
19627         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19628         piece of code.
19629
19630         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19631         fix, we were returning too early, so we were not registering
19632         pending methods from abstract classes.
19633
19634         Do not register pending methods if the class is abstract.
19635
19636         * expression.cs (Conditional.DoResolve): Report circular implicit
19637         conversions when we neecd to compute it for conditional
19638         expressions. 
19639
19640         (Is.DoResolve): If the expression is always of the provided type,
19641         flag warning 183.  If the expression can not ever be of the
19642         provided type flag warning 184.
19643
19644         * class.cs: Catch 169 as well.
19645
19646         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19647         read. 
19648
19649 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19650
19651         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19652
19653 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19654
19655         * interface.cs: (PopulateMethod): Check for pointers being defined
19656         only if the unsafe context is active.
19657         (PopulateProperty): ditto.
19658         (PopulateIndexer): ditto.
19659
19660         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19661         specified.  If pointers are present, make sure that they are
19662         present in an unsafe context.
19663         (Constructor, Constructor.Define): ditto.
19664         (Field, Field.Define): ditto.
19665         (Property, Property.Define): ditto.
19666         (Event, Event.Define): ditto.
19667
19668         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19669         hashtable if there are classes or structs defined.
19670
19671         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19672         code, as the constant resolution moved.
19673
19674         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19675         the metadata, so we can flag error 133. 
19676
19677         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19678         pointer is being declared in an unsafe context.
19679
19680 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * modifiers.cs (Modifiers.Check): Require a Location argument.
19683         Report error 227 for Unsafe use.
19684
19685         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19686
19687         * statement.cs (For.Emit): If the test is null, then report that
19688         we do `return', as we wont reach anything afterwards.
19689
19690         (Switch.SwitchGoverningType): Track the expression that matched
19691         the conversion.
19692
19693         * driver.cs: Allow negative numbers as an error code to flag.
19694
19695         * cs-parser.jay: Handle 1551.
19696
19697         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19698
19699 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * cs-parser.jay: Report 1518 (type declaration can only contain
19702         class, struct, interface, enum or delegate)
19703
19704         (switch_label): Report 1523 (keywords `case' or `default' must
19705         preced code)
19706
19707         (opt_switch_sections): Report 1522 (empty switch)
19708
19709         * driver.cs: Report 1515 (response file specified multiple times)
19710         Report 1516 (Source file specified multiple times).
19711
19712         * expression.cs (Argument.Resolve): Signal 1510
19713
19714         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19715         access not allowed in static code)
19716
19717 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19718
19719         * typemanager.cs (IsPointerType): Utility method which we are going
19720         to need a lot.
19721
19722         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19723         the object type, so we take care of that.
19724
19725         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19726
19727         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19728         added to non-params parameters :-)
19729
19730         * typemanager.cs (CSharpName): Include 'void' type too. 
19731
19732         (void_ptr_type): Include in the set of core types.
19733
19734         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19735         duplicating code.
19736
19737         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19738         an unsafe context.
19739
19740         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19741         completely forgotten about it.
19742
19743 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19744
19745         * cs-parser.jay (pointer_type): Add. This begins our implementation
19746         of parsing rules for unsafe code.
19747
19748         (unsafe_statement): Implement.
19749
19750         (embedded_statement): Modify to include the above.
19751
19752         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19753
19754         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19755         if the current context is an unsafe one.
19756
19757         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19758         are handled differently, we need separate rules for them.
19759
19760         (local_variable_declaration): Update to use local_variable_pointer_type
19761         to allow variable declarations of unmanaged pointer types.
19762
19763         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19764         in unsafe contexts.
19765
19766         * ../errors/cs0214.cs : Add.
19767
19768 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19769
19770         * makefile: remove 'response' file when cleaning.
19771
19772 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * cs-parser.jay: Report 1524.
19775
19776 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19777
19778         * typemanager.cs (RegisterMethod): drop checking if we have
19779         registered this from here
19780
19781 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19782
19783         * class.cs (Method.EmitDestructor): Implement calling our base
19784         destructor. 
19785
19786         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19787         value of InFinally.
19788
19789         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19790         this routine and will wrap the call in a try/catch block.  Deal
19791         with the case.
19792
19793 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19794
19795         * ecore.cs (Expression.MemberLookup): instead of taking a
19796         parameter `same_type' that was used to tell whether we could
19797         access private members we compute our containing type from the
19798         EmitContext.
19799
19800         (FieldExpr): Added partial support for volatile fields.  This does
19801         not work for volatile fields exposed from assemblies, as I can not
19802         figure out how to extract the modreq from it.
19803
19804         Updated all the source files to use this.
19805
19806         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19807         because it is referenced by MemberLookup very often. 
19808
19809 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19810
19811         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19812         TypeBuilder.GetCustomAttributes to retrieve what we need.
19813
19814         Get rid of redundant default_member_attr_type as this is the same as
19815         default_member_type which already exists.
19816
19817         * interface.cs, attribute.cs : Update accordingly.
19818
19819 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19820
19821         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19822         work for TYpeBuilders though.  Ravi, can you please fix this?
19823
19824         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19825
19826         * expression.cs (Argument.Emit): Handle the case of ref objects
19827         being passed to ref functions;  
19828
19829         (ParameterReference.EmitLoad): Loads the content of the pointer
19830         without dereferencing.
19831
19832 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19833
19834         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19835
19836 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19837
19838         * class.cs (Indexer.DefineMethod): Incorporate the interface
19839         type in the name of the method if we are doing explicit interface
19840         implementation.
19841
19842         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19843
19844         (BetterConversion): Fix extremely trivial bug where we were referring to
19845         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19846         again !
19847
19848         * ../errors/bug16.cs : Add although we have fixed it.
19849
19850 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19851
19852         * expression.cs (BaseIndexer): Begin implementation.
19853
19854         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19855
19856         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19857         production directly to remove a shift/reduce, and implement
19858         explicit interface implementation.
19859
19860         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19861         after a floating point suffix.
19862
19863         * expression.cs (DoNumericPromotions): Improved the conversion for
19864         uint/uint.  If we have a constant, we avoid doing a typecast to a
19865         larger type.
19866
19867         * class.cs (Indexer): Implement explicit interface implementation
19868         for indexers.
19869
19870 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19871
19872         * class.cs: make the default instance constructor public and hidebysig.
19873
19874 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19875
19876         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19877         so we can call it from elsewhere.
19878
19879         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19880         we emit it internally if the class has a defined indexer; otherwise the user
19881         emits it by decorating the class definition with the DefaultMemberAttribute.
19882
19883         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19884         attribute is not used on a type which defines an indexer.
19885
19886         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19887         character when we skip whitespace.
19888
19889         * ../errors/cs0646.cs : Add.
19890
19891 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19892
19893         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19894         again. 
19895
19896         * makefile: Add practical target `mcs3.exe' which builds the third
19897         generation compiler. 
19898
19899         * expression.cs (New): Fix structures constructor calling.
19900
19901         * class.cs (Property, Method, Indexer): Emit Final flag on the
19902         method if we are an interface implementation and we are not
19903         abstract. 
19904
19905         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19906         whether this property is referencing a `base' method.
19907
19908         * expression.cs (Invocation.EmitCall): take an extra argument:
19909         is_base, this is used to determine whether the `call' or
19910         `callvirt' opcode should be used.
19911
19912
19913         * delegate.cs: update EmitCall.
19914
19915         * class.cs (Method.Define): Set NewSlot for the cases where we are
19916         not implementing an interface method.
19917
19918         (Property.Define): ditto.
19919
19920 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19921
19922         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19923         'r'.  Allows mcs to parse itself fully.
19924
19925 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19926
19927         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19928         of the number of initializers that require the InitializeArray method.
19929
19930         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19931         update the above field where necessary.
19932
19933         (MakeByteBlob): Update accordingly.
19934
19935         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19936         greater than 2.
19937
19938         (EmitDynamicInitializers): Update in accordance with the new optimization.
19939
19940         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19941         same OpCode applies.
19942
19943         * cs-parser.jay : Fix some glaring errors I introduced.
19944
19945 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19946
19947         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19948         so that we can check for name clashes there too.
19949
19950         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19951         for interface indexers.
19952
19953         * interfaces.cs (Define): Emit the default member attribute.
19954
19955         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19956         variable was being referred to while setting the value ;-)
19957
19958 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19959
19960         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19961         byte-by-byte information when we know the data is zero.
19962
19963         Make the block always a multiple of 4, because
19964         DefineInitializedData has a bug.
19965
19966         * assign.cs: Fix, we should assign from the temporary, not from
19967         the source. 
19968
19969         * expression.cs (MakeByteBlob): Fix my incorrect code.
19970
19971 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19972
19973         * typemanager.cs (EnumToUnderlying): This function is used to get
19974         the underlying type from an enumeration, because it does not
19975         always work. 
19976
19977         * constant.cs: Use the I4_S form for values between -128 and 127.
19978
19979         * statement.cs (Block.LookupLabel): Looks up a label.
19980         (Block): Drop support for labeled blocks.
19981
19982         (LabeledStatement): New kind of statement that represents a label
19983         only.
19984
19985         (Goto): Finally implement this bad boy.
19986
19987         * cs-parser.jay: Update to reflect new mechanism to implement
19988         labels.
19989
19990 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * codegen.cs (EmitContext.This): a codegen property that keeps the
19993         a single instance of this instead of creating many different this
19994         instances. 
19995
19996         * delegate.cs (Delegate.DoResolve): Update to use the property;
19997
19998         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19999
20000         * expression.cs (BaseAccess.DoResolve): Ditto.
20001
20002 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20003
20004         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20005         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20006
20007         (InitCoreTypes): Update accordingly.
20008
20009         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20010         so we can quickly store the state.
20011
20012         (ApplyAttributes): Set the correct implementation flags
20013         for InternalCall methods.
20014
20015 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20016
20017         * expression.cs (EmitCall): if a method is not virtual, then do
20018         not use callvirt on it.
20019
20020         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20021         user defined stuff) requires the use of stobj, which takes an
20022         address on the stack instead of an array and an index.  So emit
20023         the Ldelema operation for it.
20024
20025         (EmitStoreOpcode): Use stobj for valuetypes.
20026
20027         (UnaryMutator.EmitCode): Use the right 1 value depending on
20028         whether we are dealing with int64/uint64, float or doubles.
20029
20030         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20031         constructors that I implemented last night.
20032
20033         (Constructor.IsDefault): Fix to work properly for static
20034         constructors.
20035
20036         * cs-parser.jay (CheckDef): report method signature errors.
20037         Update error number 103 to be 132.
20038
20039         * decl.cs: New AdditionResult enumeration value: MethodExists.
20040         Although we do this check for methods later on in the semantic
20041         analysis, catching repeated default constructors is so easy that
20042         we catch these here. 
20043
20044         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20045         promotions code.
20046
20047         (ParameterReference.EmitAssign, Emit): handle
20048         bools as bytes.
20049
20050         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20051         (ArrayAccess.EmitStoreOpcode): ditto.
20052
20053         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20054
20055         * expression.cs (MakeByteBlob): Complete all the missing types
20056         (uint, short, ushort, byte, sbyte)
20057
20058         * class.cs: Only init instance field initializers on instance
20059         constructors. 
20060
20061         Rename `constructors' to instance_constructors. 
20062
20063         (TypeContainer.AddConstructor): Only add constructors to the list
20064         if it is not static.
20065
20066         Make sure that we handle default_static_constructor independently
20067         everywhere where we handle instance_constructors
20068
20069 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20070
20071         * class.cs: Do not lookup or create a base initializer for a
20072         static constructor.
20073
20074         (ConstructorInitializer.Resolve): use the proper type to lookup
20075         for constructors.
20076
20077         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20078
20079         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20080         in DeclSpace. 
20081
20082         * decl.cs: CloseType is now an virtual method, the default
20083         implementation just closes this type.
20084
20085 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20086
20087         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20088         to PreserveSig by default. Also emit HideBySig on such methods.
20089
20090         Basically, set the defaults to standard values.
20091
20092         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20093         argument, if candidate is better, it can't be worse than the best !
20094
20095         (Invocation): Re-write bits to differentiate between methods being
20096         applicable in their expanded form and their normal form - for params
20097         methods of course.
20098
20099         Get rid of use_standard everywhere as only standard conversions are allowed
20100         in overload resolution. 
20101
20102         More spec conformance.
20103
20104 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20105
20106         * driver.cs: Add --timestamp, to see where the compiler spends
20107         most of its time.
20108
20109         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20110         `this' in static code.
20111
20112         (SimpleName.DoResolve): Implement in terms of a helper function
20113         that allows static-references to be passed upstream to
20114         MemberAccess.
20115
20116         (Expression.ResolveWithSimpleName): Resolve specially simple
20117         names when called by MemberAccess to implement the special
20118         semantics. 
20119
20120         (Expression.ImplicitReferenceConversion): Handle conversions from
20121         Null to reference types before others, as Null's type is
20122         System.Object. 
20123
20124         * expression.cs (Invocation.EmitCall): Handle the special case of
20125         calling methods declared on a reference type from a ValueType
20126         (Base classes System.Object and System.Enum)
20127
20128         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20129         the left hand side is a TypeExpr, not on every enumeration. 
20130
20131         (Binary.Resolve): If types are reference types, then do a cast to
20132         object on operators != and == of both arguments.
20133
20134         * typemanager.cs (FindMembers): Extract instance and static
20135         members if requested.
20136
20137         * interface.cs (PopulateProperty): Use void_type instead of null
20138         as the return type for the setter method.
20139
20140         (PopulateIndexer): ditto.
20141
20142 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20143
20144         * support.cs (ReflectionParameters): Fix minor bug where we
20145         were examining the wrong parameter for the ParamArray attribute.
20146
20147         Cope with requests for the type of the parameter at position
20148         greater than the params parameter's. We now return the element
20149         type of the params array as that makes more sense.
20150
20151         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20152         accordingly as we no longer have to extract the element type
20153         ourselves.
20154
20155         (Invocation.OverloadResolve): Update.
20156
20157 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20158
20159         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20160         against IEnumerator, test whether the return value is a descendant
20161         of the IEnumerator interface.
20162
20163         * class.cs (Indexer.Define): Use an auxiliary method to implement
20164         the other bits of the method definition.  Begin support for
20165         explicit interface implementation.
20166
20167         (Property.DefineMethod): Use TypeManager.void_type instead of null
20168         for an empty return value.
20169
20170 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20171
20172         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20173         dealing with a FieldExpr which is composed of a FieldBuilder, in
20174         the code path we did extract the constant, but we should have
20175         obtained the underlying value to be able to cast it (otherwise we
20176         end up in an infinite loop, this is what Ravi was running into).
20177
20178         (ArrayCreation.UpdateIndices): Arrays might be empty.
20179
20180         (MemberAccess.ResolveMemberAccess): Add support for section
20181         14.5.4.1 that deals with the special case of E.I when E is a type
20182         and something else, that I can be a reference to a static member.
20183
20184         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20185         handle a particular array type to create byte blobs, it is just
20186         something we dont generate byteblobs for.
20187
20188         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20189         arguments. 
20190
20191         * location.cs (Push): remove the key from the hashtable that we
20192         are about to add.   This happens for empty files.
20193
20194         * driver.cs: Dispose files after we have parsed them.
20195
20196         (tokenize): new function that only runs the tokenizer on its
20197         input, for speed testing.
20198
20199 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20200
20201         * class.cs (Event.Define): Define the private field only if there
20202         are no accessors defined.
20203
20204         * expression.cs (ResolveMemberAccess): If there is no associated
20205         field with the event, that means we have an event defined with its
20206         own accessors and we should flag error cs0070 since transforming
20207         ourselves into a field is not valid in that case.
20208
20209         * ecore.cs (SimpleName.DoResolve): Same as above.
20210
20211         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20212         and charset to sane values.
20213
20214 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20215
20216         * assign.cs (DoResolve): Perform check on events only if they 
20217         are being accessed outside the declaring type.
20218
20219         * cs-parser.jay (event_declarations): Update rules to correctly
20220         set the type of the implicit parameter etc.
20221
20222         (add_accessor, remove_accessor): Set current local parameters.
20223
20224         * expression.cs (Binary): For delegate addition and subtraction,
20225         cast the return value from the method into the appropriate delegate
20226         type.
20227
20228 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20229
20230         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20231         of these as the workaround is unnecessary.
20232
20233         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20234         delegate data - none of that is needed at all.
20235
20236         Re-write bits to extract the instance expression and the delegate method
20237         correctly.
20238
20239         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20240         on delegates too.
20241
20242         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20243         of attaching attributes instead of duplicating code everywhere.
20244
20245         * everywhere : Update code to do attribute emission using the above method.
20246
20247 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20248
20249         * expression.cs (IsParamsMethodApplicable): if there are not
20250         parameters, return immediately.
20251
20252         * ecore.cs: The 0 literal can be implicity converted to an enum
20253         type. 
20254
20255         (SimpleName.DoResolve): First lookup the type, then lookup the
20256         members. 
20257
20258         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20259         want to get its address.  If the InstanceExpression is not
20260         addressable, store the result in a temporary variable, then get
20261         the address of it.
20262
20263         * codegen.cs: Only display 219 errors on warning level or above. 
20264
20265         * expression.cs (ArrayAccess): Make it implement the
20266         IMemoryLocation interface.
20267
20268         (Binary.DoResolve): handle the operator == (object a, object b)
20269         and operator != (object a, object b) without incurring into a
20270         BoxedCast (because 5 != o should never be performed).
20271
20272         Handle binary enumerator operators.
20273
20274         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20275         value type, otherwise use Ldelem_ref.
20276
20277         Use precomputed names;
20278
20279         (AddressOf): Implement address of
20280
20281         * cs-parser.jay (labeled_statement): Fix recursive block
20282         addition by reworking the production.
20283
20284         * expression.cs (New.DoEmit): New has a special case:
20285                 
20286                  If we are dealing with a ValueType, we have a few
20287                  situations to deal with:
20288                 
20289                     * The target of New is a ValueType variable, that is
20290                       easy, we just pass this as the variable reference
20291                 
20292                     * The target of New is being passed as an argument,
20293                       to a boxing operation or a function that takes a
20294                       ValueType.
20295                 
20296                       In this case, we need to create a temporary variable
20297                       that is the argument of New.
20298
20299
20300 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20301
20302         * rootcontext.cs (LookupType): Check that current_type is not null before
20303         going about looking at nested types.
20304
20305         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20306         not implement the IAssignMethod interface any more.
20307
20308         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20309         where we tranform them into FieldExprs if they are being resolved from within
20310         the declaring type.
20311
20312         * ecore.cs (SimpleName.DoResolve): Do the same here.
20313
20314         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20315
20316         * ../errors/bug10.cs : Add.
20317
20318         * ../errors/cs0070.cs : Add.
20319
20320         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20321
20322         * assign.cs : Get rid of EventIsLocal everywhere.
20323
20324 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * ecore.cs (ConvertIntLiteral): finished the implementation.
20327
20328         * statement.cs (SwitchLabel): Convert the value we are using as a
20329         key before looking up the table.
20330
20331 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20332
20333         * codegen.cs (EmitTopBlock): Require a Location argument now.
20334
20335         * cs-parser.jay (constructor_declarator): We need to setup
20336         current_local_parameters before we parse the
20337         opt_constructor_initializer, to allow the variables to be bound
20338         to the constructor arguments.
20339
20340         * rootcontext.cs (LookupType): First lookup nested classes in our
20341         class and our parents before we go looking outside our class.
20342
20343         * expression.cs (ConstantFold): Extract/debox the values at the
20344         beginnning. 
20345
20346         * rootcontext.cs (EmitCode): Resolve the constants first before we
20347         resolve the types.  This is not really needed, but it helps debugging.
20348
20349         * statement.cs: report location.
20350
20351         * cs-parser.jay: pass location to throw statement.
20352
20353         * driver.cs: Small bug fix.
20354
20355         * report.cs: Updated format to be 4-zero filled digits.
20356
20357 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20358
20359         * expression.cs (CheckIndices): Fix minor bug where the wrong
20360         variable was being referred to ;-)
20361
20362         (DoEmit): Do not call EmitStaticInitializers when the 
20363         underlying type is System.Object.
20364
20365 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20366
20367         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20368         and do the usual workaround for SRE.
20369
20370         * class.cs (MyEventBuilder.EventType): New member to get at the type
20371         of the event, quickly.
20372
20373         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20374
20375         * assign.cs (Assign.DoResolve): Handle the case when the target
20376         is an EventExpr and perform the necessary checks.
20377
20378         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20379         interface.
20380
20381         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20382
20383         (EventExpr): Set the type in the constructor itself since we 
20384         are meant to be born fully resolved.
20385
20386         (EventExpr.Define): Revert code I wrote earlier.
20387                 
20388         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20389         instance expression is null. The instance expression is a This in that case
20390         or a null, depending on whether it is a static method or not.
20391
20392         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20393         refers to more than one method.
20394
20395         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20396         and accordingly flag errors.
20397
20398 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20401
20402 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20403
20404         * location.cs (ToString): Provide useful rutine.
20405
20406 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20407
20408         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20409         objects, return the actual integral boxed.
20410
20411         * statement.cs (SwitchLabel): define an ILLabel for each
20412         SwitchLabel. 
20413
20414         (Switch.CheckSwitch): If the value is a Literal, extract
20415         the underlying literal.
20416
20417         Also in the unused hashtable we had, add the SwitchLabel so we can
20418         quickly look this value up.
20419
20420         * constant.cs: Implement a bunch of new constants.  Rewrite
20421         Literal based on this.  Made changes everywhere to adapt to this.
20422
20423         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20424         dereferencing array only once, and also copes with enumrations.
20425
20426         bytes are two bytes wide, not one.
20427
20428         (Cast): Perform constant conversions.
20429
20430         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20431         wrappers to the literals here.
20432
20433         * expression.cs (DoNumericPromotions): long literals can converted
20434         to ulong implicity (this is taken care of elsewhere, but I was
20435         missing this spot).
20436
20437         * ecore.cs (Expression.Literalize): Make the return type Literal,
20438         to improve type checking.
20439
20440         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20441
20442 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * literal.cs: Revert code from ravi that checked the bounds.  The
20445         bounds are sane by the definition of the type itself. 
20446
20447         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20448         need to actually look up in our parent hierarchy for interfaces
20449         implemented. 
20450
20451         * const.cs: Use the underlying type for enumerations
20452
20453         * delegate.cs: Compute the basename for the delegate creation,
20454         that should fix the delegate test case, and restore the correct
20455         Type Lookup semantics in rootcontext
20456
20457         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20458         referencing a nested type with the Reflection API is using the "+"
20459         sign. 
20460
20461         * cs-parser.jay: Do not require EOF token at the end.
20462
20463 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20464
20465         * rootcontext.cs (LookupType): Concatenate type names with
20466         a '.' instead of a '+' The test suite passes again.
20467
20468         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20469         field of the enumeration.
20470
20471         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20472         the case when the member is an EventExpr.
20473
20474         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20475         static has an associated instance expression.
20476
20477         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20478
20479         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20480
20481         * class.cs (Event.Define): Register event and perform appropriate checks
20482         for error #111.
20483
20484         We define the Add and Remove methods even if the use provides none because
20485         in that case, we provide default implementations ourselves.
20486
20487         Define a private field of the type of the event. This is done by the CSC compiler
20488         and we should be doing it too ;-)
20489
20490         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20491         More methods we use in code we generate.
20492
20493         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20494         is important.
20495
20496         (InitCoreTypes): Update accordingly for the above.
20497
20498         * class.cs (Event.Emit): Generate code for default accessors that we provide
20499
20500         (EmitDefaultMethod): Do the job in the above.
20501
20502         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20503         appropriate place.
20504
20505 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20508         builders even if we were missing one.
20509
20510         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20511         pass the Basename as our class name instead of the Name.  The
20512         basename will be correctly composed for us.
20513
20514         * parameter.cs (Paramters): Now takes a Location argument.
20515
20516         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20517         make all the code call directly LookupType in RootContext and take
20518         this chance to pass the Location information everywhere.
20519
20520         * Everywhere: pass Location information.
20521
20522 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20523
20524         * class.cs (Constructor.Define): Updated way of detecting the
20525         length of the parameters.
20526
20527         (TypeContainer.DefineType): Use basename as the type name for
20528         nested types.
20529
20530         (TypeContainer.Define): Do not recursively define types here, as
20531         definition is taken care in order by the RootContext.
20532
20533         * tree.cs: Keep track of namespaces in a per-file basis.
20534
20535         * parameter.cs (Parameter.ComputeSignature): Update to use
20536         DeclSpace. 
20537
20538         (Parameters.GetSignature): ditto.
20539
20540         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20541         instead of a TypeContainer.
20542
20543         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20544         resolve names.  Because we need to be resolve in our context, not
20545         our parents.
20546
20547         * driver.cs: Implement response files.
20548
20549         * class.cs (TypeContainer.DefineType): If we are defined, do not
20550         redefine ourselves.
20551
20552         (Event.Emit): Emit the code for add/remove handlers.
20553         (Event.Define): Save the MethodBuilders for add/remove.
20554
20555         * typemanager.cs: Use pair here too.
20556
20557         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20558         DictionaryEntry requires the first argument to be non-null.  
20559
20560         (enum_declaration): Compute full name for registering the
20561         enumeration.
20562
20563         (delegate_declaration): Instead of using
20564         formal_parameter_list, use opt_formal_parameter_list as the list
20565         can be empty.
20566
20567         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20568         (EventParsing): New property that controls whether `add' and
20569         `remove' are returned as tokens or identifiers (for events);
20570
20571 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20572
20573         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20574         use MyEventBuilder only and let it wrap the real builder for us.
20575
20576         (MyEventBuilder): Revamp constructor etc.
20577
20578         Implement all operations that we perform on EventBuilder in precisely the same
20579         way here too.
20580
20581         (FindMembers): Update to use the EventBuilder member.
20582
20583         (Event.Emit): Update accordingly.
20584
20585 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20586
20587         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20588         by calling the appropriate methods.
20589
20590         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20591         useful.
20592
20593         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20594
20595 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20596
20597         * delegate.cs (Delegate.Populate): Check that the return type
20598         and various parameters types are indeed accessible.
20599
20600         * class.cs (Constructor.Define): Same here.
20601
20602         (Field.Define): Ditto.
20603
20604         (Event.Define): Ditto.
20605
20606         (Operator.Define): Check that the underlying Method defined itself
20607         correctly - so it's MethodBuilder should not be null.
20608
20609         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20610         expression happens to be null.
20611
20612         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20613         members but as of now we don't seem to be able to do anything really useful with it.
20614
20615         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20616         not the EventBuilder.
20617
20618 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20619
20620         * cs-tokenizer.cs: Add support for defines.
20621         Add support for #if, #elif, #else, #endif
20622
20623         (eval_var): evaluates a variable.
20624         (eval): stubbed for evaluating functions.
20625
20626         * cs-parser.jay: Pass the defines information
20627
20628         * driver.cs: Add --define command line option.
20629
20630         * decl.cs: Move MemberCore here.
20631
20632         Make it the base class for DeclSpace.  This allows us to catch and
20633         report 108 and 109 for everything now.
20634
20635         * class.cs (TypeContainer.Define): Extract all the members
20636         before populating and emit the warning 108 (new keyword required
20637         to override) instead of having each member implement this.
20638
20639         (MemberCore.Define): New abstract method, we will be using this in
20640         the warning reporting engine in Populate.
20641
20642         (Operator.Define): Adjust to new MemberCore protocol. 
20643
20644         * const.cs (Const): This does not derive from Expression, it is a
20645         temporary object we use to create fields, it is a MemberCore. 
20646
20647         * class.cs (Method.Define): Allow the entry point to be in a
20648         specific class.
20649
20650         * driver.cs: Rewrite the argument handler to clean it up a bit.
20651
20652         * rootcontext.cs: Made it just an auxiliary namespace feature by
20653         making everything static.
20654
20655         * driver.cs: Adapt code to use RootContext type name instead of
20656         instance variable.
20657
20658         * delegate.cs: Remove RootContext argument.
20659
20660         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20661         argument. 
20662
20663         * class.cs (Event.Define): The lookup can fail.
20664
20665         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20666
20667         * expression.cs: Resolve the this instance before invoking the code.
20668
20669 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20670
20671         * cs-parser.jay: Add a production in element_access that allows
20672         the thing to become a "type" reference.  This way we can parse
20673         things like "(string [])" as a type.
20674
20675         Note that this still does not handle the more complex rules of
20676         casts. 
20677
20678
20679         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20680
20681         * ecore.cs: (CopyNewMethods): new utility function used to
20682         assemble the list of methods from running FindMembers.
20683
20684         (MemberLookup): Rework FindMembers so that 
20685
20686 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20687
20688         * class.cs (TypeContainer): Remove Delegates who fail to be
20689         defined.
20690
20691         * delegate.cs (Populate): Verify that we dont get null return
20692         values.   TODO: Check for AsAccessible.
20693
20694         * cs-parser.jay: Use basename to emit error 574 (destructor should
20695         have the same name as container class), not the full name.
20696
20697         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20698         possible representation.  
20699
20700         Also implements integer type suffixes U and L.
20701
20702 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20703
20704         * expression.cs (ArrayCreation.DoResolve): We need to do the
20705         argument resolution *always*.
20706
20707         * decl.cs: Make this hold the namespace.  Hold the root context as
20708         well.
20709         (LookupType): Move here.
20710
20711         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20712
20713         * location.cs (Row, Name): Fixed the code, it was always returning
20714         references to the first file.
20715
20716         * interface.cs: Register properties defined through interfaces.
20717
20718         * driver.cs: Add support for globbing on the command line
20719
20720         * class.cs (Field): Make it derive from MemberCore as well.
20721         (Event): ditto.
20722
20723 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20724
20725         * class.cs (Event::Define): Check that the type of the event is a delegate
20726         type else flag error #66.
20727
20728         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20729         same.
20730
20731         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20732         values of EntryPoint, CharSet etc etc.
20733
20734         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20735
20736         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20737         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20738         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20739         which needs this to do its work.
20740
20741         * ../errors/cs0066.cs : Add.
20742
20743 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20746         helper functions.
20747
20748         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20749         clears out the parameters field.
20750         (MemberSignatureCompare): Cleanup
20751
20752         (MemberCore): New base class used to share code between MethodCore
20753         and Property.
20754
20755         (RegisterRequiredImplementations) BindingFlags.Public requires
20756         either BindingFlags.Instace or Static.  Use instance here.
20757
20758         (Property): Refactored code to cope better with the full spec.
20759
20760         * parameter.cs (GetParameterInfo): Return an empty array instead
20761         of null on error.
20762
20763         * class.cs (Property): Abstract or extern properties have no bodies.
20764
20765         * parameter.cs (GetParameterInfo): return a zero-sized array.
20766
20767         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20768         method modifier validation to the typecontainer so we can reuse
20769         this on properties.
20770
20771         (MethodCore.ParameterTypes): return an empty sized array of types.
20772
20773         (Property.Define): Test property modifier validity.
20774
20775         Add tests for sealed/override too.
20776
20777         (Method.Emit): abstract or extern methods have no bodies.
20778
20779 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20780
20781         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20782         thing.
20783
20784         (Method::Define, ::Emit): Modify accordingly.
20785
20786         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20787
20788         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20789
20790         * makefile: Pass in /unsafe.
20791
20792 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20793
20794         * class.cs (MakeKey): Kill routine.
20795
20796         * class.cs (TypeContainer.Define): Correctly define explicit
20797         method implementations (they require the full interface name plus
20798         the method name).
20799
20800         * typemanager.cs: Deply the PtrHashtable here and stop using the
20801         lame keys.  Things work so much better.
20802
20803         This of course broke everyone who depended on `RegisterMethod' to
20804         do the `test for existance' test.  This has to be done elsewhere.
20805
20806         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20807         the object stupid Equals method (because, that like fails all over
20808         the place).  We still do not use it.
20809
20810         * class.cs (TypeContainer.SetRequiredInterface,
20811         TypeContainer.RequireMethods): Killed these two routines and moved
20812         all the functionality to RegisterRequiredImplementations.
20813
20814         (TypeContainer.RegisterRequiredImplementations): This routine now
20815         registers all the implementations required in an array for the
20816         interfaces and abstract methods.  We use an array of structures
20817         which can be computed ahead of time to reduce memory usage and we
20818         also assume that lookups are cheap as most classes will not
20819         implement too many interfaces.
20820
20821         We also avoid creating too many MethodSignatures.
20822
20823         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20824         clear the "pending" bit if we find that there are problems with
20825         the declaration.
20826
20827         (TypeContainer.VerifyPendingMethods): Update to report errors of
20828         methods that look like implementations but are not.
20829
20830         (TypeContainer.Define): Add support for explicit interface method
20831         implementation. 
20832
20833 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20834
20835         * typemanager.cs: Keep track of the parameters here instead of
20836         being a feature of the TypeContainer.
20837
20838         * class.cs: Drop the registration of parameters here, as
20839         InterfaceMethods are also interface declarations.
20840
20841         * delegate.cs: Register methods with the TypeManager not only with
20842         the TypeContainer.  This code was buggy.
20843
20844         * interface.cs: Full registation here.
20845
20846 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20847
20848         * expression.cs: Remove reducer for binary expressions, it can not
20849         be done this way.
20850
20851         * const.cs: Put here the code that used to go into constant.cs
20852
20853         * constant.cs: Put here the code for constants, this is a new base
20854         class for Literals.
20855
20856         * literal.cs: Make Literal derive from Constant.
20857
20858 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20859
20860         * statement.cs (Return.Emit): Report error 157 if the user
20861         attempts to return from a finally block.
20862
20863         (Return.Emit): Instead of emitting a return, jump to the end of
20864         the function.
20865
20866         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20867         LocalBuilder to store the result of the function.  ReturnLabel is
20868         the target where we jump.
20869
20870
20871 2001-12-09  Radek Doulik  <rodo@ximian.com>
20872
20873         * cs-parser.jay: remember alias in current namespace
20874
20875         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20876         namespaces
20877
20878         * class.cs (LookupAlias): lookup alias in my_namespace
20879
20880         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20881         aliases hashtable
20882         (LookupAlias): lookup alias in this and if needed in parent
20883         namespaces
20884
20885 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20886
20887         * support.cs: 
20888
20889         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20890         making things static.  I need this to avoid passing the
20891         TypeContainer when calling ParameterType.
20892
20893         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20894         that did string manipulation to compute the type and then call
20895         GetType.  Use Parameter.ParameterType instead.
20896
20897         * cs-tokenizer.cs: Consume the suffix for floating values.
20898
20899         * expression.cs (ParameterReference): figure out whether this is a
20900         reference parameter or not.  Kill an extra variable by computing
20901         the arg_idx during emission.
20902
20903         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20904         function that returns whether a parameter is an out/ref value or not.
20905
20906         (Parameter.ParameterType): The type of the parameter (base,
20907         without ref/out applied).
20908
20909         (Parameter.Resolve): Perform resolution here.
20910         (Parameter.ExternalType): The full type (with ref/out applied).
20911
20912         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20913         support for expressions on the using statement.
20914
20915 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * statement.cs (Using.EmitLocalVariableDecls): Split the
20918         localvariable handling of the using statement.
20919
20920         (Block.EmitMeta): Keep track of variable count across blocks.  We
20921         were reusing slots on separate branches of blocks.
20922
20923         (Try.Emit): Emit the general code block, we were not emitting it. 
20924
20925         Check the type of the declaration to be an IDisposable or
20926         something that can be implicity converted to it. 
20927
20928         Emit conversions if required.
20929
20930         * ecore.cs (EmptyExpression): New utility class.
20931         (Expression.ImplicitConversionExists): New utility function.
20932
20933 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20934
20935         * statement.cs (Using): Implement.
20936
20937         * expression.cs (LocalVariableReference): Support read only variables.
20938
20939         * statement.cs: Remove the explicit emit for the Leave opcode.
20940         (VariableInfo): Add a readonly field.
20941
20942 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20943
20944         * ecore.cs (ConvCast): new class used to encapsulate the various
20945         explicit integer conversions that works in both checked and
20946         unchecked contexts.
20947
20948         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20949         properly generate the overflow opcodes.
20950
20951 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20952
20953         * statement.cs: The correct type for the EmptyExpression is the
20954         element_type, not the variable type.  Ravi pointed this out.
20955
20956 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20957
20958         * class.cs (Method::Define): Handle PInvoke methods specially
20959         by using DefinePInvokeMethod instead of the usual one.
20960
20961         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20962         above to do the task of extracting information and defining the method.
20963
20964 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20965
20966         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20967         of the condition for string type.
20968
20969         (Emit): Move that here. 
20970
20971         (ArrayCreation::CheckIndices): Keep string literals in their expression
20972         form.
20973
20974         (EmitDynamicInitializers): Handle strings appropriately.
20975
20976 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20977
20978         * codegen.cs (EmitContext): Replace multiple variables with a
20979         single pointer to the current Switch statement.
20980
20981         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20982         EmitContext.
20983
20984 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20985
20986         * statement.cs 
20987
20988         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20989         default'.
20990
20991         (Foreach.Emit): Foreach on arrays was not setting
20992         up the loop variables (for break/continue).
20993
20994         (GotoCase): Semi-implented.
20995
20996 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20997
20998         * attribute.cs (CheckAttribute): Handle system attributes by using
20999         Attribute.GetAttributes to examine information we need.
21000
21001         (GetValidPlaces): Same here.
21002
21003         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21004
21005         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21006
21007         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21008
21009         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21010
21011         (Method::Emit): Handle the case when we are a PInvoke method.
21012
21013 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * expression.cs: Use ResolveWithSimpleName on compound names.
21016
21017 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21018
21019         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21020         before trying to reduce it.
21021
21022         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21023
21024         * constant.cs (LookupConstantValue): Implement.
21025
21026         (EmitConstant): Use the above in emitting the constant.
21027
21028         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21029         that are user-defined by doing a LookupConstantValue on them.
21030
21031         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21032         too, like above.
21033
21034 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21035
21036         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21037
21038         (BaseAccess.DoResolve): Implement.
21039
21040         (MemberAccess.DoResolve): Split this routine into a
21041         ResolveMemberAccess routine that can be used independently
21042
21043 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21046         As that share bits of the implementation.  Is returns a boolean,
21047         while As returns the Type that is being probed.
21048
21049 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21050
21051         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21052         instead of a Literal - much easier.
21053
21054         (EnumInTransit): Remove - utterly useless :-)
21055
21056         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21057
21058         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21059
21060         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21061         chain when we have no associated expression.
21062
21063 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21064
21065         * constant.cs (Define): Use Location while reporting the errror.
21066
21067         Also emit a warning when 'new' is used and there is no inherited
21068         member to hide.
21069
21070         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21071         populated.
21072
21073         (LookupEnumValue): Implement to lookup an enum member's value and define it
21074         if necessary.
21075
21076         (Populate): Re-write accordingly to use the above routine.
21077
21078 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * expression.cs (This): Fix prototype for DoResolveLValue to
21081         override the base class DoResolveLValue.
21082
21083         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21084         declarations) 
21085
21086         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21087         (we need to load the address of the field here).  This fixes
21088         test-22. 
21089
21090         (FieldExpr.DoResolveLValue): Call the DoResolve
21091         function to initialize the Instance expression.
21092
21093         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21094         correctly the GetEnumerator operation on a value type.
21095
21096         * cs-parser.jay: Add more simple parsing error catches.
21097
21098         * statement.cs (Switch): Add support for string switches.
21099         Handle null specially.
21100
21101         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21102
21103 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21104
21105         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21106
21107         (declare_local_constant): New helper function.
21108
21109         * statement.cs (AddConstant): Keep a separate record of constants
21110
21111         (IsConstant): Implement to determine if a variable is a constant.
21112
21113         (GetConstantExpression): Implement.
21114
21115         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21116
21117         * statement.cs (IsVariableDefined): Re-write.
21118
21119 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21120
21121         * class.cs (TypeContainer::FindMembers): Look for constants
21122         in the case when we are looking for MemberTypes.Field
21123
21124         * expression.cs (MemberAccess::DoResolve): Check that in the
21125         case we are a FieldExpr and a Literal, we are not being accessed
21126         by an instance reference.
21127
21128         * cs-parser.jay (local_constant_declaration): Implement.
21129
21130         (declaration_statement): Implement for constant declarations.
21131
21132 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * statement.cs (Switch): Catch double defaults.
21135
21136         (Switch): More work on the switch() statement
21137         implementation.  It works for integral values now, need to finish
21138         string support.
21139
21140
21141 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21142
21143         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21144         integer literals into other integer literals.  To be used by
21145         switch. 
21146
21147 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21148
21149         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21150         some memory.
21151
21152         (EmitDynamicInitializers): Cope with the above since we extract data
21153         directly from ArrayData now.
21154
21155         (ExpectInitializers): Keep track of whether initializers are mandatory
21156         or not.
21157
21158         (Bounds): Make it a hashtable to prevent the same dimension being 
21159         recorded for every element in that dimension.
21160
21161         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21162         from being found.
21163
21164         Also fix bug which was causing the indices to be emitted in the reverse
21165         order.
21166
21167 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21168
21169         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21170         unfinished.  They do not work, because the underlying code is
21171         sloppy.
21172
21173 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * cs-parser.jay: Remove bogus fixme.
21176
21177         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21178         on Switch statement.
21179
21180 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21181
21182         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21183         the same. 
21184
21185         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21186         parameter. Apparently, any expression is allowed. 
21187
21188         (ValidateInitializers): Update accordingly.
21189
21190         (CheckIndices): Fix some tricky bugs thanks to recursion.
21191
21192         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21193         I was being completely brain-dead.
21194
21195         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21196         and re-write acordingly.
21197
21198         (DelegateInvocation): Re-write accordingly.
21199
21200         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21201
21202         (MakeByteBlob): Handle types more correctly.
21203
21204         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21205         initialization from expressions but it is incomplete because I am a complete
21206         Dodo :-|
21207
21208 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21209
21210         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21211         on If.  Basically, we have to return `true' (ie, we do return to
21212         our caller) only if both branches of the if return.
21213
21214         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21215         short-circuit operators, handle them as short circuit operators. 
21216
21217         (Cast.DoResolve): Resolve type.
21218         (Cast.Cast): Take an expression as the target type.
21219
21220         * cs-parser.jay (cast_expression): Remove old hack that only
21221         allowed a limited set of types to be handled.  Now we take a
21222         unary_expression and we resolve to a type during semantic
21223         analysis.
21224
21225         Use the grammar productions from Rhys to handle casts (this is
21226         not complete like Rhys syntax yet, we fail to handle that corner
21227         case that C# has regarding (-x), but we will get there.
21228
21229 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21230
21231         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21232         field which is an array type.
21233
21234         * cs-parser.jay (declare_local_variables): Support array initialization too.
21235
21236         * typemanager.cs (MakeKey): Implement.
21237
21238         (everywhere): Use the above appropriately.
21239
21240         * cs-parser.jay (for_statement): Update for array initialization while
21241         declaring variables.
21242
21243         * ecore.cs : The error message was correct, it's the variable's names that
21244         were misleading ;-) Make the code more readable.
21245
21246         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21247         the correct type etc.
21248
21249         (ConvertExplicit): Handle Enum types by examining the underlying type.
21250
21251 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21252
21253         * parameter.cs (GetCallingConvention): Always return
21254         CallingConventions.Standard for now.
21255
21256 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21259         and `r' after calling DoNumericPromotions.
21260
21261         * ecore.cs: Fix error message (the types were in the wrong order).
21262
21263         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21264         BindingFlags.Instance as well 
21265
21266         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21267         implicit int literal conversion in an empty cast so that we
21268         propagate the right type upstream.
21269
21270         (UnboxCast): new class used to unbox value types.
21271         (Expression.ConvertExplicit): Add explicit type conversions done
21272         by unboxing.
21273
21274         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21275         the target type before applying the implicit LongLiterals to ULong
21276         literal cast.
21277
21278 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21279
21280         * cs-parser.jay (for_statement): Reworked the way For works: now
21281         we declare manually any variables that are introduced in
21282         for_initializer to solve the problem of having out-of-band code
21283         emition (that is what got for broken).
21284
21285         (declaration_statement): Perform the actual variable declaration
21286         that used to be done in local_variable_declaration here.
21287
21288         (local_variable_declaration): Do not declare anything, just pass
21289         the information on a DictionaryEntry
21290
21291 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21292
21293         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21294         re-write of the logic to now make it recursive.
21295
21296         (UpdateIndices): Re-write accordingly.
21297
21298         Store element data in a separate ArrayData list in the above methods.
21299
21300         (MakeByteBlob): Implement to dump the array data into a byte array.
21301
21302 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21303
21304         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21305         into CheckIndices.
21306
21307         * constant.cs (Define): Implement.
21308
21309         (EmitConstant): Re-write fully.
21310
21311         Pass in location info.
21312
21313         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21314         respectively.
21315
21316         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21317         DictionaryEntry since we need location info too.
21318
21319         (constant_declaration): Update accordingly.
21320
21321         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21322         code into another method : UpdateIndices.
21323
21324 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21325
21326         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21327         some type checking etc.
21328
21329 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21330
21331         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21332         bits to provide dimension info if the user skips doing that.
21333
21334         Update second constructor to store the rank correctly.
21335
21336 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21337
21338         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21339         and try to implement.
21340
21341         * ../errors/cs0150.cs : Add.
21342
21343         * ../errors/cs0178.cs : Add.
21344
21345 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21346
21347         * statement.cs: Implement foreach on multi-dimensional arrays. 
21348
21349         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21350         name of the params argument.
21351
21352         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21353         initializing the array.
21354
21355         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21356         we can use this elsewhere.
21357
21358         * statement.cs: Finish implementation of foreach for single
21359         dimension arrays.
21360
21361         * cs-parser.jay: Use an out-of-band stack to pass information
21362         around, I wonder why I need this.
21363
21364         foreach_block: Make the new foreach_block the current_block.
21365
21366         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21367         function used to return a static Parameters structure.  Used for
21368         empty parameters, as those are created very frequently.
21369
21370         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21371
21372 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21373
21374         * interface.cs : Default modifier is private, not public. The
21375         make verify test passes again.
21376
21377 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21378
21379         * support.cs (ReflectionParameters): Fix logic to determine
21380         whether the last parameter is a params one. Test 9 passes again.
21381
21382         * delegate.cs (Populate): Register the builders we define with
21383         RegisterParameterForBuilder. Test 19 passes again.
21384
21385         * cs-parser.jay (property_declaration): Reference $6 instead
21386         of $$ to get at the location.
21387
21388         (indexer_declaration): Similar stuff.
21389
21390         (attribute): Ditto.
21391
21392         * class.cs (Property): Register parameters for the Get and Set methods
21393         if they exist. Test 23 passes again.
21394
21395         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21396         call to EmitArguments as we are sure there aren't any params arguments. 
21397         Test 32 passes again.
21398
21399         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21400         IndexOutOfRangeException. 
21401
21402         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21403         Test 33 now passes again.
21404
21405 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21406
21407         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21408         broke a bunch of things.  Will have to come up with a better way
21409         of tracking locations.
21410
21411         * statement.cs: Implemented foreach for single dimension arrays.
21412
21413 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21414
21415         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21416         an error.  This removes the lookup from the critical path.
21417
21418         * cs-parser.jay: Removed use of temporary_loc, which is completely
21419         broken. 
21420
21421 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21422
21423         * support.cs (ReflectionParameters.ParameterModifier): Report
21424         whether the argument is a PARAMS argument or not.
21425
21426         * class.cs: Set the attribute `ParamArrayAttribute' on the
21427         parameter argument.
21428
21429         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21430         and cons_param_array_attribute (ConstructorInfo for
21431         ParamArrayAttribute)., 
21432
21433         * codegen.cs: Emit the return using the `Return' statement, that
21434         way we can report the error correctly for missing return values. 
21435
21436         * class.cs (Method.Emit): Clean up.
21437
21438         * expression.cs (Argument.Resolve): Take another argument: the
21439         location where this argument is used.  Notice that this is not
21440         part of the "Argument" class as to reduce the size of the
21441         structure (we know the approximate location anyways).
21442
21443         Test if the argument is a variable-reference, if not, then
21444         complain with a 206.
21445
21446         (Argument.Emit): Emit addresses of variables.
21447
21448         (Argument.FullDesc): Simplify.
21449
21450         (Invocation.DoResolve): Update for Argument.Resolve.
21451
21452         (ElementAccess.DoResolve): ditto.
21453
21454         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21455         method should be virtual, as this method is always virtual.
21456
21457         (NewDelegate.DoResolve): Update for Argument.Resolve.
21458
21459         * class.cs (ConstructorInitializer.DoResolve): ditto.
21460
21461         * attribute.cs (Attribute.Resolve): ditto.
21462
21463 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21464
21465         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21466
21467         * expression.cs (ParameterReference): Drop IStackStorage and implement
21468         IAssignMethod instead. 
21469
21470         (LocalVariableReference): ditto.
21471
21472         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21473         IAssignMethod instead. 
21474
21475 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21476
21477         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21478         enumerations that are used in heavily used structures derive from
21479         byte in a laughable and pathetic attempt to reduce memory usage.
21480         This is the kind of pre-optimzations that you should not do at
21481         home without adult supervision.
21482
21483         * expression.cs (UnaryMutator): New class, used to handle ++ and
21484         -- separatedly from the other unary operators.  Cleans up the
21485         code, and kills the ExpressionStatement dependency in Unary.
21486
21487         (Unary): Removed `method' and `Arguments' from this class, making
21488         it smaller, and moving it all to SimpleCall, so I can reuse this
21489         code in other locations and avoid creating a lot of transient data
21490         strucutres when not required.
21491
21492         * cs-parser.jay: Adjust for new changes.
21493
21494 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21495
21496         * enum.cs (Enum.Populate): If there is a failure during
21497         definition, return
21498
21499         * cs-parser.jay (opt_enum_base): we used to catch type errors
21500         here, but this is really incorrect.  The type error should be
21501         catched during semantic analysis.
21502
21503 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21504
21505         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21506         current_local_parameters as expected since I, in my stupidity, had forgotten
21507         to do this :-)
21508
21509         * attribute.cs (GetValidPlaces): Fix stupid bug.
21510
21511         * class.cs (Method::Emit): Perform check on applicability of attributes.
21512
21513         (Constructor::Emit): Ditto.
21514
21515         (Field::Emit): Ditto.
21516
21517         (Field.Location): Store location information.
21518
21519         (Property, Event, Indexer, Operator): Ditto.
21520
21521         * cs-parser.jay (field_declaration): Pass in location for each field.
21522
21523         * ../errors/cs0592.cs : Add.
21524
21525 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21526
21527         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21528
21529         (InitCoreTypes): Update accordingly.
21530
21531         (RegisterAttrType, LookupAttr): Implement.
21532
21533         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21534         info about the same.
21535
21536         (Resolve): Update to populate the above as necessary.
21537
21538         (Error592): Helper.
21539
21540         (GetValidPlaces): Helper to the above.
21541
21542         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21543
21544         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21545
21546 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21547
21548         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21549
21550         * ../errors/cs0617.cs : Add.
21551
21552 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21553
21554         * enum.cs (Emit): Rename to Populate to be more consistent with what
21555         we expect it to do and when exactly it is called.
21556
21557         * class.cs, rootcontext.cs : Update accordingly.
21558
21559         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21560         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21561
21562         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21563
21564         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21565         of a fieldinfo using the above, when dealing with a FieldBuilder.
21566
21567 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21568
21569         * ../errors/cs0031.cs : Add.
21570
21571         * ../errors/cs1008.cs : Add.
21572
21573         * ../errrors/cs0543.cs : Add.
21574
21575         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21576         enum type.
21577
21578         (FindMembers): Implement.
21579
21580         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21581         enums and delegates too.
21582
21583         (enum_types): Rename to builder_to_enum.
21584
21585         (delegate_types): Rename to builder_to_delegate.
21586
21587         * delegate.cs (FindMembers): Implement.
21588
21589 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21590
21591         * typemanager.cs (IsEnumType): Implement.
21592
21593         * enum.cs (Emit): Re-write parts to account for the underlying type
21594         better and perform checking etc.
21595
21596         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21597         of the underlying type.
21598
21599         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21600         value
21601
21602         * enum.cs (error31): Helper to report error #31.
21603
21604         * cs-parser.jay (enum_declaration): Store location of each member too.
21605
21606         * enum.cs (member_to_location): New hashtable. 
21607
21608         (AddEnumMember): Update location hashtable.
21609
21610         (Emit): Use the location of each member while reporting errors.
21611
21612 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21613
21614         * cs-parser.jay: A for_initializer if is a
21615         local_variable_declaration really ammount to have an implicit
21616         block with the variable declaration and no initializer for for.
21617
21618         * statement.cs (For.Emit): Cope with null initializers.
21619
21620         This fixes the infinite loop on for initializers.
21621
21622 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21623
21624         * enum.cs: More cleanup.
21625
21626         * ecore.cs: Remove dead code.
21627
21628         * class.cs (Property.Emit): More simplification.
21629         (Event.Emit): ditto.
21630
21631         Reworked to have less levels of indentation.
21632
21633 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21634
21635         * class.cs (Property): Emit attributes.
21636
21637         (Field): Ditto.
21638
21639         (Event): Ditto.
21640
21641         (Indexer): Ditto.
21642
21643         (Operator): Ditto.
21644
21645         * enum.cs (Emit): Ditto.
21646
21647         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21648         Enums too.
21649
21650         * class.cs (Field, Event, etc.): Move attribute generation into the
21651         Emit method everywhere.
21652
21653         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21654         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21655         as we had no way of defining nested enums !
21656
21657         * rootcontext.cs : Adjust code accordingly.
21658
21659         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21660
21661 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21662
21663         * expression.cs (EvalConstantExpression): Move into ecore.cs
21664
21665         * enum.cs (Enum): Rename some members and make them public and readonly
21666         according to our convention.
21667
21668         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21669         nothing else.
21670
21671         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21672
21673         (Enum::Emit): Write a simple version for now which doesn't try to compute
21674         expressions. I shall modify this to be more robust in just a while.
21675
21676         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21677
21678         (TypeContainer::CloseType): Create the Enum types too.
21679
21680         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21681
21682         * expression.cs (EvalConstantExpression): Get rid of completely.
21683
21684         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21685         user-defined values and other cases.
21686
21687         (IsValidEnumLiteral): Helper function.
21688
21689         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21690         out there in the case we had a literal FieldExpr.
21691
21692         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21693
21694         (Literalize): Revamp a bit to take two arguments.
21695
21696         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21697
21698 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21699
21700         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21701
21702         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21703
21704         (Resolve): Use the above to ensure we have proper initializers.
21705
21706 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21707
21708         * expression.cs (Expression::EvalConstantExpression): New method to 
21709         evaluate constant expressions.
21710
21711         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21712
21713 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21714
21715         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21716         in an array.
21717
21718         (Binary.ResolveOperator): Handle operator != (object a, object b)
21719         and operator == (object a, object b);
21720
21721         (Binary.DoNumericPromotions): Indicate whether the numeric
21722         promotion was possible.
21723
21724         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21725         Implement.  
21726
21727         Made the ArrayAccess implement interface IAssignMethod instead of
21728         IStackStore as the order in which arguments are passed reflects
21729         this.
21730
21731         * assign.cs: Instead of using expr.ExprClass to select the way of
21732         assinging, probe for the IStackStore/IAssignMethod interfaces.
21733
21734         * typemanager.cs: Load InitializeArray definition.
21735
21736         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21737         static data that can be used to initialize arrays. 
21738
21739 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21740
21741         * expression.cs: Handle operator== and operator!= for booleans.
21742
21743         (Conditioal.Reduce): Implement reducer for the ?: operator.
21744
21745         (Conditional.Resolve): Implement dead code elimination.
21746
21747         (Binary.Resolve): Catch string literals and return a new
21748         concatenated string.
21749
21750         (Unary.Reduce): Implement reduction of unary expressions.
21751
21752         * ecore.cs: Split out the expression core handling here.
21753
21754         (Expression.Reduce): New method used to perform constant folding
21755         and CSE.  This is needed to support constant-expressions. 
21756
21757         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21758         targets, and optimize for !x.
21759
21760 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21761
21762         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21763         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21764         set custom atttributes.
21765
21766         * literal.cs (Literal::GetValue): New abstract method to return the actual
21767         value of the literal, cast as an object.
21768
21769         (*Literal): Implement GetValue method.
21770
21771         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21772         expressions to the arraylist but objects of type Argument.
21773
21774         * class.cs (TypeContainer::Emit): Emit our attributes too.
21775
21776         (Method::Emit, Constructor::Emit): Ditto.
21777
21778         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21779         to be ignoring earlier.
21780
21781 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21782
21783         * attribute.cs (AttributeSection::Define): Implement to do the business
21784         of constructing a CustomAttributeBuilder.
21785
21786         (Attribute): New trivial class. Increases readability of code.  
21787
21788         * cs-parser.jay : Update accordingly.
21789
21790         (positional_argument_list, named_argument_list, named_argument): New rules
21791
21792         (attribute_arguments): Use the above so that we are more correct.
21793
21794 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21795
21796         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21797         to perform all checks for a method with a params parameter.
21798
21799         (Invocation::OverloadResolve): Update to use the above method and therefore
21800         cope correctly with params method invocations.
21801
21802         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21803         params too.
21804
21805         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21806         constructors in our parent too because we can't afford to miss out on 
21807         protected ones ;-)
21808
21809         * attribute.cs (AttributeSection): New name for the class Attribute
21810
21811         Other trivial changes to improve readability.
21812
21813         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21814         use the new class names.
21815
21816 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21817
21818         * class.cs (Method::Define): Complete definition for params types too
21819
21820         (Indexer::Define): Ditto.
21821
21822         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21823         Cope everywhere with a request for info about the array parameter.
21824
21825 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21826
21827         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21828
21829         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21830         local_variable_type to extract the string corresponding to the type.
21831
21832         (local_variable_type): Fixup the action to use the new helper method.
21833
21834         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21835         go.
21836
21837         * expression.cs : Clean out code which uses the above.
21838
21839 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21840
21841         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21842         and bale out if necessary by returning a false.
21843
21844         (RegisterProperty): Ditto.
21845
21846         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21847         and print out appropriate error messages.
21848
21849         * interface.cs (everywhere): Ditto.
21850
21851         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21852         location to constructor.
21853
21854         * class.cs (Property, Event, Indexer): Update accordingly.
21855
21856         * ../errors/cs111.cs : Added.
21857
21858         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21859         of a method, as laid down by the spec.
21860
21861         (Invocation::OverloadResolve): Use the above method.
21862
21863 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21864
21865         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21866         now take a TypeContainer and a Parameters object.
21867
21868         (ParameterData): Modify return type of ParameterModifier method to be 
21869         Parameter.Modifier and not a string.
21870
21871         (ReflectionParameters, InternalParameters): Update accordingly.
21872
21873         * expression.cs (Argument::GetParameterModifier): Same here.
21874
21875         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21876         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21877         symbol in it at all so maybe this is only for now.
21878
21879 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21880
21881         * support.cs (InternalParameters): Constructor now takes an extra argument 
21882         which is the actual Parameters class.
21883
21884         (ParameterDesc): Update to provide info on ref/out modifiers.
21885
21886         * class.cs (everywhere): Update call to InternalParameters to pass in
21887         the second argument too.
21888
21889         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21890         to return the modifier info [ref/out etc]
21891
21892         (InternalParameters, ReflectionParameters): Implement the above.
21893
21894         * expression.cs (Argument::ParameterModifier): Similar function to return
21895         info about the argument's modifiers.
21896
21897         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21898         too.
21899
21900         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21901         a new SetFormalParameters object which we pass to InternalParameters.
21902
21903 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21904
21905         * expression.cs (NewArray): Merge into the ArrayCreation class.
21906
21907 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21908
21909         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21910         NewUserdefinedArray into one as there wasn't much of a use in having
21911         two separate ones.
21912
21913         * expression.cs (Argument): Change field's name to ArgType from Type.
21914
21915         (Type): New readonly property which returns the proper type, taking into 
21916         account ref/out modifiers.
21917
21918         (everywhere): Adjust code accordingly for the above.
21919
21920         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21921         whether we are emitting for a ref or out parameter.
21922
21923         * expression.cs (Argument::Emit): Use the above field to set the state.
21924
21925         (LocalVariableReference::Emit): Update to honour the flag and emit the
21926         right stuff.
21927
21928         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21929
21930         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21931
21932         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21933
21934         (ReflectionParameters, InternalParameters): Implement the above method.
21935
21936         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21937         reporting errors.
21938
21939         (Invocation::FullMethodDesc): Ditto. 
21940
21941 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * cs-parser.jay: Add extra production for the second form of array
21944         creation. 
21945
21946         * expression.cs (ArrayCreation): Update to reflect the above
21947         change. 
21948
21949         * Small changes to prepare for Array initialization.
21950
21951 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21952
21953         * typemanager.cs (ImplementsInterface): interface might be null;
21954         Deal with this problem;
21955
21956         Also, we do store negative hits on the cache (null values), so use
21957         this instead of calling t.GetInterfaces on the type everytime.
21958
21959 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21960
21961         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21962
21963         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21964         split functionality out into different classes.
21965
21966         (New::FormArrayType): Move into NewBuiltinArray.
21967
21968         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21969         quite useless.
21970
21971         (NewBuiltinArray): New class to handle creation of built-in arrays.
21972
21973         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21974         account creation of one-dimensional arrays.
21975
21976         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21977
21978         (NewUserdefinedArray::DoResolve): Implement.
21979
21980         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21981
21982         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21983         we maintain inside the TypeManager. This is necessary to perform lookups on the
21984         module builder.
21985
21986         (LookupType): Update to perform GetType on the module builders too.     
21987
21988         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21989
21990         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21991
21992 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21993
21994         * expression.cs (New::DoResolve): Implement guts of array creation.
21995
21996         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21997
21998 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21999
22000         * expression.cs: Fix bug I introduced lsat night that broke
22001         Delegates. 
22002
22003         (Expression.Resolve): Report a 246 error (can not resolve name)
22004         if we find a SimpleName in the stream.
22005
22006         (Expression.ResolveLValue): Ditto.
22007
22008         (Expression.ResolveWithSimpleName): This function is a variant of
22009         ResolveName, this one allows SimpleNames to be returned without a
22010         warning.  The only consumer of SimpleNames is MemberAccess
22011
22012 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22015         might arrive here.  I have my doubts that this is correct.
22016
22017         * statement.cs (Lock): Implement lock statement.
22018
22019         * cs-parser.jay: Small fixes to support `lock' and `using'
22020
22021         * cs-tokenizer.cs: Remove extra space
22022
22023         * driver.cs: New flag --checked, allows to turn on integer math
22024         checking. 
22025
22026         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22027         Threading.Monitor.Exit 
22028
22029 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22030
22031         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22032         Expression Class to be IndexerAccess.
22033
22034         Notice that Indexer::DoResolve sets the eclass to Value.
22035
22036 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22037
22038         * class.cs (TypeContainer::Emit): Emit code for indexers.
22039
22040         * assign.cs (IAssignMethod): New interface implemented by Indexers
22041         and Properties for handling assignment.
22042
22043         (Assign::Emit): Simplify and reuse code. 
22044
22045         * expression.cs (IndexerAccess, PropertyExpr): Implement
22046         IAssignMethod, clean up old code. 
22047
22048 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22049
22050         * typemanager.cs (ImplementsInterface): New method to determine if a type
22051         implements a given interface. Provides a nice cache too.
22052
22053         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22054         method.
22055
22056         (ConvertReferenceExplicit): Ditto.
22057
22058         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22059         various methods, with correct names etc.
22060
22061         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22062         Operator.UnaryNegation.
22063
22064         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22065         we have a unary plus or minus operator.
22066
22067         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22068         UnaryMinus.
22069
22070         * everywhere : update accordingly.
22071
22072         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22073         respectively.
22074
22075         * class.cs (Method::Define): For the case where we are implementing a method
22076         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22077         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22078
22079 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22080
22081         * interface.cs (FindMembers): Implement to work around S.R.E
22082         lameness.
22083
22084         * typemanager.cs (IsInterfaceType): Implement.
22085
22086         (FindMembers): Update to handle interface types too.
22087
22088         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22089         use IsAssignableFrom as that is not correct - it doesn't work.
22090
22091         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22092         and accordingly override EmitStatement.
22093
22094         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22095         using the correct logic :-)
22096
22097 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22098
22099         * ../errors/cs-11.cs : Add to demonstrate error -11 
22100
22101 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22104         then pass this as a hint to ResolveLValue.
22105
22106         * expression.cs (FieldExpr): Add Location information
22107
22108         (FieldExpr::LValueResolve): Report assignment to readonly
22109         variable. 
22110
22111         (Expression::ExprClassFromMemberInfo): Pass location information.
22112
22113         (Expression::ResolveLValue): Add new method that resolves an
22114         LValue. 
22115
22116         (Expression::DoResolveLValue): Default invocation calls
22117         DoResolve. 
22118
22119         (Indexers): New class used to keep track of indexers in a given
22120         Type. 
22121
22122         (IStackStore): Renamed from LValue, as it did not really describe
22123         what this did.  Also ResolveLValue is gone from this interface and
22124         now is part of Expression.
22125
22126         (ElementAccess): Depending on the element access type
22127
22128         * typemanager.cs: Add `indexer_name_type' as a Core type
22129         (System.Runtime.CompilerServices.IndexerNameAttribute)
22130
22131         * statement.cs (Goto): Take a location.
22132
22133 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22134
22135         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22136         if two delegates are compatible.
22137
22138         (NewDelegate::DoResolve): Update to take care of the case when
22139         we instantiate a delegate from another delegate.
22140
22141         * typemanager.cs (FindMembers): Don't even try to look up members
22142         of Delegate types for now.
22143
22144 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22145
22146         * delegate.cs (NewDelegate): New class to take care of delegate
22147         instantiation.
22148
22149         * expression.cs (New): Split the delegate related code out into 
22150         the NewDelegate class.
22151
22152         * delegate.cs (DelegateInvocation): New class to handle delegate 
22153         invocation.
22154
22155         * expression.cs (Invocation): Split out delegate related code into
22156         the DelegateInvocation class.
22157
22158 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22159
22160         * expression.cs (New::DoResolve): Implement delegate creation fully
22161         and according to the spec.
22162
22163         (New::DoEmit): Update to handle delegates differently.
22164
22165         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22166         because of which we were printing out arguments in reverse order !
22167
22168         * delegate.cs (VerifyMethod): Implement to check if the given method
22169         matches the delegate.
22170
22171         (FullDelegateDesc): Implement.
22172
22173         (VerifyApplicability): Implement.
22174
22175         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22176         delegate invocations too.
22177
22178         (Invocation::Emit): Ditto.
22179
22180         * ../errors/cs1593.cs : Added.
22181
22182         * ../errors/cs1594.cs : Added.
22183
22184         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22185
22186 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22187
22188         * typemanager.cs (intptr_type): Core type for System.IntPtr
22189
22190         (InitCoreTypes): Update for the same.
22191
22192         (iasyncresult_type, asynccallback_type): Ditto.
22193
22194         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22195         correct.
22196
22197         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22198         too.
22199
22200         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22201         the builders for the 4 members of a delegate type :-)
22202
22203         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22204         type.
22205
22206         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22207
22208         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22209
22210 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22211
22212         * statement.cs (Break::Emit): Implement.   
22213         (Continue::Emit): Implement.
22214
22215         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22216         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22217         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22218         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22219         end loop
22220
22221         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22222         properties that track the label for the current loop (begin of the
22223         loop and end of the loop).
22224
22225 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22226
22227         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22228         use of emitting anything at all.
22229
22230         * class.cs, rootcontext.cs : Get rid of calls to the same.
22231
22232         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22233
22234         (Populate): Define the constructor correctly and set the implementation
22235         attributes.
22236
22237         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22238         have been defined.
22239
22240         (AddDelegateType): Implement.
22241
22242         (IsDelegateType): Implement helper method.
22243
22244         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22245
22246         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22247         and accordingly handle it.
22248
22249         * delegate.cs (Populate): Take TypeContainer argument.
22250         Implement bits to define the Invoke method. However, I still haven't figured out
22251         how to take care of the native int bit :-(
22252
22253         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22254         Qualify the name of the delegate, not its return type !
22255
22256         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22257         conversion.
22258
22259         (StandardConversionExists): Checking for array types turns out to be recursive.
22260
22261         (ConvertReferenceExplicit): Implement array conversion.
22262
22263         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22264
22265 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22266
22267         * cs-parser.jay (delegate_declaration): Store the fully qualified
22268         name as it is a type declaration.
22269
22270         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22271         readonly.
22272
22273         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22274         as TypeContainer::DefineType.
22275
22276         (Populate): Method in which all the definition of the various methods (Invoke)
22277         etc is done.
22278
22279         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22280         see.
22281
22282         (CloseDelegate): Finally creates the delegate.
22283
22284         * class.cs (TypeContainer::DefineType): Update to define delegates.
22285         (Populate, Emit and CloseType): Do the same thing here too.
22286
22287         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22288         delegates in all these operations.
22289
22290 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22291
22292         * expression.cs: LocalTemporary: a new expression used to
22293         reference a temporary that has been created.
22294
22295         * assign.cs: Handle PropertyAccess back here, so that we can
22296         provide the proper semantic access to properties.
22297
22298         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22299         a few more explicit conversions. 
22300
22301         * modifiers.cs: `NEW' modifier maps to HideBySig.
22302
22303         * expression.cs (PropertyExpr): Make this into an
22304         ExpressionStatement, and support the EmitStatement code path. 
22305
22306         Perform get/set error checking, clean up the interface.
22307
22308         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22309         them into toplevel access objects.
22310
22311 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22312
22313         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22314         SRE.
22315
22316         * typemanager.cs: Keep track here of our PropertyBuilders again to
22317         work around lameness in SRE.
22318
22319 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22320
22321         * expression.cs (LValue::LValueResolve): New method in the
22322         interface, used to perform a second resolution pass for LValues. 
22323
22324         (This::DoResolve): Catch the use of this in static methods.
22325
22326         (This::LValueResolve): Implement.
22327
22328         (This::Store): Remove warning, assigning to `this' in structures
22329         is 
22330
22331         (Invocation::Emit): Deal with invocation of
22332         methods on value types.  We need to pass the address to structure
22333         methods rather than the object itself.  (The equivalent code to
22334         emit "this" for structures leaves the entire structure on the
22335         stack instead of a pointer to it). 
22336
22337         (ParameterReference::DoResolve): Compute the real index for the
22338         argument based on whether the method takes or not a `this' pointer
22339         (ie, the method is static).
22340
22341         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22342         value types returned from functions when we need to invoke a
22343         method on the sturcture.
22344
22345
22346 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22347
22348         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22349         defining the type in the Modulebuilder or Typebuilder. This is to take
22350         care of nested types which need to be defined on the TypeBuilder using
22351         DefineNestedMethod.
22352
22353         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22354         methods in RootContext, only ported to be part of TypeContainer.
22355
22356         (TypeContainer::GetInterfaceOrClass): Ditto.
22357
22358         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22359
22360         * interface.cs (Interface::DefineInterface): New method. Does exactly
22361         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22362         too.
22363
22364         (Interface::GetInterfaces): Move from RootContext here and port.
22365
22366         (Interface::GetInterfaceByName): Same here.
22367
22368         * rootcontext.cs (ResolveTree): Re-write.
22369
22370         (PopulateTypes): Re-write.
22371
22372         * class.cs (TypeContainer::Populate): Populate nested types too.
22373         (TypeContainer::Emit): Emit nested members too.
22374
22375         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22376         instead just use the name argument passed in as it is already fully
22377         qualified.
22378
22379         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22380         to TypeContainer mapping to see if a type is user-defined.
22381
22382         * class.cs (TypeContainer::CloseType): Implement. 
22383
22384         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22385         the default constructor.
22386
22387         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22388         twice.
22389
22390         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22391
22392         * interface.cs (CloseType): Create the type here.
22393
22394         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22395         the hierarchy.
22396
22397         Remove all the methods which are now in TypeContainer.
22398
22399 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22400
22401         * delegate.cs (Define): Re-write bits to define the delegate
22402         correctly.
22403
22404 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22405
22406         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22407
22408         * expression.cs (ImplicitReferenceConversion): handle null as well
22409         as a source to convert to any reference type.
22410
22411         * statement.cs (Return): Perform any implicit conversions to
22412         expected return type.  
22413
22414         Validate use of return statement.  
22415
22416         * codegen.cs (EmitContext): Pass the expected return type here.
22417
22418         * class.cs (Method, Constructor, Property): Pass expected return
22419         type to EmitContext.
22420
22421 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22422
22423         * expression.cs: Make DoResolve take an EmitContext instead of a
22424         TypeContainer.
22425
22426         Replaced `l' and `location' for `loc', for consistency.
22427
22428         (Error, Warning): Remove unneeded Tc argument.
22429
22430         * assign.cs, literal.cs, constant.cs: Update to new calling
22431         convention. 
22432
22433         * codegen.cs: EmitContext now contains a flag indicating whether
22434         code is being generated in a static method or not.
22435
22436         * cs-parser.jay: DecomposeQI, new function that replaces the old
22437         QualifiedIdentifier.  Now we always decompose the assembled
22438         strings from qualified_identifier productions into a group of
22439         memberaccesses.
22440
22441 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22442
22443         * rootcontext.cs: Deal with field-less struct types correctly now
22444         by passing the size option to Define Type.
22445
22446         * class.cs: Removed hack that created one static field. 
22447
22448 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22449
22450         * statement.cs: Moved most of the code generation here. 
22451
22452 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22453
22454         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22455         seem very right.
22456
22457         (ElementAccess): Remove useless bits for now - keep checks as the spec
22458         says.
22459
22460 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22461
22462         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22463         and start performing checks according to the spec.
22464
22465 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22466
22467         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22468         rank_specifiers instead.
22469
22470         (rank_specifiers): Change the order in which the rank specifiers are stored
22471
22472         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22473
22474         * expression.cs (ElementAccess): Implement the LValue interface too.
22475
22476 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22477
22478         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22479         except that user defined conversions are not included.
22480
22481         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22482         perform the conversion of the return type, if necessary.
22483
22484         (New::DoResolve): Check whether we are creating an array or an object
22485         and accordingly do the needful.
22486
22487         (New::Emit): Same here.
22488
22489         (New::DoResolve): Implement guts of array creation.
22490
22491         (New::FormLookupType): Helper function.
22492
22493 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22494
22495         * codegen.cs: Removed most of the code generation here, and move the
22496         corresponding code generation bits to the statement classes. 
22497
22498         Added support for try/catch/finalize and throw.
22499
22500         * cs-parser.jay: Added support for try/catch/finalize.
22501
22502         * class.cs: Catch static methods having the flags override,
22503         virtual or abstract.
22504
22505         * expression.cs (UserCast): This user cast was not really doing
22506         what it was supposed to do.  Which is to be born in fully resolved
22507         state.  Parts of the resolution were being performed at Emit time! 
22508
22509         Fixed this code.
22510
22511 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22512
22513         * expression.cs: Implicity convert the result from UserCast.
22514
22515 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22516
22517         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22518         prevented it from working correctly. 
22519
22520         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22521         merely ConvertImplicit.
22522
22523 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * typemanager.cs: Make the LookupTypeContainer function static,
22526         and not per-instance.  
22527
22528         * class.cs: Make static FindMembers (the one that takes a Type
22529         argument). 
22530
22531         * codegen.cs: Add EmitForeach here.
22532
22533         * cs-parser.jay: Make foreach a toplevel object instead of the
22534         inline expansion, as we need to perform semantic analysis on it. 
22535
22536 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22537
22538         * expression.cs (Expression::ImplicitUserConversion): Rename to
22539         UserDefinedConversion.
22540
22541         (Expression::UserDefinedConversion): Take an extra argument specifying 
22542         whether we look for explicit user conversions too.
22543
22544         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22545
22546         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22547
22548         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22549         with the appropriate arguments.
22550
22551         * cs-parser.jay (cast_expression): Record location too.
22552
22553         * expression.cs (Cast): Record location info.
22554
22555         (Expression::ConvertExplicit): Take location argument.
22556
22557         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22558         to determine if we are doing explicit conversions.
22559
22560         (UserCast::Emit): Update accordingly.
22561
22562         (Expression::ConvertExplicit): Report an error if everything fails.
22563
22564         * ../errors/cs0030.cs : Add.
22565
22566 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22567
22568         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22569         virtual and newslot bits. 
22570
22571         * class.cs (TypeContainer::RegisterRequiredImplementations):
22572         Record methods we need.
22573
22574         (TypeContainer::MakeKey): Helper function to make keys for
22575         MethodBases, since the Methodbase key is useless.
22576
22577         (TypeContainer::Populate): Call RegisterRequiredImplementations
22578         before defining the methods.   
22579
22580         Create a mapping for method_builders_to_methods ahead of time
22581         instead of inside a tight loop.
22582
22583         (::RequireMethods):  Accept an object as the data to set into the
22584         hashtable so we can report interface vs abstract method mismatch.
22585
22586 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22587
22588         * report.cs: Make all of it static.
22589
22590         * rootcontext.cs: Drop object_type and value_type computations, as
22591         we have those in the TypeManager anyways.
22592
22593         Drop report instance variable too, now it is a global.
22594
22595         * driver.cs: Use try/catch on command line handling.
22596
22597         Add --probe option to debug the error reporting system with a test
22598         suite. 
22599
22600         * report.cs: Add support for exiting program when a probe
22601         condition is reached.
22602
22603 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22604
22605         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22606         we do a forcible conversion regardless of type, to check if 
22607         ForceConversion returns a null.
22608
22609         (Binary::error19): Use location to report error.
22610
22611         (Unary::error23): Use location here too.
22612
22613         * ../errors/cs0019.cs : Check in.
22614
22615         * ../errors/cs0023.cs : Check in.
22616
22617         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22618         case of a non-null MethodInfo object with a length of 0 !
22619
22620         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22621         an applicable member - according to the spec :-)
22622         Also fix logic to find members in base types.
22623
22624         (Unary::ResolveOperator): Same here.
22625
22626         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22627         as I was getting thoroughly confused between this and error19 :-)
22628
22629         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22630         (::FindMostEncompassedType): Implement.
22631         (::FindMostEncompassingType): Implement.
22632         (::StandardConversionExists): Implement.
22633
22634         (UserImplicitCast): Re-vamp. We now need info about most specific
22635         source and target types so that we can do the necessary conversions.
22636
22637         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22638         mathematical union with no duplicates.
22639
22640 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22641
22642         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22643         in order from base classes to child classes, so that we can in
22644         child classes look up in our parent for method names and
22645         attributes (required for handling abstract, virtual, new, override
22646         constructs: we need to instrospect our base class, and if we dont
22647         populate the classes in order, the introspection might be
22648         incorrect.  For example, a method could query its parent before
22649         the parent has any methods and would determine that the parent has
22650         no abstract methods (while it could have had them)).
22651
22652         (RootContext::CreateType): Record the order in which we define the
22653         classes.
22654
22655 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * class.cs (TypeContainer::Populate): Also method definitions can
22658         fail now, keep track of this.
22659
22660         (TypeContainer::FindMembers): Implement support for
22661         DeclaredOnly/noDeclaredOnly flag.
22662
22663         (Constructor::Emit) Return the ConstructorBuilder.
22664
22665         (Method::Emit) Return the MethodBuilder. 
22666         Check for abstract or virtual methods to be public.
22667
22668         * rootcontext.cs (RootContext::CreateType): Register all the
22669         abstract methods required for the class to be complete and the
22670         interface methods that must be implemented. 
22671
22672         * cs-parser.jay: Report error 501 (method requires body if it is
22673         not marked abstract or extern).
22674
22675         * expression.cs (TypeOf::Emit): Implement.
22676
22677         * typemanager.cs: runtime_handle_type, new global type.
22678
22679         * class.cs (Property::Emit): Generate code for properties.
22680
22681 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22682
22683         * expression.cs (Unary::ResolveOperator): Find operators on base type
22684         too - we now conform exactly to the spec.
22685
22686         (Binary::ResolveOperator): Same here.
22687
22688         * class.cs (Operator::Define): Fix minor quirk in the tests.
22689
22690         * ../errors/cs0215.cs : Added.
22691
22692         * ../errors/cs0556.cs : Added.
22693
22694         * ../errors/cs0555.cs : Added.
22695
22696 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22697
22698         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22699         single integer which is really efficient
22700
22701 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22702
22703         *  expression.cs (Expression::ImplicitUserConversion): Use location
22704         even in the case when we are examining True operators.
22705  
22706         * class.cs (Operator::Define): Perform extensive checks to conform
22707         with the rules for operator overloading in the spec.
22708
22709         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22710         some of the other conversions mentioned in the spec.
22711
22712         * typemanager.cs (array_type): New static member for the System.Array built-in
22713         type.
22714
22715         (cloneable_interface): For System.ICloneable interface.
22716
22717         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22718         we start resolving the tree and populating types.
22719
22720         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22721  
22722 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22723
22724         * expression.cs (Expression::ExprClassFromMemberInfo,
22725         Expression::Literalize): Create literal expressions from
22726         FieldInfos which are literals.
22727
22728         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22729         type casts, because they were wrong.  The test suite in tests
22730         caught these ones.
22731
22732         (ImplicitNumericConversion): ushort to ulong requires a widening
22733         cast. 
22734
22735         Int32 constant to long requires widening cast as well.
22736
22737         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22738         for integers because the type on the stack is not i4.
22739
22740 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22741
22742         * expression.cs (report118): require location argument. 
22743
22744         * parameter.cs: Do not dereference potential null value.
22745
22746         * class.cs: Catch methods that lack the `new' keyword when
22747         overriding a name.  Report warnings when `new' is used without
22748         anything being there to override.
22749
22750         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22751
22752         * class.cs: Only add constructor to hashtable if it is non-null
22753         (as now constructors can fail on define).
22754
22755         (TypeManager, Class, Struct): Take location arguments.
22756
22757         Catch field instance initialization in structs as errors.
22758
22759         accepting_filter: a new filter for FindMembers that is static so
22760         that we dont create an instance per invocation.
22761
22762         (Constructor::Define): Catch errors where a struct constructor is
22763         parameterless 
22764
22765         * cs-parser.jay: Pass location information for various new
22766         constructs. 
22767
22768         * delegate.cs (Delegate): take a location argument.
22769
22770         * driver.cs: Do not call EmitCode if there were problesm in the
22771         Definition of the types, as many Builders wont be there. 
22772
22773         * decl.cs (Decl::Decl): Require a location argument.
22774
22775         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22776         into integers, and find the most appropiate integer for it.
22777
22778         * literal.cs: Implement ULongLiteral.
22779
22780         * rootcontext.cs: Provide better information about the location of
22781         failure when CreateType fails.
22782
22783 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22784
22785         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22786         as well.
22787
22788         * expression.cs (Binary::CheckShiftArguments): Add missing type
22789         computation.
22790         (Binary::ResolveOperator): Add type to the logical and and logical
22791         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22792         before.
22793
22794         (Binary::DoNumericPromotions): In the case where either argument
22795         is ulong (and most signed types combined with ulong cause an
22796         error) perform implicit integer constant conversions as well.
22797
22798 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22799
22800         * expression.cs (UserImplicitCast): Method should always be
22801         non-null. 
22802         (Invocation::BetterConversion): Simplified test for IntLiteral.
22803
22804         (Expression::ImplicitNumericConversion): Split this routine out.
22805         Put the code that performs implicit constant integer conversions
22806         here. 
22807
22808         (Expression::Resolve): Become a wrapper around DoResolve so we can
22809         check eclass and type being set after resolve.
22810
22811         (Invocation::Badness): Remove this dead function
22812
22813         (Binary::ResolveOperator): Do not compute the expensive argumnets
22814         unless we have a union for it.
22815
22816         (Probe::Emit): Is needs to do an isinst and then
22817         compare against null.
22818
22819         (::CanConvert): Added Location argument.  If the Location argument
22820         is null (Location.Null), then we do not report errors.  This is
22821         used by the `probe' mechanism of the Explicit conversion.  We do
22822         not want to generate an error for something that the user
22823         explicitly requested to be casted.  But the pipeline for an
22824         explicit cast first tests for potential implicit casts.
22825
22826         So for now, if the Location is null, it means `Probe only' to
22827         avoid adding another argument.   Might have to revise this
22828         strategy later.
22829
22830         (ClassCast): New class used to type cast objects into arbitrary
22831         classes (used in Explicit Reference Conversions).
22832
22833         Implement `as' as well.
22834
22835         Reverted all the patches from Ravi below: they were broken:
22836
22837                 * The use of `level' as a mechanism to stop recursive
22838                   invocations is wrong.  That was there just to catch the
22839                   bug with a strack trace but not as a way of addressing
22840                   the problem.
22841
22842                   To fix the problem we have to *understand* what is going
22843                   on and the interactions and come up with a plan, not
22844                   just get things going.
22845
22846                 * The use of the type conversion cache that I proposed
22847                   last night had an open topic: How does this work across
22848                   protection domains.  A user defined conversion might not
22849                   be public in the location where we are applying the
22850                   conversion, a different conversion might be selected
22851                   (ie, private A->B (better) but public B->A (worse),
22852                   inside A, A->B applies, but outside it, B->A will
22853                   apply).
22854
22855                 * On top of that (ie, even if the above is solved),
22856                   conversions in a cache need to be abstract.  Ie, `To
22857                   convert from an Int to a Short use an OpcodeCast', not
22858                   `To convert from an Int to a Short use the OpcodeCast on
22859                   the variable 5' (which is what this patch was doing).
22860
22861 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22862
22863         * expression.cs (Invocation::ConversionExists): Re-write to use
22864         the conversion cache
22865
22866         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22867         cache all conversions done, not just user-defined ones.
22868
22869         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22870         to determine if a conversion exists instead of acutually trying to 
22871         perform the conversion. It's faster too.
22872
22873         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22874         and only then attempt the implicit conversion.
22875
22876 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22877
22878         * expression.cs (ConvertImplicit): Use a cache for conversions
22879         already found. Check level of recursion and bail out if necessary.
22880
22881 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22882
22883         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22884         Export standard methods that we expect for string operations.
22885
22886         * statement.cs (Block::UsageWarning): Track usage of variables and
22887         report the errors for not used variables.
22888
22889         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22890         operator. 
22891
22892 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22893
22894         * codegen.cs: remove unnneded code 
22895
22896         * expression.cs: Removed BuiltinTypeAccess class
22897
22898         Fix the order in which implicit conversions are
22899         done.  
22900
22901         The previous fixed dropped support for boxed conversions (adding a
22902         test to the test suite now)
22903
22904         (UserImplicitCast::CanConvert): Remove test for source being null,
22905         that code is broken.  We should not feed a null to begin with, if
22906         we do, then we should track the bug where the problem originates
22907         and not try to cover it up here.
22908
22909         Return a resolved expression of type UserImplicitCast on success
22910         rather than true/false.  Ravi: this is what I was talking about,
22911         the pattern is to use a static method as a "constructor" for
22912         objects. 
22913
22914         Also, do not create arguments until the very last minute,
22915         otherwise we always create the arguments even for lookups that
22916         will never be performed. 
22917
22918         (UserImplicitCast::Resolve): Eliminate, objects of type
22919         UserImplicitCast are born in a fully resolved state. 
22920
22921         * typemanager.cs (InitCoreTypes): Init also value_type
22922         (System.ValueType). 
22923
22924         * expression.cs (Cast::Resolve): First resolve the child expression.
22925
22926         (LValue): Add new method AddressOf to be used by
22927         the `&' operator.  
22928
22929         Change the argument of Store to take an EmitContext instead of an
22930         ILGenerator, because things like FieldExpr need to be able to call
22931         their children expression to generate the instance code. 
22932
22933         (Expression::Error, Expression::Warning): Sugar functions for
22934         reporting errors.
22935
22936         (Expression::MemberLookup): Accept a TypeContainer instead of a
22937         Report as the first argument.
22938
22939         (Expression::ResolvePrimary): Killed.  I still want to improve
22940         this as currently the code is just not right.
22941
22942         (Expression::ResolveMemberAccess): Simplify, but it is still
22943         wrong. 
22944
22945         (Unary::Resolve): Catch errors in AddressOf operators.
22946
22947         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22948         index to a byte for the short-version, or the compiler will choose
22949         the wrong Emit call, which generates the wrong data.
22950
22951         (ParameterReference::Emit, ::Store): same.
22952
22953         (FieldExpr::AddressOf): Implement.
22954
22955         * typemanager.cs: TypeManager: made public variable instead of
22956         property.
22957
22958         * driver.cs: document --fatal.
22959
22960         * report.cs (ErrorMessage, WarningMessage): new names for the old
22961         Error and Warning classes.
22962
22963         * cs-parser.jay (member_access): Turn built-in access to types
22964         into a normal simplename
22965
22966 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22967
22968         * expression.cs (Invocation::BetterConversion): Fix to cope
22969         with q being null, since this was introducing a bug.
22970
22971         * expression.cs (ConvertImplicit): Do built-in conversions first.
22972
22973 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22974
22975         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22976
22977 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22978
22979         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22980         I had introduced long ago (what's new ?).
22981
22982         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22983         the work of all the checking. 
22984         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22985         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22986
22987         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22988         that is the right way. 
22989
22990         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22991         overloading resolution. Use everywhere instead of cutting and pasting code.
22992
22993         (Binary::ResolveOperator): Use MakeUnionSet.
22994
22995         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22996         we have to convert to bool types. Not complete yet.
22997
22998 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22999
23000         * typemanager.cs (TypeManager::CSharpName): support ushort.
23001
23002         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23003         to provide an expression that performsn an implicit constant int
23004         conversion (section 6.1.6).
23005         (Expression::ConvertImplicitRequired): Reworked to include
23006         implicit constant expression conversions.
23007
23008         (Expression::ConvertNumericExplicit): Finished.
23009
23010         (Invocation::Emit): If InstanceExpression is null, then it means
23011         that we perform a call on this.
23012
23013 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23014
23015         * expression.cs (Unary::Emit): Remove some dead code.
23016         (Probe): Implement Resolve and Emit for `is'.
23017         (Expression::ConvertImplicitRequired): Attempt to do constant
23018         expression conversions here.  Maybe should be moved to
23019         ConvertImplicit, but I am not sure.
23020         (Expression::ImplicitLongConstantConversionPossible,
23021         Expression::ImplicitIntConstantConversionPossible): New functions
23022         that tell whether is it possible to apply an implicit constant
23023         expression conversion.
23024
23025         (ConvertNumericExplicit): Started work on explicit numeric
23026         conversions.
23027
23028         * cs-parser.jay: Update operator constants.
23029
23030         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23031         (Parameters::GetSignature): Hook up VerifyArgs here.
23032         (Parameters::VerifyArgs): Verifies that no two arguments have the
23033         same name. 
23034
23035         * class.cs (Operator): Update the operator names to reflect the
23036         ones that the spec expects (as we are just stringizing the
23037         operator names).
23038
23039         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23040         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23041         previous usage did only work for our methods.
23042         (Expression::ConvertImplicit): Handle decimal implicit numeric
23043         conversions as well.
23044         (Expression::InternalTypeConstructor): Used to invoke constructors
23045         on internal types for default promotions.
23046
23047         (Unary::Emit): Implement special handling for the pre/post
23048         increment/decrement for overloaded operators, as they need to have
23049         the same semantics as the other operators.
23050
23051         (Binary::ResolveOperator): ditto.
23052         (Invocation::ConversionExists): ditto.
23053         (UserImplicitCast::Resolve): ditto.
23054
23055 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23056
23057         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23058         operator, return after emitting body. Regression tests pass again !
23059
23060         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23061         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23062         (Invocation::OverloadResolve): Ditto.
23063         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23064
23065         * everywhere : update calls to the above methods accordingly.
23066
23067 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23068
23069         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23070
23071         * expression.cs (ExpressionStatement): New base class used for
23072         expressions that can appear in statements, so that we can provide
23073         an alternate path to generate expression that do not leave a value
23074         on the stack.
23075
23076         (Expression::Emit, and all the derivatives): We no longer return
23077         whether a value is left on the stack or not.  Every expression
23078         after being emitted leaves a single value on the stack.
23079
23080         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23081         facilties of ExpressionStatement if possible.
23082
23083         * cs-parser.jay: Update statement_expression.
23084
23085 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23086
23087         * driver.cs: Change the wording of message
23088
23089 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23090
23091         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23092         the type of the expression to the return type of the method if
23093         we have an overloaded operator match ! The regression tests pass again !
23094         (Unary::ResolveOperator): Ditto.
23095
23096         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23097         to find "op_Implicit", not "implicit" ;-)
23098         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23099         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23100
23101         * everywhere : Correct calls to the above accordingly.
23102
23103         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23104         (ConvertImplicit): Do user-defined conversion if it exists.
23105
23106 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23107
23108         * assign.cs: track location.
23109         (Resolve): Use implicit conversions on assignment.
23110
23111         * literal.cs: Oops.  Not good, Emit of short access values should
23112         pass (Bytes) or the wrong argument will be selected.
23113
23114         * expression.cs (Unary::Emit): Emit code for -expr.
23115
23116         (Unary::ResolveOperator): Handle `Substract' for non-constants
23117         (substract from zero from the non-constants).
23118         Deal with Doubles as well. 
23119
23120         (Expression::ConvertImplicitRequired): New routine that reports an
23121         error if no implicit conversion exists. 
23122
23123         (Invocation::OverloadResolve): Store the converted implicit
23124         expressions if we make them
23125
23126 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23127
23128         * class.cs (ConstructorInitializer): Take a Location argument.
23129         (ConstructorBaseInitializer): Same here.
23130         (ConstructorThisInitializer): Same here.
23131
23132         * cs-parser.jay : Update all calls accordingly.
23133
23134         * expression.cs (Unary, Binary, New): Take location argument.
23135         Update accordingly everywhere.
23136
23137         * cs-parser.jay : Update all calls to the above to take a location
23138         argument.
23139
23140         * class.cs : Ditto.
23141
23142 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23143
23144         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23145         (Invocation::BetterConversion): Same here
23146         (Invocation::ConversionExists): Ditto.
23147
23148         (Invocation::ConversionExists): Implement.
23149
23150 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23151
23152         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23153         Also take an additional TypeContainer argument.
23154
23155         * All over : Pass in TypeContainer as argument to OverloadResolve.
23156
23157         * typemanager.cs (CSharpName): Update to check for the string type and return
23158         that too.
23159
23160         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23161         a given method.
23162
23163 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23164
23165         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23166         (Invocation::BetterFunction): Implement.
23167         (Invocation::BetterConversion): Implement.
23168         (Invocation::ConversionExists): Skeleton, no implementation yet.
23169
23170         Okay, things work fine !
23171
23172 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * typemanager.cs: declare and load enum_type, delegate_type and
23175         void_type. 
23176
23177         * expression.cs (Expression::Emit): Now emit returns a value that
23178         tells whether a value is left on the stack or not.  This strategy
23179         might be reveted tomorrow with a mechanism that would address
23180         multiple assignments.
23181         (Expression::report118): Utility routine to report mismatches on
23182         the ExprClass.
23183
23184         (Unary::Report23): Report impossible type/operator combination
23185         utility function.
23186
23187         (Unary::IsIncrementableNumber): Whether the type can be
23188         incremented or decremented with add.
23189         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23190         complemented. 
23191         (Unary::ResolveOperator): Implement ++, !, ~,
23192
23193         (Invocation::Emit): Deal with new Emit convetion.
23194
23195         * All Expression derivatives: Updated their Emit method to return
23196         whether they leave values on the stack or not.
23197
23198         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23199         stack for expressions that are statements. 
23200
23201 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23202
23203         * expression.cs (LValue): New interface.  Must be implemented by
23204         LValue objects.
23205         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23206         LValue interface.
23207
23208         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23209         interface for generating code, simplifies the code.
23210
23211 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23212
23213         * expression.cs (everywhere): Comment out return statements in ::Resolve
23214         methods to avoid the warnings.
23215
23216 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23217
23218         * driver.cs (parse): Report error 2001 if we can not open the
23219         source file.
23220
23221         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23222         not resolve it.
23223
23224         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23225         object. 
23226
23227         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23228         otherwise nested blocks end up with the same index.
23229
23230         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23231
23232         * expression.cs:  Instead of having FIXMEs in the Resolve
23233         functions, throw exceptions so it is obvious that we are facing a
23234         bug. 
23235
23236         * cs-parser.jay (invocation_expression): Pass Location information.
23237
23238         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23239         Use a basename for those routines because .NET does not like paths
23240         on them. 
23241
23242         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23243         already defined.
23244
23245 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23246
23247         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23248         are loading the correct data types (throws an exception if not).
23249         (TypeManager::InitCoreTypes): Use CoreLookupType
23250
23251         * expression.cs (Unary::ResolveOperator): return the child
23252         expression for expressions which are just +expr.
23253         (Unary::ResolveOperator): Return negative literals for -LITERAL
23254         expressions (otherwise they are Unary {Literal}).
23255         (Invocation::Badness): Take into account `Implicit constant
23256         expression conversions'.
23257
23258         * literal.cs (LongLiteral): Implement long literal class.
23259         (IntLiteral): export the `Value' of the intliteral. 
23260
23261 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23262
23263         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23264
23265         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23266         instead of 'Operator'
23267
23268         * expression.cs (Binary::ResolveOperator): Update accordingly.
23269         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23270         and 'Minus'
23271
23272         * cs-parser.jay (unary_expression): Update to use the new names.
23273
23274         * gen-treedump.cs (GetUnary): Same here.
23275
23276         * expression.cs (Unary::Resolve): Implement.
23277         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23278         operators are found instead of making noise ;-)
23279         (Unary::ResolveOperator): New method to do precisely the same thing which
23280         Binary::ResolveOperator does for Binary expressions.
23281         (Unary.method, .Arguments): Add.
23282         (Unary::OperName): Implement.   
23283         (Unary::ForceConversion): Copy and Paste !
23284
23285         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23286         a unary operator.
23287
23288         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23289         for the inbuilt operators. Only overloading works for now ;-)
23290
23291 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23292
23293         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23294         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23295
23296         * expression.cs (This::Emit): Implement. 
23297         (This::Resolve): Implement.
23298         (TypeOf:Resolve): Implement.
23299         (Expression::ResolveSimpleName): Add an implicit this to instance
23300         field references. 
23301         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23302         Bind instance variable to Field expressions.
23303         (FieldExpr::Instance): New field used to track the expression that
23304         represents the object instance.
23305         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23306         binding 
23307         (FieldExpr::Emit): Implement.
23308
23309         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23310         the last instruction contains a return opcode to avoid generating
23311         the last `ret' instruction (this generates correct code, and it is
23312         nice to pass the peverify output).
23313
23314         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23315         initializer for static and instance variables.
23316         (Constructor::Emit): Allow initializer to be null in the case of
23317         static constructors.  Only emit initializer for instance
23318         constructors. 
23319
23320         (TypeContainer::FindMembers): Return a null array if there are no
23321         matches.
23322
23323         Also fix the code for the MemberTypes.Method branch, as it was not
23324         scanning that for operators (or tried to access null variables before).
23325
23326         * assign.cs (Assign::Emit): Handle instance and static fields. 
23327
23328         * TODO: Updated.
23329
23330         * driver.cs: Stop compilation if there are parse errors.
23331
23332         * cs-parser.jay (constructor_declaration): Provide default base
23333         initializer for non-static constructors.
23334         (constructor_declarator): Do not provide a default base
23335         initializers if none was specified.
23336         Catch the fact that constructors should not have parameters.
23337
23338         * class.cs: Do not emit parent class initializers for static
23339         constructors, that should be flagged as an error.
23340
23341 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23342
23343         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23344         Move back code into TypeContainer::Populate.
23345
23346 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23347
23348         * class.cs (TypeContainer::AddConstructor): Fix the check to
23349         compare against Name, not Basename. 
23350         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23351
23352         * cs-parser.jay : Update accordingly.
23353
23354         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23355         for methods, don't forget to look into the operators too.
23356         (RegisterMethodBuilder): Helper method to take care of this for
23357         methods, constructors and operators.
23358         (Operator::Define): Completely revamp.
23359         (Operator.OperatorMethod, MethodName): New fields.
23360         (TypeContainer::Populate): Move the registering of builders into
23361         RegisterMethodBuilder.
23362         (Operator::Emit): Re-write.
23363
23364         * expression.cs (Binary::Emit): Comment out code path to emit method
23365         invocation stuff for the case when we have a user defined operator. I am
23366         just not able to get it right !
23367
23368 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23369
23370         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23371         argument. 
23372
23373         (Expression::MemberLookup): Provide a version that allows to
23374         specify the MemberTypes and BindingFlags. 
23375
23376         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23377         so it was not fetching variable information from outer blocks.
23378
23379         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23380         Beforefieldinit as it was buggy.
23381
23382         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23383         that Ravi put here.  
23384
23385         * class.cs (Constructor::Emit): Only emit if block is not null.
23386         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23387         deal with this by semantically definining it as if the user had
23388         done it.
23389
23390         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23391         constructors as we now "emit" them at a higher level.
23392
23393         (TypeContainer::DefineDefaultConstructor): Used to define the
23394         default constructors if none was provided.
23395
23396         (ConstructorInitializer): Add methods Resolve and Emit. 
23397
23398         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23399
23400 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23401
23402         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23403         the default constructor builder with our hashtable for methodbuilders
23404         to methodcores.
23405
23406         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23407         and argument_count is 0 in which case we have a match.
23408         (Binary::ResolveOperator): More null checking and miscellaneous coding
23409         style cleanup.
23410
23411 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23412
23413         * rootcontext.cs (IsNameSpace): Compare against null.
23414
23415         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23416
23417         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23418         and Unary::Operator.
23419
23420         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23421         accordingly.
23422
23423         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23424         we have overloaded operators.
23425         (Binary::ResolveOperator): Implement the part which does the operator overload
23426         resolution.
23427
23428         * class.cs (Operator::Emit): Implement.
23429         (TypeContainer::Emit): Emit the operators we have too.
23430
23431         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23432         the case when we have a user-defined operator.
23433
23434 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23435
23436         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23437
23438 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23439
23440         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23441         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23442         (Constructor::Emit): Implement.
23443         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23444         if we have no work to do. 
23445         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23446         Emit method.
23447
23448         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23449         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23450
23451         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23452         of parent.parent.
23453
23454 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23455
23456         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23457         in the source.
23458         (Tree::RecordNamespace): Method to do what the name says ;-)
23459         (Tree::Namespaces): Property to get at the namespaces hashtable.
23460
23461         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23462         keep track.
23463
23464         * rootcontext.cs (IsNamespace): Fixed it :-)
23465
23466 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23467
23468         * class.cs (TypeContainer::FindMembers): Add support for
23469         constructors. 
23470         (MethodCore): New class that encapsulates both the shared aspects
23471         of a Constructor and a Method.  
23472         (Method, Constructor): Factored pieces into MethodCore.
23473
23474         * driver.cs: Added --fatal which makes errors throw exceptions.
23475         Load System assembly as well as part of the standard library.
23476
23477         * report.cs: Allow throwing exceptions on errors for debugging.
23478
23479         * modifiers.cs: Do not use `parent', instead use the real type
23480         container to evaluate permission settings.
23481
23482         * class.cs: Put Ravi's patch back in.  He is right, and we will
23483         have to cope with the
23484
23485 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23486
23487         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23488         FamORAssem, not FamANDAssem.
23489
23490 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23491
23492         * driver.cs: Added --parse option that only parses its input files
23493         and terminates.
23494
23495         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23496         incorrect.  IsTopLevel is not used to tell whether an object is
23497         root_types or not (that can be achieved by testing this ==
23498         root_types).  But to see if this is a top-level *class* (not
23499         necessarly our "toplevel" container). 
23500
23501 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23502
23503         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23504         parent instead of a direct call to GetType.
23505
23506 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23507
23508         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23509         Modifiers.TypeAttr. This should just be a call to that method.
23510
23511         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23512         object so that we can determine if we are top-level or not.
23513
23514         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23515         TypeContainer too.
23516
23517         * enum.cs (Enum::Define): Ditto.
23518
23519         * modifiers.cs (FieldAttr): Re-write.
23520
23521         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23522         (TypeContainer::HaveStaticConstructor): New property to provide access
23523         to precisely that info.
23524
23525         * modifiers.cs (MethodAttr): Re-write.
23526         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23527
23528         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23529         of top-level types as claimed.
23530
23531 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23532
23533         * expression.cs (MemberLookup): Fruitless attempt to lookup
23534         constructors.  Maybe I need to emit default constructors?  That
23535         might be it (currently .NET emits this for me automatically).
23536         (Invocation::OverloadResolve): Cope with Arguments == null.
23537         (Invocation::EmitArguments): new function, shared by the new
23538         constructor and us.
23539         (Invocation::Emit): Handle static and instance methods.  Emit
23540         proper call instruction for virtual or non-virtual invocations.
23541         (New::Emit): Implement.
23542         (New::Resolve): Implement.
23543         (MemberAccess:Resolve): Implement.
23544         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23545         to track instances.
23546         (FieldExpr::Resolve): Set type.
23547
23548         * support.cs: Handle empty arguments.
23549                 
23550         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23551         SimpleLookup): Auxiliary routines to help parse a qualifier
23552         identifier.  
23553
23554         Update qualifier_identifier rule.
23555
23556         * codegen.cs: Removed debugging messages.
23557
23558         * class.cs: Make this a global thing, this acts just as a "key" to
23559         objects that we might have around.
23560
23561         (Populate): Only initialize method_builders_to_methods once.
23562
23563         * expression.cs (PropertyExpr): Initialize type from the
23564         PropertyType. 
23565
23566         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23567         Resolve pattern.  Attempt to implicitly convert value to boolean.
23568         Emit code.
23569
23570         * expression.cs: Set the type for the int32/int32 argument case.
23571         (Binary::ResolveOperator): Set the return type to boolean for
23572         comparission operators
23573
23574         * typemanager.cs: Remove debugging print code.
23575
23576         (Invocation::Resolve): resolve type.
23577
23578         * class.cs: Allocate a MemberInfo of the correct size, as the code
23579         elsewhere depends on the test to reflect the correct contents.
23580
23581         (Method::) Keep track of parameters, due to System.Reflection holes
23582
23583         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23584         mapping here.
23585
23586         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23587         of the exact size and return that.
23588
23589         (Class::LookupMethodByBuilder): New function that maps
23590         MethodBuilders to its methods.  Required to locate the information
23591         on methods because System.Reflection bit us again.
23592
23593         * support.cs: New file, contains an interface ParameterData and
23594         two implementations: ReflectionParameters and InternalParameters
23595         used to access Parameter information.  We will need to grow this
23596         as required.
23597
23598         * expression.cs (Invocation::GetParameterData): implement a cache
23599         and a wrapper around the ParameterData creation for methods. 
23600         (Invocation::OverloadResolve): Use new code.
23601
23602 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23603
23604         * class.cs (TypeContainer::EmitField): Remove and move into 
23605         (Field::Define): here and modify accordingly.
23606         (Field.FieldBuilder): New member.
23607         (TypeContainer::Populate): Update accordingly.
23608         (TypeContainer::FindMembers): Implement.
23609
23610 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23611
23612         * statement.cs: (VariableInfo::VariableType): New field to be
23613         initialized with the full type once it is resolved. 
23614
23615 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23616
23617         * parameter.cs (GetParameterInfo): Use a type cache to compute
23618         things only once, and to reuse this information
23619
23620         * expression.cs (LocalVariableReference::Emit): Implement.
23621         (OpcodeCast::Emit): fix.
23622
23623         (ParameterReference::Resolve): Implement.
23624         (ParameterReference::Emit): Implement.
23625
23626         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23627         that are expressions need to stay as Expressions.
23628
23629         * typemanager.cs (CSharpName): Returns the C# name of a type if
23630         possible. 
23631
23632         * expression.cs (Expression::ConvertImplicit): New function that
23633         implements implicit type conversions.
23634
23635         (Expression::ImplicitReferenceConversion): Implements implicit
23636         reference conversions.
23637
23638         (EmptyCast): New type for transparent casts.
23639
23640         (OpcodeCast): New type for casts of types that are performed with
23641         a sequence of bytecodes.
23642
23643         (BoxedCast): New type used for casting value types into reference
23644         types.  Emits a box opcode.
23645
23646         (Binary::DoNumericPromotions): Implements numeric promotions of
23647         and computation of the Binary::Type.
23648
23649         (Binary::EmitBranchable): Optimization.
23650
23651         (Binary::Emit): Implement code emission for expressions.
23652
23653         * typemanager.cs (TypeManager): Added two new core types: sbyte
23654         and byte.
23655
23656 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23657
23658         * class.cs (TypeContainer::FindMembers): Method which does exactly
23659         what Type.FindMembers does, only we don't have to use reflection. No
23660         implementation yet.
23661
23662         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23663         typecontainer objects as we need to get at them.
23664         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23665
23666         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23667         typecontainer object.
23668
23669         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23670         of just a Report object.
23671
23672 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23673
23674         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23675         "remove_"
23676         (TypeContainer::Populate): Now define the delegates of the type too.
23677         (TypeContainer.Delegates): Property to access the list of delegates defined
23678         in the type.
23679
23680         * delegates.cs (Delegate::Define): Implement partially.
23681
23682         * modifiers.cs (TypeAttr): Handle more flags.
23683
23684 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23685
23686         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23687         and not <=
23688         (Operator::Define): Re-write logic to get types by using the LookupType method
23689         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23690         (Indexer::Define): Ditto.
23691         (Event::Define): Ditto.
23692         (Property::Define): Ditto.
23693
23694 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23695
23696         * class.cs (TypeContainer::Populate): Now define operators too. 
23697         (TypeContainer.Operators): New property to access the list of operators
23698         in a type.
23699         (Operator.OperatorMethodBuilder): New member to hold the method builder
23700         for the operator we are defining.
23701         (Operator::Define): Implement.
23702
23703 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23704
23705         * class.cs (Event::Define): Make the prefixes of the accessor methods
23706         addOn_ and removeOn_ 
23707
23708         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23709         of the location being passed in too. Ideally, this should go later since all
23710         error reporting should be done through the Report object.
23711
23712         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23713         (Populate): Iterate thru the indexers we have and define them too.
23714         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23715         for the get and set accessors.
23716         (Indexer::Define): Implement.
23717
23718 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23719
23720         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23721         my previous implementation, did not work.
23722
23723         * typemanager.cs: Add a couple of missing types (the longs).
23724
23725         * literal.cs: Use TypeManager.bool_type instead of getting it.
23726
23727         * expression.cs (EventExpr): New kind of expressions.
23728         (Expressio::ExprClassFromMemberInfo): finish
23729
23730 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23731
23732         * assign.cs: Emit stores to static fields differently.
23733
23734 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23735
23736         * Merge in changes and adjust code to tackle conflicts. Backed out my
23737         code in Assign::Resolve ;-) 
23738
23739 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23740
23741         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23742         instead Report.Error and also pass in the location.
23743         (CSharpParser::Lexer): New readonly property to return the reference
23744         to the Tokenizer object.
23745         (declare_local_variables): Use Report.Error with location instead of plain 
23746         old error.
23747         (CheckDef): Ditto.
23748
23749         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23750         (Operator.CheckBinaryOperator): Ditto.
23751
23752         * cs-parser.jay (operator_declarator): Update accordingly.
23753
23754         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23755         (CheckBinaryOperator): Same here.
23756
23757         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23758         on the name without any prefixes of namespace names etc. This is because we
23759         already might have something already fully qualified like 
23760         'System.Console.WriteLine'
23761
23762         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23763
23764 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23765
23766         * cs-tokenizer.cs (location): Return a string which also contains
23767         the file name.
23768
23769         * expression.cs (ElementAccess): New class for expressions of the
23770         type 'element access.'
23771         (BaseAccess): New class for expressions of the type 'base access.'
23772         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23773         respectively.
23774
23775         * cs-parser.jay (element_access): Implement action.
23776         (base_access): Implement actions.
23777         (checked_expression, unchecked_expression): Implement.
23778
23779         * cs-parser.jay (local_variable_type): Correct and implement.
23780         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23781
23782         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23783
23784         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23785         name and the specifiers.
23786
23787         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23788
23789         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23790         making them all public ;-)
23791
23792         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23793         class anyways.
23794
23795 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23796
23797         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23798         PropertyExprs.
23799         (FieldExpr, PropertyExprs): New resolved expressions.
23800         (SimpleName::MemberStaticCheck): Perform static checks for access
23801         to non-static fields on static methods. Maybe this should be
23802         generalized for MemberAccesses. 
23803         (SimpleName::ResolveSimpleName): More work on simple name
23804         resolution. 
23805
23806         * cs-parser.jay (primary_expression/qualified_identifier): track
23807         the parameter index.
23808
23809         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23810         (EmitContext::EmitBoolExpression): Chain to expression generation
23811         instead of temporary hack.
23812         (::EmitStatementExpression): Put generic expression code generation.
23813
23814         * assign.cs (Assign::Emit): Implement variable assignments to
23815         local variables, parameters and fields.
23816
23817 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23818
23819         * statement.cs (Block::GetVariableInfo): New method, returns the
23820         VariableInfo for a variable name in a block.
23821         (Block::GetVariableType): Implement in terms of GetVariableInfo
23822
23823         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23824         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23825
23826 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23827
23828         * cs-parser.jay (operator_declaration): Continue on my quest : update
23829         to take attributes argument.
23830         (event_declaration): Ditto.
23831         (enum_declaration): Ditto.
23832         (indexer_declaration): Ditto.
23833
23834         * class.cs (Operator::Operator): Update constructor accordingly.
23835         (Event::Event): Ditto.
23836
23837         * delegate.cs (Delegate::Delegate): Same here.
23838
23839         * enum.cs (Enum::Enum): Same here.
23840
23841 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23842
23843         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23844
23845         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23846
23847         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23848         being passed around as an arraylist.
23849         (Attributes::AddAttribute): Method to add attribute sections.
23850
23851         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23852         (struct_declaration): Update accordingly.
23853         (constant_declaration): Update.
23854         (field_declaration): Update.
23855         (method_header): Update.
23856         (fixed_parameter): Update.
23857         (parameter_array): Ditto.
23858         (property_declaration): Ditto.
23859         (destructor_declaration): Ditto.
23860
23861         * class.cs (Struct::Struct): Update constructors accordingly.
23862         (Class::Class): Ditto.
23863         (Field::Field): Ditto.
23864         (Method::Method): Ditto.
23865         (Property::Property): Ditto.
23866         (TypeContainer::OptAttribute): update property's return type.
23867
23868         * interface.cs (Interface.opt_attributes): New member.
23869         (Interface::Interface): Update to take the extra Attributes argument.
23870
23871         * parameter.cs (Parameter::Parameter): Ditto.
23872
23873         * constant.cs (Constant::Constant): Ditto.
23874
23875         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23876         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23877         the attributes as a parameter.
23878         (InterfaceProperty): Update constructor call.
23879         (InterfaceEvent): Ditto.
23880         (InterfaceMethod): Ditto.
23881         (InterfaceIndexer): Ditto.
23882
23883         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23884         pass the attributes too.
23885         (interface_event_declaration): Ditto.
23886         (interface_property_declaration): Ditto.
23887         (interface_method_declaration): Ditto.
23888         (interface_declaration): Ditto.
23889
23890 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23891
23892         * class.cs (Method::Define): Track the "static Main" definition to
23893         create an entry point. 
23894
23895         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23896         EntryPoint if we find it. 
23897
23898         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23899         (EmitContext::ig): Make this variable public.
23900
23901         * driver.cs: Make the default output file be the first file name
23902         with the .exe extension.  
23903
23904         Detect empty compilations
23905
23906         Handle various kinds of output targets.  Handle --target and
23907         rename -t to --dumper.
23908
23909         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23910         methods inherited from Expression return now an Expression.  This
23911         will is used during the tree rewriting as we resolve them during
23912         semantic analysis.
23913
23914         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23915         the spec.  Missing entirely is the information about
23916         accessability of elements of it.
23917
23918         (Expression::ExprClassFromMemberInfo): New constructor for
23919         Expressions that creates a fully initialized Expression based on
23920         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23921         a Type.
23922
23923         (Invocation::Resolve): Begin implementing resolution of invocations.
23924
23925         * literal.cs (StringLiteral):  Implement Emit.
23926
23927 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23928
23929         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23930         member.
23931
23932 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23933
23934         * cs-parser.jay (attribute_arguments): Implement actions.
23935         (attribute): Fix bug in production. Implement action.
23936         (attribute_list): Implement.
23937         (attribute_target): Implement.
23938         (attribute_target_specifier, opt_target_specifier): Implement
23939         (CheckAttributeTarget): New method to check if the attribute target
23940         is valid.
23941         (attribute_section): Implement.
23942         (opt_attributes): Implement.
23943
23944         * attribute.cs : New file to handle attributes.
23945         (Attribute): Class to hold attribute info.
23946
23947         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23948         (attribute_section): Modify production to use 2 different rules to 
23949         achieve the same thing. 1 s/r conflict down !
23950         Clean out commented, useless, non-reducing dimension_separator rules.
23951
23952         * class.cs (TypeContainer.attributes): New member to hold list
23953         of attributes for a type.
23954         (Struct::Struct): Modify to take one more argument, the attribute list.
23955         (Class::Class): Ditto.
23956         (Field::Field): Ditto.
23957         (Method::Method): Ditto.
23958         (Property::Property): Ditto.
23959
23960         * cs-parser.jay (struct_declaration): Update constructor call to
23961         pass in the attributes too.
23962         (class_declaration): Ditto.
23963         (constant_declaration): Ditto.
23964         (field_declaration): Ditto.
23965         (method_header): Ditto.
23966         (fixed_parameter): Ditto.
23967         (parameter_array): Ditto.
23968         (property_declaration): Ditto.
23969
23970         * constant.cs (Constant::Constant): Update constructor similarly.
23971         Use System.Collections.
23972
23973         * parameter.cs (Parameter::Parameter): Update as above.
23974
23975 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23976
23977         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23978         (TypeContainer.delegates): New member to hold list of delegates.
23979
23980         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23981         this time as I seem to be on crack ;-)
23982
23983 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23984
23985         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23986         tell whether an identifier represents a namespace.
23987
23988         * expression.cs (NamespaceExpr): A namespace expression, used only
23989         temporarly during expression resolution.
23990         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23991         utility functions to resolve names on expressions.
23992
23993 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23994
23995         * codegen.cs: Add hook for StatementExpressions. 
23996
23997         * class.cs: Fix inverted test for static flag in methods.
23998
23999 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24000
24001         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24002         to make it coincide with MS' number.
24003         (Operator::CheckBinaryOperator): Ditto.
24004
24005         * ../errors/errors.txt : Remove error numbers added earlier.
24006
24007         * ../errors/cs1019.cs : Test case for error # 1019
24008
24009         * ../errros/cs1020.cs : Test case for error # 1020
24010
24011         * cs-parser.jay : Clean out commented cruft.
24012         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24013         used anywhere - non-reducing rule.
24014         (namespace_declarations): Non-reducing rule - comment out.
24015
24016         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24017         with TypeContainer::AddEnum.
24018
24019         * delegate.cs : New file for delegate handling classes.
24020         (Delegate): Class for declaring delegates.
24021
24022         * makefile : Update.
24023
24024         * cs-parser.jay (delegate_declaration): Implement.
24025
24026 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24027
24028         * class.cs (Event::Define): Implement.
24029         (Event.EventBuilder): New member.
24030
24031         * class.cs (TypeContainer::Populate): Update to define all enums and events
24032         we have.
24033         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24034         readonly fields for all these cases ?
24035
24036 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24037
24038         * class.cs (Property): Revamp to use the convention of making fields readonly.
24039         Accordingly modify code elsewhere.
24040
24041         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24042         the Define method of the Property class.
24043
24044         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24045         trivial bug.
24046         (TypeContainer::Populate): Update to define all the properties we have. Also
24047         define all enumerations.
24048
24049         * enum.cs (Define): Implement.
24050
24051 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24052
24053         * cs-parser.jay (overloadable_operator): The semantic value is an
24054         enum of the Operator class.
24055         (operator_declarator): Implement actions.
24056         (operator_declaration): Implement.
24057
24058         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24059         validity of definitions.
24060         (Operator::CheckBinaryOperator): Static method to check for binary operators
24061         (TypeContainer::AddOperator): New method to add an operator to a type.
24062
24063         * cs-parser.jay (indexer_declaration): Added line to actually call the
24064         AddIndexer method so it gets added ;-)
24065
24066         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24067         already taken care of by the MS compiler ?  
24068
24069 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24070
24071         * class.cs (Operator): New class for operator declarations.
24072         (Operator::OpType): Enum for the various operators.
24073
24074 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24075
24076         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24077         ostensibly handle this in semantic analysis.
24078
24079         * cs-parser.jay (general_catch_clause): Comment out
24080         (specific_catch_clauses, specific_catch_clause): Ditto.
24081         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24082         (catch_args, opt_catch_args): New productions.
24083         (catch_clause): Rewrite to use the new productions above
24084         (catch_clauses): Modify accordingly.
24085         (opt_catch_clauses): New production to use in try_statement
24086         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24087         and re-write the code in the actions to extract the specific and
24088         general catch clauses by being a little smart ;-)
24089
24090         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24091         Hooray, try and catch statements parse fine !
24092
24093 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24094
24095         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24096         string from the hashtable of variables.
24097
24098         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24099         I end up making that mistake ;-)
24100         (catch_clauses): Fixed gross error which made Key and Value of the 
24101         DictionaryEntry the same : $1 !!
24102
24103 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24104
24105         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24106
24107         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24108         when the add and remove accessors are specified. 
24109
24110 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24111
24112         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24113         information about indexer_declarator.
24114         (indexer_declarator): Implement actions.
24115         (parsing_indexer): New local boolean used to keep track of whether
24116         we are parsing indexers or properties. This is necessary because 
24117         implicit_parameters come into picture even for the get accessor in the 
24118         case of an indexer.
24119         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24120
24121         * class.cs (Indexer): New class for indexer declarations.
24122         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24123         (TypeContainer::indexers): New member to hold list of indexers for the
24124         type.
24125
24126 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24127
24128         * cs-parser.jay (add_accessor_declaration): Implement action.
24129         (remove_accessor_declaration): Implement action.
24130         (event_accessors_declaration): Implement
24131         (variable_declarators): swap statements for first rule - trivial.
24132
24133         * class.cs (Event): New class to hold information about event
24134         declarations.
24135         (TypeContainer::AddEvent): New method to add an event to a type
24136         (TypeContainer::events): New member to hold list of events.
24137
24138         * cs-parser.jay (event_declaration): Implement actions.
24139
24140 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24141
24142         * cs-parser.jay (dim_separators): Implement. Make it a string
24143         concatenating all the commas together, just as they appear.
24144         (opt_dim_separators): Modify accordingly
24145         (rank_specifiers): Update accordingly. Basically do the same
24146         thing - instead, collect the brackets here.
24147         (opt_rank_sepcifiers): Modify accordingly.
24148         (array_type): Modify to actually return the complete type string
24149         instead of ignoring the rank_specifiers.
24150         (expression_list): Implement to collect the expressions
24151         (variable_initializer): Implement. We make it a list of expressions
24152         essentially so that we can handle the array_initializer case neatly too.
24153         (variable_initializer_list): Implement.
24154         (array_initializer): Make it a list of variable_initializers
24155         (opt_array_initializer): Modify accordingly.
24156
24157         * expression.cs (New::NType): Add enumeration to help us
24158         keep track of whether we have an object/delegate creation
24159         or an array creation.
24160         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24161         members to hold data about array creation.
24162         (New:New): Modify to update NewType
24163         (New:New): New Overloaded contructor for the array creation
24164         case.
24165
24166         * cs-parser.jay (array_creation_expression): Implement to call
24167         the overloaded New constructor.
24168
24169 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24170
24171         * class.cs (TypeContainer::Constructors): Return member
24172         constructors instead of returning null.
24173
24174 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24175
24176         * typemanager.cs (InitCoreTypes): Initialize the various core
24177         types after we have populated the type manager with the user
24178         defined types (this distinction will be important later while
24179         compiling corlib.dll)
24180
24181         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24182         on Expression Classification.  Now all expressions have a method
24183         `Resolve' and a method `Emit'.
24184
24185         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24186         generation from working.     Also add some temporary debugging
24187         code. 
24188
24189 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24190
24191         * codegen.cs: Lots of code generation pieces.  This is only the
24192         beginning, will continue tomorrow with more touches of polish.  We
24193         handle the fundamentals of if, while, do, for, return.  Others are
24194         trickier and I need to start working on invocations soon.
24195
24196         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24197         s.InitStatement. 
24198
24199         * codegen.cs (EmitContext): New struct, used during code
24200         emission to keep a context.   Most of the code generation will be
24201         here. 
24202
24203         * cs-parser.jay: Add embedded blocks to the list of statements of
24204         this block.  So code generation proceeds in a top down fashion.
24205
24206 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24207
24208         * statement.cs: Add support for multiple child blocks.
24209
24210 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24211
24212         * codegen.cs (EmitCode): New function, will emit the code for a
24213         Block of code given a TypeContainer and its ILGenerator. 
24214
24215         * statement.cs (Block): Standard public readonly optimization.
24216         (Block::Block constructors): Link children. 
24217         (Block::Child): Child Linker.
24218         (Block::EmitVariables): Emits IL variable declarations.
24219
24220         * class.cs: Drop support for MethodGroups here, delay until
24221         Semantic Analysis.
24222         (Method::): Applied the same simplification that I did before, and
24223         move from Properties to public readonly fields.
24224         (Method::ParameterTypes): Returns the parameter types for the
24225         function, and implements a cache that will be useful later when I
24226         do error checking and the semantic analysis on the methods is
24227         performed.
24228         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24229         and made a method, optional argument tells whether this is a class
24230         or a structure to apply the `has-this' bit.
24231         (Method::GetCallingConvention): Implement, returns the calling
24232         convention. 
24233         (Method::Define): Defines the type, a second pass is performed
24234         later to populate the methods.
24235
24236         (Constructor::ParameterTypes): implement a cache similar to the
24237         one on Method::ParameterTypes, useful later when we do semantic
24238         analysis. 
24239
24240         (TypeContainer::EmitMethod):  New method.  Emits methods.
24241
24242         * expression.cs: Removed MethodGroup class from here.
24243
24244         * parameter.cs (Parameters::GetCallingConvention): new method.
24245
24246 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24247
24248         * class.cs (TypeContainer::Populate): Drop RootContext from the
24249         argument. 
24250
24251         (Constructor::CallingConvention): Returns the calling convention.
24252         (Constructor::ParameterTypes): Returns the constructor parameter
24253         types. 
24254
24255         (TypeContainer::AddConstructor): Keep track of default constructor
24256         and the default static constructor.
24257
24258         (Constructor::) Another class that starts using `public readonly'
24259         instead of properties. 
24260
24261         (Constructor::IsDefault): Whether this is a default constructor. 
24262
24263         (Field::) use readonly public fields instead of properties also.
24264
24265         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24266         track of static constructors;  If none is used, turn on
24267         BeforeFieldInit in the TypeAttributes. 
24268
24269         * cs-parser.jay (opt_argument_list): now the return can be null
24270         for the cases where there are no arguments. 
24271
24272         (constructor_declarator): If there is no implicit `base' or
24273         `this', then invoke the default parent constructor. 
24274
24275         * modifiers.cs (MethodAttr): New static function maps a set of
24276         modifiers flags into a MethodAttributes enum
24277         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24278         MethodAttr, TypeAttr to represent the various mappings where the
24279         modifiers are used.
24280         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24281
24282 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24283
24284         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24285         method arguments.
24286
24287         * interface.cs (PopulateIndexer): Implemented the code generator
24288         for interface indexers.
24289
24290 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24291
24292         * interface.cs (InterfaceMemberBase): Now we track the new status
24293         here.  
24294
24295         (PopulateProperty): Implement property population.  Woohoo!  Got
24296         Methods and Properties going today. 
24297
24298         Removed all the properties for interfaces, and replaced them with
24299         `public readonly' fields. 
24300
24301 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24302
24303         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24304         initialize their hashtables/arraylists only when they are needed
24305         instead of doing this always.
24306
24307         * parameter.cs: Handle refs and out parameters.
24308
24309         * cs-parser.jay: Use an ArrayList to construct the arguments
24310         instead of the ParameterCollection, and then cast that to a
24311         Parameter[] array.
24312
24313         * parameter.cs: Drop the use of ParameterCollection and use
24314         instead arrays of Parameters.
24315
24316         (GetParameterInfo): Use the Type, not the Name when resolving
24317         types. 
24318
24319 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24320
24321         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24322         and instead use public readonly fields.
24323
24324         * class.cs: Put back walking code for type containers.
24325
24326 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24327
24328         * class.cs (MakeConstant): Code to define constants.
24329
24330         * rootcontext.cs (LookupType): New function.  Used to locate types 
24331
24332
24333 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24334
24335         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24336         this System.Reflection code is.  Kudos to Microsoft
24337
24338         * typemanager.cs: Implement a type cache and avoid loading all
24339         types at boot time.  Wrap in LookupType the internals.  This made
24340         the compiler so much faster.  Wow.  I rule!
24341
24342         * driver.cs: Make sure we always load mscorlib first (for
24343         debugging purposes, nothing really important).
24344
24345         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24346         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24347
24348         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24349         on namespaces that have been imported using the `using' keyword.
24350
24351         * class.cs (TypeContainer::TypeAttr): Virtualize.
24352         (Class::TypeAttr): Return attributes suitable for this bad boy.
24353         (Struct::TypeAttr): ditto.
24354         Handle nested classes.
24355         (TypeContainer::) Remove all the type visiting code, it is now
24356         replaced with the rootcontext.cs code
24357
24358         * rootcontext.cs (GetClassBases): Added support for structs. 
24359
24360 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24361
24362         * interface.cs, statement.cs, class.cs, parameter.cs,
24363         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24364         Drop use of TypeRefs, and use strings instead.
24365
24366 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24367
24368         * rootcontext.cs: 
24369
24370         * class.cs (Struct::Struct): set the SEALED flags after
24371         checking the modifiers.
24372         (TypeContainer::TypeAttr): new property, returns the
24373         TypeAttributes for a class.  
24374
24375         * cs-parser.jay (type_list): Oops, list production was creating a
24376         new list of base types.
24377
24378         * rootcontext.cs (StdLib): New property.
24379         (GetInterfaceTypeByName): returns an interface by type name, and
24380         encapsulates error handling here.
24381         (GetInterfaces): simplified.
24382         (ResolveTree): Encapsulated all the tree resolution here.
24383         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24384         types. 
24385
24386         * driver.cs: Add support for --nostdlib, to avoid loading the
24387         default assemblies.
24388         (Main): Do not put tree resolution here. 
24389
24390         * rootcontext.cs: Beginning of the class resolution.
24391
24392 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24393
24394         * rootcontext.cs: Provide better error reporting. 
24395
24396         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24397
24398         * rootcontext.cs (CreateInterface): Handle the case where there
24399         are no parent interfaces.
24400
24401         (CloseTypes): Routine to flush types at the end.
24402         (CreateInterface): Track types.
24403         (GetInterfaces): Returns an array of Types from the list of
24404         defined interfaces.
24405
24406         * typemanager.c (AddUserType): Mechanism to track user types (puts
24407         the type on the global type hash, and allows us to close it at the
24408         end). 
24409
24410 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24411
24412         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24413         RecordInterface instead.
24414
24415         * cs-parser.jay: Updated to reflect changes above.
24416
24417         * decl.cs (Definition): Keep track of the TypeBuilder type that
24418         represents this type here.  Not sure we will use it in the long
24419         run, but wont hurt for now.
24420
24421         * driver.cs: Smaller changes to accomodate the new code.
24422
24423         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24424         when done. 
24425
24426         * rootcontext.cs (CreateInterface):  New method, used to create
24427         the System.TypeBuilder type for interfaces.
24428         (ResolveInterfaces): new entry point to resolve the interface
24429         hierarchy. 
24430         (CodeGen): Property, used to keep track of the code generator.
24431
24432 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24433
24434         * cs-parser.jay: Add a second production for delegate_declaration
24435         with `VOID'.
24436
24437         (enum_body): Put an opt_comma here instead of putting it on
24438         enum_body or enum_member_declarations so we can handle trailing
24439         commas on enumeration members.  Gets rid of a shift/reduce.
24440
24441         (type_list): Need a COMMA in the middle.
24442
24443         (indexer_declaration): Tell tokenizer to recognize get/set
24444
24445         * Remove old targets.
24446
24447         * Re-add the parser target.
24448
24449 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24450
24451         * cs-parser.jay: Add precendence rules for a number of operators
24452         ot reduce the number of shift/reduce conflicts in the grammar.
24453
24454 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24455
24456         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24457         and put it here.
24458
24459         Get rid of old crufty code.
24460
24461         * rootcontext.cs: Use this to keep track of the parsed
24462         representation and the defined types available to the program. 
24463
24464         * gen-treedump.cs: adjust for new convention.
24465
24466         * type.cs: Split out the type manager, and the assembly builder
24467         from here. 
24468
24469         * typemanager.cs: the type manager will live here now.
24470
24471         * cil-codegen.cs: And the code generator here. 
24472
24473 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24474
24475         * makefile: Fixed up for easy making.
24476
24477 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24478
24479         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24480         the 
24481
24482         (unary_expression): Expand pre_increment_expression and
24483         post_decrement_expression to reduce a shift/reduce.
24484
24485 2001-07-11  Simon Cozens
24486
24487         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24488
24489         Improve allow_keyword_as_indent name.
24490
24491 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24492
24493         * Adjustments for Beta2. 
24494
24495 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24496
24497         * decl.cs: Added `Define' abstract method.
24498         (InTransit): new property, used to catch recursive definitions. 
24499
24500         * interface.cs: Implement `Define'. 
24501
24502         * modifiers.cs: Map Modifiers.constants to
24503         System.Reflection.TypeAttribute flags.
24504
24505         * class.cs: Keep track of types and user-defined types.
24506         (BuilderInit): New method for creating an assembly
24507         (ResolveType): New function to launch the resolution process, only
24508         used by interfaces for now.
24509
24510         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24511         that are inserted into the name space. 
24512
24513 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24514
24515         * ARGH.  I have screwed up my tree so many times due to the use of
24516         rsync rather than using CVS.  Going to fix this at once. 
24517
24518         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24519         load types.
24520
24521 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24522
24523         * Experiment successful: Use System.Type rather that our own
24524         version of Type.  
24525
24526 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24527
24528         * cs-parser.jay: Removed nsAliases from here.
24529
24530         Use new namespaces, handle `using XXX;' 
24531
24532         * namespace.cs: Reimplemented namespace handling, use a recursive
24533         definition of the class.  Now we can keep track of using clauses
24534         and catch invalid using clauses.
24535
24536 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24537
24538         * gen-treedump.cs: Adapted for all the renaming.
24539
24540         * expression.cs (Expression): this class now has a Type property
24541         which returns an expression Type.
24542
24543         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24544         `Type', as this has a different meaning now in the base
24545
24546 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24547
24548         * interface.cs, class.cs: Removed from all the sources the
24549         references to signature computation, as we can not do method
24550         signature computation during the parsing time, as we are not
24551         trying to solve at that point distinguishing:
24552
24553         class X {
24554                 void a (Blah x) {}
24555                 void a (NS.Blah x) {}
24556         }
24557
24558         Which depending on the context might be valid or not, as we do not
24559         know if Blah is the same thing as NS.Blah at that point.
24560
24561         * Redid everything so the code uses TypeRefs now instead of
24562         Types.  TypeRefs are just temporary type placeholders, that need
24563         to be resolved.  They initially have a pointer to a string and the
24564         current scope in which they are used.  This is used later by the
24565         compiler to resolve the reference to an actual Type. 
24566
24567         * DeclSpace is no longer a CIR.Type, and neither are
24568         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24569         are all DeclSpaces, but no Types. 
24570
24571         * type.cs (TypeRefManager): This implements the TypeRef manager,
24572         which keeps track of all the types that need to be resolved after
24573         the parsing has finished. 
24574
24575 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24576
24577         * ARGH.  We are going to have to store `foreach' as a class rather
24578         than resolving it, as we need to verify error 1579 after name
24579         resolution.   *OR* we could keep a flag that says `This request to
24580         IEnumerator comes from a foreach statement' which we can then use
24581         to generate the error.
24582
24583 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24584
24585         * class.cs (TypeContainer.AddMethod): we now add methods to the
24586         MethodGroup instead of the method hashtable.  
24587
24588         * expression.cs: Add MethodGroup abstraction, which gets us one
24589         step closer to the specification in the way we handle method
24590         declarations.  
24591
24592         * cs-parser.jay (primary_expression): qualified_identifier now
24593         tried to match up an identifier to a local variable reference or
24594         to a parameter reference.
24595
24596         current_local_parameters is now a parser global variable that
24597         points to the current parameters for the block, used during name
24598         lookup.
24599
24600         (property_declaration): Now creates an implicit `value' argument to
24601         the set accessor.
24602
24603 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24604
24605         * parameter.cs: Do not use `param' arguments as part of the
24606         signature, per the spec.
24607
24608 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24609
24610         * decl.cs: Base class for classes, structs and interfaces.  This
24611         is the "Declaration Space" 
24612
24613         * cs-parser.jay: Use CheckDef for checking declaration errors
24614         instead of having one on each function.
24615
24616         * class.cs: Factor out some code for handling error handling in
24617         accordance to the "Declarations" section in the "Basic Concepts"
24618         chapter in the ECMA C# spec.
24619
24620         * interface.cs: Make all interface member classes derive from
24621         InterfaceMemberBase.
24622
24623 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24624
24625         * Many things: all interfaces are parsed and generated in
24626         gen-treedump.  Support for member variables, constructors,
24627         destructors, properties, constants is there.
24628
24629         Beginning of the IL backend, but very little done, just there for
24630         testing purposes. 
24631
24632 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24633
24634         * cs-parser.jay: Fix labeled statement.
24635
24636         * cs-tokenizer.cs (escape): Escape " and ' always.
24637         ref_line, ref_name: keep track of the line/filename as instructed
24638         by #line by the compiler.
24639         Parse #line.
24640
24641 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24642
24643         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24644         to match the values in System.CodeDOM.
24645
24646         Divid renamed to Divide.
24647
24648         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24649         statements. 
24650         (Statements.set): remove.
24651
24652         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24653         statements. 
24654
24655         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24656         falseStatements always have valid values. 
24657
24658         * cs-parser.jay: Use System.CodeDOM now.
24659