Address parts of #58244 -- most of what's left is in the runtime
[mono.git] / mcs / mcs / ChangeLog
1 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2
3         Address parts of #58244 -- most of what's left is in the runtime
4         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5         CS1509 error checks, and handle them for all assembly loads, not
6         just the first invocation.
7         (LoadModule): Likewise.  Move handling of 'adder_method' ...
8         * codegen.cs (AssemblyClass.AddModule): ... here.
9
10 2006-11-02  Marek Safar  <marek.safar@gmail.com>
11
12         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
13         IEnumerable<T> is ambiguous.
14
15 2006-10-31  Marek Safar  <marek.safar@gmail.com>
16
17         A fix for bug #67689
18         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
19         GetEnumerator is ambiguous.
20
21         * report.cs: Add new warning.
22
23 2006-10-29  Marek Safar  <marek.safar@gmail.com>
24
25         A fix for bug #78602
26         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
27         to protected member can be nested type.
28
29 2006-10-28  Marek Safar  <marek.safar@gmail.com>
30
31         A fix for bug #78965
32         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
33         to protected member must derive from current type.
34
35 2006-10-27  Marek Safar  <marek.safar@gmail.com>
36
37         assign.cs: Reuses error method.
38
39         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
40         instead of type for constants.
41         (Expression.Error_ValueAssignment): Common error method.
42
43         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
44         for any assignment.
45
46 2006-10-27  Marek Safar  <marek.safar@gmail.com>
47
48         A fix for bug #79081
49         * expression.cs (MemberAccess.DoResolve): Check nested type
50         accessibility.
51
52 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
53
54         * doc.cs : nested delegates were not handled. Fixed bug #79754.
55
56 2006-10-26  Marek Safar  <marek.safar@gmail.com>
57
58         A fix for bug #76591
59         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
60
61 2006-10-26  Marek Safar  <marek.safar@gmail.com>
62
63         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
64         type forwarder of the same type multiple times.
65
66 2006-10-26  Raja R Harinath  <rharinath@novell.com>
67
68         Fix #78820
69         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
70         instance as an rvalue, even when we later resolve as an lvalue.
71
72 2006-10-25  Martin Baulig  <martin@ximian.com>
73
74         * anonymous.cs: Fix #79673.
75
76 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
77
78         A fix for bug #79666
79         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
80         ignored when is optimized (= default value) as its value is already set.
81
82 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
83
84         A fix for bug #79724
85         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
86         TypeContainer for type lookup.
87
88 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
89
90         A fix for bug #79231
91         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
92         * expression.cs (OverloadResolve): Always convert type name for
93         an error message.
94         (ResolveNamespaceOrType): Don't confuse a nested type with any 
95         other member.
96
97 2006-10-18  Martin Baulig <martin@ximian.com>
98
99         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
100
101 2006-10-17  Miguel de Icaza  <miguel@novell.com>
102
103         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
104         an int32, but requesting an int64 from the conversion
105
106 2006-10-12  Martin Baulig  <martin@ximian.com>
107
108         * anonymous.cs
109         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
110         
111 2006-10-12  Martin Baulig  <martin@ximian.com>
112
113         * statement.cs
114         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
115
116 2006-10-11  Miguel de Icaza  <miguel@novell.com>
117
118         * convert.cs: Remove broken code: I was doing the "Existance"
119         tests for Implicit conversions.
120
121 2006-10-10  Miguel de Icaza  <miguel@novell.com>
122
123         * convert.cs: Added one missing case in
124         ImplicitStandardConversionExists uint64 to intptr.
125
126         Fixes #59800
127         
128         * typemanager.cs (uintptr_type): another core known type.   
129
130         * ecore.cs (OperatorCast): routine used to do cast operations that
131         depend on op_Explicit.  We could change some of the Decimal
132         conversions to use this.
133
134         This one has a probe mechanism that checks both types for an op_
135         which it coudl be used to eliminate two classes: CastToDecimal
136         and CastFromDecimal.
137
138         * convert.cs: Implement the conversions documented in #59800
139         
140 2006-10-10  Martin Baulig  <martin@ximian.com>
141
142         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
143         before RootScope.ResolveMembers().
144
145         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
146         `CurrentType' if appropriate.
147
148 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
149
150         A fix for bug #78568
151         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
152         when contains binary operators.
153         * cs-parser.jay: Updated.
154
155 2006-10-09  Martin Baulig  <martin@ximian.com>
156
157         * delegate.cs
158         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
159         moved that into Define() and also do the other type parameter
160         checks there.  Fixes #79094.  Added gtest-292.cs.
161
162         * expression.cs
163         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
164         since that doesn't include type parameters; don't use `Ldelema'
165         for type parameters.  Fixes #78980.  Added gtest-293.cs.
166
167 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
168
169         A fix for #77796
170         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
171         conversion is allowed.
172
173 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
174
175         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
176         error reporting when no error occurs.
177
178 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
179
180         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
181         does not exist.
182
183 2006-10-06  Raja R Harinath  <rharinath@novell.com>
184
185         Fix #79584
186         * class.cs (DefineTypeBuilder): Check circular dependencies before
187         setting the parent of the TypeBuilder.
188         (CheckRecursiveDefinition): Don't use 'BaseType', since
189         it may not be valid until after DefineTypeBuilder.  Use
190         'base_type' instead.
191
192 2006-10-04  Martin Baulig  <martin@ximian.com>
193
194         Merged the Anonymous Methods patch.
195
196         * anonymous.cs, iterators.cs: The new anonymous methods code.
197
198         * statement.cs (Variable): New public abstract class.
199         (LocalInfo.Variable): New public property.
200         (LocalInfo.ResolveVariable): New public method.
201         (Block.Flags): Add `IsIterator'.
202         (Block.AddVariable): Improved the CS0136 check.
203         (Block.AnonymousChildren): New public property.
204         (Block.AddAnonymousChild): New public method.
205         (ToplevelBlock): Update to use the new anonymous method framework.
206         (ToplevelBlock.ctor): `container' is now a `Block' and not a
207         `ToplevelBlock'; this is required to correctly implement the
208         CS0136 check.
209         (Fixed, Using): Use `TemporaryVariable' instead of directly
210         creating the `LocalBuilder'.
211
212         * parameter.cs (Parameter.ResolveVariable): New public method.
213         (Parameters.ResolveVariable): Likewise.
214
215         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
216
217         * class.cs (TypeContainer): Replaced the `iterators' list and
218         corresponding methods with a list of `CompilerGeneratedClass'es.
219         (TypeContainer.ResolveMembers): New public method.
220         (Method): `IIteratorContainer' has been replaced by
221         `IAnonymousHost'.
222
223         * expression.cs (VariableReference): New public abstract base
224         class for `LocalVariableReference', `ParameterReference' and
225         `This'.
226
227         * codegen.cs (EmitContext): Removed `capture_context',
228         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
229         (EmitContext.EmitThis): Removed.
230
231         * cs-parser.jay: Replace `iterator_container' with
232         `anonymous_host'.       
233
234 2006-10-04  Martin Baulig  <martin@ximian.com>
235
236         * generic.cs (GenericMethod): Don't make this abstract.
237         (Constraints.Clone): Added dummy implementation.
238
239 2006-10-04  Raja R Harinath  <harinath@gmail.com>
240
241         Fix #79577
242         * namespace.cs (LookForAnyGenericType): Avoid nullref on
243         'declspaces'.  Avoid allocating arrays willy-nilly.
244
245         Fix #79553
246         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
247         cases out of the switch.
248
249 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
250
251         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
252         message when non-generic type is used with the type arguments.
253         * expression.cs: Updated.
254
255 2006-09-28  Raja R Harinath  <rharinath@novell.com>
256
257         Fix #79013
258         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
259         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
260         Change semantics slightly.  Don't insist on having only one
261         temporary EmptyExpression -- just throttle the creation of new ones.
262
263         Fix #79451
264         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
265         non-interfaces too.  If no methods are found, don't try to create
266         a MethodGroupExpr.
267
268 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
269
270         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
271         generic type.
272
273         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
274         us produce better error message.
275
276 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
277
278         * expression.cs (Binary.ResolveOperator): Warn about a side effect
279         of the `|' operator.
280
281         * report.cs: A new warning added.
282
283 2006-09-27  Martin Baulig  <martin@ximian.com>
284
285         * generic.cs (GenericMethod): Don't make this abstract.
286
287 2006-09-27  Martin Baulig  <martin@ximian.com>
288
289         * report.cs
290         (InternalErrorException): Added overloaded ctor taking a params array.
291
292 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
293
294         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
295         Fixed the cases when same error was reported twice.
296
297         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
298         now report symbol information.
299
300 2006-09-25  Martin Baulig  <martin@ximian.com>
301
302         * class.cs: Completely unified with the gmcs version.
303
304 2006-09-25  Martin Baulig  <martin@ximian.com>
305
306         * typemanager.cs (TypeManager.IsNullableType): New public function.
307         (TypeManager.IsNullableTypeOf): Likewise.
308         (TypeManager.IsNullableValueType): Likewise.
309
310         * class.cs (MethodCore): Added the `GenericMethod' argument from
311         gmcs and also unified all classes derived from `MethodCore' with gmcs.
312
313 2006-09-24  Raja R Harinath  <harinath@gmail.com>
314
315         * convert.cs: Unify with gmcs version.
316
317 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
318
319         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
320         verify them as well.
321
322         * report.cs: New warning.
323
324 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
325
326         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
327         for anonymous block with out argument.
328
329 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
330
331         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
332         not used private events only.
333
334 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
335
336         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
337
338         * const.cs (Const.Define): Check for constant type.
339         (Const.IsConstantTypeValid): Looks for valid constant types.
340
341         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
342
343         * ecore.cs (EmptyConstantCast): New common class for all constant based
344         EmptyCast(s).
345
346         * expression.cs (Is.DoResolve): Handle null constant especially.
347         (New.DoResolve): Check for new void().
348         (MemberAccess.DoResolve): Cope with all kind of nulls.
349
350         * literal.cs (NullConstant): Uses EmptyConstantCast.
351         (NullDefault): Based on EmptyConstantCast.
352         (NullLiteral): Uses EmptyConstantCast.
353
354         * statement.cs (Block.ResolveMeta): Check for constant type.
355
356 2006-09-22  Martin Baulig  <martin@ximian.com>
357
358         * delegate.cs, attribute.cs: Merged with the gmcs versions.
359
360 2006-09-22  Raja R Harinath  <rharinath@novell.com>
361
362         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
363         not the null type.
364
365         Fix part of #79451
366         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
367         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
368         code slightly.
369
370 2006-09-22  Martin Baulig  <martin@ximian.com>
371
372         * ecore.cs: Merged with the gmcs version.
373
374         * generic.cs (ConstructedType): New dummy class.
375         (TypeArguments): Don't make this abstract.
376
377         * typemanager.cs
378         (TypeManager.IsGenericTypeDefinition): New method.
379         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
380
381 2006-09-22  Raja R Harinath  <rharinath@novell.com>
382
383         * expression.cs (ComposedCast): Check for arrays of TypedReference
384         before creating the type, not after.
385
386 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
387
388         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
389         after ToType change.
390
391         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
392         when constant must be implicitly convertible.
393
394         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
395
396         * ecore.cs (NullCast): Derives from NullConstant.
397
398         * expression.cs (Is.DoResolve): Removed useless variables.
399         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
400         (New.Constantify): Add enum support.
401         (MemberAccess.DoResolve): Add warning when accessing null constant or
402         variable.
403
404         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
405         property.
406
407         * literal.cs (NullConstant): New abstract class with common
408         functionality for all null specializations.
409         (NullDefault): Represents default(X) when result can be
410         reduced to null.
411         (NullLiteral): Updated.
412
413         * report.cs: Add new warning.
414
415 2006-09-21  Martin Baulig  <martin@ximian.com>
416
417         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
418
419 2006-09-21  Martin Baulig  <martin@ximian.com>
420
421         * generic.cs (GenericConstraints): New dummy class.
422         (Constraints): Likewise.
423         (TypeParameter): Likewise.
424         (TypeParameterName): Likewise.
425         (GenericMethod): Likewise.
426
427         * typemanager.cs (TypeManager.GetGenericArguments): New method.
428
429         * decl.cs: Merged with the gmcs version.
430
431 2006-09-21  Raja R Harinath  <rharinath@novell.com>
432
433         * generic.cs (TypeParameter): Implement IMemberContainer.
434         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
435
436         * rootcontext.cs: Unify with gmcs version.
437
438         * report.cs: Unify with gmcs version.
439         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
440         from gmcs/generics.cs.
441         * generics.cs (TypeParameter): New dummy class.
442
443         * support.cs: Unify with gmcs version.
444
445 2006-09-20  Raja R Harinath  <rharinath@novell.com>
446
447         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
448         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
449
450         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
451         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
452         * mcs.exe.sources: Add generic.cs.
453
454         * codegen.cs: Unify with gmcs version.
455
456         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
457         (EmitContext): Add GenericDeclContainer implementation.
458         * decl.cs (MemberCore, DeclSpace): Likewise.
459         * namespace.cs: Remove #ifdef GMCS_SOURCE.
460
461         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
462         MCS TypeManager has a corresponding dummy method.
463
464 2006-09-19  Martin Baulig  <martin@ximian.com>
465
466         * expression.cs: Completely merged with the gmcs version.
467
468 2006-09-19  Martin Baulig  <martin@ximian.com>
469
470         * expression.cs (Invocation): Merged with the gmcs version.
471         (ArrayAccess.GetStoreOpcode): Likewise.
472
473 2006-09-19  Martin Baulig  <martin@ximian.com>
474
475         * typemanager.cs
476         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
477         (TypeManager.IsGenericMethodDefinition): Likewise.
478
479 2006-09-19  Martin Baulig  <martin@ximian.com>
480
481         * typemanager.cs
482         (TypeManager.IsEqual): Moved the gmcs implementation here.
483         (TypeManager.DropGenericTypeArguments): Likewise.
484         (TypeManager.DropGenericMethodArguments): Likewise.
485         (TypeManager.GetTypeArguments): Moved here from gmcs.
486         (TypeManager.HasGenericArguments): Likewise.
487
488 2006-09-19  Martin Baulig  <martin@ximian.com>
489
490         * expression.cs (Binary): Merged with the gmcs version.
491
492 2006-09-19  Martin Baulig  <martin@ximian.com>
493
494         * expression.cs (Probe, As, Is): Merged with the gmcs version.
495
496 2006-09-19  Martin Baulig  <martin@ximian.com>
497
498         * typemanager.cs: Merged with the gmcs version.
499
500 2006-09-16  Raja R Harinath  <rharinath@novell.com>
501
502         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
503         * driver.cs: Likewise.
504
505 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
506
507         A fix for #79401
508         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
509         only if parent type is class.
510         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
511         update.
512
513 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
514
515         * cs-parser.jay,
516         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
517         keywords are used.
518         * typemanager.cs(CSharpName): Converts NullType to null.
519
520 2006-09-15  Martin Baulig  <martin@ximian.com>
521
522         * typemanager.cs
523         (TypeManager.GetMethodName): Added mcs implementation.
524         (TypeManager.IsEqual): Likewise.
525
526         * ecore.cs
527         (SimpleName.RemoveGenericArity): Added dummy implementation.
528
529         * pending.cs: Merged with the gmcs version.     
530
531 2006-09-15  Martin Baulig  <martin@ximian.com>
532
533         * statement.cs: Merge with the gmcs version.
534
535 2006-09-15  Martin Baulig  <martin@ximian.com>
536
537         * statement.cs (Switch): Merge with the gmcs implementation
538         (without nullables), which is newer.
539
540 2006-09-15  Martin Baulig  <martin@ximian.com>
541
542         * statement.cs (Block.Variables): Make this public.
543         (ToplevelBlock.Parameters): Make this a property.
544         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
545
546 2006-09-15  Martin Baulig  <martin@ximian.com>
547
548         * namespace.cs: Merge with the gmcs version.
549
550 2006-09-15  Martin Baulig  <martin@ximian.com>
551
552         * decl.cs (MemberName): Minor code cleanups.
553
554 2006-09-15  Martin Baulig  <martin@ximian.com>
555
556         * parameter.cs: Merge with the gmcs version.
557
558 2006-09-15  Martin Baulig  <martin@ximian.com>
559
560         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
561         and an error in mcs.
562
563 2006-09-15  Martin Baulig  <martin@ximian.com>
564
565         * flowanalysis.cs: Merged from GMCS; added the generics code into
566         a `GMCS_SOURCE' conditional so we can share this file.
567
568 2006-09-08  Martin Baulig  <martin@ximian.com>
569
570         * typemanager.cs (TypeManager.interlocked_type): New public field.
571         (TypeManager.int_interlocked_compare-exchange): New public field.
572         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
573         enumerator types here and call InitGenericCoreTypes().
574         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
575         after calling InitEnumUnderlyingTypes().
576
577         * rootcontext.cs
578         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
579         `classes_second_stage'. 
580
581 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
582
583         * assign.cs, ecore.cs, expression.cs: Share error message text.
584         * class.cs (FieldMember.Define): Check for varible of static type.
585         * driver.cs (LoadAssembly): Uses error output for errors.
586         * statement.cs: Updated.
587
588 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
589
590         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
591         type instance.
592
593 2006-09-07  Martin Baulig  <martin@ximian.com>
594
595         * driver.cs
596         (MainDriver): Revert r62663 from Marek; see #70506 for details.
597
598 2006-08-29  Miguel de Icaza  <miguel@novell.com>
599
600         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
601         
602 2006-08-17  Miguel de Icaza  <miguel@novell.com>
603
604         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
605         #52019 and #79064, the use of the \uXXXX sequence in source code
606         to represent unicode characters.
607
608 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
609
610         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
611         support.
612         * class.cs, ecore.cs, statement.cs: Merged to one error message.
613
614 2006-08-13  Miguel de Icaza  <miguel@novell.com>
615
616         * assign.cs: Catch attempts to assign to a method groups in += and
617         report as 1656
618
619 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
620
621         A fix for #79056
622         * cs-parser.jay: Don't destroy current array type by typeof of array's.
623
624 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
625
626         * class.cs (Method.Define): Issue a warning when generic method looks like
627         an entry point.
628         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
629         as well.
630
631 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
632  
633         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
634         looking for ctor.
635         * decl.cs (MemberCache.FindMembers): When container is interface we need to
636         search all base interfaces as a member can be ambiguous.
637         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
638         Constructor member type filter. 
639         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
640         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
641         reporting for returned memberinfos.
642         * report.cs: Updated.
643         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
644         version to work on all runtimes.
645         (TypeManager.RealMemberLookup): Removed members filtering.
646
647 2006-08-08  Raja R Harinath  <rharinath@novell.com>
648
649         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
650         (PropertyExpr.EmitAssign): Likewise.
651         * expression.cs (Indirection.EmitAssign): Likewise.
652         (LocalVariableReference.EmitAssign): Likewise.
653         (ParameterReference.EmitAssign): Likewise.
654         (Invocation.EmitArguments): Likewise.
655         (ArrayAccess.EmitAssign): Likewise.
656         (IndexerAccess.EmitAssign): Likewise.
657         (This.EmitAssign): Likewise.
658         (ConditionalLogicalOperator.Emit): Likewise.
659
660         Fix #79026
661         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
662         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
663         leave it in after returning it.
664         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
665
666 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
667
668         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
669         message.
670
671 2006-08-03  Raja R Harinath  <rharinath@novell.com>
672
673         Fix cs0146-3.cs and cs0146-4.cs.
674         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
675         enclosing types don't depend on the current type.
676
677 2006-08-02  Raja R Harinath  <rharinath@novell.com>
678
679         Fix #77963
680         * class.cs (TypeContainer.DoDefineMembers): Use
681         FindBaseMemberWithSameName on Parent, since we're interested in
682         whether we hide inherited members or not.
683         (FindBaseMemberWithSameName): Make slightly more robust.
684
685         Fix the non-generic testcase from #77396
686         * decl.cs (DeclSpace.DeclContainer): Remove override.
687
688         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
689         declspaces for doppelgangers too.
690         (UsingEntry): Implement IResolveContext.
691         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
692         'this' as the resolve context.
693         (LocalAliasEntry): Likewise.
694
695         Implement parts of #77403
696         * roottypes.cs (RootDeclSpace): New.  Used to represent the
697         toplevel declaration space.  Each namespace declaration introduces
698         a "partial" root declaretion space.
699         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
700         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
701         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
702         from 'current_namespace.SlaveDeclSpace'.
703         (namespace_declaration): Likewise.
704         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
705         check.  It can't happen now.
706         * decl.cs (DeclSpace.LookupType): Likewise.
707         * driver.cs (MainDriver): Sanity check.
708
709 2006-08-01  Raja R Harinath  <rharinath@novell.com>
710
711         * decl.cs (DeclSpace.FindNestedType): Remove.
712         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
713         LookupTypeContainer to get the container of the nested type.
714         * class.cs (TypeContainer.FindNestedType): Make non-override.
715
716 2006-07-31  Raja R Harinath  <rharinath@novell.com>
717
718         * decl.cs (DeclSpace.PartialContainer): Move field from ...
719         * class.cs (TypeContainer.PartialContainer): ... here.
720         (TypeContainer.AddBasesForPart): New helper.
721         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
722         instead.
723         * cs-parser.jay (current_class): Convert to DeclSpace.
724         (struct_declaration, interface_declaration, class_declaration):
725         Use AddBasesForPart instead of .Bases directly.
726         * const.cs, iterators.cs: Update to changes.
727
728 2006-07-28  Raja R Harinath  <rharinath@novell.com>
729
730         * class.cs (TypeContainer.AddMemberType): Rename from
731         AddToTypeContainer.
732         (TypeContainer.AddMember): Rename from AddToMemberContainer.
733         (AddTypeContainer): New.  Combine AddClassOrStruct and
734         AddInterface.
735         (AddPartial): Update.  Add 'is_partial' argument.
736         * roottypes.cs: Update to changes.
737         * cs-parser.jay (push_current_class): New helper for handling
738         current_container and current_class.
739         (struct_declaration, interface_declaration, class_declaration):
740         Use it.
741
742 2006-07-26  Raja R Harinath  <rharinath@novell.com>
743
744         * roottypes.cs: Rename from tree.cs.
745
746         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
747         * tree.cs (Tree, ITreeDump): Remove types.
748         * rootcontext.cs (tree, Tree): Remove fields.
749         (root, ToplevelTypes): New.
750         * *.cs: Update to rename.
751
752         * tree.cs (Tree.RecordDecl): Remove.
753         (RootTypes.AddToTypeContainer): Record the toplevel type in its
754         namespace here.
755         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
756
757 2006-07-23  Raja R Harinath  <harinath@gmail.com>
758
759         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
760         DoFlowAnalysis and OmitStructFlowAnalysis here.
761         (ec.With): Rename from WithUnsafe and generalize.
762         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
763         (ec.WithFlowAnalyis): New.
764         * ecore.cs, expression.cs, statement.cs: Update.
765
766 2006-07-22  Raja R Harinath  <harinath@gmail.com>
767
768         * statement.cs (Block.ResolveMeta): Simplify slightly.
769
770         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
771         multiple boolean fields.  Convert InUnsafe, constant_check_state,
772         check_state to flags.
773         (CheckState, ConstantCheckState): Update.
774         (InUnsafe): New read-only property.
775         (FlagsHandle): Rename from CheckStateHandle and convert to handle
776         arbitrary flags.
777         (WithUnsafe): New helper similar to WithCheckState.
778         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
779         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
780
781 2006-07-21  Raja R Harinath  <rharinath@novell.com>
782
783         Make comparisons use the same IL irrespective of whether they're
784         in a 'checked' or 'unchecked' context: one of the issues in #78899
785         * codegen.cs (EmitContext.CheckState): Make read-only property.
786         (EmitContext.ConstantCheckState): Likewise.
787         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
788         helper that implement a save/restore stack for CheckState
789         values.  This is the only way to change check-state.
790         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
791         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
792         (CheckedExpr.EmitBranchable): New forwarding method.
793         (UnCheckedExpr): Likewise.
794         * statement.cs (Block.ResolveMeta): Use WithCheckState.
795         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
796         (Checked.Resolve, checked.DoEmit): Likewise.
797
798 2006-07-20  Miguel de Icaza  <miguel@novell.com>
799
800         * anonymous.cs: Cache the resolved anonymous delegate, and return
801         this so that the ResolveTopBlock is only triggered once, not
802         twice.
803
804         Currently we trigger ResolvetopBlock twice due to a first pass of
805         argument check compatibility, and a second pass that does the
806         actual resolution.   
807         
808 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
809
810         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
811         modifiers.
812         * rootcontext.cs (Reset): Add helper_classes.
813
814 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
815
816         A fix for #78860
817         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
818         correctly.
819
820 2006-07-13  Miguel de Icaza  <miguel@novell.com>
821
822         * statement.cs (Lock): Handle expressions of type
823         TypeManager.null_type specially.  Fixes #78770
824
825 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
826
827         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
828         to an event.
829
830 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
831
832         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
833         for accessors as well.
834         * ecore.cs (EventExpr): Add AccessorTable.
835
836 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
837
838         A fix for #78738
839         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
840         for CS0122 where appropriate.
841         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
842         level attributes.
843         (Filter): Assembly can be null in the case of top level attributes.
844
845 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
846
847         A fix for #78690
848
849         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
850         is done at global level.
851
852 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
853
854         A fix for #77002, Implemented TypeForwarder support.
855
856         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
857         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
858         * typemanager.cs (): Add type_forwarder_attr_type.
859
860 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
861
862         * report.cs: Add CS0469 warning.
863
864 2006-06-21  Martin Baulig  <martin@ximian.com>
865
866         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
867         the `try'-block, so we also report CS0016 etc. there.
868
869 2006-06-21  Martin Baulig  <martin@ximian.com>
870
871         * delegate.cs
872         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
873
874 2006-06-21  Martin Baulig  <martin@ximian.com>
875
876         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
877         also report CS1686 for parameters.
878
879 2006-06-21  Martin Baulig  <martin@ximian.com>
880
881         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
882         instead of an error if the value is not implicitly convertible to
883         the switch types; fixes #77964.
884
885 2006-06-21  Raja R Harinath  <rharinath@novell.com>
886
887         Fix #78673
888         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
889         FieldBuilder is null.
890
891         Fix #78662
892         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
893         'left' and 'right' before error-checking.
894
895 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
896
897         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
898         Fixed bug #78601.
899         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
900         (FieldExpr.DoResolve): likewise.
901         (PropertyExpr.InstanceResolve): likewise.
902         (EventExpr.InstanceResolve): likewise. 
903
904 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
905
906         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
907         attribute applicable tests for attribute argument.
908
909 2006-06-02  Raja R Harinath  <rharinath@novell.com>
910
911         Fix #78079
912         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
913         (Binary.OverloadResolve_PredefinedIntegral): New.
914         (Binary.OverloadResolve_PredefinedFloating): New.
915         (Binary.OverloadResolve_PredefinedString): New.
916         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
917         Follow the standard more closely, and treat numeric promotions in
918         terms of overload resolution.
919         (Binary.CheckShiftArguments): Simplify.
920
921 2006-06-01  Raja R Harinath  <rharinath@novell.com>
922
923         * flowanalysis.cs (MyBitVector): Simplify representation.
924         (MyBitVector.Clone): Avoid allocating BitArray.
925         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
926         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
927         (*): Update.  Change all references to MyBitVector.And and
928         MyBitVector.Or to &= and |=.
929
930 2006-05-29  Raja R Harinath  <rharinath@novell.com>
931
932         Fix cs0231-[34].cs.
933         * cs-parser.jay (formal_parameter_list): Extend the pattern below
934         to param arguments too.
935
936 2006-05-26  Miguel de Icaza  <miguel@novell.com>
937
938         * cs-parser.jay: Catch another parsing form for arglist being
939         followed by other arguments.  Fixes #78313.
940
941 2006-05-24  Raja R Harinath  <rharinath@novell.com>
942
943         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
944         checking of out parameters to ...
945         (FlowBranchingToplevel.Merge): ... here.
946         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
947         set, propagate the origin upward, and only complain if there was
948         no other error.
949         (FlowBranchingException.AddContinueOrigin): Likewise.
950         (FlowBranchingException.AddReturnOrigin): Likewise.
951         (FlowBranchingException.AddGotoOrigin): Likewise.       
952
953 2006-05-23  Raja R Harinath  <rharinath@novell.com>
954
955         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
956         unreachable, skip it.
957         (FlowBranchingException.Merge): Always propagate jumps, even if
958         the finally block renders subsequent code unreachable.
959
960 2006-05-18  Raja R Harinath  <rharinath@novell.com>
961
962         Fix #77601
963         * statement.cs (Goto.Resolve): Move responsibility for resolving
964         'goto' to FlowBranching.AddGotoOrigin.
965         (Goto.SetResolvedTarget): New.  Callback to set the
966         LabeledStatement that's the target of the goto.
967         (Goto.DoEmit): Use Leave instead of Br when crossing an
968         unwind-protect boundary.
969         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
970         LookupLabel and adjust to new semantics.
971         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
972         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
973         Goto.SetResolvedTarget to update target.
974         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
975         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
976         AddBreakOrigin & co.  Delay propagation until ...
977         (FlowBranchingException.Merge): ... this.
978
979         * statement.cs (Block.Resolve): Always depend on flow-branching to
980         determine unreachability.  Kill workaround that originally emitted
981         only one statement after an "unreachable" label (see infloop in
982         test-515.cs).
983
984         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
985         This is still "wrong", but anything better would probably need a
986         multi-pass algorithm.
987         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
988         usage vector.  Force current usage vector to be reachable, to
989         optimistically signify backward jumps.
990         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
991         detected.
992         (FlowBranchingLabeled.Merge): New.  If no backward jump was
993         detected, return the original salted-away usage vector instead,
994         updated with appropriate changes.  Print unreachable warning if
995         necessary.
996         * statement.cs (Block.Resolve): Don't print unreachable warning on
997         a labeled statement.
998
999 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1000
1001         * driver.cs: Pass filename without path to AssemblyBuilder's 
1002         AddResourceFile. Fixes bug #78407.
1003
1004 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1005
1006         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1007         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1008         (FlowBranching.MergeChild): Overwrite
1009         reachability information from Labeled branchings too.
1010
1011 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1012
1013         * statement.cs (Goto.Resolve): Merge jump origins here ...
1014         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1015
1016         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1017         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1018         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1019         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1020         here, ...
1021         * statement.cs (Goto.Resolve): ... not here.
1022         (Goto.Emit): Remove CS1632 check.
1023
1024 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1025
1026         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1027         error message.
1028
1029 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1030
1031         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1032         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1033         (FlowBranchingException.Label): Likewise.
1034
1035         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1036         given value.
1037         (MyBitVector.Or): Use it to avoid losing information (Count).
1038         (FlowBranching.MergeOrigins): Likewise.
1039
1040         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1041         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1042         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1043         (UsageVector.ToString): Simplify.
1044         (UsageVector.MergeSiblings): Move here from ...
1045         (FlowBranching.Merge): ... here.
1046         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1047         not a MyBitVector.
1048
1049 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1050
1051         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1052         null bitvector is treated as all-true.
1053
1054         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1055         (MyBitVector): Rationalize invariants.  'vector != null' implies
1056         that we have our own copy of the bitvector.  Otherwise,
1057         'InheritsFrom == null' implies all inherited bits are true.
1058
1059 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1060
1061         * statement.cs (LocalInfo): Add IsConstant.
1062         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1063         local variable for constants.
1064
1065 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1066
1067         * flowanalysis.cs (MyBitVector.Empty): New.
1068         (MyBitVector): Don't allow InheritedFrom to be null.
1069         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1070         (UsageVector, FlowBranching): Update to changes.
1071
1072         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1073         recursion.  The 'Parent == null' condition isn't sufficient for
1074         anonymous methods.
1075         (FlowBranching.AddBreakOrigin): Likewise.
1076         (FlowBranching.AddContinueOrigin): Likewise.
1077         (FlowBranching.AddReturnOrigin): Likewise.
1078         (FlowBranching.StealFinallyClauses): Likewise.
1079         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1080         (FlowBranching.CheckOutParameters): Likewise.
1081         (FlowBranchingToplevel): Terminate all the above recursions here.
1082         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1083         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1084
1085         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1086         toplevel block.
1087         (FlowBranchingToplevel): New.  Empty for now.
1088         (FlowBranching.MergeTopBlock): Update.
1089         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1090         branching for the anonymous delegate.
1091         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1092
1093         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1094         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1095         information at the start of the merge.  Reorganize.
1096
1097 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1098
1099         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1100
1101 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1102
1103         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1104         to newly introduced ctor.
1105
1106         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1107         message to one place.
1108         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1109         global namespace.
1110
1111 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1112
1113         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1114
1115         * ecore.cs (Expression.ResolveAsConstant): Updated.
1116
1117         * statement.cs (ResolveMeta): Updated.
1118
1119 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1120
1121         * cs-parser.jay: __arglist cannot be used in initializer.
1122
1123 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1124
1125         A fix for #77879
1126         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1127         private types.
1128
1129 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1130
1131         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1132         (LabeledStatement): Add 'name' parameter.
1133         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1134         (Block.AddLabel): Update to changes.
1135         * cs-parser.jay (labeled_statement): Likewise.
1136
1137         * flowanalysis.cs (BranchingType.Labeled): New.
1138         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1139         (FlowBranchingLabeled): New.  Does nothing for now, but will
1140         eventually handle 'goto' flows.
1141         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1142         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1143         that's terminated ...
1144         (Block.Resolve): ... here.
1145
1146         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1147         (UsageVector.MergeFinallyOrigins): Likewise.
1148         (FlowBranching.InTryOrCatch): Likewise.
1149         (FlowBranching.AddFinallyVector): Likewise.
1150         (FlowBranchingException): Update to changes.
1151
1152         Fix #78290
1153         * statement.cs (Return.Resolve): Move error checking to ...
1154         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1155         (FlowBranchingException): Handle return origins like break and
1156         continue origins.
1157         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1158
1159 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1160
1161         A fix for #76122
1162         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1163         filter.
1164
1165 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1166
1167         A fix for #77543
1168         * class.cs (MethodData.Define): Do public accessor check only when method
1169         implements an interface.
1170
1171 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1172
1173         Remove special handling of 'break'
1174         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1175         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1176         (UsageVector.Break): Remove.
1177         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1178         reachability.
1179         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1180
1181         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1182         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1183
1184 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1185
1186         A fix for #75726
1187         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1188         be the interface member.
1189
1190 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1191
1192         A fix for #60069
1193         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1194         for emitting small (int) values.
1195
1196 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1197
1198         Fix #59427
1199         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1200         control-flow passes through the 'finally' after merging-in all the
1201         control-flows from 'try' and the 'catch' clauses.
1202
1203         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1204         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1205         always true at the only non-recursive entry point.
1206         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1207         FlowBranchingBreakable.
1208         (FlowBranchingLoop): Remove.
1209         * statement.cs (Return.DoResolve): Update to changes.
1210
1211         Fix #76471, #76665
1212         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1213         (FlowBranching.CreateBranching): Handle it: create a
1214         FlowBranchingContinuable.
1215         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1216         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1217         except that it handles the 'continue' command.
1218         (FlowBranching.UsageVector.MergeOrigins): Rename from
1219         MergeBreakOrigins.
1220         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1221         except that it overrides AddContinueOrigin.
1222         (FlowBranchingException): Override AddContinueOrigin, similar to
1223         AddBreakOrigin.
1224         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1225         Create a new branching around the embedded statement.
1226         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1227         control flow after the embedded statement.
1228         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1229
1230         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1231         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1232         FlowBranchingBreakable.
1233         (FlowBranchingSwitch): Remove.
1234
1235         Fix test-503.cs
1236         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1237         error reporting to ...
1238         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1239         Rename from 'AddBreakVector'.  Add new location argument.  Return
1240         a bool indicating whether the 'break' crosses an unwind-protect.
1241         (FlowBranchingException.AddBreakOrigin): Add.
1242         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1243         flowbranching after updating with the effects of the 'finally'
1244         clause.
1245         (FlowBranchingBreakable): New common base class for
1246         FlowBranchingLoop and FlowBranchingSwitch.
1247
1248         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1249         embedded statement.
1250         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1251
1252 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1253
1254         * statement.cs (Do.Resolve): If the loop is infinite, set the
1255         barrier.
1256         (While.Resolve, For.Resolve): Set a barrier after the embedded
1257         statement.  There's no direct control flow that goes from the end
1258         of the embedded statement to the end of the loop.
1259         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1260         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1261         above ensure that the reachability is correctly computed.
1262
1263         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1264         (UsageVector.MergeBreakOrigins): If the current path is
1265         unreachable, treat it as if all parameters/locals are initialized.
1266         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1267         infinite loops before merging-in break origins.
1268
1269         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1270         (Reachability.Reachable): Split part into ...
1271         (Reachability.Unreachable): ... this.  Simplify.
1272         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1273
1274         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1275         (Reachability.SetThrowsSometimes): Likewise.
1276         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1277         TriState.Always, use corresponding property.
1278         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1279         (Block.Resolve): Likewise.  Remove some redundant checks.
1280
1281 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1282
1283         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1284         (Reachability.Meet): Don't bother checking AlwaysThrows --
1285         barrier is always set.
1286         (FlowBranchingBlock.Merge): Likewise.
1287
1288 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1289
1290         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1291         checks for unreachable.
1292
1293 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1294
1295         A fix for #77980
1296         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1297
1298         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1299         whether field is really assigned.
1300
1301 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1302
1303         * flowanalysis.cs (Reachability): Make 4-argument constructor
1304         private.
1305         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1306         (Reachability.Always): Rename from the highly misleading
1307         'Reachability.Never'.
1308         (FlowBranching.Merge): Update to changes.  Mark an impossible
1309         situation with a 'throw'.
1310         (*): Update to changes.
1311
1312 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1313
1314         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1315         Remove 'Undefined'.
1316         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1317         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1318         (*): Update to changes.
1319         * statement.cs: Update to changes.
1320
1321 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1322
1323         A fix for #78049
1324         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1325
1326 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1327
1328         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1329         dummy UsageVector.
1330
1331         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1332         argument to two arguments: an usage-vector and a bool.  Move call
1333         to FlowBranching.Merge () ...
1334         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1335
1336         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1337         handling of loop and switch reachability to ...
1338         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1339
1340 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1341
1342         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1343         handling to FlowBranchingLoop.InLoop.
1344         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1345
1346 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1347
1348         A fix for #78115
1349         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1350         anonymous method is allowed from AnonymousContainer here.
1351
1352         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1353
1354 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1355
1356         Fix #78156
1357         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1358
1359 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1360
1361         A fix for #49011.
1362         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1363         (DoubleConstant.Reduce): Ditto.
1364
1365 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1366
1367         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1368         Remove 'lvalue_right_side' argument.  Move parts to ...
1369         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1370         (LocalVariable.DoResolveLValue): ... these.
1371
1372 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1373
1374         Fix cs1655.cs
1375         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1376         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1377         (LocalVariableReference.DoResolveBase): Use it to implement new
1378         CS1655 check.
1379         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1380         (Argument.Resolve): Simplify.  Move CS1510 check ...
1381         * ecore.cs (Expression.ResolveLValue): ... here.
1382         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1383         (PropertyExpr.DoResolveLValue): Likewise.
1384         (FieldExpr.Report_AssignToReadonly): Likewise.
1385         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1386         LValueMemberAccess or LValueMemberOutAccess on instance depending
1387         on it.
1388         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1389         DoResolve as appropriate.
1390
1391 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1392
1393         Fix #75800
1394         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1395         implicit conversions on 'out' and 'ref' arguments.
1396
1397         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1398         improve clarity.  Remove dead code.
1399
1400         Fix #66031
1401         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1402         (Catch.Resolve): Resolve VarBlock if it exists.
1403
1404 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1405
1406         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1407         twice, this was some residual code, the enumerator was emitted
1408         properly in the two branche of if later.
1409
1410 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1411
1412         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1413         cast is never an lvalue.
1414         (Cast.DoResolve, Cast.ResolveRest): Combine.
1415         (Argument.Emit): Simplify slightly.  Move 'Expr is
1416         IMemoryLocation' check ...
1417         (Argument.Resolve): ... here.
1418         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1419
1420         Simplifications.  Fix cs0191-2.cs
1421         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1422         CS1649 and CS1651 to ...
1423         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1424         the actual selection of the error code and message to a lookup
1425         table.  Add a dummy return value to simplify callsites.
1426         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1427         readonly fields of other instances of the same type.  Move CS0197
1428         warning from ...
1429         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1430         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1431         resolution of an out or ref argument.  The code simplification
1432         above uses this invariant.
1433
1434 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1435
1436         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1437         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1438         CheckMarshallByRefAccess.  Drop parameter.
1439         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1440         warning.
1441         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1442         InstanceExpression.
1443         * report.cs (AllWarnings): Add CS1690.
1444         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1445         for ref access too.
1446         (LocalVariableReference.DoResolveBase): Update.
1447
1448 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1449
1450         * class.cs (MethodOrOperator): Moved common parts from method class.
1451         detect obsolete attributes.
1452         (Method.Define): Simplified as it reuses code from base.
1453         (Constructor.ValidAttributeTargets): Fixed issue found during
1454         refactoring.
1455         (Destructor.ValidAttributeTargets): Fixed issue found during
1456         refactoring.
1457         (Operator): Finished refactoring set off by #78020. Operator class is now
1458         ordinary method class.
1459
1460         * anonymous.cs: Updated.
1461
1462         * decl.cs (DeclSpace): Add IsGeneric
1463
1464 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1465
1466         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1467
1468 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1469
1470         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1471         detect obsolete attributes.
1472         (Method.CreateEmitContext): Moved to MethodOrOperator.
1473
1474 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1475
1476         A fix for #78048.
1477         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1478         customized exception to make crash detection easier.
1479         (MethodOrOperator): Started to work on new base class for methods and
1480         operators.
1481         (Method): Derives from MethodOrOperator.
1482         (Constructor.Emit): Emits its own attributes.
1483         (AbstractPropertyEventMethod.Emit): Ditto.
1484         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1485         patch.
1486         (Operator.Emit): It's temporary more tricky than should be.
1487         
1488         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1489
1490         * report.cs (InternalErrorException): Add ctor with inner exception.
1491
1492 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1493
1494         A fix for #76744.
1495         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1496         only not visible.
1497
1498 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1499
1500         A fix for #77916.
1501         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1502         array.
1503
1504 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1505
1506         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1507         attribute is present and Guid not.
1508         (Interface.ApplyAttributeBuilder): Ditto.
1509
1510         * attribute.cs: Add error message.
1511
1512 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1513
1514         A fix for #78020.
1515
1516         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1517         sources (it's composite) so hold them in extra array as they are used in
1518         Emit phase only. It worked in the previous versions by mistake.
1519         (Attribute.Emit): Emit attribute for more owners when exist.
1520
1521         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1522         it has now different behaviour.
1523
1524 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1525
1526         * constant.cs (Constant.IsDefaultInitializer): New method.
1527
1528         * class.cs: Updated.
1529
1530         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1531         re-initialize default values. It saves KBs almost for every assembly.
1532         Thanks Zoltan for the idea.
1533         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1534         (ArrayCreation.DoResolve): Resolve only once.
1535         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1536         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1537
1538 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1539
1540         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1541         From #77961.
1542
1543 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1544
1545         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1546         in an embedded statement too.
1547
1548 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1549
1550         Fix #77958
1551         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1552
1553 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1554
1555         A fix for #77966.
1556
1557         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1558         was not specified.
1559
1560         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1561
1562 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1563
1564         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1565         phase.
1566
1567         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1568         LocalTemporary change.
1569
1570         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1571         TypeContainer.
1572         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1573         initializers optimization.
1574         (ClassOrStruct.TypeAttr): Moved from modifiers.
1575         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1576         (FieldBase.ResolveInitializer): Resolves initializer.
1577         (FieldBase.HasDefaultInitializer): New property.
1578
1579         * cs-parser.jay: Removed message.
1580
1581         * expression.cs (CompilerGeneratedThis): New specialization.
1582
1583         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1584
1585 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1586
1587         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1588
1589 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1590
1591         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1592         be now EnumConstants only.
1593
1594 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1595
1596         * attribute.cs, driver.cs: Reset more caches.
1597
1598 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1599
1600         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1601
1602 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1603
1604         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1605         for easier reuse. Updated all overrides.
1606         (IntegralConstant): New base class for all integral constants.
1607         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1608         of the constant range, report custom error.
1609         (UIntConstant.Reduce): Fixed uint conversion.
1610
1611         * ecore.cs, literal.cs: Reduce updates.
1612
1613 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1614
1615         A fix for #75813.
1616
1617         * class.cs (Constructor.Define): Removed extra if for default ctors.
1618         A patch from Atsushi Enomoto.
1619
1620 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1621
1622         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1623         GetAttributableValue.
1624
1625         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1626         when required.
1627
1628         * convert.cs (ImplicitConversionRequired): Error message moved to
1629         DoubleLiteral.
1630
1631         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1632         automatic implicit conversion of an output value.
1633         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1634
1635         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1636         conversion.
1637         (TypeOf.GetAttributableValue): Add extra handling for object type.
1638
1639         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1640         special error message.
1641
1642 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1643
1644         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1645         InternalCall.
1646         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1647         compatible with MS runtime.
1648
1649 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1650
1651         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1652         attribute arguments here.
1653
1654         * class.cs (Indexer.Define): The check was moved to attribute class.
1655
1656 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1657
1658         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1659         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1660         easier.
1661
1662 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1663
1664         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1665         mcs to keep code differences small.
1666         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1667         * typemanager.cs (parameter_default_value_attribute_type): New.
1668         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1669         CS1908 check.
1670
1671 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1672
1673         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1674
1675 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1676
1677         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1678
1679         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1680         the blocks too.
1681
1682 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1683
1684         * doc-bootstrap.cs : fix build.
1685
1686 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1687
1688         * expression.cs (StringConcat.Append): Issue a warning when empty string
1689         is going to append.
1690
1691 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1692
1693         * assign.cs (CompoundAssign.ResolveSource): Removed.
1694
1695         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1696         clean up.
1697
1698         * class.cs (TypeContainer.FindMethods): Removed.
1699         (TypeContainer.CheckMemberUsage): Made static.
1700
1701         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1702
1703         * constant.cs (CheckRange): Removed unused type argument.
1704         (CheckUnsigned): Removed unused type argument.
1705
1706         * cs-parser.jay: Updated after MemberAccess clean up.
1707         Uses Length for empty string test.
1708
1709         * cs-tokenizer.cs: Uses Length for empty string test.
1710         (IsCastToken): Made static.
1711         (is_hex): Made static.
1712         (real_type_suffix): Made static.
1713
1714         * decl.cs (SetupCache): Made static.
1715         (OnGenerateDocComment): Removed unused ds argument.
1716
1717         * delegate.cs (VerifyDelegate): Removed unused argument.
1718
1719         * doc.cs: Uses Length for empty string test.
1720
1721         * driver.cs: Uses Length for empty string test.
1722
1723         * enum.cs (IsValidEnumType): Made static
1724
1725         * expression.cs (EnumLiftUp): Removed unused argument.
1726         (ResolveMethodGroup): Ditto.
1727         (BetterConversion): Ditto.
1728         (GetVarargsTypes): Ditto.
1729         (UpdateIndices): Ditto.
1730         (ValidateInitializers): Ditto.
1731         (MemberAccess.ctor): Ditto.
1732         (GetIndexersForType): Ditto.
1733
1734         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1735
1736         * iterators.cs: Updated after MemberAccess clean up.
1737
1738         * location.cs: Uses Length for empty string test.
1739
1740         * namespace.cs: Uses Length for empty string test.
1741
1742          * report.cs (CheckWarningCode): Made static.
1743
1744         * statement.cs (LabeledStatement): Removed unused argument.
1745
1746         * typemanager.cs (FilterNone): Removed.
1747
1748 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1749
1750         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1751         obsolete.
1752
1753         * class.cs: Updated.
1754
1755 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1756
1757         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1758
1759 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1760
1761         A fix for #77822.
1762
1763         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1764         reporting, it's more tricky than I thought.
1765
1766 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1767
1768         A fix for #77816.
1769
1770         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1771         host container.
1772         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1773         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1774         Add more error reporting; Fixed issue with params.
1775
1776         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1777
1778         * cs-parser.jay: AnonymousMethod requires host container.
1779
1780         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1781
1782 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1783
1784         * class.cs: Change 'TypeContainer ds' constructor argument to
1785         'DeclSpace parent'.  Some classes were missed below due to
1786         different naming convention.
1787
1788         * class.cs (MemberCore.Parent): Delete.  This makes the
1789         ParentContainer changes below enforceable by the compiler.
1790
1791         Treat pointers to enclosing declaration space as 'DeclSpace', not
1792         'TypeContainer'.
1793         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1794         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1795
1796         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1797         of TypeContainer.
1798         (Block.AddThisVariable): Likewise.
1799         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1800         (AbstractPropertyEventMethod.Emit): Likewise.
1801         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1802         (GetMethod.Define, SetMethod.Define): Likewise.
1803         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1804         (DelegateMethod.EmitMethod): Likewise.
1805
1806         Fix regression test-partial-13.cs.
1807         Rationalize use of PartialContainer.  Ensure that the partial
1808         class semantics can be tied to type-correctness, i.e., any
1809         violation will cause a compile error.
1810         * class.cs, const.cs: Access all fields that belong to class
1811         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1812         Resolve()-like functions still use 'Parent'.
1813
1814         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1815         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1816         (PropertyMethod.CheckModifiers): Remove unused argument.
1817         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1818         DeclSpace.
1819
1820 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1821
1822         Make semantics of PartialContainer simpler.
1823         * decl.cs (DeclSpace.IsPartial): Remove.
1824         * class.cs (TypeContainer.IsPartial): Likewise.
1825         (TypeContainer..ctor): Set PartialContainer to point to self.
1826         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1827         (TypeContainer.FindNestedType): Likewise.
1828         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1829
1830 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1831
1832         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1833
1834 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1835
1836         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1837         classes.
1838
1839 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1840
1841         * class.cs (Operator.Define): An error for base conversion was not
1842         reported correctly.
1843
1844 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1845
1846         * iterator.cs : yield break is allowed in try statement which has
1847           catch clauses. Fixed bug #77767.
1848
1849 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1850
1851         A fix for #77593, #77574.
1852
1853         * class.cs (MethodCore.CheckBase): Another if for operator.
1854
1855 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1856
1857         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1858         were not resolved
1859
1860         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1861         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1862         conversion test.
1863         
1864         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1865         not needed.
1866
1867         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1868         Updated after another emitcontext usage was clean up. It should help us to
1869         synchronize with gmcs easier.
1870
1871 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1872
1873         A fix for #77353.
1874
1875         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1876         (Event.Define): ditto
1877         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1878
1879         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1880         Removed redundant code and set NewSlot for Invoke method too.
1881
1882         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1883         (Parameters.MergeGenerated): New method. Use this method when you merge
1884         compiler generated argument with user arguments.
1885
1886 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1887
1888         * attribute.cs (ResolveAsTypeTerminal): Removed.
1889
1890         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1891         specialization for predefined types; 30% speed up.
1892         Finally placed obsolete check to right place.
1893         (Expression.ResolveType): Removed.
1894
1895         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1896         Updated after ResolveType was removed.
1897
1898         * expression.cs (Cast.ctor): Check void cast.
1899         (Binary.ResolveAsTypeTerminal): Is never type.
1900         (Conditional.ResolveAsTypeTerminal): Is never type.
1901
1902         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1903
1904 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1905
1906         Fix #77679.
1907         * expression.cs (ParameterReference.DoResolveBase): Change return
1908         type to bool.
1909         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1910         Update.
1911
1912         Fix #77628.
1913         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1914
1915         Fix #77642.
1916         * typemanager.cs (GetFullNameSignature): Don't nullref on
1917         protected accessors.
1918
1919 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1920
1921         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1922         these two separated members to simplify the code.
1923         (Attribute.Resolve): Refactored to use new fields and methods.
1924         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1925         implemented obsolete attribute checking.
1926         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1927         implemented obsolete checking again. It look line never ending quest ;-)
1928         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1929
1930         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1931
1932         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1933
1934         *class.cs (Property.Define): Add RegisterProperty call.
1935
1936         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1937         argument groups (only 2).
1938
1939         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1940         encoding expression to arguments.
1941         (Expression.ExprClassToResolveFlags): Just turned to property.
1942
1943         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1944         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1945         optimized as well as implemented support for zero-length attributes.
1946
1947         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1948         Add caching of PropertyInfo's.
1949
1950 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1951
1952         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1953         error multiple times.
1954
1955 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1956
1957         New partial class implementation.
1958         A fix for #77027, #77029, #77403
1959
1960         * attribute.cs (Attributable): Made attributes protected.
1961
1962         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1963         the replacements of ClassPart and PartialContainer.
1964         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1965         (TypeContainer.AddInterface): Ditto.
1966         (TypeContainer.AddPartial): The main method for partial classes. It checks
1967         for errors and merges ModFlags and attributes. At the end class is added to
1968         partial_parts list.
1969         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1970         required here.
1971         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1972         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1973         from the rest of partial classes.
1974         (TypeContainer.GetClassBases): Simplified.
1975         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1976         DefineType.
1977         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1978         (TypeContainer.HasExplicitLayout): Uses Flags now.
1979         (PartialContainer): Removed.
1980         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1981         (StaticClass): Was merged with Class.
1982         (Class.GetClassBases): class and static class bases are verified here.
1983         (Class.TypeAttr): Added static attributes when class is static.
1984         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1985         (MemberBase): In some cases we need to call parent container for partial
1986         class. It should be eliminated but it's not easy now.
1987
1988         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1989
1990         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1991         partial classed to accumulate class comments.
1992         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1993
1994         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1995
1996         * driver.cs (MainDriver): Tree.GetDecl was removed.
1997
1998         * modifiers.cs (Modifiers): Add partial modifier.
1999
2000         * tree.cs (Tree.decl): Removed.
2001         (RootTypes): Started to use this class more often for root types
2002         specializations.
2003
2004 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2005
2006         A fix for #77615
2007
2008         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2009         external interface does not have an attribute.
2010
2011 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2012
2013         Another prerequisites for new partial classs implementation.
2014         
2015         * attribute.cs (Attribute.Equal): Implemented.
2016         (Attribute.Emit): Changed as attributes can be applied more than twice.
2017         (Attributes.Emit): Check for duplicate attributes here.
2018
2019         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2020         as a parameter, clean-up.
2021
2022 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2023
2024         A fix for #77485
2025
2026         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2027         contains obsolete attribute check which can in some cases look for base
2028         type of current class which is not initialized yet.
2029         (TypeContainer.BaseType): Replacement of ptype.
2030
2031         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2032
2033 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2034
2035         First of prerequisites for new partial classs implemention.
2036         
2037         * attribute.cs (Attributable): Extended by ResolveContext;
2038         Attributes finally have correct context for resolving in all cases.
2039         (AttachTo): Attribute owner is assigned here.
2040
2041         * codegen.cs (IResolveContext): Introduce new interface to hold
2042         all information needed in resolving phase.
2043         (EmitContext): Implements IResolveContext; more clean-up needed here.
2044         
2045         * decl.cs (MemberCore): Implemented IResolveContext.
2046
2047         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2048         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2049         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2050         Refactored to use new IResolveContext instead of EmitContext; cleanup
2051
2052 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2053
2054         * codegen.cs (EmitScopeInitFromBlock): check here the
2055         capture_context, there is no need to make two calls to the
2056         EmitContext. 
2057
2058         * anonymous.cs: Add some debugging messages that might help me
2059         track other instances of this problem in the future (the
2060         regression of test 467).
2061
2062         * cs-parser.jay: track the variable block, as we need to initalize
2063         any captured variables declared in this block for the "catch"
2064         portion of the "Try" statement.
2065
2066         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2067         scope initialization for captured variables. 
2068
2069         Also, move the emit for the variables after the block location has
2070         been marked.
2071
2072 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2073
2074         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2075
2076 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2077
2078         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2079         commit yesterday, the initialization for the roots is necessary.
2080         What is not necessary is the scope activation.
2081
2082 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2083
2084         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2085         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2086         CS0206 checks.
2087         (Argument.Resolve): Remove CS0206 checks.
2088
2089 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2090
2091         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2092         scopes for all the roots, the scopes will now be emitted when the
2093         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2094
2095         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2096         code.  This reduces a lot of existing cruft.
2097         
2098         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2099         that the ScopeInfo is generated as we enter the scope, not at the
2100         time of use, which is what we used to do before.
2101
2102         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2103         every time a Block is about to be emitted if we have a
2104         CaptureContext. 
2105
2106 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2107
2108         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2109         (Reset): Update.
2110         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2111
2112         * typemanager.cs (cons_param_array_attribute): Make private.
2113         (Reset): Set it to null.
2114         (InitCoreHelpers): Don't initialize it.
2115         (ConsParamArrayAttribute): New.  Initialize it as needed.
2116         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2117
2118 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2119
2120         * expression.cs: There might be errors reported during the
2121         selection of applicable methods.  If there are errors, do not
2122         continue execution as it will lead the compiler to crash.
2123
2124 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2125
2126         * expression.cs: Member access is not allowed on anonymous
2127         methods.  Fixes #77402.
2128
2129 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2130
2131         Fix #77401
2132         * cs-parser.jay (VariableDeclaration): Don't set
2133         current_array_type to null.
2134         (field_declaration, event_declaration, declaration_statement):
2135         Set it to null here.
2136
2137 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2138
2139         * typemanager.cs (GenericParameterPosition): New.
2140         * doc.cs: Use it.
2141
2142 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2143
2144         * doc.cs : To process "include" elements, first we should create
2145           another list than XmlNodeList, because it could result in node
2146           removal, which could result in that the XmlNodeList gives up
2147           yielding next node.
2148
2149           (Also made code identical to gmcs again.)
2150
2151 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2152
2153         * ecore.cs: Introduce an error report that we were not catching
2154         before, if not silent, we must report the error.  Gonzalo ran into
2155         it.
2156
2157 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2158
2159         A fix for bug: #76957
2160         
2161         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2162         ComputeMethodHost before creating the method, this is a new
2163         requirement. 
2164
2165         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2166         that this method references (RegisterScope).  The actual scope
2167         where the method is hosted is computed with the ComputeMethodHost
2168         before we create the method.
2169
2170         Moved the Deepest routine here.
2171
2172         (AnonymousContainer.ComputeMethodHost): New routine used to
2173         compute the proper ScopeInfo that will host the anonymous method.
2174
2175         (ScopeInfo): Deal with multiple roots.  The problem was that we
2176         did not have a unique root where all ScopeInfos could be hanged
2177         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2178         of roots.  
2179
2180         Remove AdjustMethodScope which is now computed at the end.  Remove
2181         LinkScope which did a partial link, instead link all ScopeInfos
2182         before code generation from the new "LinkScopes" routine. 
2183
2184         Simplify all the Add* routines as they no longer need to maintain
2185         the tree, they just need to record that they are using variables
2186         from a ScopeInfo.
2187
2188         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2189         routines to produce the forest of ScopeInfo trees.
2190
2191         * class.cs (TypeContainer.AppendMethod): This is just like
2192         AddMethod, but ensures that an interface implementation method
2193         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2194         methods, but at the end.
2195
2196         We use this functionality to ensure that the generated MoveNext
2197         method in the iterator class is resolved/emitted before the
2198         enumerator methods created.   
2199
2200         This is required because the MoveNext method computes the right
2201         ScopeInfo for the method.  And the other methods will eventually
2202         need to resolve and fetch information computed from the anonymous
2203         method. 
2204
2205 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2206             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2207
2208         Fix rest of #76995.
2209         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2210         the 'aliases' hash.
2211         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2212         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2213
2214 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2215
2216         Fix #76656, cs0231-2.cs.
2217         * cs-parser.jay (formal_parameter_list): Make error case catch
2218         more issues.
2219         (parenthesized_expression_0): Add CS1026 check.
2220         (invocation_expression): Remove unused { $$ = lexer.Location }.
2221
2222 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2223
2224         Fix #76824.
2225         * cs-parser.jay (statement_expression): Don't list out the
2226         individual statement-expressions.  Convert syntax error into
2227         CS0201 check.
2228
2229 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2230
2231         Fix #76874.
2232         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2233         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2234         CheckIntermediateModification.
2235         (FieldExpr.DoResolve): Add new two-argument version that
2236         allows us to resolve the InstanceExpression as an lvalue.
2237         The one-argument variant is now just a wrapper.
2238         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2239         Resolve the lhs as an lvalue if the it has a value type.
2240         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2241         from Assign.DoResolve.
2242         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2243         resolved as an lvalue.
2244         (PropertyExpr.DoResolve): Update.
2245         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2246         has a value type.  Move CS1612 check here from
2247         CheckIntermediateModification.
2248         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2249         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2250         'right_side' of a ResolveLValue on an 'out' argument.
2251         (EmptyExpression.LValueMemberAccess): New.  Used as the
2252         'right_side' of a propagated ResolveLValue on a value type.
2253         (LocalVariableReference.DoResolveBase): Recognize
2254         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2255         Add CS1654 check.
2256         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2257         EmptyExpression.Null.
2258
2259 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2260
2261         * typemanager.cs : added IsGenericParameter(). In mcs it always
2262           return false.
2263         * doc.cs : for generic parameters, use GenericParameterPosition,
2264           not FullName.
2265
2266 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2267
2268         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2269
2270 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2271
2272         This fixes the problem where we used ldfld instead of ldflda to
2273         load the "THIS" pointer on captured parameters, when THIS is a
2274         value type.  See bug #77205.
2275         
2276         * iterators.cs (CapturedThisReference.Emit): Pass false to
2277         EmitThis (we do not need the address).
2278
2279         * codegen.cs (EmitThis): it needs to know whether we need the
2280         address of `this' or not.  This is used by value types.  
2281
2282         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2283         every other call passes false.
2284
2285 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2286
2287         Fix #77221.
2288         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2289         GetOverride.
2290         * expression.cs (Invocation.OverloadResolve): Update.
2291         (Invocation.DoResolve): Avoid double resolution of invocation.
2292
2293 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2294
2295         Fix #77180.
2296         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2297         unary negation of floating point types as 0-expr; negation cannot
2298         overflow in floating point types.
2299
2300         Fix #77204.
2301         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2302         on operands of 'void' type.
2303
2304         Fix #77200.
2305         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2306         and ExclusiveOr for boolean constants too.
2307
2308 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2309
2310         Fix #75636.
2311         * expression.cs (Invocation.OverloadResolve): Replace reflected
2312         override methods with their base virtual methods, rather than
2313         skipping over them.
2314         * typemanager.cs (TypeManager.GetOverride): New.
2315
2316 2006-01-05  Jb Evain  <jbevain@gmail.com>
2317
2318         * class.cs (Property.Define, Indexer.Define): do not tag the
2319         properties as SpecialName | RTSpecialName.
2320
2321 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2322
2323         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2324         doing a low-level comparission of parameter types.  It was lacking
2325         a check for __argslist. 
2326
2327 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2328
2329         * expression.cs (ParameterReference.DoResolveBase): Allow
2330         reference parameters if they are local to this block. 
2331
2332         This allows the ref and out parameters of a delegate to be used in
2333         an anonymous method, for example:
2334
2335         delegate void set (out int x);
2336
2337         set s = delegate (out int x){
2338                 x = 0;
2339         };
2340
2341         This is used by functionality introduced late in the C# language.
2342         
2343         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2344         method that take ref and out parameters. 
2345
2346         Fixes #77119 which was a late change in the spec.
2347
2348 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2349
2350         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2351         parent if its the same scope.  Fixes #77060.
2352
2353 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2354
2355         * driver.cs: Report the case of no source files and no -out:
2356         argument provided.
2357
2358 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2359
2360         Fix #77035.
2361         * expression.cs (ComposedCast.GetSignatureForError): Define.
2362
2363 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2364
2365         Fix #76995
2366
2367         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2368         ListDictionary, to contain the ExternAliasEntry entries (in
2369         addition to the NamespaceEntry.aliases hashtable). This field is
2370         shared between the original entry and its doppelganger (bodyless 
2371         copy of it).
2372         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2373         extern_aliases field.
2374         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2375         lookup in extern_aliases.
2376
2377 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2378
2379         Fix #77006.
2380         * class.cs (TypeContainer.Mark_HasEquals): New.
2381         (TypeContainer.Mark_HasGetHashCode): New.
2382         (ClassPart): Override them.
2383         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2384
2385         Fix #77008.
2386         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2387         'parent' argument to the base constructor.
2388
2389         Remove all mention of TypeContainer from decl.cs.
2390         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2391         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2392         (DeclSpace.DeclSpace): Likewise.
2393         (DeclSpace.DefineMembers): Remove unused argument.
2394         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2395         debugging check -- we don't care if the debug code throws an
2396         InvalidCastException instead of an InternalErrorException.
2397         * class.cs (TypeContainer.DefineMembers): Update to changes.
2398         (TypeContainer.DoDefineMembers): Likewise.
2399         (TypeContainer.GetMethods): Likewise.
2400         (PropertyMember.Define): Likewise.
2401         (MemberBase.Parent): New property that forwards to
2402         MemberCore.Parent, but ensures that we get a TypeContainer.
2403         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2404         (RootContext.PopulateTypes): Likewise.  Remove special case code
2405         for !RootContext.StdLib: DefineMembers is idempotent.
2406
2407 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2408
2409         * convert.cs (ExplicitConversionCore): Check the return value from
2410         ExplicitConversionCore which can return null on failure.  Fixes #76914
2411
2412 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2413
2414         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2415
2416 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2417
2418         * doc.cs : The search for referenced namespace was insufficient to
2419           get global one as it used to do. Fixed bug #76965.
2420
2421 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2422
2423         * doc.cs : check name in cref in the last phase that whether it is
2424           namespace or not.
2425
2426 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2427
2428         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2429           Mono.C5.
2430
2431 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2432
2433         * doc.cs : so it turned out that we cannot skip override check for 
2434           interface members. Fixed bug #76954.
2435
2436 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2437
2438         * cs-tokenizer.cs : fixed bug #75984:
2439           - #warning and #error should not be handled when the source line
2440             is disabled.
2441           - #line is not checked strictly when the source line is disabled.
2442           - #define and #undef is on the other hand checked strictly at any
2443             state.
2444
2445 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2446
2447         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2448           CS1027 report.
2449
2450 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2451
2452         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2453
2454         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2455         event initializers.
2456         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2457         (FieldBase.Initializer): Initializer is now optional.
2458         (EventField.Define): Only event field can have initializer.
2459
2460         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2461
2462         * const.cs (Const): Reuse initializer.
2463
2464         * cs-parser.jay: Updated after FieldBase changes.
2465         Added current_array_type to simplify array initializers.
2466
2467         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2468
2469         * expression.cs, iterators.cs: Updated.
2470
2471         * namespace.cs (NamespaceEntry): Made UsingFound private.
2472
2473 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2474
2475         * parameterCollection.cs: Obsolete, removed.
2476         * parser.cs: Obsolete, removed.
2477
2478 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2479
2480         Fix #76849.
2481         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2482
2483         * enum.cs (Enum.Define): Set obsolete context here.
2484
2485 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2486
2487         * doc.cs :
2488           - FindDocumentedMember() now expects 1) paramList as null
2489             when "we don't have to check the number of parameters" and
2490             2) Type.EmptyTypes when "there is no arguments".
2491           - Introduced FoundMember struct to hold the exact type which was
2492             used to find the documented member (the above change broke
2493             test-xml-044; it might be better just to use DeclaringType than
2494             what MS does, like this change does, but it depends on usage.)
2495
2496 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2497
2498         * doc.cs : documented member might be from DeclaringType for nested
2499           types. Fixed bug #76782.
2500
2501 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2502
2503         * anonymous.cs: Have the param code handle leaving copies on the
2504         stack etc. Allows anonymous params to take part in the assignment
2505         code (++, +=, etc). Fixes bug #76550
2506
2507         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2508         it down to the anon code.
2509
2510         * iterators.cs: Use dummy var here
2511
2512         * codegen.cs: Handle new vars
2513
2514 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2515
2516         Fix #76849.
2517         * class.cs (MethodData.Define): Set proper Obsolete context.
2518
2519         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2520         obsolete context.
2521         (FieldExpr.DoResolve): Ditto.
2522
2523 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2524
2525         Fix #76849.
2526         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2527         parent is not obsolete.
2528
2529 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2530
2531         * doc.cs : (FindDocumentedMember) find parameterless members first
2532           and get CS0419 in the early stage. Fixed first case of bug #76727.
2533
2534 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2535
2536         Fix #76859.
2537         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2538         no error was reported.
2539
2540         *expression.cs (Binary.DoResolve): left can be null.
2541
2542 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2543
2544         Fix #76783.
2545         * class.cs (MethodData.Emit): Parameters should be labeled first.
2546
2547 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2548
2549         Fix #76761.
2550         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2551
2552 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2553
2554         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2555
2556         * class.cs (MethodCore): Parameter clean up.
2557         (IMethodData): Added ParameterInfo.
2558         (MethodData): Parameter clean up.
2559         (Indexer.Define): Parameter clean up.
2560
2561         * anonymous.cs,
2562         * codegen.cs,
2563         * cs-parser.jay,
2564         * decl.cs,
2565         * doc.cs,
2566         * ecore.cs,
2567         * flowanalysis.cs,
2568         * iterators.cs,
2569         * pending.cs,
2570         * statement.cs,
2571         * typemanager.cs: Parameter clean up.
2572
2573         * delegate.cs (Define): Get rid of duplicated code.
2574
2575         * expression.cs (ParameterReference): Removed useless parameters
2576         and simplified.
2577         (Invocation): Ditto.
2578
2579         * parameter.cs (ParamsParameter): New class, params specialization.
2580         (ArglistParameter): Attemp to separate arglist.
2581         (Parameter): Refactored to be reusable and faster.
2582         (Parameter.Modifier): Made understandable.
2583         (Parameters): Changed to be used as a class for `this' assembly
2584         parameters. Refactored to use new specialized classes.
2585
2586         * support.cs (ParameterData): Added Types property.
2587         (InternalParameters): Deleted.
2588
2589 2005-08-20  Martin Baulig  <martin@ximian.com>
2590
2591         Merging this patch from GMCS to fix #75867.
2592
2593         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2594         scope if we don't already have it.
2595
2596 2005-11-17  Martin Baulig  <martin@ximian.com>
2597
2598         * anonymous.cs
2599         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2600         inherit the scope from our parent.  Fixes #76653.
2601
2602 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2603
2604         * doc.cs : the previous patch does not actually fix the bug.
2605           PropertyInfo override check is now implemented and really fixed it.
2606         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2607
2608 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2609
2610         * doc.cs : apply "override filter" also to properties.
2611           Fixed bug #76730.
2612
2613 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2614
2615         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2616           no need to check overrides. For classes, omit those results from 
2617           interfaces since they must exist in the class. Fixed bug #76726.
2618
2619 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2620
2621         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2622           with different parameters. Fixed the second problem in #76685.
2623
2624 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2625
2626         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2627           get expected 'protected' access in CheckValidFamilyAccess()).
2628           Fixed bug #76692.
2629
2630 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2631
2632         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2633           Fixed bug #76705.  CS1569 was incorrectly commented out.
2634
2635 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2636
2637         * doc.cs : use Invocation.IsOverride() to do real override check.
2638         * expression.cs : made Invocation.IsOverride() internal.
2639
2640 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2641
2642         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2643           TypeBuilder.FindMembers() and filter overriden base members out.
2644           Fixed bug #76990.
2645
2646 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2647
2648         * doc.cs : ref/out parameters are represented as '@' (instead of
2649           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2650
2651 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2652
2653         * doc.cs : when there was no '.' in cref to methods in doc comment,
2654           then parameters were missing in the output. Fixed bug #76691.
2655
2656 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2657
2658         * driver.cs : don't output docs when there is an error.
2659           Fixed bug #76693.
2660
2661 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2662
2663         * doc.cs :
2664           Now it should detect indexers. Fixed primary concern in bug #76685.
2665           Fixed CS0419 message to not show the identical member signature in
2666           the message.
2667
2668 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2669
2670         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2671           instead of Type.FindMembers() since it does not handle events.
2672           Fixed bug #71604.
2673
2674 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2675
2676         * codegen.cs: Fixed typo (speficied -> specified).
2677
2678 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2679
2680         Fix #76369.
2681         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2682
2683 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2684
2685         * attribute.cs: Changed error message.
2686
2687         * cs-tokenizer.cs: One more check.
2688
2689 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2690
2691         * statement.cs (Block.Resolve): Ignore empty statement.
2692
2693 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2694
2695         * report.cs: Made error/warning methods more strict to avoid
2696         their misuse.
2697
2698         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2699         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2700         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2701         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2702
2703 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2704
2705         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2706         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2707
2708         * class.cs (TypeContainer.IsComImport): New property.
2709         (Constructor.Define): Create proper ctor for ComImport types.
2710
2711         * expression.cs (New.CheckComImport): Fixed.
2712
2713 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2714
2715         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2716         that a parameter has been captured does not mean that we do not
2717         have to do the rest of the processing.  This fixes the second part
2718         of #76592.  If there was another anonymous method capturing
2719         values in the past, the Scope would never be set for the second
2720         method that captured the same parameter.
2721
2722         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2723         properly manipulate the stack.   Second part of fix for #76592.
2724
2725         * expression.cs (New): Add support for invoking "new" on
2726         interfaces that have been flagged with the ComImport attribute and
2727         the CoClass.  Fixes #76637 
2728
2729         * statement.cs (Try.DoEmit): When a variable is captured, do not
2730         try to emit the vi.LocalBuilder variable as it has been captured.
2731         Create a temporary variable and store the results on the
2732         FieldBuilder.  Fixes #76642
2733
2734 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2735
2736         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2737
2738         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2739
2740         * expression.cs (Binary.DoResolve): Added && optimalization.
2741     
2742         * typemanager.cs (AddUserType): Removed useless argument.
2743
2744 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2745
2746         * statement.cs (Block.variables): Uses ListDictionary.
2747
2748 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2749
2750         Fix #75969.
2751         * class.cs (PartialContainer.EmitType): Customized to emit
2752         security attributes.
2753         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2754         for partial classes.
2755
2756 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2757
2758         Fix #76599.
2759         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2760         access has to be fixed.
2761         
2762         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2763
2764 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2765
2766         Fix #76590.
2767         * ecore.cs (NullCast.Reduce): Implemented.
2768
2769         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2770         constant type.
2771         
2772         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2773         properly.
2774         (Foreach.Resolve): Catch null properly.
2775
2776 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2777  
2778         * cs-tokenizer.cs: Warning text fix.
2779
2780         * driver.cs: AllWarningNumbers exposed on public interface.
2781
2782         * report.cs (): Reviewed warning numbers.
2783         (IsValidWarning): Use binary search.
2784
2785 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2786  
2787         * driver.cs: Implemeted resource visibility.
2788         (Resources): New class for code sharing between /res: and
2789         /linkres:
2790  
2791 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2792
2793         Fix #76568.
2794         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2795         folding.
2796         
2797         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2798         contants only.
2799         
2800         * ecore.cs (NullCast): Child is contant only.
2801         
2802         * literal.cs (NullLiteral.Reduce): null can be converted to any
2803         reference type.
2804
2805 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2806
2807         * driver.cs: Use Encoding.Default as default code page instead
2808           of ISO-28591.
2809
2810 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2811
2812         Fix #76085.
2813         * expression.cs (Invocation.Error_InvalidArguments): Handle
2814         __arglist parameters.
2815         (Invocation.VerifyArgumentsCompat): Likewise.
2816         * support.cs (ReflectionParameters.GetSignatureForError): Print
2817         __arglist parameters.
2818         (InternalParamters.GetSignatureForError): Likewise.
2819         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2820
2821 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2822
2823         * attribute.cs (GetPropertyValue): Made public.
2824
2825         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2826         Resolve.
2827         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2828         attribute.
2829         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2830         is not defined.
2831         
2832         * driver.cs: Reflect method name change.
2833         
2834         * statement.cs (Try.Resolve): Warn when try has both general
2835         exception handlers.
2836         
2837         * typemanager.cs: runtime_compatibility_attr_type new predefined
2838         type.
2839
2840 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2841
2842         Fix #76419.
2843         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2844         treat it as an empty parameter list.
2845
2846 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2847
2848         Fix #76271.     
2849         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2850         ResolveAsTypeStep silent.
2851         * statement.cs (Block.AddConstant): Mark block as used.
2852         (Block.ResolveMeta): Avoid piling on error messages
2853         if a constant initializer resolution fails.
2854
2855 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2856
2857         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2858         Remove.
2859         (NamespaceEntry.VerifyAllUsing): New.
2860         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2861         behaviour.  Delegates actual resolution of alias to ...
2862         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2863         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2864         Update.
2865         * driver.cs (Driver.MainDriver): Update.
2866         
2867         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2868         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2869         property.
2870         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2871         Remove.
2872         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2873         RootNamespace.DefineNamespacesForAll.
2874
2875 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2876
2877         * typemanager.cs (assemblies, external_aliases, modules)
2878         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2879         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2880         overhead.  Move resposibility ...
2881         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2882         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2883
2884 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2885
2886         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2887         cached_namespaces.  Improve usage.
2888         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2889         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2890         Move from GlobalRootNamespace and simplify.
2891         (RootNamespace.Global): Make instance variable.
2892         (RootNamespace.RootNamespace): Add "alias name" parameter.
2893         (GlobalRootNamespace): Simplify drastically.
2894         (Namespace.Lookup): Don't use GetNamespace.
2895         * typemanager.cs (GetRootNamespace): Rename from
2896         ComputeNamespaceForAlias.
2897         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2898
2899 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2900
2901         * anonymous.cs (AnonymousContainer): Don't crash when container
2902         doesn't exist.
2903
2904 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2905
2906         * expression.cs (Binary.DoResolve): Warn when comparing same
2907         values.
2908
2909 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2910
2911         Fix #76486.
2912         * expression.cs (Binary.DoResolve): It looks like there are no
2913         convetsion rules in enum context.
2914
2915 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2916
2917         Add support for extern alias qualifiers.
2918         * typemanager.cs: Move some LookupTypeReflection code
2919         to namespace.cs, to have cleaner code. Added some methods
2920         to help us keep track of the extern aliased references.
2921         * driver.cs: Add suport for extern alias assemblies on command
2922         line and check for their warnings/errors. Also keep track of the
2923         extern aliased assemblies.
2924         * namespace.cs: Move the global functionality of Namespace
2925         to GlobalRootNamespace/RootNamespace. Now the global namespace
2926         is GlobalRootNamespace.Globa. Also the code moved from 
2927         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2928         Finally added LocalAliasEntry (AliasEntry before) and
2929         ExternAliasEntry, to handle alias statements.
2930         * cs-parser.jay: Add support in the grammar for extern alias
2931         statement.
2932         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2933         Update callings to Namespace (now in GlobalRootNamespace).
2934
2935 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2936
2937         Fix #76371.
2938         * class.cs (TypeContainer.DefineType): Move updating of
2939         topological sort earlier in the code.
2940         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2941
2942 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2943
2944         Fix #76273.
2945         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2946         
2947         * constant.cs (Constant.TryReduce): Moved from Cast class.
2948         (Reduce): Made little bit more OO and fixed missing conversions.
2949         
2950         * ecore.cs (Reduce): Implemented.
2951         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2952         
2953         * literal.cs (Reduce): Implemented.
2954         
2955         * class.cs: Reverted Miguel's wrong commit.
2956
2957 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2958
2959         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2960
2961 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2962
2963         * cs-parser.jay, expression.cs : CS0214 was missing error location
2964           for constants. Fixed bug #76404.
2965
2966 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2967
2968         Fix #76370.
2969         * convert.cs (ExplicitConversionCore): Fixed object->enum
2970         conversion.
2971
2972 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2973
2974         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2975         InstanceExpression.
2976         (PropertyExpr.EmitCall): Likewise.
2977         * expression.cs (Invocation.EmitArguments): Handle case where
2978         arguments == null.
2979         (Invocation.EmitCall): Avoid allocating temporary variable if
2980         there are no arguments.
2981
2982 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2983
2984         Fix #76323.
2985         * convert.cs (ImplicitConversionStandard): Move conversion of
2986         void* to arbitrary pointer types ...
2987         (ExplicitConversionStandard): .. here.
2988         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2989         error to always print typenames.
2990
2991 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2992
2993         * convert.cs (GetConversionOperator): Rename from
2994         GetConversionOperators.  Move operator selection code from ...
2995         (UserDefinedConversion): ... here.
2996
2997 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2998
2999         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3000         conversion.
3001
3002 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3003
3004         * assign.cs (Assign.DoResolve): Error method changed.
3005
3006         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3007         
3008         * const.cs (ResolveValue): Reset in_transit immediately.
3009         
3010         * constant.cs: Error method changed.
3011         
3012         * convert.cs: Removed useless location parameter.
3013         (ExplicitNumericConversion): Don't do double enum check.
3014         (ExplicitConversionCore): Renamed from ExplicitConversion.
3015         (ExplicitUnsafe): Extracted from ExplicitConversion.
3016         (ExplicitConversion): Uses for error reporting.
3017         
3018         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3019         error messages.
3020         (ResolveBoolean): Uses common error method.
3021         (CastToDecimal): Get rid of ec.
3022         (CastFromDecimal): Optimized.
3023         (ConvCast): Get rid of ec.
3024         
3025         * enum.cs (ResolveValue): Reset in_transit immediately.
3026         (Emit): Return after first error.
3027         
3028         * expression.cs: Convert changes.
3029         
3030         * literal.cs: Error method changed.
3031         
3032         * statement.cs: Error method changed.
3033
3034 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3035
3036         * support.cs (SeekableStreamReader.Position): Don't error out when
3037         the requested position is just beyond the end of the current
3038         buffered data.
3039
3040 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3041
3042         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3043         try to keep in sync with the byte count of the underlying Stream.
3044         However, this limits us to a window size of 2048 characters: i.e.,
3045         the maximum lookahead of our lexer/parser can be 2048 characters.
3046
3047 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3048
3049         Fix #76255.
3050         * driver.cs: Fix compilation files with full root path.
3051
3052 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3053
3054         * report.cs (SymbolRelatedToPreviousError): Format the output so
3055         it does not use an open parenthesis that is never closed. 
3056
3057         * driver.cs: Follow coding guidelines
3058
3059 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3060
3061         Fix #72930.
3062         * const.cs (Const.ResolveValue): Check for assigning non-null
3063         value to reference type.
3064
3065 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3066
3067         * anonymous.cs: Implemented ExprClassName.
3068         
3069         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3070         delegate.
3071         
3072         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3073         check.
3074         
3075         * class.cs (StaticClass.DefineContainerMembers): Report protected
3076         members as error.
3077         
3078         * codegen.cs: if(ed) PRODUCTION.
3079         
3080         * convert.cs (Error_CannotImplicitConversion): Better error
3081         distinction.
3082         
3083         * cs-parser.jay: More error checks.
3084         
3085         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3086         
3087         * driver.cs (CSCParseOption): Enabled wrong option check.
3088         
3089         * ecore.cs (Expression.ExprClassName): Turned to property.
3090         (MemberExpr.CheckIntermediateModification): For checking boxed
3091         value types     modification.
3092         
3093         * statement.cs (Fixed.Resolve): Expression type must be
3094         convertible to fixed type.
3095         (CollectionForeach.GetEnumeratorFilter,TryType):
3096         Small refactoring for easier error checking.
3097
3098 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3099
3100         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3101         attributes.
3102         
3103         * class.cs (GeneratedBaseInitializer): New class for customization
3104         compiler generated initializers.
3105         (MemberBase.DoDefine): Check Obsolete attribute here.
3106         (FieldMember.DoDefine): Ditto.
3107         
3108         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3109         constants.
3110         
3111         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3112         (MemberCore.GetObsoleteAttribute): Removed argument.
3113         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3114         (MemberCore.CheckObsoleteType): New helper.
3115         
3116         * delegate.cs,
3117         * enum.cs,
3118         * statement.cs: Updates after MemberCore changes.
3119         
3120         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3121         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3122         
3123         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3124         obsolete attribute for compiler construct.
3125         (As.DoResolve): Cache result.
3126         
3127         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3128
3129 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3130
3131         Fix #76133.
3132         * expression.cs (This.VerifyFixed): In a value type T, the type of
3133         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3134         value type R, 'this' is treated as a value parameter.
3135
3136 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3137
3138         * statement.cs (Lock): Use the TemporaryVariable class instead of
3139         manually using local variables as those do not work when variables
3140         are captured.
3141
3142         * ecore.cs: Moved the TemporaryVariable class from being a nested
3143         class inside Foreach to be a public class that can be employed in
3144         other places. 
3145
3146 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3147
3148         * cs-parser.jay: interface_accessors replaced by
3149         accessor_declarations.
3150
3151         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3152         location.
3153         
3154         * statement.cs (GotoCase.Resolve): Convert null constant to
3155         null case.
3156         (SwitchLabel.ResolveAndReduce): Ditto.
3157         (SwitchLabel.NullStringCase): Custom null stamp.
3158         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3159         
3160         typemanager.cs (CSharpSignature): Don't skip first argument
3161         for full names.
3162
3163 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3164
3165         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3166
3167         * location.cs (InEmacs): in this mode, do not report column
3168         location as it confuses Emacs.
3169
3170 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3171
3172         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3173         expression.cs, iterators.cs, literal.cs: Store constants and
3174         literals location.
3175         
3176         * class.cs (MemberBase.ShortName): Pass location.
3177         
3178         * cs-parser.jay: Some location fixes.
3179         
3180         * ecore.cs (Expression.Location): Made virtual.
3181
3182 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3183
3184         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3185         if the underlying types are the same, otherwise we need to produce
3186         code that will do the proper cast.
3187
3188         This was exposed by Marek's constant rewrite which produced
3189         invalid code for the call site:
3190
3191         enum X : long { a }
3192         void Method (X v) {}
3193
3194         Method ((X) 5)
3195
3196         This fixes test-49.cs
3197
3198 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3199
3200         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3201           Type/Object should be allowed as well. Fixed bug #75968.
3202
3203 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3204
3205         * expression.cs : (Binary.DoResolve): when one is enum constant and
3206           another is constant 0, then return enum one *as enum type*.
3207           Fixed bug 74846.
3208
3209 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3210
3211         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3212         internal.
3213
3214         Fix #75941.
3215         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3216         flow-branching for LocalVariableReferences in case we were invoked
3217         from a MemberAccess.
3218         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3219         Carved out of ...
3220         (LocalVariableReference.DoResolveBase): ... this.
3221         (MemberAccess.Resolve): Do the check that was disabled during
3222         SimpleNameResolve.
3223
3224 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3225
3226         * class.cs :
3227           (PartialContainer.Create): check abstract/sealed/static strictly
3228           but abstract/sealed can exist only at one side. Fixed bug #75883.
3229
3230 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3231
3232         Fix #75945.
3233         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3234         specified, don't default to UnmanagedType.I4.
3235
3236 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3237
3238         * expression.cs : conditional operator should check possibly
3239           incorrect assign expression. Fixed bug #75946.
3240
3241 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3242
3243         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3244           Reverting the change. gmcs is much complex than mcs on this matter.
3245
3246 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3247
3248         * cs-tokenizer.cs : To read another token ahead of the actual 
3249           consumption, use new SavedToken and cache token instead of moving
3250           back the stream with SeekableStreamReader (it seemed problematic).
3251         * cs-parser.jay,
3252           driver.cs : Thus use StreamReader directly.
3253         * support.cs : Thus removed SeekableStreamReader.
3254
3255 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3256
3257         Fix #75934.
3258         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3259         (ScopeInfo.EmitScopeType): Use it to construct field names from
3260         names of captured locals.
3261
3262         Fix #75929.
3263         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3264         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3265         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3266         (ExplicitConversion): Remove enum cases already handled by
3267         implicit conversion.  Move implicit conversion check to the beginning.
3268         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3269         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3270         Don't treat System.Enum as a struct.
3271
3272 2005-08-30  Jb Evain  <jbevain@gmail.com>
3273
3274         * attribute.cs: handles as expression in parameters.
3275
3276 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3277
3278         Fix #75802.
3279         * class.cs (TypeContainer.VerifyClsName): Don't use a
3280         PartialContainer when verifying CLS compliance.
3281         (AbstractPropertyEventMethod): Set Parent here, ...
3282         (PropertyMethod): ... not here.
3283
3284 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3285
3286         * attribute.cs : escaped attribute name should not be allowed to be
3287           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3288
3289 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3290
3291         Fix #75927.
3292         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3293         when converting a long constant to unsigned long.
3294         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3295         detect where IsApplicable and VerifyArgumentsCompat disagree.
3296
3297 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3298         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3299
3300         Fix #75848.
3301         * class.cs (TypeContainer.CanElideInitializer): New helper.
3302         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3303         can safely emitting the initializer of a field.
3304
3305 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3306
3307         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3308           allowed inside a switch (without loop). Fixed bug #75433.
3309
3310 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3311
3312         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3313         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3314
3315 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3316
3317         * driver.cs : kinda reverting the default encoding changes (not exact 
3318           revert since I noticed that "codepage:reset" might not work fine).
3319
3320 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3321
3322         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3323           Location. Now getter and setter store location correctly.
3324           (errors/cs0111-12.cs now reports the expected location.)
3325
3326 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3327
3328         * driver.cs : Use default encoding on the environment.
3329           Removed (now that) extra parameter for SeekableStreamReader.
3330         * support.cs : (SeekableStreamReader) third .ctor() argument for
3331           StreamReader is not required (always true). preamble size could
3332           be acquired in simpler and safe way.
3333
3334 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3335
3336         * cs-parser.jay: report CS0642 at warning level 3
3337           and report CS0642 for an if else statement also
3338           fixes bug #74745. Patch by John Luke (and a bit
3339           modified by me).
3340           Removed extra CS0642 warning check for "while",
3341           "for" and "fixed".
3342         * statement.cs: In Block.Resolve(), CS0642 check
3343           is reimplemented to check a sequence of an empty
3344           statement and a block.
3345
3346           Both fix bug #66777.
3347
3348 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3349
3350         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3351         detection until I fix it.
3352         
3353         * cs-tokenizer.cs: Changed error message.
3354         
3355         * cs-parser.jay: Fixed 2 error locations.
3356         
3357         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3358         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3359         properties.
3360         
3361         * enum.cs (GetSignatureForError): Fixed.
3362         
3363         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3364         method detection.
3365         
3366         * class.cs,
3367         * typemanager.cs (RegisterProperty): Removed.
3368         
3369         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3370
3371 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3372
3373         Fix #75874.
3374         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3375         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3376
3377 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3378
3379         * expression.cs : tiny fix is required for not warning positive ulong.
3380           See test-441.cs.
3381
3382 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3383
3384         * expression.cs : add CS0652 check for constant and integral
3385           expression. Fixed bug #53974.
3386
3387 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3388
3389         * expression.cs : in DoNumericPromotions(), check if there is implicit
3390           conversion overload for string (to check CS0034). Fixed bug #52492.
3391
3392 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3393
3394         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3395
3396 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3397
3398         * ecore.cs : report location when it is *not* Null.
3399
3400 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3401
3402         * codegen.cs,
3403           ecore.cs,
3404           flowanalysis.cs,
3405           expression.cs:
3406           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3407           correctly. Fixed bug #75721.
3408
3409 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3410
3411         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3412         loop that performs 'min (pos, char_count)'.
3413
3414         Fix #75862.
3415         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3416         converted value in Operator.OnesComplement.
3417
3418 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3419
3420         * anonymous.cs: If the anon method is pulled into a helper class,
3421         it needs to be `internal' not `private'. Fixes runtime behavior on
3422         msft. bug #75704
3423
3424 2005-08-20  Martin Baulig  <martin@ximian.com>
3425
3426         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3427         scope if we don't already have it.
3428
3429         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3430         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3431         fixes #75867.
3432
3433 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3434
3435         Fix #75803
3436         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3437         is a partial class.
3438
3439 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3440
3441         The big constants rewrite
3442         Fix #75746, #75685 and more
3443         As a side effect saved 1MB for MWF ;-)
3444         
3445         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3446         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3447         enum based for corlib compilation.
3448         
3449         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3450         subtractions.
3451         
3452         * class.cs (FixedField.Define): Use ResolveAsConstant.
3453         
3454         * const.cs (IConstant): Interface constants and enums.
3455         (Const.ResolveValue): New method for constant resolvning.
3456         (ExternalConstant): Constants from imported assemblies.
3457         
3458         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3459         conversion; like enums.
3460         (Constant.ToType): Converts this constant to different type.
3461         (Constant.Increment): Adds 1.
3462         
3463         * convert.cs (ImplicitConversionRequired): Simplified.
3464         
3465         * cs-parser.jay: Create EnumMember directly.
3466         
3467         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3468         
3469         * doc.cs (GenerateEnumDocComment): Removed.
3470         
3471         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3472         (ConvertIntLiteral): Removed.
3473         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3474         
3475         * enum.cs (EnumMember): Implement IConstant.
3476         (Enum.IsValidEnumConstant): Removed.
3477         (Enum.GetNextDefaultValue): Removed.
3478         (Enum.FindMembers): Updated.
3479         (Enum.GenerateDocComment): Iterate enum members.
3480         
3481         * expression.cs (Cast.TryReduce): Handle enums correctly.
3482         (New.Constantify): Made public.
3483         (MemberAccess.DoResolve): Removed contant specific if(s).
3484         
3485         * literal.cs (NullLiteral): Implement new abstract methods.
3486         
3487         * statement.cs (GotoCase.Resolve): Use new constant methods.
3488         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3489         
3490         * typemanager.cs (LookupEnum): Removed.
3491         (IsEnumType): Fixed to work with corlib.
3492         (RegisterConstant): Removed.
3493         (LookupConstant): Removed.
3494         (GetConstant): Changed to work with IConstant.
3495
3496 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3497
3498         * location.cs : Fixed overflown (>255) column number.
3499
3500 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3501
3502         First cut of the qualified-alias-member feature.
3503         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3504         token.
3505         * cs-parser.jay (DOUBLE_COLON): New token.
3506         (namespace_or_type_name): Add rule for recognizing
3507         qualified-alias-members.
3508         (primary_expression): Likewise.
3509         (element_access): Allow QualifiedAliasMember as a possible
3510         type-bearing expression.
3511         (local_variable_type, local_variable_pointer_type): Likewise.
3512         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3513         aliases in the current and enclosing namespace declarations.
3514         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3515         * decl.cs (MemberName.is_double_colon): New.
3516         (MemberName.MemberName): Add new constructor for alias-member.
3517         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3518         * expression.cs (QualifiedAliasMember): New expression type.
3519
3520 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3521
3522         * location.cs : it borked when no argument was specified.
3523
3524 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3525
3526         * location.cs : tiny ToString() format fix.
3527
3528 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3529
3530         * statement.cs : oops, it was missing.
3531
3532 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3533
3534         A set of fixes for precise line/column location.
3535
3536         * location.cs :
3537           "token" field now holds a file/line "delta", a line number offset 
3538           from the segment, and a column number. See also:
3539           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3540           December/009508.html
3541           Removed static IsNull. Use instance IsNull property instead.
3542         * cs-tokenizer.cs :
3543           For some tokens it stores Location. For Identifier it stores
3544           LocatedToken which is a pair of string name and location.
3545           Column numbers are adjusted only at getChar().
3546         * report.cs :
3547           Use Location.ToString() for reporting (it now contains column).
3548         * cs-parser.jay :
3549           Largely modified to use LocatedToken instead of
3550           string (IDENTIFIER), and to acquire Location from some tokens.
3551         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3552           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3553           codegen.cs :
3554           Now MemberName holds Location. DeclSpace.ctor() receives Location
3555           as a parameter. Removed extra parameters to all derived classes.
3556           Replaced Location.IsNull() with instance property.
3557         * assign.cs, expression.cs :
3558           Added .ctor() overload that omits Location.
3559         * attribute.cs :
3560           Added "nameEscaped" flag that indicates the identifier was escaped
3561           in the source file. This fixes bug #57047.
3562
3563 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3564
3565         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3566         New method, looking for lo-case imported cls type.
3567
3568         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3569         here.
3570
3571         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3572
3573         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3574
3575         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3576         all_imported_types.
3577         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3578
3579         Optimized to save 3.5 MB for SWF compilation.
3580
3581 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3582
3583         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3584         (PartialContainer.Create): Moved logic AddToContainer.
3585         (PartialContainer.MarkForDuplicationCheck): Shares name.
3586         
3587         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3588         place.
3589         
3590         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3591         initialization.
3592         (Namespace.GetSignatureForError): New method.
3593         
3594         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3595         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3596
3597 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3598
3599         Fix #75669.
3600         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3601         member lookup rather than qualifier_type, since qualifier_type can
3602         be null.
3603
3604 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3605
3606         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3607         enum member.
3608
3609 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3610
3611         * statement.cs: Copy the local exception into the exception
3612         captured local.  Fixes 75674
3613
3614 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3615
3616         Fix #75658.
3617         * expression.cs (Invocation.OverloadResolve): Don't report error
3618         CS1501 if error CS1502 has been reported.
3619         (New.DoResolve): Delegate CS1501 reporting to
3620         Invocation.OverloadResolve.
3621
3622         Fix #75656.
3623         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3624         invariant-meaning-in-block property in an enclosing block if
3625         necessary.
3626
3627 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3628
3629         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3630         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3631         (Switch.CheckSwitch): Just save 50kb for SWF.
3632
3633 2005-07-27  Martin Baulig  <martin@ximian.com>
3634
3635         * anonymous.cs (CaptureContext.AddField): Added
3636         `AnonymousContainer am' argument; compute its toplevel scope if
3637         it's not already computed.  Fixes #75649.
3638
3639 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3640
3641         Fix #75628.
3642         * class.cs (Constructor.Emit): Reset block to null if the block
3643         resolve fails.
3644
3645 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3646
3647         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3648
3649 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3650
3651         * class.cs (MethodData.Define): Check whether accessor implementing
3652         interface is public.
3653
3654         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3655
3656 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3657
3658         Fix #57245
3659         * namespace.cs (LookupType): Moved same type check to...
3660         
3661         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3662         with the same name.
3663
3664 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3665
3666         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3667         already found a typebuilder.
3668         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3669         MemberNames, not strings.
3670
3671         * const.cs (Error_ExpressionMustBeConst): 
3672         Rename from Error_EpressionMustBeConst.
3673         * const.cs, class.cs, statement.cd: Update.
3674
3675 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3676
3677         Fix #65573
3678
3679         * const.cs (Const.LookupConstantValue): Report missing contant expression
3680         everytime.
3681         (Error_EpressionMustBeConstant): Only one error method.
3682
3683         * class.cs, statement.c: Updated.
3684
3685 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3686
3687         * statement.cs (Block.Flags): Add back HasVarargs.
3688         (Block.flags): Make protected.
3689         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3690
3691         * typemanager.cs (types, typecontainers, user_types): Remove.
3692         (UserTypes, TypeContainers): Likewise.
3693         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3694         (CleanUp, Reset): Update.
3695         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3696         (GetNestedType): Use Type.GetNestedType.
3697         (CoreLookupType): Take two arguments, the namespace and the
3698         basename of the type.  Update to use the Namespace.Lookup
3699         mechanism.
3700         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3701         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3702         string concatenation and substring matches.
3703         * class.cs, enum.cs, delegate.cs: Update to changes.
3704
3705 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3706
3707         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3708         Expression and made virtual.
3709
3710         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3711         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3712
3713         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3714
3715         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3716         error message.
3717
3718         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3719         change.
3720
3721 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3722
3723         Fix #57707
3724         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3725         AssemblyCultureAttribute is not used on executable.
3726
3727         * rootcontext.cs,
3728         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3729
3730 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3731
3732         Fix #60638.
3733         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3734         New.  Reports CS0252/CS0253.
3735         Mostly taken from preliminary patch by Duncak Mak.
3736         (Binary.DoResolveOperator): Store results of operator lookup.
3737         Use them to detect if we need to warn about unintended reference
3738         comparisons.
3739
3740 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3741
3742         Fix #72969.
3743         * namespace.cs (Namespace.Lookup): Add back location parameter.
3744         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3745         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3746
3747         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3748         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3749         (Namespace.LookupType): ... this.
3750         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3751         of namespaces.
3752         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3753         purported to handle pointers.
3754         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3755         CoreLookupType.
3756
3757 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3758
3759         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3760         type as namespace.
3761
3762 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3763
3764         * namespace.cs (Namespace.Lookup): Drop location parameter.
3765         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3766         (NamespaceEntry.Lookup): ... this.
3767         (NamespaceEntry.Error_AmbiguousTypeReference):
3768         Move here from DeclSpace.
3769         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3770         names ...
3771         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3772         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3773         Move to NamespaceEntry.
3774         * delegate.cs, expression.cs: Update to changes.
3775
3776 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3777
3778         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3779         CheckAttributeType and refactored.
3780         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3781         ResolveAsTypeTerminal error handling.
3782         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3783         handling.
3784         (GetSignatureForError): Print errors in same way.
3785
3786         * class.cs,
3787         * codegen.cs: Reflect attribute GetSignatureForError change.
3788
3789         * ecore.cs,
3790         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3791
3792         * namespace.cs (UsingEntry): Refactored to make fields private.
3793
3794         * assign.cs,
3795         statement.cs: Error_UnexpectedKind has extra parameter.
3796
3797 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3798
3799         * ecore.cs (IAlias): Remove.
3800         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3801         that implement the interface.
3802         * namespace.cs (Namespace): Likewise.
3803         (Namespace.declspaces): Renamed from 'defined_names'.
3804         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3805         DeclSpace instead of an IAlias.
3806         * tree.cs (Tree.AddDecl): Update.
3807
3808 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3809
3810         * statement.cs (Block.Flags); Remove HasVarargs.
3811         (Block.HasVarargs): Move to ToplevelBlock.
3812         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3813         (Block.Variables): Make protected.  Initialize variable hashtable
3814         if necessary.
3815         (Block.AddVariable): Update.
3816         (Block.Resolve): Update to changes.
3817         (ToplevelBlock.HasVarargs): New boolean.
3818         (ToplevelBlock.ThisVariable): Move here from Block.
3819         (ToplevelBlock.AddThisVariable): Likewise.
3820         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3821         * expression.cs (This.ResolveBase): Update to changes.
3822         (ArglistAccess.DoResolve): Likewise.
3823
3824 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3825
3826         Fix #75321
3827         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3828
3829         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3830         not used and not used & assigned.
3831         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3832
3833 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3834
3835         Fix #75053
3836         * expression.cs (Is.DoResolve): null is never provided type.
3837
3838 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3839
3840         Fix #52496
3841         * cs-parser.jay: Less strict event error rule to catch more errors.
3842
3843 2005-07-08  Martin Baulig  <martin@ximian.com>
3844
3845         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3846         gettter (allowed) or setter (not allowed).
3847
3848         * class.cs (Accessor): Implement IIteratorContainer.
3849         (Accessor.Yields): New public field.
3850         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3851         per-accessor basis.
3852
3853         * cs-parser.jay
3854         (get_accessor_declaration, set_accessor_declaration): Set the
3855         `yields' flag on the accessor, not the property.
3856         (property_declaration): Do the iterators check on a per-accessor
3857         basis and not for the whole property.
3858
3859 2005-07-08  Martin Baulig  <martin@ximian.com>
3860
3861         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3862         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3863
3864 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3865
3866         Fix #74975
3867         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3868         (ExtractSecurityPermissionSet): Cope with self referencing security
3869         attributes properly.
3870
3871         * driver.cs (SetOutputFile): Made public property OutputFile.
3872
3873 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3874
3875         Fix #75486.
3876         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3877         has_nonstatic_fields.  Make into a FieldBase pointer.
3878         (TypeContainer.AddField): Add CS0282 check.
3879         (TypeContainer.EmitType): Update.
3880
3881 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3882
3883         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3884         compare if they start with __.
3885
3886 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3887
3888         * statement.cs (Switch.SwitchGoverningType): Only look at
3889         UserCasts that don't need implicit standard conversions to one of
3890         the allowed switch types (Fixes test-322.cs).
3891         (LocalInfo.Resolve): Re-enable sanity-test.
3892
3893 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3894
3895         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3896         
3897         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3898         
3899         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3900
3901 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3902
3903         Fix #75472.
3904         * ecore.cs (SimpleName.GetSignatureForError): Add.
3905         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3906         (MemberAccess.GetSignatureForError): Add.
3907
3908 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3909  
3910         The big error and warning messages review.
3911         
3912         * anonymous.cs,
3913         * assign.cs,
3914         * attribute.cs,
3915         * class.cs,
3916         * codegen.cs,
3917         * convert.cs,
3918         * cs-parser.jay,
3919         * cs-tokenizer.cs,
3920         * decl.cs,
3921         * delegate.cs,
3922         * doc.cs,
3923         * driver.cs,
3924         * ecore.cs,
3925         * enum.cs,
3926         * expression.cs,
3927         * flowanalysis.cs,
3928         * iterators.cs,
3929         * literal.cs,
3930         * location.cs,
3931         * modifiers.cs,
3932         * namespace.cs,
3933         * parameter.cs,
3934         * pending.cs,
3935         * report.cs,
3936         * rootcontext.cs,
3937         * statement.cs,
3938         * support.cs,
3939         * tree.cs,
3940         * typemanager.cs: Updated.
3941         
3942         * class.cs: (MethodCore.SetYields): Moved here to share.
3943         (PropertyMethod.Define): Moved iterator setup here.
3944         
3945         * iterators.cs: Add orig_method to have full access to parent
3946         container.
3947
3948 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3949
3950         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3951         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3952         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3953         variable of struct type.
3954         * expression.cs (Unary.ResolveOperator): Update to change.
3955         (Indirection.VerifyFixed): Likewise.
3956         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3957         (ParameterReference.VerifyFixed): Value parameters are fixed.
3958         (This.VerifyFixed): Treat 'this' as a value parameter.
3959         * statement.cs (LocalInfo.IsFixed): Remove.
3960
3961 2005-07-01  Martin Baulig  <martin@ximian.com>
3962
3963         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3964         `ec.EmitThis ()' to get the correct scope.
3965
3966 2005-07-01  Martin Baulig  <martin@ximian.com>
3967
3968         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3969         instance is a ParameterReference; fixes #75299.
3970
3971 2005-07-01  Martin Baulig  <martin@ximian.com>
3972
3973         Reverted Marek's latest patch (r46725):
3974         - it contains structural changes which are neither mentioned in
3975           the ChangeLog nor explained anywhere; for example the additional
3976           argument of EmitContext's and Iterator's .ctor's and the
3977           TypeContainer.DefineMembers() change.
3978         - structural changes like this should go in in seperate patches
3979           and not be hidden in a huge patch which just seems to affect
3980           warnings and errors.
3981           a big and hard to understand patch.
3982         - it breaks iterators and causes regressions, for instance in
3983           test-iter-03.cs.      
3984
3985 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3986
3987         Fix #75412.
3988         * expression.cs (Indexers.map): Remove.
3989         (Indexers.Append): Filter out inaccessible setters and getters.
3990         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3991
3992         Fix #75283.
3993         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3994         Refactored from ...
3995         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3996         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3997         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3998         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3999
4000 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4001
4002         Fix #75322
4003         * class.cs (FieldBase.GetInitializerExpression): One more field
4004         for backup.
4005
4006 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4007
4008         * pending.cs: Do not define a proxy if the base method is virtual,
4009         it will be picked up by the runtime (bug 75270).
4010
4011 2005-06-08  Martin Baulig  <martin@ximian.com>
4012
4013         The big Iterators rewrite :-)
4014
4015         * iterators.cs: Rewrite this to use the anonymous methods framework.
4016
4017         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4018         before the TypeContainers; see 2test-21.cs.
4019
4020         * class.cs
4021         (TypeContainer.DefineType): Don't create a new EmitContext if we
4022         already have one (this only happens if we're an Iterator).
4023         (TypeContainer.Define): Also call Define() on all our iterators.
4024         (Method.CreateEmitContext): Added support for iterators.
4025
4026         * anonymous.cs
4027         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4028         (AnonymousContainer.CreateMethodHost): Moved here from
4029         AnonymousMethod and made abstract.
4030         (AnonymousContainer.CreateScopeType): New abstract method.
4031         (AnonymousContainer.IsIterator): New public property.
4032         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4033         get the ScopeTypeBuilder rather than manually defining it here. 
4034         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4035         iterators here.
4036
4037         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4038         before RootContext.DefineTypes().
4039
4040         * codegen.cs (EmitContext.RemapToProxy): Removed.
4041         (EmitContext.CurrentAnonymousMethod): Changed type from
4042         AnonymousMethod -> AnonymousContainer.
4043         (EmitContext.ResolveTopBlock): Protect from being called twice.
4044         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4045         (EmitContext.EmitThis): Removed the iterators hacks; use the
4046         anonymous methods framework for that.
4047
4048         * statement.cs
4049         (ToplevelBlock.Container): Make this a property, not a field.
4050         (ToplevelBlock.ReParent): New public method; move the
4051         ToplevelBlock into a new container.
4052         (Foreach.TemporaryVariable): Simplify.
4053
4054 2005-06-05  Martin Baulig  <martin@ximian.com>
4055
4056         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4057         (Block.AddTemporaryVariable): New public method; creates a new
4058         `LocalInfo' for a temporary variable.
4059         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4060         variables here.
4061         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4062         non-iterator variables.
4063
4064 2005-06-05  Martin Baulig  <martin@ximian.com>
4065
4066         * statement.cs (Foreach.TemporaryVariable): Create the
4067         LocalBuilder in the Emit phase and not in Resolve since in some
4068         situations, we don't have an ILGenerator during Resolve; see
4069         2test-19.cs for an example.
4070
4071 2005-06-04  Martin Baulig  <martin@ximian.com>
4072
4073         **** Merged r45395 from GCS ****
4074
4075         The big Foreach rewrite - Part II.
4076
4077         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4078         with `PropertyInfo ienumerator_getcurrent'.
4079
4080         * codegen.cs (VariableStorage): Removed.
4081
4082         * statement.cs
4083         (Foreach): Derive from Statement, not ExceptionStatement.
4084         (Foreach.CollectionForeach): New nested class.  Moved all the code
4085         dealing with collection foreach here.
4086         (Foreach.ForeachHelperMethods): Removed.
4087         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4088
4089 2005-05-23  Martin Baulig  <martin@ximian.com>
4090
4091         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4092         don't need to.  Fix #75014.
4093
4094 2005-05-20  Martin Baulig  <martin@ximian.com>
4095
4096         Merged r44808 from GMCS.
4097
4098         * class.cs (TypeContainer.CircularDepException): Removed.
4099         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4100         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4101         (CS0146) and interface (CS0529) dependencies here.
4102
4103 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4104
4105         * expression.cs (Invocation.EmitCall): Fix initialization
4106         'this_call' to reflect current behaviour.  Fix indentation.
4107
4108         * convert.cs (FindMostEncompassedType): Add two trivial special
4109         cases (number_of_types == 0 || number_of_types == 1).
4110         (FindMostEncompasingType): Likewise.
4111
4112 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4113
4114         Some cleanups preparing for the fix of #75283.
4115         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4116         error testing.
4117         (EventExpr.InstanceResolve): Likewise.
4118         (EventExpr.DoResolve): Remove redundant checks.
4119
4120 2005-06-10  Duncan Mak  <duncan@novell.com>
4121
4122         * cs-tokenizer.cs (process_directives): New flag for controlling
4123         the processing of preprocessor directives.
4124         (x_token): After seeing a '#', return Token.NONE instead of going
4125         to handle_preprocessing_directive() when not processing
4126         directives. This avoids unnecessary processing during the token peek in
4127         is_punct().
4128
4129         This fixes #74939.
4130
4131         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4132         the existing error reporting methods instead of Report.Error.
4133
4134         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4135         after Raja's rewrite.
4136
4137 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4138
4139         * class.cs: Small fix.
4140
4141 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4142
4143         Fix #75160.
4144         * class.cs (GetPartialBases): Fix return value check of
4145         part.GetClassBases.
4146
4147 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4148
4149         Ensure that partial classes are registered in their enclosing
4150         namespace.  Initial part of fix of #75160.
4151         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4152         Register declspace with namespace here, not in
4153         DeclSpace.RecordDecl.
4154         * cs-parser.jay: Pass namespace to RecordDecl.
4155         * class.cs (PartialContainer.Create): Likewise.
4156         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4157         called.
4158         * decl.cs (Declspace.RecordDecl): Remove.
4159         * namespace.cs (NamespaceEntry.DefineName): Remove.
4160
4161 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4162
4163         * rootcontext.cs: Reset TargetExt as well.
4164
4165 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4166
4167         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4168         -langversion:ISO-1.
4169
4170 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4171
4172         Fix #75080, cs0119.cs.
4173         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4174         of ...
4175         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4176         allowing ExprClass.Type and ExprClass.Namespace for
4177         ResolveFlags.VariableOrValue.
4178         (Expression.Resolve) [1-argument variant]: Change default resolve
4179         flags based on language version.
4180         (Expression.Error_UnexpectedKind): Use a simple string array
4181         rather than an ArrayList.
4182         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4183         not ExprClass.Type.
4184         (TypeOfVoid.DoResolve): Likewise.
4185         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4186         flags argument -- it always has the same value.
4187
4188 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4189
4190         Fix #75081.
4191         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4192         Use it in the error message.
4193         * assign.cs, expression.cs, statement.cs: Update.
4194
4195 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4196
4197         Fix #75088.
4198         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4199         the "almostMatchedMember" case too.
4200         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4201         that failed the accessibility checks to 'almost_match'.
4202
4203 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4204
4205         * attribute.cs: Use internal MethodBuilder methods to set
4206         ExactSpelling and SetLastError on PInvoke methods, instead
4207         of passing them via charset.  Fixes #75060.
4208
4209 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4210
4211         * parameter.cs (Parameter): Remove TODO comment.
4212         (Parameter.DefineParameter): Remove Location parameter.
4213         (Parameters.LabelParameters): Likewise.
4214         * class.cs (Constructor.Emit): Update to change.
4215         (MethodData.Emit): Likewise.
4216         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4217         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4218
4219 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4220
4221         * parameter.cs,
4222           Removed Parameters.Location and added Parameter.Location instead.
4223           Removed Location parameter from Emit() and GetSignature().
4224         * anonymous.cs,
4225           class.cs,
4226           cs-parser.jay,
4227           delegate.cs,
4228           iterators.cs,
4229           statement.cs :
4230           Modified all related calls.
4231
4232 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4233
4234         Improve user-defined conversion handling.
4235         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4236         applicable operators.
4237         (AddConversionOperators): New.  Helper for GetConversionOperators.
4238         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4239         there is only one most encompassed/encompassing type.
4240         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4241         "applicable operator" handling.
4242         (UserConversion): Move cache here from GetConversionOperators.
4243         Directly cache the chosen operator, rather than the whole
4244         MethodGroup.
4245         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4246         case.  Allow conversion of decimal to sbyte and byte too.
4247         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4248         New static methods.  Used to avoid allocating EmptyExpressions in
4249         convert.cs.
4250
4251 2005-05-24  Duncan Mak  <duncan@novell.com>
4252
4253         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4254         another class, used in Convert.ExplicitNumericConversion.
4255         (CastToDecimal): New class, similar to above, but casts to
4256         System.Decimal, used in Convert.ImplicitNumericConversion and also
4257         in explicit convesion from double/float to decimal.
4258
4259         * convert.cs (ImplicitNumericConversion): Handle implicit
4260         conversions to System.Decimal.
4261         (ExplicitNumericConversion): handle explicit conversions to
4262         System.Decimal.
4263
4264         This fixes #68711.
4265         
4266 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4267
4268         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4269         know the type at this stage, just break through.   Fixes #75008 
4270
4271 2005-05-19  Martin Baulig  <martin@ximian.com>
4272
4273         * delegate.cs
4274         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4275         to disable error reporting.
4276
4277         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4278         here since we don't want to report an error; see the new test-336.cs.
4279
4280 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4281
4282         * statement.cs (ToplevelBlock.GetParameterReference)
4283         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4284         Move here from class Block.
4285         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4286         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4287
4288 2005-05-18  Martin Baulig  <martin@ximian.com>
4289
4290         Fix #74978.
4291
4292         * flowanalysis.cs
4293         (FlowBranching.Reachability): Add non-static public And() and Or()
4294         methods.
4295         (FlowBranchingSwitch): New class; do the `break_origins' thing
4296         like in FlowBranchingLoop.
4297         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4298         reachability, not just locals and parameters.
4299         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4300         switch; MergeBreakOrigins() now takes care of that.
4301
4302 2005-05-18  Martin Baulig  <martin@ximian.com>
4303
4304         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4305         a loop and may leave it, reset the barrier; fixes #74974.
4306
4307 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4308         
4309         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4310         is back.
4311         
4312         * cs-parser.jay: Catch more lexical errors.
4313         
4314         * report.cs: Add one more Error method.
4315         
4316         * rootcontext.cs,
4317         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4318
4319 2005-05-17  Martin Baulig  <martin@ximian.com>
4320
4321         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4322         #70970. 
4323
4324 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4325
4326         Fix test-382.cs.  Emit values of decimal constants.
4327         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4328         Carved out of ...
4329         (TypeContainer.AddField): ... this.
4330         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4331         with initializers to include 'Const's.
4332         (ClassPart.RegisterFieldForInitialization): Forward to
4333         PartialContainer.
4334         * const.cs (Const.Const): Pass initializer to base class.
4335         (Const.Define): In case of decimal constants, register them for
4336         initialization in a static constructor.
4337
4338 2005-05-14  Martin Baulig  <martin@ximian.com>
4339
4340         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4341         do not call ResolveUnreachable() on unreachable statements in
4342         here, see the comment in the source code.
4343
4344 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4345
4346         Fix #74934.
4347         * expression.cs (BinaryResolveOperator): If one of the operands of
4348         an equality comparison is 'null' and the other is a pointer type,
4349         convert the null to a NullPointer.
4350         * convert.cs (ImplicitReferenceConversion): If the expression is a
4351         NullLiteral and the target type is a pointer type, return a
4352         NullPointer instead.
4353         (ImplicitConversionStandard): Likewise.
4354
4355 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4356         
4357         * cs-parser.jay: Set readonly context based on special constructs.
4358         
4359         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4360         readonly variable error handling.
4361         
4362         * rootcontext.cs (EmitCode): Don't verify members when error
4363         occurred.
4364         
4365         * statement.cs (LocalInfo): Add reaodnly context information.
4366         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4367
4368 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4369
4370         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4371         for #74041 to initialize 'resolved' to false only for explicit
4372         blocks.  Fixes #74873.
4373
4374 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4375
4376         Fix #74920.
4377         * typemanager.cs (unmanaged_enclosing_types): New.
4378         (IsUnmanagedType): Avoid infloops by using
4379         'unmanaged_enclosing_types' to talk with recursive invocations.
4380
4381 2005-05-13  Martin Baulig  <martin@ximian.com>
4382
4383         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4384         instance variable, not a local.  Fix #74873.
4385         (Block.ResolveUnreachable): Set it to true here.
4386
4387 2005-05-11  Duncan Mak  <duncan@novell.com>
4388
4389         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4390         continuing to process for 'arg'.
4391         (handle_preprocessing_directive): Check the argument of the #endif
4392         directive and report error CS1025 if there are any trailing
4393         characters.
4394
4395         According to the C# spec, having even whitespace after the #endif
4396         directive is illegal; however, because we call arg.TrimEnd ()
4397         beforehand, we have the same behavior as csc, allowing whitespace
4398         after the directive.
4399
4400         Fixes #74892.
4401
4402 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4403
4404         Fix #74863.
4405         
4406         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4407         (Constructor.GetObsoleteAttribute): Implemented correctly.
4408
4409 2005-05-10  Martin Baulig  <martin@ximian.com>
4410
4411         * support.cs (ReflectionParameters.ParameterModifier): Use
4412         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4413         and `ParameterAttributes.In'.  Fixes #74884.
4414
4415 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4416
4417         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4418         
4419         * expression.cs (Argument.GetParameterModifier): Turned to property.
4420         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4421         
4422         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4423         its C# equivalent.
4424         
4425 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4426
4427         Fix #74852.
4428         * decl.cs (MemberCache.AddMethods): Register override methods,
4429         rather than non-override methods.
4430         * typemanager.cs (RegisterOverride): New.
4431         (IsOverride): Update.
4432
4433 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4434
4435         Fix #73105.
4436         
4437         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4438         recursive declaration.
4439         
4440         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4441         
4442 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4443
4444         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4445         
4446         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4447
4448 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4449
4450         Fix #74797.
4451         * decl.cs (DeclSpace.FamilyAccessible): 
4452         Use TypeManager.IsNestedFamilyAccessible.
4453
4454         Fix reopened #64812.
4455         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4456         internal'.
4457
4458 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4459             Abin Thomas  <projectmonokochi@rediffmail.com>
4460             Anoob V E  <projectmonokochi@rediffmail.com>
4461             Harilal P R  <projectmonokochi@rediffmail.com>
4462
4463         Fix #64812.
4464         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4465         allow access to all static members.
4466
4467 2005-05-04  Martin Baulig  <martin@ximian.com>
4468
4469         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4470
4471 2005-05-04  Martin Baulig  <martin@ximian.com>
4472
4473         Fix #74655.
4474
4475         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4476         section at the end; make things work if `default' is not the last
4477         section.        
4478
4479 2005-05-04  Martin Baulig  <martin@ximian.com>
4480
4481         Fix #70400.
4482
4483         * statement.cs (Switch): Replaced the `got_default' field with a
4484         `default_section' one.
4485         (Switch.CheckSwitch): Set `default_section' here.
4486         (Switch.Resolve): If we're a constant switch and the constant is
4487         not found, use the default section.
4488
4489 2005-05-03  Martin Baulig  <martin@ximian.com>
4490
4491         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4492
4493         * statement.cs (Foreach.ArrayForeach): New nested class.
4494         (Foreach.TemporaryVariable): New nested class.
4495         (Foreach.EmitArrayForeach): Removed; this is now in the new
4496         ArrayForeach class.
4497
4498 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4499
4500         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4501         more conservative.
4502         (VerifyPendingMethods): Revert change below.
4503
4504         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4505         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4506         that used to trigger warning -28.  Remove warning -28.
4507         * expression.cs (Invocation.OverloadResolve): Use
4508         TypeManager.IsOverride to distinguish override methods.
4509
4510         Fix #74773.
4511         * pending.cs (VerifyPendingMethods): If a base type implements the
4512         requested interface, don't bother checking individual methods of
4513         the base type.  As a side-effect, this prevents the creation of
4514         unnecessary proxies.
4515
4516 2005-05-02  Martin Baulig  <martin@ximian.com>
4517
4518         Fix #70182.
4519
4520         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4521         Also `And' the locals if the old vector is null.
4522         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4523         null; in this case we basically reset all the variables.        
4524
4525 2005-05-02  Martin Baulig  <martin@ximian.com>
4526
4527         Fix #74529.
4528
4529         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4530         Added `FlowBranching branching' argument; always `and' the
4531         variables instead of `or'ing them unless we're an infinite loop.
4532
4533         * statement.cs (While.Resolve): Create a new sibling unless we're
4534         infinite.       
4535
4536 2005-05-02  Martin Baulig  <martin@ximian.com>
4537
4538         Fix #70140.
4539
4540         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4541         arguments; use it instead of creating a new TopLevelBlock.
4542         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4543         our ConstructorInitializer.
4544
4545         * statement.cs
4546         (TopLevelBlock.TopLevelBranching): New public property.
4547         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4548         and create our `TopLevelBranching'.
4549
4550         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4551         anonymous method host, use `block.TopLevelBranching' rather than
4552         creating a new branching.
4553
4554 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4555
4556         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4557         a ScopeInfo, if any of the current children is a child of the new
4558         entry, move those children there.
4559
4560 2005-04-30  Martin Baulig  <martin@ximian.com>
4561
4562         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4563         at the beginning of a SwitchSection.  Fix #73335.
4564
4565 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4566
4567         Fix #74378
4568         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4569         
4570         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4571         (FieldExpr.DoResolve): Obsolete members are ignored for field
4572         initializers.
4573         
4574 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4575
4576         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4577         of arrays detection.
4578
4579         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4580         verification.
4581         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4582
4583         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4584         arrays report.
4585
4586 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4587
4588         * cs-parser.jay: Use the prefered version of -unsafe in error
4589         message.
4590
4591 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4592
4593         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4594         circumstances.
4595
4596 2005-04-20  John Luke  <john.luke@gmail.com>
4597
4598         * driver.cs: fix typo in error message, --outout to --output
4599
4600 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4601
4602         * codegen.cs (InRefOutArgumentResolving): New field.
4603         
4604         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4605         fields outside contructor.
4606         
4607         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4608         
4609 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4610
4611         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4612         parameter code was not completed ever, so it was not as up-to-date
4613         as local variables.  Must finish it.
4614
4615         The bug fix was to compare the Toplevel of the block, not the
4616         current block.  Thanks for Ben for pointing this out. 
4617
4618 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4619
4620         * decl.cs (AddMethods): Use the declaring type of the problem
4621         method to determine if we want to squash a warning.
4622
4623 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4624
4625         * attribute.cs: Removed debug output.
4626
4627         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4628         
4629         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4630         Report.Stderr.
4631         
4632 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4633
4634         Fix #74481.
4635         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4636         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4637         all null comparisons against reference types.
4638
4639 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4640
4641         Fix# 74565
4642         * class.cs (TypeContainer.CircularDepException) New nested
4643         exception class.
4644         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4645         (TypeContainer.DefineType): Removed error, reset InTransit before
4646         exit.
4647         (Class.DefineType): Throw exception when is in Transit.
4648         Catch exception and report error.
4649         (Struct.DefineType): Throw exception when is in Transit.
4650         Catch exception and report error.
4651         (Interface.DefineType): Throw exception when is in Transit.
4652         Catch exception and report error.
4653
4654         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4655         handle nested exception handlers.
4656
4657         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4658         a catch.
4659
4660         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4661         InFinally and InCatch storage.
4662
4663         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4664         (Catch.Resolve): Set and Restore ec.InCatch.
4665         (Try.Resolve): Set and Restore ec.InFinally.
4666         (Try.HasCatch): True when try has catch.
4667
4668 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4669
4670         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4671           for the same event member, so exclude such cases from warning 419.
4672           Fixed bug #74633.
4673
4674 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4675
4676         * expression.cs (Binary.ResolveOperator): Apply patch from John
4677         Luke to fix bug 59864: operators &, | and ^ on enumerations
4678         require that the same enum type on both sides.
4679
4680         * driver.cs: Add warnings to old flag usage, this is to assist
4681         people who produce Makefiles and hope that the Makefiles will be
4682         used on Windows.
4683
4684         * class.cs (TypeContainer.EmitType): Moved the definition of the
4685         special $PRIVATE$ field from the resolve phase to the Emit phase.
4686         During resolve we do not know if we are a struct with
4687         HasExplicitLayout, we know this only after the attributes for the
4688         type are emitted.
4689
4690         Set the FieldOffset to zero on the dummy field that we create for
4691         the class.   Fixes 74590.
4692
4693 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4694
4695         Fix #73834.
4696         * ecore.cs (PropertyExpr.resolved): New.
4697         (DoResolve): Use it to handle a case of double resolution here.
4698         Handle a case of identical-name-and-type-name.
4699         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4700         resolution by storing the results of expression resolution back
4701         into the "probes" array.
4702
4703 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4704
4705         Fix cs0208-7.cs and cs0208-8.cs.
4706         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4707         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4708         error reporting to point out the reason a struct is not unmanaged.
4709
4710 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4711
4712         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4713           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4714
4715 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4716
4717         Fix #74528.
4718         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4719         IdenticalNameAndTypeName here.
4720         (EventExpr.InstanceResolve): Likewise.
4721
4722 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4723
4724         C# 2.0 DefaultCharSetAttribute implementation
4725         
4726         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4727         which allows us to set GlobalNamespace for every resolve.
4728         (Attribute.ResolveArguments): Cut from Resolve.
4729         (Attribute.GetCharSetValue): Returns CharSet named argument.
4730         (Attribute.DefinePInvokeMethod): Gets default charset from
4731         module settings.
4732         (GlobalAttribute.ResolveAsTypeStep): Override.
4733         (GlobalAttribute.ResolveArguments): Override.
4734         
4735         * class.cs (TypeAttr): Is protected.
4736         
4737         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4738         (ModuleClass.DefaultCharSetType): New memeber.
4739         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4740         
4741         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4742         charset from module.
4743         
4744         * delegate.cs (TypeAttr): Override.
4745         (Delegate.DefineType): Use this TypeAttr.
4746         
4747         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4748         at very early stage (before types are defined) to resolve model
4749         module attributes. It will probably not work with corlib but it
4750         should be ok.
4751         
4752         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4753         charset from module.
4754         
4755         * typemanager.cs (default_charset_type): New type.
4756
4757 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4758
4759         * decl.cs (MemberCache.AddMethods): Don't warn if
4760         System.Object.Finalize has buggy MethodAttributes.
4761
4762         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4763         removed below.
4764
4765 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4766
4767         * doc.cs : detect ambiguous reference to overloaded members.
4768           Fixed bug #71603. MS 1.1 csc does not detect it.
4769
4770 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4771
4772         * doc.cs : delegates must not be referenced with parameters.
4773           Fixed bug #71605.
4774
4775 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4776
4777         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4778
4779 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4780
4781         * driver.cs (MainDriver): Stop processing if the CLS stage found
4782         errors. 
4783
4784         (CompilerCallableEntryPoint.InvokeCompiler): Always
4785         reset after execution;   Take a TextWriter argument for the
4786         output.
4787
4788         * report.cs: Use the error stream instead of hardcoding stderr. 
4789
4790 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4791
4792         * class.cs: Reduce code paths to test, too small of an
4793         optimization to make it worth the extra testing.  Always perform
4794         it. 
4795
4796 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4797
4798         Fix #74510.
4799         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4800         operators that had errors reported on them.
4801
4802 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4803
4804         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4805         argument types.
4806         (Attribute.Resolve): Add named argument type checking.
4807         
4808         * class.cs (FixedField.Define): Use IsPrimitiveType
4809         
4810         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4811         
4812         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4813         unsafe parameter types.
4814         
4815         * statement.cs (Using.ResolveExpression): Add better error description.
4816         
4817         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4818         
4819 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4820
4821         Fix #74484.
4822         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4823         AttributeUsageAttribute in the emitcontext of the attribute class,
4824         not in the emitcontext of the attributable entity it was attached to.
4825         * cs-parser.jay: Use 'current_class', not 'current_container',
4826         when creating a GlobalAttribute.
4827
4828 2005-04-08  Alp Toker  <alp@atoker.com>
4829
4830         * pending.cs: The fix to #58413 failed to compile methods implementing
4831         interfaces with/without params modifiers and vice versa, even though
4832         params modifiers aren't part of the signature. Make the modifier check
4833         less strict as in csc.
4834
4835 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4836             Anoob V E  <projectmonokochi@rediffmail.com>
4837             Harilal P R  <projectmonokochi@rediffmail.com>
4838
4839         Fix #58413.
4840         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4841         modifiers of pending methods.
4842         (PendingImplementation.PendingImplementation): Initialize it.
4843         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4844         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4845         with ParameterData.  Add check for modifiers.
4846         * class.cs (MethodData.Define): Update to changes.
4847
4848 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4849
4850         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4851
4852 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4855         property.
4856         
4857         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4858         
4859         * rootcontext.cs,
4860         * typemanager.cs: Registered RequiredAttributeAttribute.
4861         
4862 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4863
4864         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4865         Warning CS0169 is back at level 3.
4866         (IMethodData.SetMemberIsUsed): New method.
4867         
4868         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4869         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4870         
4871         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4872
4873         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4874         contants.
4875         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4876         is used.
4877         
4878         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4879         is used.
4880         
4881         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4882         to avoid the problems with nested types.
4883
4884 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4885             Anoob V.E  <projectmonokochi@rediffmail.com>
4886             Harilal P.R  <projectmonokochi@rediffmail.com>
4887             Raja R Harinath  <rharinath@novell.com>
4888
4889         Fix #73820.
4890         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4891         attribute.
4892         * typemanager (GetConstructor): Make public.
4893
4894 2005-04-05  John Luke  <john.luke@gmail.com>
4895             Raja R Harinath  <rharinath@novell.com>
4896
4897         Fix #62232.
4898         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4899         struct too.  Return false quicker in a few cases.
4900         (VerifyUnManaged): Use it.
4901
4902 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4903
4904         Fix #74041.
4905         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4906         not 'unreachable_seen'.
4907
4908 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4909
4910         * attribute.cs (Attribute.GetValue): Removed unused.
4911         
4912         * codegen.cs (CodeGen.TrimExt): Removed unused.
4913         
4914         * cs-parser.jay (output): Removed unused.
4915         
4916         * cs-tokenizer.cs (hex_digits): Removed unused.
4917         
4918         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4919         
4920         * expression.cs (Indirection.LoadExprValue): Removed unused.
4921         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4922         
4923         * iterators.cs (Iterator.param_types): Removed unused.
4924         
4925         * statement.cs (Goto.block): Removed unused.
4926         (ToplevelBlock.did): Removed unused.
4927         (Switch.ResolveConstantSwitch): Removed unused.
4928
4929 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4930
4931         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4932         resetting thingy.
4933
4934 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4935
4936         Fix #74232 and cs0208-3.cs.
4937         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4938         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4939         unmanaged type.  Don't use FieldBuilders when 't' is a
4940         TypeBuilder.  Use ModFlags and MemberType fields.
4941         * class.cs (MemberBase.member_type): Rename from MemberType.
4942         (MemberBase.MemberType): New property.  Determines member_type on
4943         demand.
4944         (MemberBase.DoDefine): Don't initialize MemberType here.
4945         (FieldMember.Define): Likewise.
4946
4947 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4948
4949         Fix #74241
4950         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4951         Attributes are emitted there.
4952         
4953 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4954
4955         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4956         keyword in 'partial enum' too.
4957         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4958         is not allowed).
4959         Report from Kamil Skalski <nazgul@omega.pl>.
4960
4961         Fix #74309.
4962         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4963         have partial containers too.
4964
4965         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4966         in block' checks to Block.CheckInvariantMeaningInBlock.
4967         * statement.cs (Block.GetKnownVariableInfo): Make private.
4968         (Block.IsVariableUsedInChildBlock): Remove.
4969         (Block.IsVariableUsedInBlock): Likewise.
4970         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4971         conflicting declaration.
4972         (Block.AddVariable): Make error messages less long-winded and more
4973         specific.  Show location of conflicting declaration.
4974         * parameter.cs (Parameters.Location): New readonly property.
4975
4976 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4977
4978         Clean up semantics of invoking ResolveMemberAccess.
4979         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4980         can have an instance, ensure that we pass in a non-TypeExpression
4981         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4982         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4983         argument.  Update to changes and simplify.
4984         (FieldExpr.Emitinstance): Remove CS0120 check.
4985         (PropertyExpr.EmitInstance): Likewise.
4986         * expression.cs (Argument.Resolve): Likewise.
4987         (Invocation.DoResolve): Update to changes in semantics of
4988         InstanceExpression.
4989
4990 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4991
4992         Fix #74241
4993         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4994         customization.
4995         
4996         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4997
4998 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4999
5000         Fix difference in behaviour with commandline invocation.
5001         * driver.cs (Driver.Reset): New.
5002         (CompilerCallableEntryPoint): Call it.
5003
5004         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5005         variable" warnings if the boolean expression failed to resolve.
5006
5007 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5008
5009         * attribute.cs: Fix the union of several permissions when some of them
5010         are unrestricted (so the result isn't an unrestricted permission set).
5011         Fix #74036.
5012
5013 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5014
5015         * ecore.cs (MemberExpr): New class.  Convert from interface
5016         IMemberExpr.
5017         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5018         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5019         error checks.
5020         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5021         (MethodGroupExpr.IsExplicitImpl): Remove.
5022         (Expression.GetFieldFromEvent): Remove.
5023         (SimpleName.MemberStaticCheck): Remove.
5024         (SimpleName.DoSimpleNameResolve): Update to changes.
5025         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5026         (MemberAccess.IdenticalNameAndTypeName): Remove.
5027         (MemberAccess.error176): Move to MemberExpr.
5028         (MemberAccess.DoResolve): Update to changes.
5029         (BaseAccess.DoResolve): Likewise.
5030
5031 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5032
5033         C# 2.0 Conditional attribute class implementation
5034         
5035         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5036         Analyzes class whether it has attribute which has ConditionalAttribute
5037         and its condition is not defined.
5038         
5039         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5040         (Class.IsExcluded): New method. Search for at least one defined
5041         condition in ConditionalAttribute of attribute class.
5042
5043 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5044
5045         * ecore.cs (PropertyExpr): Derive from Expression, not
5046         ExpressionStatement.
5047         (PropertyExpr.EmitStatement): Remove.
5048
5049 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5050
5051         Fix #74060.
5052         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5053         internal field "value__" of an enum be private.  The examples for
5054         "value__" that I found on MSDN all used FieldAttributes.Private.
5055
5056         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5057         Don't mention IL method attribute names.
5058
5059         Fix #47991.  Remove a TODO.
5060         * statement.cs (Block.Toplevel): Make into a field.
5061         (Block.Parameters): Move into ToplevelBlock.
5062         (Block.known_variables): Rename from child_variable_names.
5063         (Block.Block): Remove variants that take Parameters.  Initialize
5064         'Toplevel' with the immediately surrounding toplevel block.
5065         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5066         LocalInfo parameter.
5067         (Block.GetKnownVariableInfo): New.
5068         (Block.IsVariableNameUsedInChildBlock): Update.
5069         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5070         the block, even though it may not be in scope.
5071         (Block.AddVariable): Remove Parameters parameter.  Use
5072         Toplevel.Parameters instead.
5073         (Block.AddConstant): Remove Parameters parameter.
5074         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5075         (Block.IsParamaterReference): Likewise.
5076         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5077         (ToplevelBlock.Parameters): New.  Moved from Block.
5078         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5079         initialize Parameters to a non-null value.
5080         * cs-parser.jay: Update to changes.
5081         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5082         simple names that mean different things in the same block.  Use
5083         Block.IsVariableNameUsedInBlock.
5084
5085 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5086
5087         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5088         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5089         GetTypeHandle.  It is possible for a reflected type to derive from
5090         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5091         System.Array during mscorlib compilation).
5092         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5093         contain a method_hash, don't create one either.  Don't create a
5094         deep copy of the base cache's method_hash.
5095         (MemberCache.SetupCache): Rename back from DeepCopy.
5096         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5097         already initialized.  If we see an override function, add its
5098         underlying base virtual function to the member_hash too.
5099
5100         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5101
5102 2005-03-26  Raja R Harinath  <harinath@acm.org>
5103
5104         Fix #73038.
5105         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5106         fails to resolve, ensure that the LHS is still resolved as an
5107         lvalue.
5108
5109 2005-03-25  Raja R Harinath  <harinath@acm.org>
5110
5111         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5112         ec.ContainerType.
5113         (Enum.current_ec): Remove.
5114         (Enum.LookupEnumValue): Remove EmitContext argument.
5115         Just uses the one created during DefineType.
5116         (Enum.FindMembers): Update.
5117         * expression.cs (MemberAccess.DoResolve): Update.
5118
5119 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5120
5121         * assign.cs (Assign.DoResolve): Check for CS1717 when
5122         source and target are same (uses Equals).
5123
5124         * expression.cs (LocalVariableReference, ParameterReference,
5125         This): Implemented Equals, GetHashCode.
5126
5127         * statement.cs (Block.GetParameterReference): Removed useless
5128         local variable.
5129
5130 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5131
5132         Fix cs0128.cs
5133         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5134         blocks before deciding whether the error is cs0136 or cs0128.
5135
5136         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5137         (using_alias_directive, using_namespace_directive): Pass
5138         MemberName, not an expression to Namespace.UsingAlias and
5139         Namespace.Using.
5140         (MakeName): Use the MemberName of the namespace.
5141         * namespace.cs (Namespace.MemberName): New.
5142         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5143         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5144         Likewise.
5145         * decl.cs (MemberName.Name): Make readonly.
5146         (MemberName.FromDotted): New "constructor".
5147         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5148         (MemberCore.Name): Compute from MemberName on demand.
5149         (MemberCore.SetMemberName): Provide a way to change the
5150         MemberName.
5151         (MemberCore.AddToContainer): Don't take a fullname parameter.
5152         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5153         fully qualified name of the container to the member name.
5154         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5155         only if the type is a member of the root container.
5156         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5157         MemberName.Left rather than searching for an embedded ".".
5158         (PartialContainer.CreatePart): Update to changes in RootContext.
5159         (MemberBase.ShortName): Turn into a property.  Use
5160         MemberCore.SetMemberName.
5161         (MemberBase.ExplicitInterfaceName): Remove.
5162         (MemberBase.UpdateMemberName): Remove.
5163         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5164         (PropertyBase.SetMemberName): New override.
5165         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5166         (Tree.GetDecl): New.
5167         (Tree.AllDecls): Rename from Decls.
5168         * attribute.cs, enum.cs, report.cs: Update to changes.
5169         * driver.cs (MainDriver): Use MemberName.FromDotted on
5170         RootContext.MainClass.
5171
5172 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5173
5174         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5175         checks.
5176
5177         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5178
5179 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5180
5181         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5182         property accessor modifiers.
5183
5184         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5185         fixed buffer attribute (CS1716).
5186         (PropertyMethod.HasCustomAccessModifier): When property accessor
5187         has custom modifier.
5188
5189         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5190         modifiers.
5191         (PropertyExpr.DoResolveLValue): Add CS0272.
5192
5193 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5194
5195         * convert.cs: When converting to a pointer, use the proper Conv.U
5196         or Conv.I depending on the source data type.
5197
5198         * cs-tokenizer.cs: Make the size for large decimal constants,
5199         fixes #72957.
5200
5201 2005-03-17  Martin Baulig  <martin@ximian.com>
5202
5203         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5204         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5205
5206 2005-03-17  Martin Baulig  <martin@ximian.com>
5207
5208         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5209         to bool so we can return an error condition.
5210         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5211         returned an error.
5212
5213 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5214
5215         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5216         attributes.
5217
5218 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5219
5220         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5221         Refactor to avoid traversing the list of assemblies, and to avoid
5222         string concatenation.
5223         * typemanager.cs (guid_attr_type): Remove.
5224         (negative_hits, pointers, references): Remove hashes.
5225         (type_hash): New.
5226         (GetConstructedType): New.  Uses type_hash to handle constructed
5227         types (arrays, references, pointers).
5228         (GetReferenceType, GetPointerType): Use it.
5229         (GetNestedType): New.  Uses type_hash to handle nested types of
5230         reflected types.
5231         (LookupType, LookupTypeDirect): Remove.
5232         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5233         'types' hash and LookupTypeReflection directly.
5234         (params_string, params_object): Use GetConstructedType.
5235         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5236         top-level types.
5237         (Namespace.Lookup): Use cached_types.
5238         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5239         provided by old TypeManager.LookupType.
5240         * rootcontext.cs (MakeFQN): Remove.
5241         * decl.cs (DeclSpace.MakeFQN): Likewise.
5242         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5243         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5244         TypeManager.GetConstructedType.
5245         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5246
5247 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5248
5249         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5250         indexers.
5251
5252         * cs-parser.jay: Reports CS1527 for any namespace element.
5253
5254         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5255         Added CS0407.
5256
5257         * expression.cs (ParameterReference.IsAssigned): Changed error to
5258         CS0269.
5259         (Error_WrongNumArguments): Moved CS0245 detection here.
5260
5261         * statement.cs (Return.Resolve): Add CS1622 report.
5262
5263 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5264
5265         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5266
5267 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5268
5269         * attribute.cs expression.cs: Get rid of some allocations.
5270
5271 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5272
5273         * doc.cs : just eliminate the latest change.
5274
5275 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5276
5277         * doc.cs : commented out the latest change. It breaks xml-030.cs
5278
5279 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5280
5281         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5282           fail. So invoke CreateType() in FindDocumentedType().
5283
5284 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5285
5286         * cs-tokenizer.cs : added IsKeyword().
5287         * doc.cs : Detect keyword incorrectly used as identifier.
5288           Allow identifiers prefixed by @.
5289
5290 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5291
5292         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5293         It caused exception in namespace resolving (again!).
5294         
5295         * class.cs (Class.ctor): Removed exit.
5296         (PropertyMethod.ctor): ditto.
5297         
5298         * codegen.cs (Codegen.Reset): Reset static data.
5299         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5300         
5301         * cs-tokenizer.cs (Cleanup): Removed.
5302         
5303         * driver.cs (GetSystemDir): Rewrote to one line command.
5304         It caused problem with unloaded dynamic modules.
5305         (UnixParseOption): Removed Exit.
5306         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5307         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5308         Now can be mcs used as library.
5309         
5310         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5311         empty location.
5312         
5313         * location.cs (Reset): Reset static data.
5314         
5315         * namespace.cs (Reset): Reset static data.
5316         
5317         * report.cs (Report.Reset): Reset static data.
5318         
5319         * rootcontext.cs (RootContext.Reset): Reset static data.
5320         
5321         * tree.cs (RootTypes.ctor): Use Location.Null
5322         
5323         * typemanager.cs (TypeManager.Reset): Reset static data.
5324         (CoreLookupType): Removed Exit.
5325         (TypeHandle.Reset): Reset static data.
5326         
5327 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5328
5329         Fix #73516.
5330         * typemanager.cs (ComputeNamespaces): Import namespaces from
5331         referenced modules too.
5332
5333 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5334
5335         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5336         than '.'.
5337
5338 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5339
5340         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5341         enclosing DeclSpace.  This ensures that a name-lookup populates
5342         more caches and there are fewer 'TypeExpression's.  Carve out
5343         nested type lookup into ...
5344         (LookupNestedTypeInHierarchy): ... this.
5345
5346 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5347
5348         Clean up a few partial-class semantics.  
5349         Fixes test-357.cs and cs1618-2.cs.
5350         * cs-parser.jay (struct_declaration): Use 'current_class' as
5351         parent of newly-created struct.  Remove call to Register ().
5352         Use 'pop_current_class' to complete handing the current struct.
5353         (interface_declaration): Likewise.
5354         (class_declaration): Likewise.
5355         (enum_declaration): Use 'current_class' as parent of newly created
5356         enum.
5357         (delegate_declaration): Likewise.
5358         (pop_current_class): New function.  This is used to handle closing
5359         up the 'current_class' and 'current_container', and pointing them
5360         to the enclosing class/container.
5361         (CSharpParser): Initialize 'current_class' too.
5362         * decl.cs (MemberCore): Add check for invariant: a partial
5363         container is not a parsed entity, and thus does not enclose any
5364         parsed members.
5365         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5366         (DeclSpace.BaseTypeExpr): Use it.
5367         (DeclSpace.LookupType): Add check for invariant.
5368         * class.cs (TypeContainer): Add check for invariant: a nested
5369         class should have the same NamespaceEntry as its enclosing class.
5370         (TypeContainer.EmitFieldInitializers): Make virtual.
5371         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5372         MemberCore.
5373         (TypeContainer.Register): Remove.
5374         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5375         null.  Use TypeResolveEmitContext for resolving base types and
5376         interfaces.  Move initialization of Parts.TypeBuilder here from
5377         ...
5378         (TypeContainer.DefineNestedTypes): ... here.
5379         (PartialContainer): Take a Namespace not a NamespaceEntry.
5380         (PartialContainer.Create): Don't use Register.  Call the
5381         appropriate Add... function directly.
5382         (ClassPart): Take both the PartialContainer and the enclosing
5383         class as constructor arguments.
5384         (ClassPart.EmitFieldInitializers): Override.
5385         (ClassPart.PartFindNestedTypes): Remove.
5386         (FieldBase.GetInitializerExpression): Resolve the initializer
5387         expression in the emit context of the enclosing class.
5388         * tree.cs (RootTypes): Remove Register ().
5389         
5390 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5391
5392         * cs-parser.jay: Removed CS0134.
5393         
5394         * driver.cs: Removed CS1901.
5395         
5396         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5397         for predefined types.
5398
5399 2005-03-07  Duncan Mak  <duncan@novell.com>
5400
5401         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5402         well. Fixes bug #73454.
5403
5404 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5405
5406         * cs-tokenizer.cs (xtoken): Add CS1035.
5407         
5408         * class.cs (MethodData.Define): Add CS0683.
5409         (FieldMember.ctor): Add CS0681.
5410
5411 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5412
5413         * ecore.cs (SimpleName.DoResolve): Rename from
5414         SimpleName.DoResolveAllowStatic.
5415         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5416         Pass 'intermediate' flag to MemberStaticCheck.
5417         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5418         of "intermediate" lookups via MemberAccess.
5419         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5420         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5421
5422 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5423
5424         Fix #73394.
5425         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5426         slipped in because of variable names that are identical to a
5427         builtin type's BCL equivalent ('string String;', 'int Int32;').
5428         (PropertyExpr.EmitInstance): Likewise.
5429
5430 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5431
5432         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5433         
5434         * report.cs (warning_ignore_table): Made public.
5435
5436 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5437
5438         Fix #73282.
5439         * class.cs (MethodData.Emit): Pass 'container' to
5440         container.GetObsoleteAttribute instead of 'container.Parent'.
5441
5442 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5443
5444         * cs-parser.jay: Add 1534 error test.
5445
5446         * iterators.cs (Yield.CheckContext): Add error 1629.
5447         (Iterator.ctor): Save unsafe modifier.
5448         (MoveNextMethod.DoEmit): Restore unsafe context.
5449
5450         * namespace.cs (UsingAlias): Better error message.
5451
5452 2005-03-03  Dan Winship  <danw@novell.com>
5453
5454         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5455         the warning message [#73219]
5456
5457 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5458
5459         Fix compile with MCS 1.0.0.0.
5460         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5461         w_restore to not depend on string constant folding.
5462
5463 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5464
5465         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5466         CS0246 check to users who passed 'silent = false'.
5467         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5468         check.
5469         (SimpleName.SimpleNameResolve): Update.
5470         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5471         (MemberAccess.IdenticalNameAndTypeName): Update.
5472         * doc.cs (FindDocumentedTypeNonArray): Update.
5473
5474 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5475
5476         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5477         * parameters.cs (ComputeAndDefineParameters): Remove.
5478         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5479         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5480         Use GetParameterInfo.
5481
5482 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5483
5484         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5485
5486 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5487
5488         Unify DeclSpace.LookupType and DeclSpace.FindType.
5489         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5490         is in charge of defining nested types on demand.
5491         (DeclSpace.LookupType): Use it when the current_type is a
5492         TypeBuilder.  Use LookupTypeDirect for reflected types.
5493         (DeclSpace.FindType): Remove.
5494         (DeclSpace.LookupInterfaceOrClass): Likewise.
5495         (DeclSpace.DefineTypeAndParents): Likewise.
5496         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5497         DeclSpace.LookupType.
5498         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5499         * typemanager.cs (LookupType): Simplify.
5500         (AddUserType): Remove type from negative_hits.
5501         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5502         * class.cs (TypeContainer.FindMembers): Move handling of nested
5503         types ...
5504         (TypeContainer.FindMembers_NestedTypes): ... here.
5505         (TypeContainer.FindNestedType): Implement override.
5506         (ClassPart.FindNestedType): Delegate to PartialContainer.
5507         (ClassPart.PartFindNestedType): Looks up the nested types of the
5508         part alone.
5509
5510 2005-03-02  Martin Baulig  <martin@ximian.com>
5511
5512         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5513         static constructor in static classes.
5514
5515 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5516
5517         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5518         sizeParamIndex is not specified.
5519
5520 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5521
5522         Fix #73117
5523         * report.cs (WarningMessage.IsEnabled): Missing null check.
5524
5525 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5526
5527         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5528         in the fields and not in the properties.
5529
5530 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5531
5532         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5533         fields as well.
5534
5535 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5536
5537         * attribute.cs: Small refactoring (improved robustness).
5538         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5539         (ValidateGuid): Removed.
5540         (Resolve): Removed referenced to above mentioned.
5541         (GetAttributeUsage): Made private and changed to work without
5542         class assistance.
5543         (GetIndexerAttributeValue): Don't crash.
5544         (GetConditionalAttributeValue): Ditto.
5545         (GetClsCompliantAttributeValue): Ditto.
5546         (ExtractSecurityPermissionSet): All attributes exceptions are
5547         error 648.
5548         (GetPropertyValue): New helper.
5549         (GetMethodImplOptions): New method.
5550         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5551         some missing properties.
5552         
5553         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5554         (Method.ApplyAttributeBuilder): Updated.
5555         
5556         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5557         exception.
5558
5559 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5560
5561         Fix #73052.
5562         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5563         non-simple types (array, pointer, reference).
5564
5565 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5568
5569         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5570         for operators.
5571         (Method.CheckBase): Catch wrong destructor here.
5572         (MethodData.Define): Add errors 550, 668.
5573
5574         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5575
5576         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5577
5578         * pending.cs (VerifyPendingMethods): Add error 551.
5579
5580         * typemanager.cs (CSharpName): Next error report helper.
5581
5582 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5583
5584         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5585         attributes. Removed useless attribute double check.
5586         It saves almost 2MBs for corlib.
5587
5588 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5589
5590         Fix #72924.
5591         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5592         called twice in case of error.
5593
5594 2005-02-23  Chris Toshok  <toshok@ximian.com>
5595
5596         Fix compiler portions of #72827.
5597         * statement.cs (Block.Emit): call Begin/EndScope on the
5598         EmitContext instead of the ILGenerator.
5599
5600         * codegen.cs (EmitContext.BeginScope): new method, call
5601         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5602         we have one.)
5603         (EmitContext.BeginScope): same, but EndScope and CloseScope
5604
5605         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5606         offset and call the superclass's OpenScope(int) with it.
5607         (SymbolWriter.CloseScope): get the current il
5608         offset and call superclass's CloseScope(int) with it.
5609
5610 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5611
5612         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5613         CS1677 for out and ref as well.
5614
5615         * class.cs (Method.Define): Add error CS1599 detection.
5616         
5617         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5618         
5619         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5620         
5621         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5622         
5623         * support.cs.cs (ModifierDesc): New helper method.
5624
5625 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5626             Abin Thomas  <projectmonokochi@rediffmail.com>
5627             Anoob V E  <projectmonokochi@rediffmail.com>
5628             Harilal P R  <projectmonokochi@rediffmail.com>
5629
5630         Fix #57851, #72718.
5631         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5632         MemberLookup (used for error reporting) actually returns a result.
5633         Fix error report number (122, not 112).
5634
5635 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5636             Anoob V E  <projectmonokochi@rediffmail.com>
5637             Harilal P R  <projectmonokochi@rediffmail.com>
5638
5639         Fix #71134.
5640         * pending.cs (PendingImplementation.GetAbstractMethods):
5641         Find NonPublic members too.
5642
5643 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5644
5645         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5646         Fixed error 217.
5647         
5648         * class.cs (MethodCore.CheckMethodAgainstBase):
5649         Add error 239 report.
5650
5651 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5652
5653         Fix #68955.
5654         * expression.cs (Invocation.IsApplicable): Make public.
5655         (Invocation.IsParamsMethodApplicable): Likewise.
5656         * delegate.cs (Delegate.VerifyApplicability): Don't use
5657         Invocation.VerifyArgumentCompat for parameter applicability
5658         testing.  Use Invocation.IsApplicable and
5659         Invocation.IsParamsMethodApplicable.
5660
5661 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5662
5663         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5664         
5665         * class.cs (Operator.Define): Add error 217 report.
5666         
5667 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5668
5669         * namespace.cs (UsingEntry.Resolve): Undo change below.
5670
5671 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5672
5673         Fix #72756.
5674         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5675         disable the error message when the extended MemberLookup also
5676         fails.
5677         (Expression.MemberLookupFinal): Update.
5678         (SimpleName.DoSimpleNameResolve): Update.
5679         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5680         Don't use MemberLookupFinal.
5681         (New.DoResolve): Update.
5682         (BaseAccess.CommonResolve): Update.
5683
5684 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5685
5686         Fix #72732.
5687         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5688         occured previously, don't resolve again.
5689
5690 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5691
5692         Fix #69949
5693         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5694         argument. Call ResolveAttributeUsage for unresolved.
5695         when types doesn't match ctor arguments.
5696         
5697         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5698         for nested attribute classes.
5699         (Class.attribute_usage): Removed.
5700         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5701         for attribute class.
5702         
5703         * ecore.cs (IsAttribute): Removed.
5704         
5705         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5706         
5707         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5708         now normal types.
5709         (attribute_types): Removed.
5710         (EmitCode): Global attributes are emited as the latest.
5711
5712 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5713
5714         * class.cs (EmitFieldInitializers): Don't emit field initializer
5715         for default values when optimilization is on.
5716         
5717         * constant.cs (Constant.IsDefaultValue): New property.
5718         
5719         * driver.cs: Add /optimize handling.
5720         
5721         * constant.cs,
5722         * ecore.cs,
5723         * literal.cs: Implement new IsDefaultValue property.
5724         
5725         * rootcontext.cs (Optimize): New field, holds /optimize option.
5726
5727 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5728
5729         Fix crasher in re-opened #72347.
5730         * namespace.cs (Namespace.Lookup): Return null if
5731         DeclSpace.DefineType returns null.
5732
5733         Fix #72678.
5734         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5735
5736 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5737
5738         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5739         now returns null if it cannot resolve to an lvalue.
5740         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5741         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5742         returned null.  Remove check for SimpleName.
5743         (EventExpr.DoResolveLValue): New.
5744         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5745         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5746         error from ...
5747         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5748         avoid CS0131 error.
5749         (Unary.ResolveOperator): Move CS0211 check ...
5750         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5751         CS0131 error.
5752         (Unary.DoResolveLValue): Simplify.
5753         (AddressOf.DoResolveLValue): New.
5754         (ArrayAccess.DoResolveLValue): New.
5755
5756 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5757
5758         * attribute.cs (Attribute.Resolve): Add arguments casting for
5759         when types doesn't match ctor arguments.
5760
5761 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5762
5763         Fix parts of #63202.
5764         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5765         lookup of operator in base type.  Ensure that all checks happen
5766         when the operator resolves to an "op_..." method.
5767
5768 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5769
5770         Fix #71992.
5771         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5772         'ignore_cs0104' parameter.  Pass it to ...
5773         (NamespaceEntry.Lookup): ... this.
5774         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5775         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5776         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5777         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5778         Update.  Request that cs0104 errors be ignored.
5779         (ComposedCast.ResolveAsTypeStep): Update.
5780
5781 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5782
5783         Fix #59209.
5784         * expression.cs (Invocation.BetterFunction): Remove support for
5785         comparing virtual functions and their overrides.
5786         (Invocation.IsOverride): New.
5787         (Invocation.OverloadResolve): Don't consider 'override' functions
5788         during candidate selection.  Store them in a lookaside list.
5789         If the selected method is a 'virtual' function, use the list to
5790         find any overrides that are closer to the LHS type.
5791
5792 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5793
5794         * expression.cs (New.DoResolve): Add complex core type reduction.
5795         (New.Constantify): Converts complex core type syntax like 'new int ()'
5796         to simple constant.
5797         
5798 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5799
5800         * decl.cs (EntryType.EntryType): New constructor to create an
5801         updated copy of a cache entry.
5802         (MemberCache.AddMethods): Use it.
5803         (MemberCache.ClearDeclaredOnly): Remove.
5804         (MemberCache.MemberCache): Update.
5805
5806 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5807
5808         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5809         variable.  This one is represents the actual low-level declaration
5810         of the method, as opposed to the semantic level `IsStatic'.   
5811
5812         An anonymous method which is hosted into a static method might be
5813         actually an instance method.  IsStatic would reflect the
5814         container, while MethodIsStatic represents the actual code
5815         generated.
5816
5817         * expression.cs (ParameterReference): Use the new MethodIsStatic
5818         instead of IsStatic.
5819
5820         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5821         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5822         set on the current EmitContext. 
5823
5824         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5825         resolve our casted expression as an LValue.  This triggers the
5826         proper LValue processing that is later required by Assign.
5827
5828         This fixes 72347.
5829
5830         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5831
5832 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5833
5834         C# 2.0 Fixed buffer implementation
5835
5836         * anonymous.cs: Update after RegisterHelperClass renaming.
5837
5838         * attribute.cs (AttributeTester.fixed_buffer_cache):
5839         Cache of external fixed buffers.
5840         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5841         implementation if field is fixed buffer else null.
5842
5843         * class.cs
5844         (TypeContainer.AddField): Accept FieldMember instead of Field.
5845         (FieldBase.IsFieldClsCompliant): Extracted code from
5846         VerifyClsCompliance descendant customization.
5847         (FixedField): New class handles fixed buffer fields.
5848         (FixedFieldExternal): Keeps information about imported fixed
5849         buffer.
5850         (IFixedField): Make access to internal or external fixed buffer
5851         same.
5852
5853         * cs-parser.jay: Add fixed buffer parsing.
5854
5855         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5856         buffer.
5857
5858         * expression.cs (Indirection): Extended implementation to accept
5859         fixed buffer field.
5860         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5861         (ElementAccess.MakePointerAccess): Get type as parameter.
5862         (DoResolve): Add fixed buffer field expression conversion.
5863         (DoResolveLValue): Ditto.
5864         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5865         (ArrayPtr): Derives from FixedBufferPtr.
5866         (ArrayPtr.Emit): Add extra emit for array elements.
5867
5868         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5869
5870         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5871         for compiler generated types.
5872         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5873
5874         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5875         and consume less memory.
5876         (Fixed.Resolve): Add fixed buffer case.
5877
5878         * typemanager.cs (compiler_generated_attr_ctor,
5879         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5880         (HasElementType): Add our own implementation to work on every
5881         runtime.
5882
5883 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5884
5885         * anonymous.cs (CaptureContext): Track whether `this' has been
5886         referenced.   
5887
5888         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5889         only captured `this' if it was implicitly done (instance
5890         methods/variables were used). 
5891
5892         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5893         `this' must be captured.
5894
5895 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5896  
5897         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5898         is null it means that there has been no need to capture anything,
5899         so we just create a sibling.
5900
5901         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5902
5903         Just a partial fix.  The other half is fairly elusive.
5904         
5905 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5906
5907         Fix #52586, cs0121-4.cs.
5908         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5909         and return a hashtable.
5910         (MemberCache.ClearDeclaredOnly): New.
5911         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5912         the method_hash of a base type too.
5913         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5914         type methods.  Overwrite entries with the same MethodHandle so
5915         that the ReflectedType is correct.  The process leaves in base
5916         virtual functions and their overrides as distinct entries.
5917         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5918         matters since it was boxed in a ArrayList before.
5919         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5920         modifier.
5921         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5922         case of a virtual function and its override (choose the overload
5923         as better).
5924         (Invocation.OverloadResolve): Avoid 'override' members during
5925         'applicable_type' calculation.
5926
5927 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5928
5929         Combine two near-redundant caches.
5930         * typemanager.cs (method_params): Rename from method_internal_params.
5931         (TypeManager.GetParameterData): New.  Replace
5932         Invocation.GetParameterData.
5933         (TypeManager.LookupParametersByBuilder): Remove.
5934         * expression.cs (Invocation.method_parameter_cache): Remove.
5935         (Invocation.GetParameterData): Remove.
5936         Update to changes.
5937         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5938         Update to changes.
5939
5940 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5941
5942         Fix #72015.
5943         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5944         TypeManager.multicast_delegate_type is null, resolve it by looking
5945         up "System.MulticastDelegate".
5946         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5947
5948 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5949             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5950             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5951
5952         Fix cs0164.cs.
5953         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5954         (LabeledStatement.AddReference): New.  Set 'referenced'.
5955         (Goto.Resolve): Use it.
5956
5957 2005-02-05  John Luke  <john.luke@gmail.com>
5958
5959         * driver.cs: remove duplicate -doc line in Usage ()
5960
5961 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5962
5963         * location.cs (Location.AddFile): Fix CS2002 error report.
5964
5965 2005-02-02  Martin Baulig  <martin@ximian.com>
5966
5967         * delegate.cs (Delegate.DefineType): Report an internal error if
5968         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5969         details.        
5970
5971 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5972
5973         Fix a crasher in a variant of #31984.
5974         * const.cs (Constant.CheckBase): New override that defers the
5975         new-or-override check in case the base type hasn't been populated
5976         yet.
5977         (Constant.Define): Ensure the new-or-override check is performed.
5978
5979 2005-02-01  Duncan Mak  <duncan@ximian.com>
5980
5981         * const.cs (LookupConstantValue): Check that `ce' is not null
5982         before calling GetValue ().
5983
5984 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5985
5986         Fix test-334.cs (#69519).
5987         * cs-parser.jay (using_alias_directive): Pass in an expression to
5988         NamespaceEntry.UsingAlias.
5989         (using_namespace_directive): Pass in an expression to
5990         NamespaceEntry.Using.
5991         (namespace_name): Don't flatten to a string.
5992         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5993         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5994         ResolveAsTypeStep.
5995         (NamespaceEntry.UsingEntry): Likewise.
5996         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5997         changes.
5998         (NamespaceEntry.LookupForUsing): Remove.
5999         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6000         names.
6001         (NamespaceEntry.Lookup): Remove support for dotted names.
6002
6003 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6004
6005         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6006         split into two.
6007         (NamespaceEntry.ImplicitParent): Compute on demand.
6008         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6009         parallels the current.
6010         (NamespaceEntry.LookupForUsing): Use it.
6011         (NamespaceEntry.Lookup): If the current namespace-entry is
6012         implicit, don't search aliases and using tables.
6013
6014 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6015
6016         Fix #31984.
6017         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6018         BaseCache here.
6019         (TypeContainer.BaseCache): Compute on demand.
6020         (TypeContainer.FindMembers): Define constants and types if they're
6021         not already created.
6022         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6023         check.
6024         * const.cs (Constant.Define): Make idempotent.
6025
6026 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6027
6028         * pending.cs: Produce better code (no nops produced by using Ldarg
6029         + value).
6030         
6031         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6032         i - 1' it should be arg + 1.
6033
6034         Fixes bug #71819.
6035
6036 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6037
6038         * attribute.cs (Attribute.CheckAttributeType): Make private
6039         non-virtual.
6040         (Attribute.ResolveType): Make virtual.
6041         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6042         handling of RootContext.Tree.Types.
6043
6044 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6045
6046         Update attribute-handling to use the SimpleName/MemberAccess
6047         mechanisms.
6048         * cs-parser.jay (attribute): Pass in an expression to the
6049         constructors of Attribute and GlobalAttribute.
6050         * attribute.cs (Attribute): Take an expression for the name.
6051         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6052         passed in attribute name expression.
6053         (Attribute.CheckAttributeType): Use it.
6054         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6055         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6056         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6057         argument to prevent error messages if the lookup fails.
6058
6059 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6060
6061         * expression.cs (Indirection): Implemented IVariable interface
6062         to support indirection in AddressOf operator.
6063         (PointerArithmetic.Emit): Add optimalization for case where
6064         result can be precomputed.
6065
6066 2005-01-26  Martin Baulig  <martin@ximian.com>
6067
6068         * class.cs (TypeContainer.AttributeTargets): Return the correct
6069         AttributeTargets depending on our `Kind' instead of throwing an
6070         exception; fixes #71632.
6071
6072 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6073
6074         Fix #71257
6075         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6076         constant members.
6077
6078 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6079
6080         Fix #71602.
6081         * expression.cs (MemberAccess.DoResolve): Don't complain with
6082         cs0572 when the LHS of a member access has identical name and type
6083         name.
6084
6085 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6086
6087         Fix #71651, #71675
6088         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6089         CreatePermission.
6090         Create custom PermissionSet only for PermissionSetAttribute.
6091
6092 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6093
6094         Fix #71649
6095         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6096         delegates in static class.
6097
6098 2005-01-24  Martin Baulig  <martin@ximian.com>
6099
6100         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6101         merging an implicit block, just use its reachability.
6102
6103         * statement.cs (Block.Resolve): Make the unreachable code check
6104         work wrt. implicit blocks; see test-337 from #63842.
6105
6106 2005-01-21  Alp Toker  <alp@atoker.com>
6107  
6108         * cs-parser.jay: destructor_declaration's container is PartialContainer
6109         not Class when partial types are used, so use Kind prop instead of
6110         'is'.
6111         
6112 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6113
6114         * cs-parser.jay: Improve error reporting when an interface
6115         declares new types.
6116
6117 2005-01-20  Dick Porter  <dick@ximian.com>
6118
6119         * support.cs: SeekableStreamReader fix from Sandor Dobos
6120         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6121         chars are read.  Fixes bug 70369.
6122
6123 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6124
6125         * cs-parser.jay (catch_clause): Simplify current_block handling
6126         somewhat.
6127
6128 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6129
6130         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6131         code with ImplicitStandardConversion to handle the implicit
6132         conversion of method groups into valid delegate invocations. 
6133
6134         The problem is that in parameter handling we were using this code
6135         path.  Fixes bug #64698
6136
6137 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6138
6139         * cs-parser.jay: Fix several infelicities.
6140         - Avoid assigning to the parser value stack.  Code like 
6141           '$3 = null' is unclean.  Synthesize a value for the code block
6142           instead. 
6143         - Avoid using oob_stack for storing location information.  Use ...
6144         (_mark_): ... this.  New (empty) rule.  Saves the current location
6145         in $$.
6146         (foreach_statement): Avoid using oob_stack for current_block
6147         handling.  Use technique used in for_statement and
6148         using_statement.  Synthesize a value for the code block to store
6149         additional intermediate information.
6150
6151 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6152
6153         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6154         of a different type is only allowed to private fields of a
6155         containing type, not on fields of a base class.
6156
6157         See test-174.cs and error cs0122-9.cs
6158
6159 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6160
6161         Fix test-335.cs (bug #58126).
6162         * cs-parser.jay (argument): Split out non-expression parts of the
6163         rule into 'non_simple_argument'.
6164         (invocation_expression): Support parenthesized invocations with
6165         multiple arguments, and with single non-simple arguments.
6166
6167 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6168
6169         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6170         places.
6171
6172 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6173
6174         Fix cs0038-1.cs, cs1640-6.cs.
6175         * ecore.cs (Expression.Resolve): Remove special-case for
6176         SimpleName in error-handling.
6177         (Expression.almostMatchedMembers): Relax access permission to
6178         protected.
6179         (Expression.MemberLookupFailed): Handle duplicates in
6180         almostMatchedMembers list.
6181         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6182         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6183         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6184         overload if the passed in MemberInfo is a MethodBase.
6185
6186 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6187
6188         Fix #70749
6189         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6190         for non-CAS & merge permission sets properly.
6191
6192 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6193
6194         Improve standard-compliance of simple name and member access 
6195         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6196         * ecore.cs (FullNamedExpression): New abstract base class 
6197         for Namespaces and TypeExpressions.
6198         (ResolveFlags.SimpleName): Remove.
6199         (SimpleName): Remove support for dotted names.
6200         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6201         DeclSpace.FindType and DeclSpace.LookupType.
6202         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6203         (Expression.ExprClassName): Make member function.
6204         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6205         a namespace.  Remove creation of dotted "SimpleName"s.
6206         (MemberAccess.DoResolve): Likewise.
6207         * decl.cs (DeclSpace.Cache): Make private.
6208         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6209         (DeclSpace.FindType): Update.
6210         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6211         FullNamedExpression.
6212         * namespace.cs (Namespace): Derive from FullNamedExpression
6213         so that it can be part of expression resolution.
6214         (Namespace.Lookup): Return an FullNamedExpression.
6215         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6216         namespace.
6217         * rootcontext.cs (NamespaceLookup): Remove.
6218         (LookupType): Move to DeclSpace.
6219         * attribute.cs (CheckAttributeType): Update.
6220         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6221         (FindDocumentedTypeNonArray): Likewise.
6222
6223 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6224
6225         Fix cs0509.cs, cs1632.cs.
6226         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6227         is the same as IsInterface.
6228         (TypeContainer.GetClassBases): Likewise.
6229         * statement.cs (LabeledStatement.ig): New field.
6230         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6231         label.
6232         (LabeledStatement.DoEmit): Check that the label was created with
6233         the same ILGenerator.
6234
6235 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6236
6237         Fix #71058
6238         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6239         accessors to its properties.
6240
6241         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6242         from accessors to property.
6243         
6244 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6245
6246         Fix #70722
6247         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6248         only for overrides.
6249         
6250 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6251
6252         * attribute.cs: Check for null and empty strings.  
6253
6254         I have lost another battle to Paolo.
6255
6256 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6257
6258         Fix #70942
6259         * class.cs (PropertyMethod): Set Parent field in ctors.
6260         (SetMethod.InternalParameters): Add unsafe switch hack.
6261         Override MarkForDuplicationCheck where it is appropriate.
6262
6263         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6264         It says whether container allows members with the same name.
6265         Base default is no.
6266         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6267         Removed is_method parameter.
6268
6269 2005-01-06  Duncan Mak  <duncan@ximian.com>
6270
6271         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6272         because the previous change led to incorrect reporting of CS1032
6273         ("Cannot define/undefine preprocessor symbols after first token in
6274         file"). Instead of using `tokens_seen' as the only flag that
6275         triggers CS1040, introduce `comments_seen'. This new flag is used
6276         to signify having seen comments on the current line, so it is
6277         unset after a newline.
6278
6279 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6280
6281         * doc.cs : When searching for a type, find nested type too.
6282           This fixes bug #71040.
6283
6284 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6285
6286         * doc.cs :
6287           - Warn missing member comment on those classes which also does not
6288             have doc comments. Fixed bug #71041.
6289           - Don't warn missing doc comment on default constructor.
6290             Fixed bug #71042.
6291
6292 2005-01-06  Duncan Mak  <duncan@ximian.com>
6293
6294         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6295         comments, set `tokens_seen' to true. This allows us to detect
6296         misplaced preprocessor directives (i.e. not at the beginning of
6297         the a line, nor after whitespaces). In that case, report error
6298         CS1040. This fixes bug #56460.
6299
6300         * cs-parser.jay (interface_member_declaration): Add checks for
6301         IsExplicitImpl, and report CS0541 error if an interface member is
6302         defined as an explicit interface declaration.
6303
6304 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6305
6306         Fix #70817
6307         * class.cs (PropertyMethod): Set Parent field in ctors.
6308         (SetMethod.InternalParameters): Add unsafe switch hack.
6309         
6310         * decl.cs (MemberCore.Parent): Cannot be readonly.
6311
6312 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6313
6314         * decl.cs (DeclSpace.ResolveType): Remove.
6315         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6316         Merge in code from ...
6317         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6318         * class.cs, enum.cs: Update to changes.
6319
6320 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6321
6322         * anonymous.cs: Ensure that we init the scope of our parent if it
6323         has not been initialized yet.
6324
6325 2004-12-30  Duncan Mak  <duncan@ximian.com>
6326
6327         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6328         if field.FieldBuilder is null. Fixes #70758.
6329
6330         * convert.cs: Fixed some typos and updated some of the comments.
6331         (ImplicitStandardConversionExists):
6332         (TryImplicitIntConversion): If `target_type' is an interface and
6333         the type of `ic' implements this interface, return true or a new
6334         BoxedCast instead of null. This fixes #70468.
6335
6336 2004-12-29  Duncan Mak  <duncan@ximian.com>
6337
6338         * expression.cs (Argument.Emit): Check that Expr is
6339         IMemoryLocation before casting to it, and report CS1510 otherwise.
6340
6341         This fixes #70402.
6342
6343 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6344
6345         * statement.cs (Block.ThisVariable): remove the recursion here, to
6346         make the --profile more sane.
6347
6348 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6349
6350         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6351         assembly, by JB Evain.
6352
6353 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6354
6355         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6356           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6357         "parent" refers to enclosing type/class.  "base" refers to superclass.
6358
6359 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6360
6361         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6362         Ensure that we only have GlobalAttributes.
6363         * attribute.cs (Attribute.Emit): Make non-virtual.
6364         (GlobalAttribute.Emit): Remove.
6365         (Attribute.Resolve): Make virtual.
6366         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6367         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6368         the argument. Don't create one.
6369         (Attribute.GetObsoleteAttribute): Likewise.
6370         (Attribute.GetClsCompliantAttributeValue): Likewise.
6371         * class.cs, decl.cs: Update to changes.
6372
6373 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6374
6375         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6376         
6377         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6378         
6379         * statement.cs (Foreach.Resolve): Add error 186 report.
6380
6381 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6382
6383         * expression.cs (Conditional.DoResolve): Add warning 429.
6384         
6385         * statement.cs (If.Resolve): Add warning 665.
6386
6387 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6388
6389         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6390         except when in the parser, and in GlobalAttribute.
6391         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6392         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6393         RootContext.Tree.Types.NamespaceEntry once work is done.
6394         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6395         and resets RootContext.Tree.Types.NamespaceEntry.
6396
6397 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6398
6399         * cs-parser.jay: Don't create a block for every variable.
6400
6401 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6402
6403         * location.cs: Provide extra information.
6404
6405         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6406         variables from the captured environment, it is the ldarg_0.
6407
6408 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6409
6410         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6411         find a conclusion.
6412         
6413         * class.cs: Changed warning level for 169 to avoid developer
6414         displeasure from warning flooding. It will be changed back when they
6415         fix most of current BCL warnings.
6416         
6417         * RootContext.cs: Pushed default WarningLevel to 3.
6418         
6419         * statement.cs: Removed unused variable.
6420
6421 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6424         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6425         Add error 502 report.
6426         (StaticClass.DefineType): Add error 441 report.
6427         (Class.AllowedModifiersProp): New virtual property as temporary
6428         extension to AllowedModifiers.
6429         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6430         to share implementation with StaticClass and don't call virtual
6431         methods from ctor.
6432         
6433         * driver.cs (MainDriver): Add error 1558 test.
6434
6435         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6436         report. Moved error 36 test here.
6437
6438         * statement.cs (Throw.Resolve): Add error 724 report.
6439
6440         * typemanager.cs: Add out_attribute_type core type.
6441         
6442 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6443
6444         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6445         3018 report.
6446         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6447
6448         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6449         3017 report.
6450         
6451         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6452
6453         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6454         Add error 3023 report.
6455         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6456
6457         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6458         implementation.
6459
6460 2004-12-12  John Luke  <john.luke@gmail.com>
6461
6462         * driver.cs (AddArgs): take -- into account when
6463         adding arguments, fixes bug 65710 
6464
6465 2004-12-12  Martin Baulig  <martin@ximian.com>
6466
6467         * expression.cs (Unary.TryReduceNegative): Added support for
6468         SByteConstant and ByteConstant.
6469         (Unary.Reduce): Check error values from TryReduceNegative().
6470
6471 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6472
6473         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6474         and report exception as error 182.
6475
6476 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6477
6478         * driver.cs (Main): Fix message when there are warnings.
6479
6480 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6481
6482         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6483
6484 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6485
6486         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6487         Reduced number of warnings.
6488         
6489         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6490
6491 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6492
6493         * driver.cs: Removed message.
6494
6495         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6496
6497 2004-12-08    <vargaz@freemail.hu>
6498
6499         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6500
6501 2004-12-08  Martin Baulig  <martin@ximian.com>
6502
6503         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6504         instead of a CS3002 for properties and indexer.
6505
6506 2004-12-08  Martin Baulig  <martin@ximian.com>
6507
6508         * decl.cs (MemberName.ToString): Make this work again.
6509
6510 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6511
6512         * attribute.cs (Resolve): Add error 591 detection.
6513
6514         * class.cs (FieldMember.Define): Add error 1547 detection.
6515         (Indexer.Define): Add error 620 detection.
6516         (Operator.Define): Add error 590 detection.
6517
6518         * ecore.cs: Missing argument for error 79.
6519
6520         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6521         detection.
6522
6523 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6524
6525         Fix #70106
6526         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6527         only.
6528
6529 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6530
6531         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6532           Some operator comments were suppressed.
6533         * doc.cs : Implicit/explicit operator name in doc comments are like
6534           "op_Explicit(type)~returnType", so added suffix handling.
6535
6536 2004-12-07  Martin Baulig  <martin@ximian.com>
6537
6538         * decl.cs
6539         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6540         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6541         (DeclSpace.ec): New protected field; store the EmitContext here.
6542         (DeclSpace.EmitContext): New public property; moved here from
6543         `TypeContainer'.
6544         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6545         EmitContext.
6546
6547         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6548         (Enum.Emit): Don't create a new EmitContext.
6549
6550         * delegate.cs (Delegate.DefineType): Always create the
6551         EmitContext.
6552
6553         * iterators.cs (Iterators.DefineIterator): Create a new
6554         EmitContext and store it in `ec'.
6555
6556 2004-08-24  Martin Baulig  <martin@ximian.com>
6557
6558         * typemanager.cs
6559         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6560         this for accessibility checks.
6561         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6562         IsNestedFamilyAccessible.
6563         (TypeManager.IsSubclassOf): New method, do what the name actually
6564         says.   
6565
6566 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6567
6568         Fix crash on cs0657-17.cs.
6569         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6570         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6571         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6572         the case where the NamespaceEntry gets overwritten.
6573
6574 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6575
6576         Fixed #69195, #56821
6577         * ecore.cs (ResolveBoolean): Tiny refactoring.
6578
6579         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6580         of right expression resolving when left is false constant and
6581         operator is LogicalAnd OR true constant and operator is LogicalOr.
6582
6583         * statement.cs (ResolveUnreachable): Always reports warning.
6584
6585 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6586
6587         * class.cs: Distinguish between 1721 and 1722 (just a little help
6588         for the programmer).
6589
6590 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6591
6592         * delegate.cs: Only allow this on new versions of the language. 
6593
6594 2004-12-02  Duncan Mak  <duncan@ximian.com>
6595
6596         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6597         Expression class.
6598         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6599         here as a static method. Take an additional bool out parameter
6600         `must_do_cs1540_check' for signaling to InstanceResolve.
6601         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6602         member field from PropertyExpr class and made it an argument of
6603         the method instead.
6604         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6605         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6606         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6607         and `remove_accessor' as well as InstanceResolve: report CS0122
6608         where applicable.
6609
6610         Fixes #70129.
6611
6612 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6613
6614         Fix test-327.cs, test-328.cs, and put in early infrastructure
6615         for eventually fixing #52697.
6616         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6617         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6618         from other methods.
6619         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6620         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6621         (VerifyUsing, error246): Update.
6622         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6623         'NamespaceEntry.LookupNamespaceOrType'.
6624
6625 2004-12-03  Martin Baulig  <martin@ximian.com>
6626
6627         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6628         method as our child, call AnonymousMethod.Compatible() on it.
6629
6630 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6631
6632         Disable XML documentation support in 'basic' profile.
6633         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6634         Redirect XmlElement to System.Object.
6635         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6636         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6637         * mcs.exe.sources: Add doc-bootstrap.cs.
6638         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6639         of doc.cs.
6640
6641 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6642
6643         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6644           comments are allowed.
6645
6646 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6647
6648         * delegate.cs: Add checks for subtypes in paramaters and return values
6649         in VerifyMethod () to add support for Covariance/Contravariance
6650         in delegates.
6651         
6652 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * report.cs: Remove extra closing parenthesis.
6655
6656         * convert.cs (Error_CannotImplicitConversion): If the name of the
6657         types are the same, provide some extra information.
6658
6659         * class.cs (FieldBase): Use an unused bit field from the field to
6660         encode the `has_offset' property from the FieldMember.  This saves
6661         a couple of Ks on bootstrap compilation.
6662
6663         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6664         method as our child, return the AnonymousMethod resolved
6665         expression.
6666
6667         * expression.cs (New.DoResolve): Allow return values from
6668         NewDelegate to also include AnonymousMethods.
6669
6670         Fixes #70150.
6671
6672 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6673
6674         Fix bug #70102
6675         * attribute.cs (Resolve): Improved implementation of params
6676         attribute arguments.
6677
6678         * support.cs (ParameterData): Add HasParams to be faster.
6679
6680 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6681
6682         all things are for /doc support:
6683
6684         * doc.cs: new file that supports XML documentation generation.
6685         * mcs.exe.sources: added doc.cs.
6686         * driver.cs:
6687           Handle /doc command line option.
6688           Report error 2006 instead of 5 for missing file name for /doc.
6689           Generate XML documentation when required, after type resolution.
6690         * cs-tokenizer.cs:
6691           Added support for picking up documentation (/// and /** ... */),
6692           including a new XmlCommentState enumeration.
6693         * cs-parser.jay:
6694           Added lines to fill Documentation element for field, constant,
6695           property, indexer, method, constructor, destructor, operator, event
6696           and class, struct, interface, delegate, enum.
6697           Added lines to warn incorrect comment.
6698         * rootcontext.cs :
6699           Added Documentation field (passed only when /doc was specified).
6700         * decl.cs:
6701           Added DocComment, DocCommentHeader, GenerateDocComment() and
6702           OnGenerateDocComment() and some supporting private members for
6703           /doc feature to MemberCore.
6704         * class.cs:
6705           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6706         * delegate.cs:
6707           Added overriden DocCommentHeader.
6708         * enum.cs:
6709           Added overriden DocCommentHeader and GenerateDocComment().
6710
6711 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6712
6713         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6714         unwrapping the enumeration values, chain to
6715         DoConstantNumericPromotions again, so we can promote things to the
6716         fundamental types (takes care of enums that are bytes, sbytes).
6717
6718         Fixes bug #62054.
6719
6720 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6721
6722         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6723         Fix long-standing bug in type-lookup.  Use FindType instead of
6724         LookupType when ec.ResolvingTypeTree.
6725         (Attribute.ResolveType, Attribute.Resolve)
6726         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6727         Update to changes.
6728         (Attributes.Search): Remove internal version.  Update.
6729         (Attributes.SearchMulti): Update.
6730         (Attributes.GetClsCompliantAttribute): Remove.
6731         (Attributes.GetIndexerNameAttribute): Remove.
6732         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6733         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6734         * class.cs (Indexer.Define): Likewise.
6735
6736 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6737
6738         Fix bug #68790
6739         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6740         MarshallByReference members access.
6741
6742         * expression.cs: Use CheckMarshallByRefAccess;
6743         Better error CS0197 message.
6744
6745         * report.cs: Print whole related error message.
6746
6747 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6748
6749         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6750         the current directory to help debugging.
6751
6752 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6753
6754         * class (GetClassBases): Better error 60 report.
6755         (EventProperty): Disabled warning 67 detection.
6756
6757 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6758
6759         Fix bug #60324
6760         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6761
6762         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6763         precise values.
6764
6765 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6766
6767         Fix bug #49488
6768         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6769
6770         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6771
6772 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6773
6774         * attribute.cs (Attribute.Resolve): Refine error reporting and
6775         report a cs0117 if the identifier does not exist, to distinguish
6776         from 0617 which is a miss-use of the actual identifier.
6777
6778         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6779         between cs0070 and cs0079.
6780
6781         * class.cs (MemberBase.DoDefine): When reporting a wrong
6782         accessibility level, we use MethodCore to compare instead of
6783         Method (this was a regression in some refactoring effort).
6784
6785         So now we correctly report cs0056 again.
6786
6787         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6788         testing the target_type (which was known to be object_type) and
6789         not the source type (which is anonymous_method).
6790
6791         Fixed reporting of error cs1660.
6792
6793         * expression.cs (UserCast.Source): Expose the underlying cast.
6794
6795         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6796         allowed types to find a match to int32 first (most common).
6797
6798         In addition, it ignores any ImplicitUserConversions that did an
6799         internal implicit conversion (as the switch statement allows only
6800         one integral conversion to exist).
6801
6802         * class.cs (PartialContainer.Create): rename `name' to
6803         `member_name' for clarity.  Then replace the string calls with a
6804         call to MemberName.GetPartialName, as now using
6805         MemberName.ToString is an error (this is due to the side effects
6806         it had, that were fixed in the past).
6807
6808         This will restore the error reporting on a number of partial class
6809         errors that were missusing this (and getting an exception as a
6810         results, which is now just a plain textual warning, because
6811         yyparse debug output would crash otherwise).
6812
6813 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6814
6815         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6816
6817 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6818
6819         * rootcontext.cs (LookupType): Make sure to cache lookups that
6820         don't give us a negative result. This saves about 5% of corlib
6821         compilation time.
6822
6823 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6824
6825         * report.cs (AbstractMessage.Print): messages are sent to stderr
6826
6827         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6828         non-interface in the list of interfaces (at this point, either
6829         parent was properly set, or a base class is being listed in the
6830         interfaces section).
6831
6832         This flags error 1722, and resolves the crash from bug 69259.
6833
6834 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6835
6836         * statement.cs (Using.EmitExpressionFinally): make this work right
6837         for valuetypes. Fixes 69926.
6838
6839 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6840
6841         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6842         converted to an enum" here, before we try to change the underlying
6843         type.  This code exists, but it is a different code path than the
6844         one used while encoding constants.
6845
6846         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6847         old bug: when converting from the null literal to a pointer,
6848         return an EmptyCast, not the NullLiteral.
6849
6850         This fixes #69921, the recent null_type changes probably made this
6851         bug more prominent.
6852
6853         (ImplicitReferenceConversionExists): In addition, resynchronized
6854         the code here, so it matches the same code in
6855         ImplicitReferenceConversionExists for the `from any class-type S
6856         to any interface-type T'.
6857         
6858
6859 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6860
6861         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6862
6863 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6864
6865         * cs-parser.jay: Use verbosity accordingly. 
6866
6867 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6868
6869         * expression.cs (Unary.ResolveOperator): Do not report warning;
6870         AddressOf reads from variable.
6871         
6872         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6873
6874 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6875
6876         Fix bug #69462
6877
6878         * attribute.cs (Attributable): Removed CheckTargets.
6879         (Attributes.Emit): Explicit attribute targets are tested here.
6880
6881         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6882         not enabled for interfaces.
6883
6884         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6885         (GetAssemblyName): Ouch next bug there.
6886
6887 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6888
6889         * expression.cs: Error 275 added.
6890         
6891 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6892
6893         Fix bug #69177 (Implemented decimal constant support)
6894
6895         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6896         (BinaryFold): Add DecimalConstant.
6897
6898         * const.cs (Define): Decimal constant 
6899         (is not constant.
6900         (ChangeType): Add decimal type handling.
6901         (LookupConstantValue): Don't set value for decimal type but
6902         emit DecimalConstantAttribute. Needed for constant optimization.
6903
6904         * constant.cs (ToDecimal): New method.
6905         (ConvertToDecimal): New method.
6906         (IntConstant): Implemented ConvertToDecimal.
6907         (DecimalConstant.Emit): Emit optimized version for decimals in
6908         int range.
6909
6910         * expression.cs (ResolveOperator): Changed order of constant
6911         reduction to work correctly with native types which have
6912         overloaded operators.
6913         (ResolveMemberAccess): Extract constant value from attribute
6914         for decimal type.
6915
6916         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6917
6918         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6919         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6920         (ChangeType): Decimal is special.
6921         (TypeToCoreType): Add decimal type.
6922
6923 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6924
6925         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6926         decimal types.
6927
6928 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6929
6930         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6931         test cs1667-5.cs.
6932
6933 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6934
6935         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6936
6937         * pending.cs (PendingImplementation): Grab only interfaces.
6938
6939 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6940
6941         * statement.cs (ForeachHelperMethods): Add location member and
6942         error 202 detection.
6943
6944 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6945
6946         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6947         automatically handled by executable.make.
6948         (PROGRAM): Make profile-specific.
6949
6950 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6951
6952         * expression.cs (DoResolveBase): Fixed wrong warning for out
6953         variables.
6954
6955 2004-11-18  Martin Baulig  <martin@ximian.com>
6956
6957         Merged latest changes into gmcs.  Please keep this comment in
6958         here, it makes it easier for me to see what changed in MCS since
6959         the last time I merged.
6960
6961 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6962
6963         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6964         (TypeHandle.GetMemberCache): New.
6965         (TypeHandle.TypeHandle): Update.
6966         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6967         (TypeManager.LookupParentInterfacesCache):
6968         Rename from LookupInterfaceCache.  Optimize slightly.
6969         (TypeManager.MemberLookup_FindMembers): Update.
6970         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6971         multi-type variant.
6972         (AddCacheContents): Rename from AddHashtable.
6973         * class.cs (TypeContainer.parent_container): Remove.
6974         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6975         (TypeContainer.DoDefineMembers): Don't initialize it.
6976         Update to name changes.
6977         
6978 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6979
6980         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6981         that factors the code to check access modifiers on override.  
6982
6983         (PropertyBase): Use the code here.
6984
6985         Patch from Lluis S'anchez, fixes bug #69361.
6986
6987 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6988
6989         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6990         routine that is used to report the use of a captured variable
6991         whose address has been taken.
6992
6993         There are two checks: one when variables are being captured and
6994         the other check is when the address of a variable is taken. 
6995         
6996         (because an anonymous methods might be resolved before *or* after
6997         the address has been taken) and 
6998
6999         * expression.cs (Conditional.DoResolve): Remove the special
7000         casing that Martin added to trueExpr and falseExpr being both
7001         NullLiteral.  We get the right behavior now just by introducing
7002         the null_type into the compiler. 
7003
7004         * convert.cs (ExplicitConversion): Change the code to use
7005         null_type instead of testing `expr is NullLiteral'.
7006         (ImplicitConversionStandard): use null_type too.
7007         (ImplicitReferenceConversionExists): use null_type too.
7008         (ImplicitReferenceConversion): use null_type too.
7009
7010         * literal.cs: The type of `NullLiteral' is now null_type instead
7011         of object_type. 
7012         (Resolve): Set the type here.
7013
7014         * typemanager.cs: Introduce null_type.
7015
7016 2004-11-17  Martin Baulig  <martin@ximian.com>
7017
7018         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7019         direction, like FindMembers() does.  Fixes #69546, testcase is in
7020         test-315.cs.    
7021
7022 2004-11-16  Martin Baulig  <martin@ximian.com>
7023
7024         This is based on a patch from Marek Safar, see bug #69082.
7025         Fixes bugs #63705 and #67130.
7026
7027         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7028         method; create a MemberCache for an interface type and cache the
7029         result.
7030
7031         * decl.cs (IMemberContainer.ParentContainer): Removed.
7032         (IMemberContainer.ParentCache): New property.
7033         (MemberCache.SetupCacheForInterface): Removed.
7034         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7035         to create a cache for an interface's "parent".
7036
7037         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7038         interfaces too.
7039
7040 2004-11-16  Martin Baulig  <martin@ximian.com>
7041
7042         Merged back from gmcs; these changes already went into gmcs a
7043         couple of weeks ago.
7044
7045         * typemanager.cs
7046         (TypeManager.AddUserType): Removed the `ifaces' argument.
7047         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7048         `TypeExpr []'.
7049         (TypeManager.AddUserInterface): Removed.
7050         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7051         `TypeExpr []'.
7052         (TypeManager.GetInterfaces): Likewise.
7053         (TypeManager.GetExplicitInterfaces): Likewise.
7054
7055         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7056
7057         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7058         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7059
7060 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7061
7062         * statement.cs: Avoid adding bools to a hashtable.
7063
7064 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7065
7066         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7067         calling an unsafe method from a safe location.
7068
7069 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7070
7071         Fix #69167
7072         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7073
7074 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7075
7076         * namespace.cs (VerifyUsing): use GetPartialName instead of
7077         ToString. 
7078
7079 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7080
7081         * statement.cs (Return.Resolve): Fix regression in typo: if
7082         `in_exc', we have to request a NeedReturnLabel, this was a typo
7083         introduced in the anonymous method check-in.  Fixes #69131.
7084
7085         * Indexers were using the ShortName when defining themselves,
7086         causing a regression in the compiler bootstrap when applying the
7087         patch from 2004-11-02 (first part), now they use their full name
7088         and the bug is gone.
7089
7090 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7091
7092         * driver.cs: Strip the path from the names of embedded resources. Fixes
7093         #68519.
7094
7095 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7096
7097         Fix error message regression: cs0104-2.cs.
7098         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7099         (AliasEntry.Resolve): Update.
7100         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7101         'silent' flag.
7102         (RootContext.LookupType): Update.
7103
7104 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7105
7106         * cs-parser.jay: Add support for handling accessor modifiers
7107         * class: Add support port accessor modifiers and error checking,
7108         define PropertyMethod.Define as virtual (not abstract anymore)
7109         * ecore.cs: Add checking for proeprties access with access modifiers
7110         * iterators.cs: Modify Accessor constructor call based in the modified
7111         constructor
7112 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7113
7114         * expression.cs (StringConcat): Handle being called twice,
7115         as when we have a concat in a field init with more than two
7116         ctors in the class
7117
7118 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7119
7120         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7121         special case explicit implementations, we should always produce
7122         the .property or .event declaration.
7123         
7124         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7125         since it will not return correct data if people use this
7126         unresolved in the presence of using statements (see test-313).
7127
7128         * class.cs (MethodData.Define): If we are an explicit interface
7129         implementation, set the method name to the full name of the
7130         interface plus the name of the method.  
7131
7132         Notice that using the method.MethodName.GetFullName() does not
7133         work, as it will only contain the name as declared on the source
7134         file (it can be a shorthand in the presence of using statements)
7135         and not the fully qualifed type name, for example:
7136
7137         using System;
7138
7139         class D : ICloneable {
7140                 object ICloneable.Clone ()  {
7141                 }
7142         }
7143
7144         Would produce a method called `ICloneable.Clone' instead of
7145         `System.ICloneable.Clone'.
7146
7147         * namespace.cs (Alias.Resolve): Use GetPartialName.
7148         
7149 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7150
7151         * cs-parser.jay: Add error 1055 report.
7152
7153 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7154
7155         * assign.cs (Assign.DoResolve): Only do the transform of
7156         assignment into a New if the types are compatible, if not, fall
7157         through and let the implicit code deal with the errors and with
7158         the necessary conversions. 
7159
7160 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7161
7162         * cs-parser.jay: Add error 1031 report.
7163
7164         * cs-tokenizer.cs: Add location for error 1038.
7165
7166 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7167
7168         * cs-parser.jay: Add error 1016 report.
7169
7170 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7171
7172         * cs-parser.jay: Add errors 1575,1611 report.
7173
7174 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7175
7176         * cs-parser.jay: Add error 1001 report.
7177
7178 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7179
7180         Fix #68850
7181         * attribute.cs (GetMarshal): Add method argument for
7182         caller identification.
7183
7184         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7185         agument for GetMarshal and RuntimeMissingSupport.
7186
7187 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7188
7189         * attribute.cs (ExtractSecurityPermissionSet): Removed
7190         TypeManager.code_access_permission_type.
7191
7192         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7193
7194 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7195
7196         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7197         for obsolete use of a variable here.   Fixes regression on errors
7198         cs0619-25 and cs0619-26.
7199
7200 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7201
7202         Fix #62358, implemented security attribute encoding.
7203
7204         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7205         Tests permitted SecurityAction for assembly or other types.
7206         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7207         data from SecurityPermissionAttribute to PermisionSet class.
7208
7209         * class.cs (ApplyAttributeBuilder): Added special handling
7210         for System.Security.Permissions.SecurityAttribute based types.
7211
7212         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7213         special handling for System.Security.Permissions.SecurityAttribute
7214         based types.
7215
7216         * enum.cs (ApplyAttributeBuilder): Added special handling
7217         for System.Security.Permissions.SecurityAttribute based types.
7218
7219         * parameter.cs (ApplyAttributeBuilder): Added special handling
7220         for System.Security.Permissions.SecurityAttribute based types.
7221
7222         * rootcontext.cs: Next 2 core types.
7223
7224         * typemanager.cs (TypeManager.security_permission_attr_type):
7225         Built in type for the SecurityPermission Attribute.
7226         (code_access_permission_type): Build in type.
7227
7228 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7229
7230         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7231         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7232         all of this information into
7233         EmitContext.EmitCapturedVariableInstance.
7234         
7235         * codegen.cs (EmitCapturedVariableInstance): move here the
7236         funcionality of emitting an ldarg.0 in the presence of a
7237         remapping.   This centralizes the instance emit code.
7238
7239         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7240         then emit a load of this: it means that we have reached the
7241         topmost ScopeInfo: the one that contains the pointer to the
7242         instance of the class hosting the anonymous method.
7243
7244         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7245         captures to the topmost CaptureContext.
7246
7247 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7248
7249         * expression.cs (LocalVariableReference): Move the knowledge about
7250         the iterators into codegen's EmitCapturedVariableInstance.
7251
7252 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7253
7254         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7255         all code paths return a value from an anonymous method (it is the
7256         same as the 161 error, but for anonymous methods).
7257
7258 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7259
7260         The introduction of anonymous methods in the compiler changed
7261         various ways of doing things in the compiler.  The most
7262         significant one is the hard split between the resolution phase
7263         and the emission phases of the compiler.
7264
7265         For instance, routines that referenced local variables no
7266         longer can safely create temporary variables during the
7267         resolution phase: they must do so from the emission phase,
7268         since the variable might have been "captured", hence access to
7269         it can not be done with the local-variable operations from the runtime.
7270         
7271         * statement.cs 
7272
7273         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7274         is a toplevel block.
7275
7276         (ToplevelBlock): A new kind of Block, these are the blocks that
7277         are created by the parser for all toplevel method bodies.  These
7278         include methods, accessors and anonymous methods.
7279
7280         These contain some extra information not found in regular blocks:
7281         A pointer to an optional CaptureContext (for tracking captured
7282         local variables and parameters).  A pointer to the parent
7283         ToplevelBlock.
7284         
7285         (Return.Resolve): Catch missmatches when returning a value from an
7286         anonymous method (error 1662).
7287         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7288         phase.
7289
7290         (Break.Resolve): ditto.
7291
7292         (SwitchLabel): instead of defining the labels during the
7293         resolution phase, we now turned the public ILLabel and ILLabelCode
7294         labels into methods called GetILLabelCode() and GetILLabel() that
7295         only define the label during the Emit phase.
7296
7297         (GotoCase): Track the SwitchLabel instead of the computed label
7298         (its contained therein).  Emit the code by using
7299         SwitchLabel.GetILLabelCode ().
7300
7301         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7302         whether the Local has been captured or not.
7303
7304         (LocalInfo.IsCaptured): New property, used to tell whether the
7305         local has been captured.
7306         
7307         * anonymous.cs: Vastly updated to contain the anonymous method
7308         support.
7309
7310         The main classes here are: CaptureContext which tracks any
7311         captured information for a toplevel block and ScopeInfo used to
7312         track the activation frames for various local variables.   
7313
7314         Each toplevel block has an optional capture context associated
7315         with it.  When a method contains an anonymous method both the
7316         toplevel method and the anonymous method will create a capture
7317         context.   When variables or parameters are captured, they are
7318         recorded on the CaptureContext that owns them, for example:
7319
7320         void Demo () {
7321              int a;
7322              MyDelegate d = delegate {
7323                  a = 1;
7324              }
7325         }
7326
7327         Here `a' will be recorded as captured on the toplevel
7328         CapturedContext, the inner captured context will not have anything
7329         (it will only have data if local variables or parameters from it
7330         are captured in a nested anonymous method.
7331
7332         The ScopeInfo is used to track the activation frames for local
7333         variables, for example:
7334
7335         for (int i = 0; i < 10; i++)
7336                 for (int j = 0; j < 10; j++){
7337                    MyDelegate d = delegate {
7338                         call (i, j);
7339                    }
7340                 }
7341
7342         At runtime this captures a single captured variable `i', but it
7343         captures 10 different versions of the variable `j'.  The variable
7344         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7345         recorded on a child.  
7346
7347         The toplevel ScopeInfo will also track information like the `this'
7348         pointer if instance variables were referenced (this is necessary
7349         as the anonymous method lives inside a nested class in the host
7350         type of the method). 
7351
7352         (AnonymousMethod): Expanded to track the Toplevel, implement
7353         `AnonymousMethod.Compatible' to tell whether an anonymous method
7354         can be converted to a target delegate type. 
7355
7356         The routine now also produces the anonymous method content
7357
7358         (AnonymousDelegate): A helper class that derives from
7359         DelegateCreation, this is used to generate the code necessary to
7360         produce the delegate for the anonymous method that was created. 
7361
7362         * assign.cs: API adjustments for new changes in
7363         Convert.ImplicitStandardConversionExists.
7364
7365         * class.cs: Adjustments to cope with the fact that now toplevel
7366         blocks are of type `ToplevelBlock'. 
7367
7368         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7369         insteda of standard blocks.
7370
7371         Flag errors if params arguments are passed to anonymous methods.
7372
7373         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7374         `CurrentAnonymousMethod' which points to the current Anonymous
7375         Method.  The variable points to the AnonymousMethod class that
7376         holds the code being compiled.  It is set in the new EmitContext
7377         created for the anonymous method.
7378
7379         (EmitContext.Phase): Introduce a variable and an enumeration to
7380         assist in enforcing some rules about when and where we are allowed
7381         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7382         only one that enfonces this right now).
7383
7384         (EmitContext.HaveCaptureInfo): new helper method that returns
7385         whether we have a CapturedContext initialized.
7386
7387         (EmitContext.CaptureVariable): New method used to register that a
7388         LocalInfo must be flagged for capturing. 
7389
7390         (EmitContext.CapturedParameter): New method used to register that a
7391         parameters must be flagged for capturing. 
7392         
7393         (EmitContext.CapturedField): New method used to register that a
7394         field must be flagged for capturing. 
7395
7396         (EmitContext.HaveCapturedVariables,
7397         EmitContext.HaveCapturedFields): Return whether there are captured
7398         variables or fields. 
7399
7400         (EmitContext.EmitMethodHostInstance): This is used to emit the
7401         instance for the anonymous method.  The instance might be null
7402         (static methods), this (for anonymous methods that capture nothing
7403         and happen to live side-by-side with the current method body) or a
7404         more complicated expression if the method has a CaptureContext.
7405
7406         (EmitContext.EmitTopBlock): Routine that drives the emission of
7407         code: it will first resolve the top block, then emit any metadata
7408         and then emit the code.  The split is done so that we can extract
7409         any anonymous methods and flag any captured variables/parameters.
7410         
7411         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7412         during this phase, the ILGenerator should not be used as labels
7413         and local variables declared here might not be accessible to any
7414         code that is part of an anonymous method.  
7415
7416         Exceptions to this include the temporary variables that are
7417         created by some statements internally for holding temporary
7418         variables. 
7419         
7420         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7421         metadata for a cb
7422
7423         (EmitContext.TemporaryReturn): This method is typically called
7424         from the Emit phase, and its the only place where we allow the
7425         ReturnLabel to be defined other than the EmitMeta.  The reason is
7426         that otherwise we would have to duplicate a lot of logic in the
7427         Resolve phases of various methods that today is on the Emit
7428         phase. 
7429
7430         (EmitContext.NeedReturnLabel): This no longer creates the label,
7431         as the ILGenerator is not valid during the resolve phase.
7432
7433         (EmitContext.EmitThis): Extended the knowledge in this class to
7434         work in anonymous methods in addition to iterators. 
7435
7436         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7437         code is necessary on the stack to access the instance to a local
7438         variable (the variable will be accessed as a field).
7439
7440         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7441         EmitContext.EmitAddressOfParameter): Routines to support
7442         parameters (not completed at this point). 
7443         
7444         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7445         will also remove the parameters.
7446
7447         * convert.cs (Convert): Define a `ConstantEC' which points to a
7448         null.  This is just to prefity some code that uses
7449         ImplicitStandardConversion code and do not have an EmitContext
7450         handy.
7451
7452         The idea is to flag explicitly that at that point in time, it is
7453         known that the conversion will not trigger the delegate checking
7454         code in implicit conversions (which requires a valid
7455         EmitContext). 
7456
7457         Everywhere: pass new EmitContext parameter since
7458         ImplicitStandardConversionExists now requires it to check for
7459         anonymous method conversions. 
7460
7461         (Convert.ImplicitStandardConversionExists): If the type of an
7462         expression is the anonymous_method_type, and the type is a
7463         delegate, we invoke the AnonymousMethod.Compatible method to check
7464         whether an implicit conversion is possible. 
7465
7466         (Convert.ImplicitConversionStandard): Only do implicit method
7467         group conversions if the language level is not ISO_1.
7468
7469         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7470         MethodInfo for the Invoke method.  used by Delegate and
7471         AnonymousDelegate.
7472
7473         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7474         method conversions if the target type is a delegate.
7475
7476         Removed extra debugging nops.
7477
7478         (LocalVariableReference): Turn the `local_info' into a public
7479         field. 
7480
7481         Add `prepared' field, the same hack used for FieldExprs to cope
7482         with composed assignments, as Local variables do not necessarily
7483         operate purely on the stack as they used to: they can be captured
7484         fields. 
7485
7486         Add `temp' for a temporary result, like fields.
7487
7488         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7489
7490         It now copes with Local variables that are captured and emits the
7491         proper instance variable to load it from a field in the captured
7492         case. 
7493
7494         (ParameterReference.DoResolveBase): During the resolve phase,
7495         capture parameters if we are in an anonymous method.
7496
7497         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7498         anonymous method, use the EmitContext helper routines to emit the
7499         parameter reference.
7500
7501         * iterators.cs: Set RemapToProxy to true/false during the
7502         EmitDispose class.
7503
7504         * parameters.cs (GetParameterByName): New helper method. 
7505
7506         * typemanager.cs (anonymous_method_type) a new type that
7507         represents an anonyous method.  This is always an internal type,
7508         used as a fencepost to test against the anonymous-methodness of an
7509         expression. 
7510         
7511 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7512
7513         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7514         561 report.
7515         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7516
7517 2004-10-18  Martin Baulig  <martin@ximian.com>
7518
7519         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7520         `Type' directly, but call ResolveType() on it.
7521         (Catch.Resolve): Likewise.
7522         (Foreach.Resolve): Likewise.
7523
7524 2004-10-18  Martin Baulig  <martin@ximian.com>
7525
7526         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7527         `Type' directly, but call ResolveType() on it.
7528         (Probe.DoResolve): Likewise.
7529         (ArrayCreation.LookupType): Likewise.
7530         (TypeOf.DoResolve): Likewise.
7531         (SizeOf.DoResolve): Likewise.
7532
7533 2004-10-18  Martin Baulig  <martin@ximian.com>
7534
7535         * expression.cs (Invocation.BetterFunction): Put back
7536         TypeManager.TypeToCoreType().
7537
7538 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7539
7540         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7541         the ResolveType.
7542
7543 2004-10-18  Martin Baulig  <martin@ximian.com>
7544
7545         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7546         `Type' directly, but call ResolveType() on it.
7547
7548 2004-10-18  Martin Baulig  <martin@ximian.com>
7549
7550         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7551         `Type' directly, but call ResolveType() on it.
7552         (MemberBase.DoDefine): Likewise.
7553
7554         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7555         `Type' directly, but call ResolveType() on it.
7556         (ComposedCast.DoResolveAsTypeStep): Likewise.
7557
7558         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7559         `Type' directly, but call ResolveType() on it.
7560
7561 2004-10-17  John Luke  <john.luke@gmail.com>
7562
7563         * class.cs (Operator.GetSignatureForError): use CSharpName
7564
7565         * parameter.cs (Parameter.GetSignatureForError): Returns
7566         correct name even if was not defined.
7567
7568 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7569
7570         Fix #65816.
7571         * class.cs (TypeContainer.EmitContext): New property.
7572         (DefineNestedTypes): Create an emitcontext for each part.
7573         (MethodCore.DoDefineParameters): Use container's emitcontext.
7574         Pass type array to InternalParameters.
7575         (MemberBase.DoDefine): Use container's emitcontext.
7576         (FieldMember.Define): Likewise.
7577         (Event.Define): Likewise.
7578         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7579         Pass type array to InternalParameters.
7580         (SetIndexerMethod.GetParameterInfo): Likewise.
7581         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7582         * delegate.cs (Define): Pass emitcontext to
7583         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7584         array to InternalParameters.
7585         * expression.cs (ParameterReference.DoResolveBase): Pass
7586         emitcontext to GetParameterInfo.
7587         (ComposedCast.DoResolveAsTypeStep): Remove check on
7588         ec.ResolvingTypeTree.
7589         * parameter.cs (Parameter.Resolve): Change argument to
7590         EmitContext.  Use ResolveAsTypeTerminal.
7591         (Parameter.GetSignature): Change argument to EmitContext.
7592         (Parameters.ComputeSignature): Likewise.
7593         (Parameters.ComputeParameterTypes): Likewise.
7594         (Parameters.GetParameterInfo): Likewise.
7595         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7596         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7597         * support.cs (InternalParameters..ctor): Remove variant that takes
7598         a DeclSpace.
7599         * typemanager.cs (system_intptr_expr): New.
7600         (InitExpressionTypes): Initialize it.
7601
7602 2004-10-12  Chris Toshok  <toshok@ximian.com>
7603
7604         * cs-parser.jay: fix location for try_statement and catch_clause.
7605
7606 2004-10-11  Martin Baulig  <martin@ximian.com>
7607
7608         * report.cs: Don't make --fatal abort on warnings, we have
7609         -warnaserror for that.
7610
7611 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7612
7613         More DeclSpace.ResolveType avoidance.
7614         * decl.cs (MemberCore.InUnsafe): New property.
7615         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7616         with newly created EmitContext.
7617         (FieldMember.Define): Likewise.
7618         * delegate.cs (Delegate.Define): Likewise.
7619         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7620         only if normal name-lookup fails.
7621         (TypeExpr.DoResolve): Enable error-checking.
7622         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7623         (SizeOf.DoResolve): Likewise.
7624         (ComposedCast.DoResolveAsTypeStep): Likewise.
7625         (StackAlloc.DoResolve): Likewise.
7626         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7627         (Block.Unsafe): New property.
7628         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7629         (Unsafe): Set 'unsafe' flag of contained block.
7630         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7631         (Fixed.Resolve): Likewise.
7632         (Catch.Resolve): Likewise.
7633         (Using.ResolveLocalVariableDecls): Likewise.
7634         (Foreach.Resolve): Likewise.
7635
7636 2004-10-05  John Luke <john.luke@gmail.com>
7637
7638         * cs-parser.jay: add location to error CS0175
7639
7640 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7641
7642         * ecore.cs (Expression.Constantity): Add support for turning null
7643         into a constant.
7644
7645         * const.cs (Const.Define): Allow constants to be reference types
7646         as long as the value is Null.
7647
7648 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7649
7650         * namespace.cs (NamespaceEntry.Using): No matter which warning
7651         level is set, check if this namespace name has already been added.
7652
7653 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7654
7655         * expression.cs: reftype [!=]= null should always use br[true,false].
7656         # 67410
7657
7658 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7659
7660         Fix #67108
7661         * attribute.cs: Enum conversion moved to 
7662         GetAttributeArgumentExpression to be applied to the all
7663         expressions.
7664
7665 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7666
7667         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7668         * class.c (TypeContainer.DefineType): Flag error if
7669         base types aren't accessible due to access permissions.
7670         * decl.cs (DeclSpace.ResolveType): Move logic to
7671         Expression.ResolveAsTypeTerminal.
7672         (DeclSpace.ResolveTypeExpr): Thin layer over
7673         Expression.ResolveAsTypeTerminal.
7674         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7675         Refactor code into NestedAccess.  Use it.
7676         (DeclSpace.NestedAccess): New.
7677         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7678         argument to silence errors.  Check access permissions.
7679         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7680         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7681         (Cast.DoResolve): Likewise.
7682         (New.DoResolve): Likewise.
7683         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7684         (TypeOf.DoResolve): Likewise.
7685
7686         * expression.cs (Invocation.BetterConversion): Return the Type of
7687         the better conversion.  Implement section 14.4.2.3 more faithfully.
7688         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7689         section 14.4.2.2 explicit.
7690         (Invocation.OverloadResolve): Update.
7691         (Invocation): Remove is_base field.
7692         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7693         (Invocation.Emit): Likewise.
7694
7695 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7696
7697         * README: Update to changes.
7698
7699 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7700
7701         * cs-parser.jay: Reverted 642 warning fix.
7702
7703 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7704
7705         Fix bug #66615
7706         * decl.cs (FindMemberWithSameName): Indexer can have more than
7707         1 argument.
7708
7709 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7710
7711         * expression.cs (LocalVariableReference.DoResolveLValue):
7712         Do not report warning 219 for out values.
7713         (EmptyExpression.Null): New member to avoid extra allocations.
7714
7715 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7716
7717         * cs-parser.jay: Fix wrong warning 642 report.
7718
7719         * cs-tokenizer.cs (CheckNextToken): New helper;
7720         Inspect next character if is same as expected.
7721
7722 2004-09-23  Martin Baulig  <martin@ximian.com>
7723
7724         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7725         (Convert.ImplicitReferenceConversionExists): Likewise.
7726
7727 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7728
7729         * class.cs (Operator.Define): Add error 448 and 559 report.
7730
7731 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7732
7733         * class.cs (MemberBase.IsTypePermitted): New protected
7734         method for checking error CS0610.
7735
7736 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7737
7738         * class.cs (TypeContainer.HasExplicitLayout): New property
7739         Returns whether container has StructLayout attribute set Explicit.
7740         (FieldMember): New abstract class for consts and fields.
7741         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7742         (Field): Reuse FieldMember.
7743
7744         * const.cs (Const): Reuse FieldMember.
7745
7746         * rootcontext.cs: EmitConstants call moved to class.
7747
7748 2004-09-22  Martin Baulig  <martin@ximian.com>
7749
7750         Thanks to Peter Sestoft for this bug report.
7751
7752         * expression.cs (Conditional): If both the `trueExpr' and the
7753         `falseExpr' is a NullLiteral, return a NullLiteral.
7754
7755 2004-09-22  Martin Baulig  <martin@ximian.com>
7756
7757         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7758         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7759         for the "get_Current" call.
7760
7761 2004-09-22  Martin Baulig  <martin@ximian.com>
7762
7763         Marek and me just fixed one of our oldest bugs: #28562 :-)
7764
7765         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7766
7767         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7768         we're an EnumConstant, just return that.
7769         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7770         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7771         to get the value which'll actually be written into the attribute.
7772         However, we have to use GetValue() to access the attribute's value
7773         in the compiler.        
7774
7775 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7776
7777         * constant.cs (Constant.IsNegative): New abstract property
7778         IsNegative.
7779
7780         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7781         (StackAlloc.DoResolve): Reused IsNegative.
7782
7783 2004-09-21  Martin Baulig  <martin@ximian.com>
7784
7785         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7786         if we're used in an iterator, we may be called from different
7787         methods.
7788
7789         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7790         we actually have an exception block.
7791
7792 2004-09-20  John Luke <jluke@cfl.rr.com>
7793
7794         * class.cs, cs-parser.jay: Improve the error report for 1520:
7795         report the actual line where the error happens, not where the
7796         class was declared.
7797
7798         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7799         Pass location information that was available elsewhere.
7800
7801 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7802
7803         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7804         runtime to delay sign assemblies.
7805
7806 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7807
7808         * cs-parser.jay: Do not report the stack trace, this is barely
7809         used nowadays.
7810
7811 2004-08-22  John Luke  <john.luke@gmail.com>
7812  
7813         * driver.cs : check that a resource id is not already used
7814         before adding it, report CS1508 if it is, bug #63637
7815
7816 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7817
7818         * ecore.cs: Removed dead code.
7819
7820 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7821
7822         * class.cs: Do not report warning CS0067 on the interfaces.
7823
7824 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7825
7826         * cs-parser.jay: Add error 504 report.
7827
7828 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7829
7830         * rootcontext.cs: WarningLevel is 4 by default now.
7831
7832         * statement.cs (Fixed.Resolve): Do not null
7833         VariableInfo.
7834
7835 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7836
7837         Fixed bug #55780
7838         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7839         deep search when property is not virtual.
7840         (PropertyExpr.ResolveAccessors): Make one call for both
7841         accessors.
7842
7843 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7844
7845         Fixed bug #65766
7846         * statement.cs: Error 152 report constains also location.
7847
7848 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7849
7850         Fixed bug #65766
7851         * const.cs: Explicitly set constant as static.
7852
7853 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7854
7855         Fixed bug #64226
7856         * cs-parser.jay: Add error 1017 report.
7857
7858 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7859
7860         Fixed bug #59980, #64224
7861         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7862
7863         * typemanager.cs (IsSpecialMethod): Simplified
7864
7865 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7866
7867         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7868         condition with better params.
7869
7870 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7871
7872         Fixed bug #65238
7873         * attribute.cs (Resolve): Property has to have both
7874         accessors.
7875
7876 2004-09-14  Martin Baulig  <martin@ximian.com>
7877
7878         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7879
7880 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7881
7882         Fixed bug #61902
7883         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7884         called and is obsolete then this member suppress message
7885         when call is inside next [Obsolete] method or type.
7886
7887         * expression.cs: Use TestObsoleteMethodUsage member.
7888
7889 2004-09-14  Martin Baulig  <martin@ximian.com>
7890
7891         * cs-parser.jay: Sync a bit with the GMCS version.
7892
7893 2004-09-14  Martin Baulig  <martin@ximian.com>
7894
7895         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7896         (CSharpParser.yacc_verbose_flag): New public field.
7897
7898         * genericparser.cs: Removed.
7899
7900 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7901
7902         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7903
7904 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7905
7906         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7907
7908 2004-09-10  Martin Baulig  <martin@ximian.com>
7909
7910         Backported my MemberName changes from GMCS into MCS.
7911
7912         - we are now using a special `MemberName' class instead of using
7913         strings; in GMCS, the `MemberName' also contains the type
7914         arguments.
7915
7916         - changed the grammar rules a bit:
7917           * the old `member_name' is now a `namespace_or_type_name':
7918             The rule is that we use `namespace_or_type_name' everywhere
7919             where we expect either a "member name" (GetEnumerator) or a
7920             "member name" with an explicit interface name
7921             (IEnumerable.GetEnumerator).
7922             In GMCS, the explicit interface name may include type arguments
7923             (IEnumerable<T>.GetEnumerator).
7924           * we use `member_name' instead of just `IDENTIFIER' for
7925             "member names":
7926             The rule is that we use `member_name' wherever a member may
7927             have type parameters in GMCS.       
7928
7929         * decl.cs (MemberName): New public class.
7930         (MemberCore.MemberName): New public readonly field.
7931         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7932         (DeclSpace): Likewise.
7933
7934         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7935         * enum.cs (Enum.ctor): Likewise.
7936
7937         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7938         MemberName.     
7939         (AliasEntry.ctor): Take a MemberName, not an Expression.
7940         (AliasEntry.UsingAlias): Likewise.
7941
7942         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7943         (IMethodData.MemberName): Changed type from string to MemberName.
7944         (MemberBase.ExplicitInterfaceName): Likewise.
7945         (AbstractPropertyEventMethod.SetupName): Make this private.
7946         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7947         argument; compute the member name here.
7948         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7949         on the `member.MemberName' and the `prefix'.
7950
7951         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7952         not `type_name'.
7953         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7954         thus, we get a `MemberName' instead of a `string'.  These
7955         declarations may have type parameters in GMCS.
7956         (interface_method_declaration, delegate_declaration): Likewise.
7957         (class_declaration, interface_declaration): Likewise.
7958         (method_header): Use `namespace_or_type_name' instead of
7959         `member_name'.  We may be an explicit interface implementation.
7960         (property_declaration, event_declaration): Likewise.
7961         (member_name): This is now just an `IDENTIFIER', not a
7962         `namespace_or_type_name'.
7963         (type_name, interface_type): Removed.
7964         (namespace_or_type_name): Return a MemberName, not an Expression.
7965         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7966         call GetTypeExpression() on the MemberName to get an expression.
7967         (IndexerDeclaration.interface_type): Changed type from string to
7968         MemberName.
7969         (MakeName): Operate on MemberName's instead of string's.
7970
7971 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7972
7973         Fix bug #55770.
7974         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7975         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7976         lookup to avoid symbols introduced by 'using'.
7977         * rootcontext.cs (NamespaceLookup): Update.
7978
7979 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7980
7981         * class.cs (TypeContainer.DoDefineMembers): Do not call
7982         DefineDefaultConstructor for static classes.
7983
7984 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7985
7986         * attribute.cs (Attribute.Resolve): Add error 653 report.
7987
7988         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7989         report.
7990         (Method.ApplyAttributeBuilder): Add error 685 report.
7991         (Operator.Define): Add error 564 report.
7992
7993         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7994
7995         * expression.cs (Invocation.DoResolve): Add error
7996         245 and 250 report.
7997
7998         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7999         error 674 report.
8000
8001 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8002
8003         * class.cs (ConstructorInitializer.Resolve):
8004         Wrong error number (515->516).
8005
8006 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8007
8008         * class.cs (Indexer.Define): Add error 631 report.
8009
8010 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8011
8012         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8013
8014 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8015
8016         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8017
8018 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8019
8020         * cs-parser.jay: Added error CS0241 report.
8021
8022 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8023
8024         * cs-parser.jay (fixed_statement): Introduce a scope for the
8025         declaration in the 'fixed' statement.
8026
8027 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8028
8029         * cs-parser.jay: Added CS0230 error report.
8030
8031 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8032
8033         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8034
8035 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8036
8037         * expression.cs (Argument.Resolve): Added error CS0192 and
8038         CS0199 report.
8039
8040 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8041
8042         C# 2.0 #pragma warning feature
8043
8044         * cs-tokenizer.cs (PreProcessPragma): New method; 
8045         Handles #pragma directive.
8046
8047         * report.cs (WarningRegions): New class; Support
8048         class for #pragma warning directive. It tests whether
8049         warning is enabled for a given line.
8050
8051 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8052
8053         * const.cs: Add more descriptive error report, tahnks to
8054         Sebastien. 
8055
8056 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8059
8060 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8061
8062         * expression.cs: Apply patch from Ben: Remove dead code from
8063         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8064         as that code just threw an exception anwyays.
8065
8066         * const.cs: Remove the call to the turnintoconstant, for details
8067         see bug: #63144
8068         
8069         * literal.cs: The type of the null-literal is the null type;  So
8070         we use a placeholder type (literal.cs:System.Null, defined here)
8071         for it.
8072
8073         * expression.cs (Conditional.DoResolve): Remove some old code that
8074         is no longer needed, conversions have been fixed.
8075
8076         (ArrayCreationExpression.DoResolve): Return false if we fail to
8077         resolve the inner expression.
8078
8079 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8080
8081         Fix test-290.cs.
8082         * cs-parser.jay (delegate_declaration): Record a delegate
8083         declaration as a type declaration.
8084         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8085
8086 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8087
8088         * parameter.cs: Do not crash if the type can not be resolved. 
8089
8090         * expression.cs: Report errors with unsafe pointers, fixes #64896
8091
8092 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8093
8094         * expression.cs: Pointer arith always needs to do a conv.i
8095         if the operand is a long. fix 65320
8096
8097 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8098
8099         Fixed cs0619-37.cs, cs0619-38.cs
8100
8101         * enum.cs (GetObsoleteAttribute): Removed.
8102
8103         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8104         on Enum member is double staged. The first is tested member
8105         and then enum.
8106
8107 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8108
8109         Fixed #56986, #63631, #65231
8110
8111         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8112         adds member to name container.
8113         (TypeContainer.AddToTypeContainer): New method, adds type to
8114         name container.
8115         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8116         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8117         AddOperator): Simplified by reusing AddToMemberContainer.
8118         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8119         instead of field.
8120         (Method.CheckForDuplications): Fixed implementation to test all
8121         possibilities.
8122         (MemberBase): Detection whether member is explicit interface
8123         implementation is now in constructor.
8124         (MemberBase.UpdateMemberName): Handles IndexerName.
8125         (Accessor): Changed to keep also location information.
8126         (AbstractPropertyEventMethod): Is derived from MemberCore.
8127         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8128         will be emited or not.
8129         (PropertyBase.AreAccessorsDuplicateImplementation):
8130         Tests whether accessors are not in collision with some method.
8131         (Operator): Is derived from MethodCore to simplify common
8132         operations.
8133
8134         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8135         must be performed.
8136         (DeclSpace.AddToContainer): Adds the member to defined_names
8137         table. It tests for duplications and enclosing name conflicts.
8138
8139         * enum.cs (EnumMember): Clean up to reuse the base structures
8140
8141 2004-09-03  Martin Baulig  <martin@ximian.com>
8142
8143         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8144         into TypeContainer, to make partial classes work again.
8145
8146 2004-09-03  Martin Baulig  <martin@ximian.com>
8147
8148         * rootcontext.cs (RootContext.V2): Removed.
8149
8150 2004-03-23  Martin Baulig  <martin@ximian.com>
8151
8152         * expression.cs (Invocation.OverloadResolve): Added `bool
8153         may_fail' argument and use it instead of the Location.IsNull() hack.
8154
8155 2004-09-03  Martin Baulig  <martin@ximian.com>
8156
8157         Merged latest changes into gmcs.  Please keep this comment in
8158         here, it makes it easier for me to see what changed in MCS since
8159         the last time I merged.
8160
8161 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8162
8163         Fix #61128.
8164         * expression.cs (BetterConversion): Don't allow either conversion 
8165         to be null.  Remove redundant implicit conversion test when 'q ==
8166         null' -- when this function is invoked, we already know that the
8167         implicit conversion exists.
8168         (BetterFunction): Assume that 'best' is non-null.  Remove
8169         redundant reimplementation of IsApplicable when 'best' is null.
8170         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8171         number of arguments.
8172         (IsAncestralType): Extract from OverloadResolve.
8173         (OverloadResolve): Make robust to the MethodGroupExpr being
8174         unsorted.  Implement all the logic of Section 14.5.5.1, and
8175         support overloading of methods from multiple applicable types.
8176         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8177
8178         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8179         (RealError, Warning): Append type of report to related symbol.
8180
8181 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8182
8183         * enum.cs: Fixed CLS-Compliance checks for enum members.
8184         Error tests cs3008-8.cs, cs3014-8.cs
8185
8186 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8187
8188         Fixed bug #62342, #63102
8189         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8190         like ImplementMethod.
8191
8192 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8193
8194         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8195         Fixed bug #65170.
8196
8197 2004-09-02  Martin Baulig  <martin@ximian.com>
8198
8199         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8200         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8201         on the MethodBase.
8202
8203 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8204
8205         C# 2.0 Static classes implemented
8206
8207         * class.cs (TypeContainer): instance_constructors,
8208         initialized_fields, initialized_static_fields,
8209         default_constructor, base_inteface_types are protected to be
8210         accessible from StaticClass.
8211         (TypeContainer.DefineDefaultConstructor): New virtual method
8212         for custom default constructor generating
8213         (StaticClass): New class to handle "Static classes" feature.
8214
8215         * cs-parser.jay: Handle static keyword on class like instance
8216         of StaticClass.
8217
8218         * driver.cs: Added "/langversion" command line switch with two
8219         options (iso-1, default).
8220
8221 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8222
8223         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8224
8225 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8226
8227         * delegate.cs: Style.
8228
8229 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8230
8231         * delegate.cs: Add seperate instance expr field for miguel.
8232
8233 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8234
8235         * PointerArithmetic (Resolve): make sure we are not doing
8236         pointer arith on void*. Also, make sure we are resolved
8237         by not setting eclass until resolve.
8238
8239         All callers: Make sure that PointerArithmetic gets resolved.
8240
8241 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8242
8243         * ArrayCreation (LookupType): If the type does not resolve 
8244         to an array, give an error.
8245
8246 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8247
8248         * statement.cs (Try.Resolve): Fixed bug #64222
8249
8250 2004-08-27  Martin Baulig  <martin@ximian.com>
8251
8252         * class.cs
8253         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8254         crash here.     
8255
8256 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8257
8258         * ecore.cs (Constantify): Get underlying type via
8259         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8260         Windows in special cases.
8261
8262 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8263
8264         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8265         for obtaining also private methods.
8266         (GetRemoveMethod): Used GetRemoveMethod (true)
8267         for obtaining also private methods.
8268
8269 2004-08-24  Martin Baulig  <martin@ximian.com>
8270
8271         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8272         MethodAttributes.HideBySig for operators.
8273
8274 2004-08-23  Martin Baulig  <martin@ximian.com>
8275
8276         Back to the old error reporting system :-)
8277
8278         * report.cs (Message): Removed.
8279         (Report.MessageData, ErrorData, WarningData): Removed.
8280         (Report.Error, Warning): Back to the old system.
8281
8282 2004-08-23  Martin Baulig  <martin@ximian.com>
8283
8284         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8285
8286         * class.cs (TypeContainer.ParentContainer): New public virtual
8287         method; replaces the explicit interface implementation.
8288         (ClassPart.ParentContainer): Override.
8289
8290 2004-08-23  Martin Baulig  <martin@ximian.com>
8291
8292         * statement.cs (Switch): Added support for constant switches; see
8293         #59428 or test-285.cs.
8294
8295 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8296
8297         Fixed bug #62740.
8298         * statement.cs (GetEnumeratorFilter): Removed useless
8299         logic because C# specs is strict. GetEnumerator must be
8300         public.
8301
8302 2004-08-22  Martin Baulig  <martin@ximian.com>
8303
8304         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8305         a switch and may break, reset the barrier.  Fixes #59867.
8306
8307 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8308
8309         CLS-Compliance speed up (~5% for corlib)
8310
8311         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8312         New method. Tests container for CLS-Compliant names
8313
8314         * class.cs (TypeContainer.VerifyClsName): New method.
8315         Checks whether container name is CLS Compliant.
8316         (Constructor): Implements IMethodData.
8317
8318         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8319         low-case table for CLS Compliance test.
8320         (MemberCache.VerifyClsParameterConflict): New method.
8321         Checks method parameters for CS3006 error.
8322
8323         * enum.cs (EnumMember): Is derived from MemberCore.
8324         (Enum.VerifyClsName): Optimized for better performance.
8325
8326 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8327
8328         * report.cs: Renamed Error_T to Error and changed all
8329         references.
8330
8331 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8332
8333         * class.cs (TypeContainer.IndexerArrayList): New inner class
8334         container for indexers.
8335         (TypeContainer.DefaultIndexerName): New constant for default
8336         indexer name. Replaced all "Item" with this constant.
8337         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8338
8339         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8340         DefaultMemberAttribute constructor.
8341
8342 2004-08-05  Martin Baulig  <martin@ximian.com>
8343
8344         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8345         Fix bug #59429.
8346
8347 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8348
8349         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8350         multi platforms problem.
8351
8352         * compiler.csproj: Included shared files.
8353
8354 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8355
8356         Fix bug 60333, 55971 in the more general way
8357         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8358         Added arg_type argument for constant conversion.
8359         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8360
8361 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8362
8363         Fix bug #59760
8364         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8365         OperatorArrayList, MethodCoreArrayList for typecontainer
8366         containers. Changed class member types to these new types.
8367         (MethodArrayList.DefineMembers): Added test for CS0659.
8368
8369 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8370
8371         * cfold.cs: Synchronize the folding with the code in expression.cs
8372         Binary.DoNumericPromotions for uint operands.
8373
8374         * attribute.cs: Revert patch from Raja, it introduced a regression
8375         while building Blam-1.2.1 (hard to isolate a test case).
8376
8377 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8378
8379         Fix for #55382
8380         * class.cs:
8381         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8382         name collision.
8383         (MethodCore.parent_method): New member. The method we're overriding
8384         if this is an override method.
8385         (MethodCore.CheckBase): Moved from Method class and made common.
8386         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8387         private.
8388         (MethodCore.CheckForDuplications): New abstract method. For custom
8389         member duplication search in a container
8390         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8391         method and its return type.
8392         (Event.conflict_symbol): New member. Symbol with same name in the
8393         parent class.
8394
8395         * decl.cs:
8396         (MemberCache.FindMemberWithSameName): New method. The method
8397         is looking for conflict with inherited symbols.
8398
8399 2004-08-04  Martin Baulig  <martin@ximian.com>
8400
8401         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8402
8403         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8404
8405 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8406
8407         * report.cs (Message): New enum for better error, warning reference in
8408         the code.
8409         (MessageData): New inner abstract class. It generally handles printing of
8410         error and warning messages.
8411         Removed unused Error, Warning, Message methods.
8412
8413 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8414
8415         Fix for cs0592-8.cs test
8416         * attribute.cs
8417         (Attributable.ValidAttributeTargets): Made public.
8418         (Attribute.ExplicitTarget): New member for explicit target value.
8419         (Attribute.CheckTargets): Now we translate explicit attribute
8420         target to Target here.
8421
8422 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8423
8424         * ecore.cs (MethodGroupExpr): new IsBase property.
8425
8426         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8427
8428         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8429         rather than an instance expr.
8430
8431         (DelegateCreation.Emit): Use the method group rather than
8432         the instance expression. Also, if you have base.Foo as the
8433         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8434
8435         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8436
8437         (NewDelegate.DoResolve): Only check for the existance of Invoke
8438         if the method is going to be needed. Use MethodGroupExpr.
8439
8440         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8441
8442         * expression.cs: For pointer arith., make sure to use
8443         the size of the type, not the size of the pointer to
8444         the type.
8445
8446 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8447
8448         Fix for #60722
8449         * class.cs (Class): Added error CS0502 test.
8450
8451 2004-08-03  John Luke  <jluke@cfl.rr.com>
8452             Raja R Harinath  <rharinath@novell.com>
8453
8454         Fix for #60997.
8455         * attribute.cs (Attribute.complained_before): New flag.
8456         (Attribute.ResolveType, Attribute.Resolve),
8457         (Attribute.DefinePInvokeMethod): Set it.
8458         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8459         
8460 2004-08-03  Martin Baulig  <martin@ximian.com>
8461
8462         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8463         use a user-defined operator; we still need to do numeric
8464         promotions in case one argument is a builtin type and the other
8465         one has an implicit conversion to that type.  Fixes #62322.
8466
8467 2004-08-02  Martin Baulig  <martin@ximian.com>
8468
8469         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8470         (LocalInfo.IsThis): New public property.
8471         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8472
8473 2004-08-01  Martin Baulig  <martin@ximian.com>
8474
8475         * class.cs (TypeContainer.GetClassBases): Don't set the default
8476         here since we may get called from GetPartialBases().
8477         (TypeContainer.DefineType): If GetClassBases() didn't return a
8478         parent, use the default one.
8479
8480 2004-07-30  Duncan Mak  <duncan@ximian.com>
8481
8482         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8483
8484 2004-07-30  Martin Baulig  <martin@ximian.com>
8485
8486         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8487
8488         * class.cs (SourceMethod): New public class, derive from the
8489         symbol writer's ISourceMethod.
8490         (Method): Use the new symbol writer API.
8491
8492         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8493         as argument and use the new symbol writer.
8494
8495         * location.cs
8496         (SourceFile): Implement the symbol writer's ISourceFile.
8497         (Location.SymbolDocument): Removed.
8498         (Location.SourceFile): New public property.
8499
8500         * symbolwriter.cs: Use the new symbol writer API.
8501
8502 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8503
8504         * Makefile (install-local): Remove.  Functionality moved to
8505         executable.make.
8506
8507 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8508
8509         * Makefile: Install mcs.exe.config file together with mcs.exe.
8510         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8511         correct runtime version.
8512         
8513 2004-07-25  Martin Baulig  <martin@ximian.com>
8514
8515         * class.cs
8516         (TypeContainer.RegisterOrder): Removed, this was unused.
8517         (TypeContainer, interface_order): Removed.
8518         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8519         TypeContainer as argument since we can also be called with a
8520         `PartialContainer' for a partial class/struct/interface.
8521         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8522         of checking whether we're an `Interface' - we could be a
8523         `PartialContainer'.
8524         (PartialContainer.Register): Override; call
8525         AddClass()/AddStruct()/AddInterface() on our parent.
8526
8527         * cs-parser.jay (interface_member_declaration): Add things to the
8528         `current_container', not the `current_class'.
8529
8530         * rootcontext.cs (RegisterOrder): The overloaded version which
8531         takes an `Interface' was unused, removed.
8532
8533         * typemanager.cs (TypeManager.LookupInterface): Return a
8534         `TypeContainer', not an `Interface'.
8535         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8536         contain a `PartialContainer' for an interface, so check it's
8537         `Kind' to figure out what it is.
8538
8539 2004-07-25  Martin Baulig  <martin@ximian.com>
8540
8541         * class.cs (Class.DefaultTypeAttributes): New public constant.
8542         (Struct.DefaultTypeAttributes): Likewise.
8543         (Interface.DefaultTypeAttributes): Likewise.
8544         (PartialContainer.TypeAttr): Override this and add the
8545         DefaultTypeAttributes.
8546
8547 2004-07-25  Martin Baulig  <martin@ximian.com>
8548
8549         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8550         we can just use the `Parent' field instead.
8551
8552 2004-07-25  Martin Baulig  <martin@ximian.com>
8553
8554         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8555
8556 2004-07-25  Martin Baulig  <martin@ximian.com>
8557
8558         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8559         our parts before defining any methods.
8560         (TypeContainer.VerifyImplements): Make this virtual.
8561         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8562         on our PartialContainer.
8563
8564 2004-07-25  Martin Baulig  <martin@ximian.com>
8565
8566         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8567
8568         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8569         argument, we can just use the `Parent' field instead.
8570
8571         * class.cs
8572         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8573         (MemberBase.DoDefine): Likewise.
8574
8575 2004-07-24  Martin Baulig  <martin@ximian.com>
8576
8577         * decl.cs (MemberCore.Parent): New public field.
8578         (DeclSpace.Parent): Moved to MemberCore.
8579
8580         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8581         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8582         parent's .ctor.
8583         (FieldBase, Field, Operator): Likewise.
8584         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8585         (EventField, Event): Likewise.
8586
8587 2004-07-23  Martin Baulig  <martin@ximian.com>
8588
8589         * class.cs (PartialContainer): New public class.
8590         (ClassPart): New public class.
8591         (TypeContainer): Added support for partial classes.
8592         (TypeContainer.GetClassBases): Splitted some of the functionality
8593         out into GetNormalBases() and GetPartialBases().
8594
8595         * cs-tokenizer.cs (Token.PARTIAL): New token.
8596         (Tokenizer.consume_identifier): Added some hacks to recognize
8597         `partial', but only if it's immediately followed by `class',
8598         `struct' or `interface'.
8599
8600         * cs-parser.jay: Added support for partial clases.
8601
8602 2004-07-23  Martin Baulig  <martin@ximian.com>
8603
8604         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8605         a `DeclSpace' and also made it readonly.
8606         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8607         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8608         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8609
8610         * cs-parser.jay: Pass the `current_class', not the
8611         `current_container' (at the moment, this is still the same thing)
8612         to a new Method, Property, Event, Indexer or Constructor.
8613
8614 2004-07-23  Martin Baulig  <martin@ximian.com>
8615
8616         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8617         and removed the `current_interface' one.
8618         (struct_declaration, class_declaration, interface_declaration):
8619         Set `current_class' to the newly created class/struct/interface;
8620         set their `Bases' and call Register() before parsing their body.
8621
8622 2004-07-23  Martin Baulig  <martin@ximian.com>
8623
8624         * class.cs (Kind): New public enum.
8625         (TypeContainer): Made this class abstract.
8626         (TypeContainer.Kind): New public readonly field.
8627         (TypeContainer.CheckDef): New public method; moved here from
8628         cs-parser.jay.
8629         (TypeContainer.Register): New public abstract method.
8630         (TypeContainer.GetPendingImplementations): New public abstract
8631         method.
8632         (TypeContainer.GetClassBases): Removed the `is_class' and
8633         `is_iface' parameters.
8634         (TypeContainer.DefineNestedTypes): Formerly known as
8635         DoDefineType().
8636         (ClassOrStruct): Made this class abstract.
8637
8638         * tree.cs (RootTypes): New public type. 
8639
8640 2004-07-20  Martin Baulig  <martin@ximian.com>
8641
8642         * tree.cs (Tree.RecordNamespace): Removed.
8643         (Tree.Namespaces): Removed.
8644
8645         * rootcontext.cs (RootContext.IsNamespace): Removed.
8646
8647         * cs-parser.jay (namespace_declaration): Just create a new
8648         NamespaceEntry here.
8649
8650 2004-07-20  Martin Baulig  <martin@ximian.com>
8651
8652         * statement.cs (ExceptionStatement): New abstract class.  This is
8653         now used as a base class for everyone who's using `finally'.
8654         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8655         our local variables before using them.
8656
8657         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8658         virtual method.  This is used by Yield.Resolve() to "steal" an
8659         outer block's `finally' clauses.
8660         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8661         argument.
8662
8663         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8664         version which takes an ExceptionStatement.  This version must be
8665         used to create exception branchings.
8666
8667         * iterator.cs
8668         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8669         (Iterator.EmitMoveNext): Added exception support; protect the
8670         block with a `fault' clause, properly handle 'finally' clauses.
8671         (Iterator.EmitDispose): Run all the `finally' clauses here.
8672
8673 2004-07-20  Martin Baulig  <martin@ximian.com>
8674
8675         * iterator.cs: This is the first of a set of changes in the
8676         iterator code.  Match the spec more closely: if we're an
8677         IEnumerable, then GetEnumerator() must be called.  The first time
8678         GetEnumerator() is called, it returns the current instance; all
8679         subsequent invocations (if any) must create a copy.
8680
8681 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8682
8683         * expression.cs: Resolve the constant expression before returning
8684         it. 
8685
8686 2004-07-19  Martin Baulig  <martin@ximian.com>
8687
8688         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8689         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8690         the return type of the new EmitContext.
8691
8692 2004-07-18  Martin Baulig  <martin@ximian.com>
8693
8694         * class.cs (Property.Define): Fix iterators.
8695
8696         * iterators.cs (Iterator.Define): Moved the
8697         `container.AddInterator (this)' call here from the .ctor; only do
8698         it if we resolved successfully.
8699
8700 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8701
8702         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8703         `true' for preprocessing directives that we parse.  The return
8704         value indicates whether we should return to regular tokenizing or
8705         not, not whether it was parsed successfully.
8706
8707         In the past if we were in: #if false ... #line #endif, we would
8708         resume parsing after `#line'.  See bug 61604.
8709
8710         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8711         building: IsEnumType should return true only for enums, not for
8712         enums or System.Enum itself.  This fixes #61593.
8713
8714         Likely what happened is that corlib was wrong: mcs depended on
8715         this bug in some places.  The bug got fixed, we had to add the
8716         hack, which caused bug 61593.
8717
8718         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8719         that was a workaround for the older conditions.
8720
8721 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8722
8723         * assign.cs: IAssignMethod has a new interface, as documented
8724         inline. All assignment code now uses this new api.
8725
8726         * ecore.cs, expression.cs: All classes which implement
8727         IAssignMethod now use the new interface.
8728
8729         * expression.cs (Invocation): add a hack to EmitCall so that
8730         IndexerAccess can be the target of a compound assignment without
8731         evaluating its arguments twice.
8732
8733         * statement.cs: Handle changes in Invocation api.
8734
8735 2004-07-16  Martin Baulig  <martin@ximian.com>
8736
8737         * iterators.cs: Rewrote this.  We're now using one single Proxy
8738         class for both the IEnumerable and the IEnumerator interface and
8739         `Iterator' derives from Class so we can use the high-level API.
8740
8741         * class.cs (TypeContainer.AddIterator): New method.
8742         (TypeContainer.DoDefineType): New protected virtual method, which
8743         is called from DefineType().
8744         (TypeContainer.DoDefineMembers): Call DefineType() and
8745         DefineMembers() on all our iterators.
8746         (TypeContainer.Emit): Call Emit() on all our iterators.
8747         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8748
8749         * codegen.cs (EmitContext.CurrentIterator): New public field.
8750
8751 2004-07-15  Martin Baulig  <martin@ximian.com>
8752
8753         * typemanager.cs
8754         (TypeManager.not_supported_exception_type): New type.   
8755
8756 2004-07-14  Martin Baulig  <martin@ximian.com>
8757
8758         * iterators.cs: Use real error numbers.
8759
8760 2004-07-14  Martin Baulig  <martin@ximian.com>
8761
8762         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8763         requires this to be a System.Collection.IEnumerable and not a
8764         class implementing that interface.
8765         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8766
8767 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8768
8769         * class.cs: Fixed previous fix, it broke some error tests.
8770
8771 2004-07-12  Martin Baulig  <martin@ximian.com>
8772
8773         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8774         Fixes #61293.
8775
8776 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8777
8778         * assign.cs (LocalTemporary): Add new argument: is_address,If
8779         `is_address' is true, then the value that we store is the address
8780         to the real value, and not the value itself.
8781         
8782         * ecore.cs (PropertyExpr): use the new local temporary
8783         stuff to allow us to handle X.Y += z (where X is a struct)
8784
8785 2004-07-08  Martin Baulig  <martin@ximian.com>
8786
8787         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8788         not always return, just like we're doing in Using.Resolve().
8789
8790 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8791
8792         * cs-parser.jay (fixed_statement): flag this as Pinned.
8793
8794 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * typemanager.cs (TypeManager): Removed MakePinned method, this
8797         mechanism is replaced with the .NET 2.x compatible mechanism of
8798         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8799
8800         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8801         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8802         `IsFixed' property which has a different meaning.
8803
8804 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8805
8806         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8807         visible from inside a nested class, not just the names of the
8808         immediately enclosing class.
8809         Fix for bug #60730.
8810
8811 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8812
8813         * expression.cs (BetterConversion): Remove buggy special-case
8814         handling of "implicit constant expression conversions".  At this
8815         point, we already know that the conversion is possible -- we're
8816         only checking to see which is better.
8817
8818 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8819
8820         * cs-parser.jay: Added error CS0210 test.
8821
8822 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8823
8824         * cs-parser.jay: Added error CS0134 test.
8825
8826 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8827
8828         Fix bug #52507
8829         * cs-parser.jay: Added error CS0145 test.
8830
8831 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8832
8833         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8834
8835 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8836         
8837         * expression.cs (StackAlloc.Resolve): The argument may not
8838         be a constant; deal with this case.
8839         
8840 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8841
8842         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8843         GetIndexerAttributeValue.
8844         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8845
8846         * class.cs (Indexer.Define): Added error tests for CS0415,
8847         CS0609.
8848
8849 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8852         property code.
8853
8854 2004-06-23  Martin Baulig  <martin@ximian.com>
8855
8856         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8857         neither return nor throw, reset the barrier as well.  Fixes #60457.
8858
8859 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8860
8861         * class.cs : EventAttributes is now set to None by default.
8862           This fixes bug #60459.
8863
8864 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8865
8866         Fix bug #60219
8867         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8868         Don't throw exception but return null (it's sufficient now).
8869
8870 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8871
8872         * typemanager.cs (GetArgumentTypes): Faster implementation.
8873
8874 2004-06-18  Martin Baulig  <martin@ximian.com>
8875
8876         * attribute.cs (Attribute.Resolve): Check whether we're an
8877         EmptyCast which a Constant child.  Fixes #60333.
8878
8879 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8880
8881         * statement.cs (EmitCollectionForeach): Account for the fact that
8882         not all valuetypes are in areas which we can take the address of.
8883         For these variables, we store to a temporary variable. Also, make
8884         sure that we dont emit a `callvirt' on a valuetype method.
8885
8886 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8887
8888         * expression.cs (StackAlloc.DoReSolve): Added test for
8889         negative parameter (CS0247).
8890
8891 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8892
8893         Fix bug #59792
8894         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8895
8896 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8897
8898         Fix bug #59781
8899         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8900         ulong.
8901
8902 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8903
8904         Fix bug #58254 & cs1555.cs, cs1556.cs
8905         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8906
8907 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8908
8909         * cs-parser.jay: Added error CS1669 test for indexers.
8910
8911 2004-06-11  Martin Baulig  <martin@ximian.com>
8912
8913         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8914         call this twice: for params and varargs methods.
8915
8916 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8917
8918         * class.cs:
8919         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8920
8921 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8922
8923         * attribute.cs (Attribute.GetValidTargets): Made public.
8924
8925         * class.cs: 
8926         (AbstractPropertyEventMethod): New class for better code sharing.
8927         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8928         CS1667 report.
8929         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8930
8931 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8932
8933         Fix bug #59477.
8934         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8935         that the call to Resolve is part of a MemberAccess.
8936         (Expression.Resolve): Use it for SimpleName resolution.
8937         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8938         Add 'intermediate' boolean argument.
8939         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8940         error message when the SimpleName can be resolved ambiguously
8941         between an expression and a type.
8942         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8943         public.
8944         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8945         call on the left-side.
8946
8947 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8948
8949         * class.cs:
8950         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8951
8952 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8953
8954         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8955
8956 2004-06-11  Martin Baulig  <martin@ximian.com>
8957
8958         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8959         varargs methods if applicable.
8960
8961 2004-06-11  Martin Baulig  <martin@ximian.com>
8962
8963         * expression.cs (Invocation.EmitCall): Don't use
8964         `method.CallingConvention == CallingConventions.VarArgs' since the
8965         method could also have `CallingConventions.HasThis'.
8966
8967 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8968
8969         * class.cs (Event.GetSignatureForError): Implemented.
8970         Fixed crash in error test cs3010.cs
8971
8972 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8973
8974         * cs-tokenizer.cs: Change the way we track __arglist to be
8975         consistent with the other keywords.
8976
8977 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8980         tomorrow.
8981
8982 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8983
8984         * codegen.cs: Check that all referenced assemblies have a strongname
8985         before strongnaming the compiled assembly. If not report error CS1577.
8986         Fix bug #56563. Patch by Jackson Harper.
8987         * typemanager.cs: Added a method to return all referenced assemblies.
8988         Fix bug #56563. Patch by Jackson Harper.
8989
8990 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8991
8992         * class.cs:
8993         (Method.ApplyAttributeBuilder): Moved and added conditional
8994         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8995
8996         * delegate.cs:
8997         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8998
8999 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9000
9001         Fixed #59640
9002         * class.cs: (EventField.attribute_targets): Changed default target.
9003
9004 2004-06-08  Martin Baulig  <martin@ximian.com>
9005
9006         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9007
9008 2004-06-08  Martin Baulig  <martin@ximian.com>
9009
9010         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9011
9012 2004-06-07  Martin Baulig  <martin@ximian.com>
9013
9014         Added support for varargs methods.
9015
9016         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9017         keyword.
9018
9019         * cs-parser.jay: Added support for `__arglist'.
9020
9021         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9022
9023         * expression.cs (Argument.AType): Added `ArgList'.
9024         (Invocation): Added support for varargs methods.
9025         (ArglistAccess): New public class.
9026         (Arglist): New public class.
9027
9028         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9029
9030         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9031         a method's top-level block if the method has varargs.
9032
9033         * support.cs (ReflectionParameters, InternalParameters): Added
9034         support for varargs methods.    
9035
9036 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9037
9038         * class.cs: Provide location in indexer error report.
9039
9040         * driver.cs: Use standard names.
9041
9042         * namespace.cs: Catch the use of using after a namespace has been
9043         declared also on using aliases.
9044
9045 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9046
9047         Bug #50820.
9048         * typemanager.cs (closure_private_ok, closure_invocation_type)
9049         (closure_qualifier_type, closure_invocation_assembly)
9050         (FilterWithClosure): Move to ...
9051         (Closure): New internal nested class.
9052         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9053         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9054         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9055         (MemberLookup, MemberLookupFailed): Use it.
9056         * expression.cs (New.DoResolve): Treat the lookup for the
9057         constructor as being qualified by the 'new'ed type.
9058         (Indexers.GetIndexersForTypeOrInterface): Update.
9059
9060 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9061
9062         * attribute.cs
9063         (GetConditionalAttributeValue): New method. Returns
9064         condition of ConditionalAttribute.
9065         (SearchMulti): New method.  Returns all attributes of type 't'.
9066         Use it when attribute is AllowMultiple = true.
9067         (IsConditionalMethodExcluded): New method.
9068
9069         * class.cs
9070         (Method.IsExcluded): Implemented. Returns true if method has conditional
9071         attribute and the conditions is not defined (method is excluded).
9072         (IMethodData): Extended interface for ConditionalAttribute support.
9073         (PropertyMethod.IsExcluded): Implemented.
9074
9075         * decl.cs
9076         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9077
9078         * expression.cs
9079         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9080         on the method.
9081
9082 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9083
9084         * expression.cs (ArrayCreationExpression): Make this just an
9085         `expression'. It can't be a statement, so the code here was
9086         dead.
9087
9088 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9089
9090         Fixed #59072
9091         * typemanager.cs (GetFullNameSignature): New method for
9092         MethodBase types.
9093
9094 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9095
9096         Fixed #56452
9097         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9098         Use this method when MethodBuilder is null.
9099         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9100         Added test for error CS0626 (MONO reports error for this situation).
9101         (IMethodData.GetSignatureForError): Extended interface.
9102
9103 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9104
9105         * attribute.cs
9106         (AttributeTester.GetObsoleteAttribute): Returns instance of
9107         ObsoleteAttribute when type is obsolete.
9108
9109         * class.cs
9110         (TypeContainer.VerifyObsoleteAttribute): Override.
9111         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9112         (MethodCode.VerifyObsoleteAttribute): Override.
9113         (MemberBase.VerifyObsoleteAttribute): Override.
9114
9115         * decl.cs
9116         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9117         and report proper error.
9118
9119         *delegate.cs
9120         Delegate.VerifyObsoleteAttribute): Override.
9121
9122         * ecore.cs
9123         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9124         and report proper error.
9125         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9126
9127         * enum.cs
9128         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9129         and enum member.
9130
9131         * expression.cs
9132         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9133         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9134         Added test for ObsoleteAttribute.
9135
9136         * statement.cs
9137         (Catch): Derived from Statement.
9138
9139 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9140  
9141         Fixed bug #59071 & cs0160.cs
9142  
9143         * statement.cs (Try.Resolve): Check here whether order of catch
9144         clauses matches their dependencies.
9145
9146 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9147
9148         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9149         caused a regression: #59343.  Referencing nested classes from an
9150         assembly stopped working.
9151
9152 2004-05-31  Martin Baulig  <martin@ximian.com>
9153
9154         MCS is now frozen for beta 2.
9155
9156 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9157
9158         * convert.cs: add a trivial cache for overload operator resolution.
9159
9160 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9161
9162         * decl.cs: If possible, use lookuptypedirect here. We can only do
9163         this if there is no `.' after the namespace. Avoids using
9164         LookupType, which does lots of slow processing.
9165         (FindNestedType) New method, does what it says :-).
9166         * namespace.cs: use LookupTypeDirect.
9167         * rootcontext.cs: use membercache, if possible.
9168         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9169
9170 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9171
9172         * expression.cs:
9173         According to the spec, 
9174
9175         In a member access of the form E.I, if E is a single identifier,
9176         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9177         field, property, localvariable, or parameter with the same type as
9178         the meaning of E as a type-name (§3.8), then both possible
9179         meanings of E are permitted.
9180
9181         We did not check that E as a simple-name had the same type as E as
9182         a type name.
9183
9184         This trivial check gives us 5-7% on bootstrap time.
9185
9186 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9187
9188         * expression.cs (Invocation.OverloadResolve): Avoid the
9189         use of hashtables and boxing here by allocating on demand.
9190
9191 2004-05-30  Martin Baulig  <martin@ximian.com>
9192
9193         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9194         we're doing a silent lookup.  Don't try to lookup nested types in
9195         TypeManager.object_type (thanks to Ben Maurer).
9196
9197 2004-05-30  Martin Baulig  <martin@ximian.com>
9198
9199         Committing a patch from Ben Maurer.
9200
9201         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9202
9203 2004-05-29  Martin Baulig  <martin@ximian.com>
9204
9205         * class.cs (IMethodData.ShouldIgnore): New method.
9206
9207         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9208         `Location' argument, we don't need it anywhere.  Use
9209         `IMethodData.ShouldIgnore ()' instead of
9210         `MethodData.GetMethodFlags ()'.
9211         (TypeManager.AddMethod): Removed.
9212         (TypeManager.AddMethod2): Renamed to AddMethod.
9213
9214 2004-05-29  Martin Baulig  <martin@ximian.com>
9215
9216         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9217
9218         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9219         converting from a class type S to an interface type and we already
9220         have an object on the stack, don't box it again.  Fixes #52578.
9221
9222 2004-05-29  Martin Baulig  <martin@ximian.com>
9223
9224         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9225         Added support for `params' parameters.  Fixes #59267.
9226
9227 2004-05-29  Martin Baulig  <martin@ximian.com>
9228
9229         * literal.cs (NullPointer): Provide a private .ctor which sets
9230         `type' to TypeManager.object_type.  Fixes #59048.
9231
9232 2004-05-29  Martin Baulig  <martin@ximian.com>
9233
9234         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9235         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9236
9237         * ecore.cs (EventExpr.instance_expr): Make the field private.
9238
9239 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9240
9241         Fixed bug #50080 & cs0214-2.cs
9242         * expression.cs (Cast.DoResolve): Check unsafe context here.
9243         
9244         * statement.cs (Resolve.DoResolve): Likewise.
9245
9246 2004-05-26  Martin Baulig  <martin@ximian.com>
9247
9248         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9249
9250         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9251         (RootContext.LookupType): Pass down the `silent' flag.
9252
9253 2004-05-25  Martin Baulig  <martin@ximian.com>
9254
9255         * expression.cs
9256         (MethodGroupExpr.IdenticalTypeName): New public property.
9257         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9258         expression actually refers to a type.
9259
9260 2004-05-25  Martin Baulig  <martin@ximian.com>
9261
9262         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9263         for #56176 and made it actually work.
9264
9265 2004-05-25  Martin Baulig  <martin@ximian.com>
9266
9267         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9268         (FieldExpr, PropertyExpr): Override and implement
9269         CacheTemporaries.  Fixes #52279.
9270
9271 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9272
9273         * location.cs: In the new compiler listing a file twice is a
9274         warning, not an error.
9275
9276 2004-05-24  Martin Baulig  <martin@ximian.com>
9277
9278         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9279         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9280
9281 2004-05-24  Martin Baulig  <martin@ximian.com>
9282
9283         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9284         walking the `using' list.  Fixes #53921.
9285
9286 2004-05-24  Martin Baulig  <martin@ximian.com>
9287
9288         * const.cs (Const.LookupConstantValue): Added support for
9289         EmptyCast's; fixes #55251.
9290
9291 2004-05-24  Martin Baulig  <martin@ximian.com>
9292
9293         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9294         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9295         which does the CS0135 check.  The reason is that we first need to
9296         check whether the variable actually exists.
9297
9298 2004-05-24  Martin Baulig  <martin@ximian.com>
9299
9300         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9301         than RootContext.LookupType() to find the explicit interface
9302         type.  Fixes #58584.
9303
9304 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9305
9306         * Makefile: Simplify.  Use executable.make.
9307         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9308
9309 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9310
9311         * decl.cs:
9312         * enum.cs:
9313         Use the invariant culture when doing String.Compare for CLS case
9314         sensitivity.
9315         
9316 2004-05-23  Martin Baulig  <martin@ximian.com>
9317
9318         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9319         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9320
9321         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9322         
9323 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9324
9325         * class.cs (MemberBase.Define): Reuse MemberType member for 
9326         resolved type. Other methods can use it too.
9327
9328 2004-05-23  Martin Baulig  <martin@ximian.com>
9329
9330         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9331         the variable also exists in the current block (otherwise, we need
9332         to report a CS0103).  Fixes #58670.
9333
9334 2004-05-23  Martin Baulig  <martin@ximian.com>
9335
9336         * flowanalysis.cs (Reachability.Reachable): Compute this
9337         on-the-fly rather than storing it as a field.
9338
9339 2004-05-23  Martin Baulig  <martin@ximian.com>
9340
9341         * flowanalysis.cs (Reachability.And): Manually compute the
9342         resulting `barrier' from the reachability.      
9343        
9344 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9345
9346         Fix bug #57835
9347         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9348         instance of ObsoleteAttribute when symbol is obsolete.
9349
9350         * class.cs
9351         (IMethodData): Extended interface for ObsoleteAttribute support.
9352
9353 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9354
9355         * attribute.cs: Fix bug #55970
9356
9357 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9358
9359         Fix bug #52705
9360         * attribute.cs
9361         (GetObsoleteAttribute): New method. Creates the instance of
9362         ObsoleteAttribute.
9363         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9364         ObsoleteAttribute when member is obsolete.
9365         (AttributeTester.Report_ObsoleteMessage): Common method for
9366         Obsolete error/warning reporting.
9367
9368         * class.cs
9369         (TypeContainer.base_classs_type): New member for storing parent type.
9370
9371         * decl.cs
9372         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9373         for this MemberCore.
9374
9375 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9376
9377         * attribute.cs, const.cs: Fix bug #58590
9378
9379 2004-05-21  Martin Baulig  <martin@ximian.com>
9380
9381         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9382         out parameters if the end of the method is unreachable.  Fixes
9383         #58098. 
9384
9385 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9386
9387         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9388         Hari was right, why extra method.
9389
9390 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9391
9392         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9393
9394 2004-05-20  Martin Baulig  <martin@ximian.com>
9395
9396         Merged this back from gmcs to keep the differences to a minumum.
9397
9398         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9399         instead of a Declspace.
9400         (Attribute.ResolveType): Likewise.
9401         (Attributes.Search): Likewise.
9402         (Attributes.Contains): Likewise.
9403         (Attributes.GetClsCompliantAttribute): Likewise.
9404
9405         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9406         argument.
9407         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9408         DeclSpace.
9409
9410 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9411
9412         Fix bug #58688 (MCS does not report error when the same attribute
9413         is assigned twice)
9414
9415         * attribute.cs (Attribute.Emit): Distinction between null and default.
9416
9417 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9418
9419         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9420         of a top-level attribute without an attribute target.
9421         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9422         Make non-static.
9423         (Attribute.Conditional_GetConditionName), 
9424         (Attribute.Obsolete_GetObsoleteMessage): Update.
9425         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9426         part of ScanForIndexerName.
9427         (Attribute.CanIgnoreInvalidAttribute): New function.
9428         (Attribute.ScanForIndexerName): Move to ...
9429         (Attributes.ScanForIndexerName): ... here.
9430         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9431         (Attributes.Search): New internal variant that can choose not to
9432         complain if types aren't resolved.  The original signature now
9433         complains.
9434         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9435         complaints suppressed.
9436         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9437         only if it not useful.
9438         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9439         top-level for attributes that are shared between the assembly
9440         and a top-level class.
9441         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9442         * class.cs: Update to reflect changes.
9443         (DefineIndexers): Fuse loops.
9444         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9445         a couple more variants of attribute names.
9446
9447 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9448
9449         Fix bug #52585 (Implemented explicit attribute declaration)
9450
9451         * attribute.cs:
9452         (Attributable.ValidAttributeTargets): New abstract method. It gets
9453         list of valid attribute targets for explicit target declaration.
9454         (Attribute.Target): It holds target itself.
9455         (AttributeSection): Removed.
9456         (Attribute.CheckTargets): New method. It checks whether attribute
9457         target is valid for the current element.
9458
9459         * class.cs:
9460         (EventProperty): New class. For events that are declared like
9461         property (with add and remove accessors).
9462         (EventField): New class. For events that are declared like field.
9463         class.cs
9464
9465         * cs-parser.jay: Implemented explicit attribute target declaration.
9466
9467         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9468         Override ValidAttributeTargets.
9469
9470         * parameter.cs:
9471         (ReturnParameter): Class for applying custom attributes on 
9472         the return type.
9473         (ParameterAtribute): New class. Class for applying custom
9474         attributes on the parameter type.
9475
9476 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9477
9478         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9479         definitions. 
9480
9481         (Method): Allow UNSAFE here.
9482
9483         * modifiers.cs: Support unsafe reporting.
9484
9485 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9486
9487         * decl.cs: Fix bug #58478.
9488
9489 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9490
9491         * statement.cs: When checking for unreachable code on an EmptyStatement,
9492         set the location. Fixes bug #58488.
9493
9494 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9495
9496         * driver.cs: Add -pkg handling.
9497
9498         From Gonzalo: UseShelLExecute=false
9499
9500 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9501
9502         * attribute.cs:
9503         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9504         for attribute.
9505         (Attribute.IsClsCompliaceRequired): Moved to base for better
9506         accesibility.
9507         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9508         when attribute is AttributeUsageAttribute.
9509         (Attribute.GetValidTargets): Simplified.
9510         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9511         attribute for this type.
9512         (Attribute.ApplyAttributes): Method renamed to Emit and make
9513         non-static.
9514         (GlobalAttributeSection): New class for special handling of global
9515         attributes (assembly, module).
9516         (AttributeSection.Emit): New method.
9517
9518         * class.cs: Implemented Attributable abstract methods.
9519         (MethodCore.LabelParameters): Moved to Parameter class.
9520         (Accessor): Is back simple class.
9521         (PropertyMethod): Implemented Attributable abstract class.
9522         (DelegateMethod): Implemented Attributable abstract class.
9523         (Event): New constructor for disctintion between normal Event
9524         and Event with accessors.
9525
9526         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9527
9528         * codegen.cs, const.cs, decl.cs, delegate.cs:
9529         (CommonAssemblyModulClass): Implemented Attributable abstract class
9530         and simplified.
9531
9532         * enum.cs: Implement IAttributeSupport interface.
9533         (EnumMember): New class for emum members. Implemented Attributable
9534         abstract class
9535
9536         * parameter.cs:
9537         (ParameterBase): Is abstract.
9538         (ReturnParameter): New class for easier [return:] attribute handling.
9539
9540         * typemanager.cs: Removed builder_to_attr.
9541
9542 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9543
9544         Fix bug #57151.
9545         * attribute.cs (Attribute.GetPositionalValue): New function.
9546         * class.cs (TypeContainer.VerifyMembers): New function.
9547         (TypeContainer.Emit): Use it.
9548         (ClassOrStruct): New base class for Class and Struct.
9549         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9550         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9551         class.
9552         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9553         then each non-static field should have a FieldOffset attribute.
9554         Otherwise, none of the fields should have a FieldOffset attribute.
9555         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9556         and FieldOffset attributes.
9557         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9558         (TypeManager.field_offset_attribute_type): New core types.
9559         (TypeManager.InitCoreTypes): Initialize them.
9560
9561 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9562
9563         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9564         Return correct type.
9565         From bug #58270.
9566
9567 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9568
9569         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9570         be implicitly converted to ulong.
9571         
9572         * expression.cs: The logic for allowing operator &, | and ^ worked
9573         was wrong, it worked before because we did not report an error in
9574         an else branch.  Fixes 57895.
9575
9576         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9577         allow volatile fields to be reference types.
9578
9579 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9580
9581         * driver.cs: Add support for /debug-
9582
9583 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9584
9585         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9586         Add a 'complain' parameter to silence errors.
9587         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9588         silently overlooked type-resolutions.
9589         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9590         to reflect changes.
9591         (Attributes.Search): New function.
9592         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9593         (Attributes.GetAttributeFullName): Remove hack.
9594         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9595         Update to reflect changes.
9596         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9597         Use Attributes.Search instead of nested loops.
9598
9599 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9600
9601         * decl.cs:
9602         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9603         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9604         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9605
9606         * report.cs: (Report.Warning): Renamed to Warning_T because of
9607         parameter collision.
9608
9609 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9610
9611         * expression.cs (MemberAccess.ResolveMemberAccess):
9612         Exit with non-zero status after Report.Error.
9613         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9614         Likewise.
9615         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9616
9617 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9618
9619         * support.cs: Don't hang when the file is empty.
9620
9621 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9622
9623         * support.cs: In SeekableStreamReader, compute the preamble size of the
9624           underlying stream. Position changes should take into account that initial
9625           count of bytes.
9626
9627 2004-05-03  Todd Berman  <tberman@sevenl.net>
9628
9629         * driver.cs: remove unused GetSysVersion function.
9630
9631 2004-05-03  Todd Berman  <tberman@sevenl.net>
9632
9633         * driver.cs: Remove the hack from saturday, as well as the hack
9634         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9635         link_paths to get that bit proper.
9636
9637 2004-05-01  Todd Berman  <tberman@sevenl.net>
9638
9639         * driver.cs: Try a LoadFrom before a Load, this checks the current
9640         path. This is currently a bug in mono that is be fixed, however, this
9641         provides a workaround for now. This will be removed when the bug
9642         is fixed.
9643
9644 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9645
9646         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9647         incomplete key pairs (#57941).
9648
9649 2004-05-01  Todd Berman  <tberman@sevenl.net>
9650
9651         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9652         from the GAC
9653
9654 2004-04-30  Jackson Harper  <jackson@ximian.com>
9655
9656         * codegen.cs: Open keys readonly.
9657         
9658 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9659
9660         * typemanager.cs: don't report cyclic struct layout when a struct
9661         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9662         which has 2 Pango.Rectangle fields.
9663
9664 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9665
9666         * expression.cs: Handle IntPtr comparisons with IL code
9667         rather than a method call.
9668
9669 2004-04-29  Martin Baulig  <martin@ximian.com>
9670
9671         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9672         the list of PropertyInfo's in class hierarchy and find the
9673         accessor.  Fixes #56013.
9674
9675 2004-04-29  Martin Baulig  <martin@ximian.com>
9676
9677         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9678
9679 2004-04-29  Martin Baulig  <martin@ximian.com>
9680
9681         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9682
9683         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9684
9685 2004-04-29  Martin Baulig  <martin@ximian.com>
9686
9687         * class.cs (ConstructorInitializer.Resolve): Check whether the
9688         parent .ctor is accessible.  Fixes #52146.
9689
9690 2004-04-29  Martin Baulig  <martin@ximian.com>
9691
9692         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9693
9694         * statement.cs (Using.EmitLocalVariableDecls): Use
9695         TypeManager.idisposable_type, not typeof (IDisposable).
9696         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9697
9698 2004-04-29  Martin Baulig  <martin@ximian.com>
9699
9700         * class.cs (Event.Define): Don't emit the field and don't set
9701         RTSpecialName and SpecialName for events on interfaces.  Fixes
9702         #57703. 
9703
9704 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9705
9706         Refactor Attribute.ApplyAttributes.
9707         * attribute.cs (Attributable): New base class for objects that can
9708         have Attributes applied on them.
9709         (Attribute): Make AttributeUsage fields public.
9710         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9711         (Attribute.IsInternalCall): New property.
9712         (Attribute.UsageAttr): Convert to a public read-only property.
9713         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9714         (Attribute.ResolveType, Attribute.Resolve)
9715         (Attribute.ScanForIndexerName): Update to reflect changes.
9716         (Attribute.CheckAttributeTarget): Re-format.
9717         (Attribute.ApplyAttributes): Refactor, to various
9718         Attributable.ApplyAttributeBuilder methods.
9719         * decl.cs (MemberCore): Make Attributable.
9720         * class.cs (Accessor): Make Attributable.
9721         (MethodData.ApplyAttributes): Use proper attribute types, not
9722         attribute names.
9723         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9724         (TypeContainer.ApplyAttributeBuilder)
9725         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9726         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9727         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9728         (Operator.ApplyAttributeBuilder): New factored-out methods.
9729         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9730         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9731         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9732         * parameter.cs (ParameterBase): New Attributable base class
9733         that can also represent Return types.
9734         (Parameter): Update to the changes.
9735
9736 2004-04-29  Jackson Harper  <jackson@ximian.com>
9737
9738         * driver.cs: Prefer the corlib system version when looking for
9739         assemblies in the GAC. This is still a hack, but its a better hack
9740         now.
9741         
9742 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9743
9744         * decl.cs, enum.cs: Improved error 3005 reporting.
9745   
9746         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9747         (related_symbols): New private member for list of symbols
9748         related to reported error/warning.
9749         
9750         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9751
9752 2004-04-29  Martin Baulig  <martin@ximian.com>
9753
9754         * ecore.cs (Expression.Constantify): If we're an enum and
9755         TypeManager.TypeToCoreType() doesn't give us another type, use
9756         t.UnderlyingSystemType.  Fixes #56178.  
9757
9758 2004-04-29  Martin Baulig  <martin@ximian.com>
9759
9760         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9761         interfaces and for each interface, only add members directly
9762         declared in that interface.  Fixes #53255.
9763
9764 2004-04-28  Martin Baulig  <martin@ximian.com>
9765
9766         * expression.cs (ConditionalLogicalOperator): Use a temporary
9767         variable for `left' to avoid that we evaluate it more than once;
9768         bug #52588.
9769
9770 2004-04-28  Martin Baulig  <martin@ximian.com>
9771
9772         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9773         `void[]' (CS1547).
9774
9775 2004-04-28  Martin Baulig  <martin@ximian.com>
9776
9777         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9778         void (CS1547).
9779
9780         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9781         whether the type is not void (CS1547).
9782
9783 2004-04-28  Martin Baulig  <martin@ximian.com>
9784
9785         * expression.cs (Unary.DoResolveLValue): Override this and report
9786         CS0131 for anything but Operator.Indirection.
9787
9788 2004-04-28  Martin Baulig  <martin@ximian.com>
9789
9790         Committing a patch from Ben Maurer; see bug #50820.
9791
9792         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9793         check for classes.
9794
9795         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9796         classes.        
9797
9798 2004-04-28  Martin Baulig  <martin@ximian.com>
9799
9800         Committing a patch from Ben Maurer; see bug #50820.
9801
9802         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9803         check for classes.
9804
9805         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9806         classes.        
9807
9808 2004-04-28  Martin Baulig  <martin@ximian.com>
9809
9810         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9811         (Block.AddLabel): Call DoLookupLabel() to only search in the
9812         current block.
9813
9814 2004-04-28  Martin Baulig  <martin@ximian.com>
9815
9816         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9817         comparing StringConstants and NullLiterals in Equality and Inequality.
9818
9819 2004-04-28  Jackson Harper  <jackson@ximian.com>
9820
9821         * driver.cs: Attempt to load referenced assemblies from the
9822         GAC. This is the quick and dirty version of this method that
9823         doesnt take into account versions and just takes the first
9824         canidate found. Will be good enough for now as we will not have more
9825         then one version installed into the GAC until I update this method.
9826
9827 2004-04-28  Martin Baulig  <martin@ximian.com>
9828
9829         * typemanager.cs (TypeManager.CheckStructCycles): New public
9830         static method to check for cycles in the struct layout.
9831
9832         * rootcontext.cs (RootContext.PopulateTypes): Call
9833         TypeManager.CheckStructCycles() for each TypeContainer.
9834         [Note: We only need to visit each type once.]
9835
9836 2004-04-28  Martin Baulig  <martin@ximian.com>
9837
9838         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9839
9840         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9841         success and added `out object value'.  Use a `bool resolved' field
9842         to check whether we've already been called rather than
9843         `ConstantValue != null' since this breaks for NullLiterals.
9844
9845 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9846
9847         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9848         setting of this flag, since the 'set' method may be non-public.
9849
9850 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9851
9852         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9853         check on current_vector.Block.
9854
9855 2004-04-27  Martin Baulig  <martin@ximian.com>
9856
9857         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9858         a field initializer.  Fixes #56459.
9859
9860 2004-04-27  Martin Baulig  <martin@ximian.com>
9861
9862         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9863         we're not attempting to use an indexer.  Fixes #52154.
9864
9865 2004-04-27  Martin Baulig  <martin@ximian.com>
9866
9867         * statement.cs (Return): Don't create a return label if we don't
9868         need it; reverts my change from January 20th.  Thanks to Ben
9869         Maurer for this.
9870
9871 2004-04-27  Martin Baulig  <martin@ximian.com>
9872
9873         According to the spec, `goto' can only leave a nested scope, but
9874         never enter it.
9875
9876         * statement.cs (Block.LookupLabel): Only lookup in the current
9877         block, don't recurse into parent or child blocks.
9878         (Block.AddLabel): Check in parent and child blocks, report
9879         CS0140/CS0158 if we find a duplicate.
9880         (Block): Removed this indexer for label lookups.
9881         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9882         this already does the error reporting for us.
9883
9884         * flowanalysis.cs
9885         (FlowBranching.UsageVector.Block): New public variable; may be null.
9886         (FlowBranching.CreateSibling): Added `Block' argument.
9887         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9888         label for the target of a `goto' and check whether we're not
9889         leaving a `finally'.
9890
9891 2004-04-27  Martin Baulig  <martin@ximian.com>
9892
9893         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9894         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9895         just for returns).
9896
9897 2004-04-27  Martin Baulig  <martin@ximian.com>
9898
9899         * statement.cs (Block.AddLabel): Also check for implicit blocks
9900         and added a CS0158 check.
9901
9902 2004-04-27  Martin Baulig  <martin@ximian.com>
9903
9904         * flowanalysis.cs (FlowBranchingLoop): New class.
9905         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9906         UsageVector's instead of an ArrayList.
9907         (FlowBranching.Label): Likewise.
9908         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9909         (FlowBranching.AddBreakVector): New method.
9910
9911 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9912
9913         * attribute.cs: Small regression fix: only convert the type if we
9914         the type is different, fixes System.Drawing build.
9915
9916 2004-04-27  Martin Baulig  <martin@ximian.com>
9917
9918         * attribute.cs (Attribute.Resolve): If we have a constant value
9919         for a named field or property, implicity convert it to the correct
9920         type.
9921
9922 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9923
9924         * statement.cs (Block.Block): Implicit blocks share
9925         'child_variable_names' fields with parent blocks.
9926         (Block.AddChildVariableNames): Remove.
9927         (Block.AddVariable): Mark variable as "used by a child block" in
9928         every surrounding block.
9929         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9930         been used in a child block, complain about violation of "Invariant
9931         meaning in blocks" rule.
9932         * cs-parser.jay (declare_local_variables): Don't use
9933         AddChildVariableNames.
9934         (foreach_statement): Don't create an implicit block: 'foreach'
9935         introduces a scope.
9936
9937 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9938
9939         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9940         converting from 0L to ulong.  Fixes 57522.
9941
9942 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9943
9944         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9945         derived class hides via 'new' keyword field from base class (test-242.cs).
9946         TODO: Handle this in the more general way.
9947         
9948         * class.cs (CheckBase): Ditto.
9949
9950 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9951
9952         * decl.cs (caching_flags): New member for storing cached values
9953         as bit flags.
9954         (MemberCore.Flags): New enum where bit flags for caching_flags
9955         are defined.
9956         (MemberCore.cls_compliance): Moved to caching_flags.
9957         (DeclSpace.Created): Moved to caching_flags.
9958
9959         * class.cs: Use caching_flags instead of DeclSpace.Created
9960         
9961 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9962
9963         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9964         if we are only a derived class, not a nested class.
9965
9966         * typemanager.cs: Same as above, but do this at the MemberLookup
9967         level (used by field and methods, properties are handled in
9968         PropertyExpr).   Allow for the qualified access if we are a nested
9969         method. 
9970
9971 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9972
9973         * class.cs: Refactoring.
9974         (IMethodData): New inteface; Holds links to parent members
9975         to avoid member duplication (reduced memory allocation).
9976         (Method): Implemented IMethodData interface.
9977         (PropertyBase): New inner classes for get/set methods.
9978         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9979         (Event): New inner classes for add/remove methods.
9980         (Event.DelegateMethod): Implemented IMethodData interface.
9981
9982         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9983         EmitContext (related to class.cs refactoring).
9984
9985 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9986
9987         * delegate.cs (Delegate.VerifyApplicability): If the number of
9988         arguments are the same as the number of parameters, first try to
9989         verify applicability ignoring  any 'params' modifier on the last
9990         parameter.
9991         Fixes #56442.
9992
9993 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9994
9995         * class.cs (TypeContainer.AddIndexer): Use
9996         'ExplicitInterfaceName' to determine if interface name was
9997         explicitly specified.  'InterfaceType' is not initialized at this time.
9998         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9999         Indexers array is already in the required order.  Initialize
10000         'IndexerName' only if there are normal indexers.
10001         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10002         (TypeContainer.Emit): Emit DefaultMember attribute only if
10003         IndexerName is initialized.
10004         Fixes #56300.
10005
10006 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10007
10008         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10009         Fixes #57007
10010
10011 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10012
10013         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10014         attributes.
10015         Fix for #56456.
10016
10017         * attribute.cs (Attribute.Resolve): Check for duplicate named
10018         attributes.
10019         Fix for #56463.
10020
10021 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10022
10023         * iterators.cs (MarkYield): track whether we are in an exception,
10024         and generate code accordingly.  Use a temporary value to store the
10025         result for our state.
10026
10027         I had ignored a bit the interaction of try/catch with iterators
10028         since their behavior was not entirely obvious, but now it is
10029         possible to verify that our behavior is the same as MS .NET 2.0
10030
10031         Fixes 54814
10032
10033 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10034
10035         * iterators.cs: Avoid creating temporaries if there is no work to
10036         do. 
10037
10038         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10039         Enumerations, use TypeManager.EnumToUnderlying and call
10040         recursively. 
10041
10042         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10043         bug #57013
10044
10045         (This.Emit): Use EmitContext.EmitThis to emit our
10046         instance variable.
10047
10048         (This.EmitAssign): Ditto.
10049
10050         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10051         codepaths, we will move all the functionality into
10052         Mono.CSharp.This 
10053
10054         (FieldExpr.EmitAssign): Ditto.
10055
10056         This fixes several hidden bugs that I uncovered while doing a code
10057         review of this today.
10058
10059         * codegen.cs (EmitThis): reworked so the semantics are more clear
10060         and also support value types "this" instances.
10061
10062         * iterators.cs: Changed so that for iterators in value types, we
10063         do not pass the value type as a parameter.  
10064
10065         Initialization of the enumerator helpers is now done in the caller
10066         instead of passing the parameters to the constructors and having
10067         the constructor set the fields.
10068
10069         The fields have now `assembly' visibility instead of private.
10070
10071 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10072
10073         * expression.cs (Argument.Resolve): Check if fields passed as ref
10074         or out are contained in a MarshalByRefObject.
10075
10076         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10077         another compiler type.
10078
10079 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10080
10081         * class.cs (Indexer.Define): use the new name checking method.
10082         Also, return false on an error.
10083         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10084         (is_identifier_[start/part]_character): make static.
10085
10086 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * expression.cs (Binary.ResolveOperator): Do no append strings
10089         twice: since we can be invoked more than once (array evaluation)
10090         on the same concatenation, take care of this here.  Based on a fix
10091         from Ben (bug #56454)
10092
10093 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10094
10095         * codegen.cs: Fix another case where CS1548 must be reported (when 
10096         delay-sign isn't specified and no private is available #56564). Fix
10097         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10098         error when MCS is used on the MS runtime and we need to delay-sign 
10099         (which seems unsupported by AssemblyBuilder - see #56621).
10100
10101 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10102
10103         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10104         (TypeManager.ComputeNamespaces): Faster implementation for
10105         Microsoft runtime.
10106
10107         * compiler.csproj: Updated AssemblyName to mcs.
10108
10109 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10110
10111         * rootcontext.cs: Add new types to the boot resolution.
10112
10113         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10114         MulticastDelegate is not allowed.
10115
10116         * typemanager.cs: Add new types to lookup: System.TypedReference
10117         and ArgIterator.
10118
10119         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10120         check for TypedReference or ArgIterator, they are not allowed. 
10121
10122         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10123         makes us properly catch 1510 in some conditions (see bug 56016 for
10124         details). 
10125
10126 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10127
10128         * CryptoConvert.cs: update from corlib version
10129         with endian fixes.
10130
10131 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10132
10133         * class.cs (Indexer.Define): Check indexername declaration
10134
10135 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10136
10137         * attribute.cs (IsClsCompliant): Fixed problem with handling
10138         all three states (compliant, not-compliant, undetected).
10139
10140 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10141
10142         * attribute.cs (Attribute): Location is now public.
10143         (Resolve): Store resolved arguments (pos_values) in attribute class.
10144         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10145         (GetClsCompliantAttributeValue): New method that gets
10146         CLSCompliantAttribute value.
10147         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10148         if exists else null.
10149         (AttributeTester): New class for CLS-Compliant verification routines.
10150
10151         * class.cs (Emit): Add CLS-Compliant verification.
10152         (Method.GetSignatureForError): Implemented.
10153         (Constructor.GetSignatureForError): Implemented
10154         (Constructor.HasCompliantArgs): Returns if constructor has
10155         CLS-Compliant arguments.
10156         (Constructor.Emit): Override.
10157         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10158         is needed to test only parameters.
10159         (FieldBase.GetSignatureForError): Implemented.
10160         (TypeContainer): New member for storing base interfaces.
10161         (TypeContainer.FindMembers): Search in base interfaces too.
10162
10163         * codegen.cs (GetClsComplianceAttribute): New method that gets
10164         assembly or module CLSCompliantAttribute value.
10165         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10166         for assembly.
10167         (ModuleClass.Emit): Add error 3012 test.
10168
10169         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10170
10171         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10172         state for all decl types.
10173         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10174         if CLS-Compliant tests are required.
10175         (IsClsCompliaceRequired): New method. Analyze whether code
10176         must be CLS-Compliant.
10177         (IsExposedFromAssembly): New method. Returns true when MemberCore
10178         is exposed from assembly.
10179         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10180         value or gets cached value.
10181         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10182         is explicitly marked with CLSCompliantAttribute.
10183         (IsIdentifierClsCompliant): New abstract method. This method is
10184         used to testing error 3005.
10185         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10186         for identifier and parameters CLS-Compliant testing.
10187         (VerifyClsCompliance): New method. The main virtual method for
10188         CLS-Compliant verifications.
10189         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10190         null. I don't know why is null (too many public members !).
10191         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10192         and get value of first CLSCompliantAttribute that found.
10193
10194         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10195         (VerifyClsCompliance): Override and add extra tests.
10196
10197         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10198         clscheck- disable CLS-Compliant verification event if assembly is has
10199         CLSCompliantAttribute(true).
10200
10201         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10202         ApllyAttribute is now called in emit section as in the other cases.
10203         Possible future Emit integration.
10204         (IsIdentifierClsCompliant): New override.
10205         (VerifyClsCompliance): New override.
10206         (GetEnumeratorName): Returns full enum name.
10207
10208         * parameter.cs (GetSignatureForError): Implemented.
10209
10210         * report.cs (WarningData): New struct for Warning message information.
10211         (LocationOfPreviousError): New method.
10212         (Warning): New method. Reports warning based on the warning table.
10213         (Error_T): New method. Reports error based on the error table.
10214
10215         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10216         verifications are done here.
10217
10218         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10219
10220         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10221         CLSCompliantAttribute.
10222         (all_imported_types): New member holds all imported types from other
10223         assemblies.
10224         (LoadAllImportedTypes): New method fills static table with exported types
10225         from all referenced assemblies.
10226         (Modules): New property returns all assembly modules.
10227
10228 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10229
10230         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10231         throwing a parser error.
10232
10233         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10234         which removes the hardcoded get_/set_ prefixes for properties, as
10235         IL allows for the properties to be named something else.  
10236
10237         Bug #56013
10238
10239         * expression.cs: Do not override operand before we know if it is
10240         non-null.  Fix 56207
10241
10242 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10243
10244         * typemanager.cs: support for pinned variables.
10245
10246 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10247
10248         * decl.cs, typemanager.cs: Avoid using an arraylist
10249         as a buffer if there is only one result set.
10250
10251 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10252
10253         * expression.cs: Make sure you cant call a static method
10254         with an instance expression, bug #56174.
10255
10256 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * class.cs (IsDuplicateImplementation): Improve error reporting to
10259         flag 663 (method only differs in parameter modifier).
10260
10261         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10262         in preprocessor directives.
10263
10264         * location.cs (LookupFile): Allow for the empty path.
10265
10266         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10267         better approach for some of that patch, but its failing with the
10268         CharSet enumeration.  For now try/catch will do.
10269
10270         * typemanager.cs: Do not crash if a struct does not have fields.
10271         Fixes 56150.
10272
10273 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10274
10275         * expression.cs: cs0213, cant fix a fixed expression.
10276         fixes 50231.
10277
10278 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10279
10280         * cs-parser.jay: detect invalid embeded statements gracefully.
10281         bug #51113.
10282
10283 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10284
10285         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10286         As a regex:
10287         s/
10288         the invocation type may not be a subclass of the tye of the item/
10289         The type of the item must be a subclass of the invocation item.
10290         /g
10291
10292         Fixes bug #50820.
10293
10294 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10295
10296         * attribute.cs: Added methods to get a string and a bool from an
10297         attribute. Required to information from AssemblyKeyFileAttribute,
10298         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10299         * codegen.cs: Modified AssemblyName creation to include support for
10300         strongnames. Catch additional exceptions to report them as CS1548.
10301         * compiler.csproj: Updated include CryptoConvert.cs.
10302         * compiler.csproj.user: Removed file - user specific configuration.
10303         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10304         Mono.Security assembly. The original class is maintained and tested in
10305         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10306         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10307         like CSC 8.0 (C# v2) supports.
10308         * Makefile: Added CryptoConvert.cs to mcs sources.
10309         * rootcontext.cs: Added new options for strongnames.
10310
10311 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10312
10313         * driver.cs: For --expect-error, report error code `2'
10314         if the program compiled with no errors, error code `1' if
10315         it compiled with an error other than the one expected.
10316
10317 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10318
10319         * compiler.csproj: Updated for Visual Studio .NET 2003.
10320         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10321         * compiler.sln: Updated for Visual Studio .NET 2003.
10322
10323 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10324
10325         * expression.cs: Fix bug #47234. We basically need to apply the
10326         rule that we prefer the conversion of null to a reference type
10327         when faced with a conversion to 'object' (csc behaviour).
10328
10329 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10330
10331         * statement.cs: Shorter form for foreach, eliminates
10332         a local variable. r=Martin.
10333
10334 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10335
10336         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10337         checks if we can use brtrue/brfalse to test for 0.
10338         * expression.cs: use the above in the test for using brtrue/brfalse.
10339         cleanup code a bit.
10340
10341 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10342
10343         * expression.cs: Rewrite string concat stuff. Benefits:
10344
10345         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10346         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10347         rather than a concat chain.
10348
10349         * typemanager.cs: Add lookups for more concat overloads.
10350
10351 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10352
10353         * expression.cs: Emit shorter il code for array init.
10354
10355         newarr
10356         dup
10357         // set 1
10358
10359         // set 2
10360
10361         newarr
10362         stloc.x
10363
10364         ldloc.x
10365         // set 1
10366
10367         ldloc.x
10368         // set 2
10369
10370 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10371
10372         * statement.cs: Before, two switch blocks would be merged if the
10373         total size of the blocks (end_item - begin_item + 1) was less than
10374         two times the combined sizes of the blocks.
10375
10376         Now, it will only merge if after the merge at least half of the
10377         slots are filled.
10378
10379         fixes 55885.
10380
10381 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10382
10383         * class.cs : csc build fix for GetMethods(). See bug #52503.
10384
10385 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10386
10387         * expression.cs: Make sure fp comparisons work with NaN.
10388         This fixes bug #54303. Mig approved this patch a long
10389         time ago, but we were not able to test b/c the runtime
10390         had a related bug.
10391
10392 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10393
10394         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10395
10396 2004-03-19  Martin Baulig  <martin@ximian.com>
10397
10398         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10399         error here and not in our caller.
10400
10401 2004-03-19  Martin Baulig  <martin@ximian.com>
10402
10403         * interface.cs: Completely killed this file.
10404         (Interface): We're now a TypeContainer and live in class.cs.
10405
10406         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10407         argument; we're now also called for interfaces.
10408         (TypeContainer.DefineMembers): Allow this method being called
10409         multiple times.
10410         (TypeContainer.GetMethods): New public method; formerly known as
10411         Interface.GetMethod().  This is used by PendingImplementation.
10412         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10413         it's now private and non-static.
10414         (Interface): Moved this here; it's now implemented similar to
10415         Class and Struct.
10416         (Method, Property, Event, Indexer): Added `bool is_interface'
10417         argument to their .ctor's.
10418         (MemberBase.IsInterface): New public field.
10419
10420         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10421         instances instead of InterfaceMethod, InterfaceProperty, etc.
10422         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10423         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10424
10425 2004-03-19  Martin Baulig  <martin@ximian.com>
10426
10427         * class.cs (MethodCore.IsDuplicateImplementation): New private
10428         method which does the CS0111 checking.
10429         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10430         Use IsDuplicateImplementation().
10431
10432 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10433
10434         * decl.cs (FindMemberToOverride): New method to find the correct
10435         method or property to override in the base class.
10436         * class.cs
10437             - Make Method/Property use the above method to find the
10438               version in the base class.
10439             - Remove the InheritableMemberSignatureCompare as it is now
10440               dead code.
10441
10442         This patch makes large code bases much faster to compile, as it is
10443         O(n) rather than O(n^2) to do this validation.
10444
10445         Also, it fixes bug 52458 which is that nested classes are not
10446         taken into account when finding the base class member.
10447
10448         Reviewed/Approved by Martin.
10449
10450 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10451
10452         * interface.cs: In all interface classes removed redundant
10453         member initialization.
10454
10455 2004-03-16  Martin Baulig  <martin@ximian.com>
10456
10457         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10458
10459 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10460
10461         * decl.cs (DefineTypeAndParents): New helper method to define a
10462         type's containers before the type itself is defined;  This is a
10463         bug exposed by the recent changes to Windows.Forms when an
10464         implemented interface was defined inside a class that had not been
10465         built yet.   
10466
10467         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10468
10469         (Check): Loop correctly to report errors modifiers
10470         (UNSAFE was not in the loop, since it was the same as TOP).
10471
10472         * interface.cs: Every interface member now takes a ModFlags,
10473         instead of a "is_new" bool, which we set on the base MemberCore. 
10474
10475         Every place where we called "UnsafeOk" in the interface, now we
10476         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10477         the unsafe settings from the member declaration instead of the
10478         container interface. 
10479
10480         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10481
10482         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10483         `set_indexer_name' to the pending bits (one per type).
10484
10485         We fixed a bug today that was picking the wrong method to
10486         override, since for properties the existing InterfaceMethod code
10487         basically ignored the method name.  Now we make sure that the
10488         method name is one of the valid indexer names.
10489
10490 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10491  
10492         * support.cs (SeekableStreamReader): Keep track of stream byte
10493         positions and don't mix them with character offsets to the buffer.
10494
10495         Patch from Gustavo Giráldez
10496
10497 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10498
10499         * interface.cs (InterfaceSetGetBase): Removed double member
10500         initialization, base class does it as well.
10501
10502 2004-03-13  Martin Baulig  <martin@ximian.com>
10503
10504         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10505         when compiling corlib.
10506
10507 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10508
10509         * convert.cs (ExplicitConversion): We were reporting an error on
10510         certain conversions (object_type source to a value type, when the
10511         expression was `null') before we had a chance to pass it through
10512         the user defined conversions.
10513
10514         * driver.cs: Replace / and \ in resource specifications to dots.
10515         Fixes 50752
10516
10517         * class.cs: Add check for duplicate operators.  Fixes 52477
10518
10519 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10520
10521         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10522         that are in the middle of the statements, not only at the end.
10523         Fixes #54987
10524
10525         * class.cs (TypeContainer.AddField): No longer set the
10526         `HaveStaticConstructor' flag, now we call it
10527         `UserDefineStaticConstructor' to diferentiate the slightly
10528         semantic difference.
10529
10530         The situation is that we were not adding BeforeFieldInit (from
10531         Modifiers.TypeAttr) to classes that could have it.
10532         BeforeFieldInit should be set to classes that have no static
10533         constructor. 
10534
10535         See:
10536
10537         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10538
10539         And most importantly Zoltan's comment:
10540
10541         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10542
10543         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10544          before its static fields are used', i.e. initialization does not need
10545          to be triggered by the first access to the type. Setting this flag
10546          helps the JIT to compile better code, since it can run the static
10547          constructor at JIT time, and does not need to generate code to call it
10548          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10549          this flag for lots of classes like String. 
10550          
10551          csc sets this flag if the type does not have an explicit static 
10552          constructor. The reasoning seems to be that if there are only static
10553          initalizers for a type, and no static constructor, then the programmer
10554          does not care when this initialization happens, so beforefieldinit
10555          can be used.
10556          
10557          This bug prevents the AOT compiler from being usable, since it 
10558          generates so many calls to mono_runtime_class_init that the AOT code
10559          is much slower than the JITted code. The JITted code is faster, 
10560          because it does not generate these calls if the vtable is type is
10561          already initialized, which is true in the majority of cases. But the
10562          AOT compiler can't do this."
10563
10564 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10565
10566         * class.cs (MethodData.Emit): Refactor the code so symbolic
10567         information is generated for destructors;  For some reasons we
10568         were taking a code path that did not generate symbolic information
10569         before. 
10570
10571 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10572
10573         * class.cs: Create a Constructor.CheckBase method that
10574         takes care of all validation type code. The method
10575         contains some code that was moved from Define.
10576
10577         It also includes new code that checks for duplicate ctors.
10578         This fixes bug #55148.
10579
10580 2004-03-09  Joshua Tauberer <tauberer@for.net>
10581
10582         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10583         a { ... }-style array creation invokes EmitStaticInitializers
10584         which is not good for reference-type arrays.  String, decimal
10585         and now null constants (NullCast) are not counted toward
10586         static initializers.
10587
10588 2004-03-05  Martin Baulig  <martin@ximian.com>
10589
10590         * location.cs (SourceFile.HasLineDirective): New public field;
10591         specifies whether the file contains or is referenced by a "#line"
10592         directive.
10593         (Location.DefineSymbolDocuments): Ignore source files which
10594         either contain or are referenced by a "#line" directive.        
10595
10596 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10597
10598         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10599         direct access to our parent, so check the method inline there.
10600
10601 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10602
10603         * expression.cs (Invocation.EmitCall): Miguel's last commit
10604         caused a regression. If you had:
10605
10606             T t = null;
10607             t.Foo ();
10608
10609         In Foo the implict this would be null.
10610
10611 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10612
10613         * expression.cs (Invocation.EmitCall): If the method is not
10614         virtual, do not emit a CallVirt to it, use Call.
10615
10616         * typemanager.cs (GetFullNameSignature): Improve the method to
10617         cope with ".ctor" and replace it with the type name.
10618
10619         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10620         as an argument the ConstructorBuilder where it is being defined,
10621         to catch the recursive constructor invocations.
10622
10623 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10624
10625         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10626         routines to check if a type is an enumerable/enumerator allow
10627         classes that implement the IEnumerable or IEnumerator interfaces.
10628
10629         * class.cs (Property, Operator): Implement IIteratorContainer, and
10630         implement SetYields.
10631
10632         (Property.Define): Do the block swapping for get_methods in the
10633         context of iterators.   We need to check if Properties also
10634         include indexers or not.
10635
10636         (Operator): Assign the Block before invoking the
10637         OperatorMethod.Define, so we can trigger the Iterator code
10638         replacement. 
10639
10640         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10641         Property and Operator classes are not created when we parse the
10642         declarator but until we have the block completed, so we use a
10643         singleton SimpleIteratorContainer.Simple to flag whether the
10644         SetYields has been invoked.
10645
10646         We propagate this setting then to the Property or the Operator to
10647         allow the `yield' to function.
10648
10649 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10650
10651         * codegen.cs: Implemented attribute support for modules.
10652         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10653         Assembly/Module functionality.
10654
10655         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10656         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10657         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10658
10659 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10660
10661         * interface.cs (FindMembers): The operation is performed on all base
10662         interfaces and not only on the first. It is required for future CLS Compliance patch.
10663
10664 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10665
10666         * statement.cs, codegen.cs:
10667         This patch deals with patterns such as:
10668
10669         public class List : IEnumerable {
10670
10671                 public MyEnumerator GetEnumerator () {
10672                         return new MyEnumerator(this);
10673                 }
10674
10675                 IEnumerator IEnumerable.GetEnumerator () {
10676                         ...
10677                 }
10678                 
10679                 public struct MyEnumerator : IEnumerator {
10680                         ...
10681                 }
10682         }
10683
10684         Before, there were a few things we did wrong:
10685         1) we would emit callvirt on a struct, which is illegal
10686         2) we emited ldarg when we needed to emit ldarga
10687         3) we would mistakenly call the interface methods on an enumerator
10688         type that derived from IEnumerator and was in another assembly. For example:
10689
10690         public class MyEnumerator : IEnumerator
10691
10692         Would have the interface methods called, even if there were public impls of the
10693         method. In a struct, this lead to invalid IL code.
10694
10695 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10696
10697         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10698           renamed to Emit.
10699
10700         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10701
10702 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10703
10704         * cs-parser.jay: Fix small regression: we were not testing V2
10705         compiler features correctly.
10706
10707         * interface.cs: If the emit context is null, then create one
10708
10709 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10710
10711         * decl.cs (GetSignatureForError): New virtual method to get full name
10712           for error messages.
10713
10714         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10715           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10716
10717         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10718           Duplicated members and code in these classes has been removed.
10719           Better encapsulation in these classes.
10720
10721 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10722
10723         * assign.cs (Assign.DoResolve): When dealing with compound
10724         assignments, there is a new rule in ECMA C# 2.4 (might have been
10725         there before, but it is documented here) that states that in:
10726
10727         a op= b;
10728
10729         If b is of type int, and the `op' is a shift-operator, then the
10730         above is evaluated as:
10731
10732         a = (int) a op b 
10733
10734         * expression.cs (Binary.ResolveOperator): Instead of testing for
10735         int/uint/long/ulong, try to implicitly convert to any of those
10736         types and use that in pointer arithmetic.
10737
10738         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10739         method to print information for from the type, not from the
10740         null-method we were given.
10741
10742 2004-02-01  Duncan Mak  <duncan@ximian.com>
10743
10744         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10745         parsing for cmd, fixes bug #53694.
10746
10747 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10748
10749         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10750         in the member name duplication tests. Property and operator name duplication
10751         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10752
10753 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10754
10755         * interface.cs (PopulateMethod): Fixed crash when interface method
10756         returns not existing type (error test cs0246-3.cs).
10757
10758 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10759
10760         * cs-parser.jay (interface_accessors): Re-write actions to also
10761         store attributes attached to get and set methods. Fix spelling
10762         while at it.
10763
10764         (inteface_property_declaration): Modify accordingly.
10765
10766         (InterfaceAccessorInfo): New helper class to store information to pass
10767         around between rules that use interface_accessors.
10768
10769         * interface.cs (Emit): Apply attributes on the get and set
10770         accessors of properties and indexers too.
10771
10772         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10773         right MethodBuilder when applying attributes to the get and set accessors.
10774
10775 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10776
10777         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10778
10779 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10782
10783 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10784
10785         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10786         changes that treat `yield' specially when present before `break'
10787         or `return' tokens.
10788
10789         * cs-tokenizer.cs: yield is no longer a keyword.
10790
10791 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10792
10793         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10794         setting for default constructors.
10795         For default constructors are almost every time set wrong Modifier. The
10796         generated IL code has been alright. But inside mcs this values was
10797         wrong and this was reason why several of my CLS Compliance tests
10798         failed.
10799
10800 2004-01-22  Martin Baulig  <martin@ximian.com>
10801
10802         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10803         not a QualifiedIdentifier.  This is what `type_name_expression'
10804         was previously doing.
10805         (type_name_expression): Removed; the code is now in
10806         `namespace_or_type_name'.
10807         (qualified_identifier): Removed, use `namespace_or_type_name'
10808         instead.
10809         (QualifiedIdentifier): Removed this class.      
10810
10811 2004-01-22  Martin Baulig  <martin@ximian.com>
10812
10813         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10814         not a string as alias name.
10815
10816 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10817
10818         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10819         #52730 bug, and instead compute correctly the need to use a
10820         temporary variable when requesting an address based on the
10821         static/instace modified of the field and the constructor.
10822  
10823 2004-01-21  Martin Baulig  <martin@ximian.com>
10824
10825         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10826         class and namespace before looking up aliases.  Fixes #52517.
10827
10828 2004-01-21  Martin Baulig  <martin@ximian.com>
10829
10830         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10831         assinged in a 'try'; fixes exception4.cs.
10832
10833 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10834         * class.cs : Implemented parameter-less constructor for TypeContainer
10835
10836         * decl.cs: Attributes are now stored here. New property OptAttributes
10837
10838         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10839
10840         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10841
10842 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10843
10844         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10845           (CSharpSignature): New method for indexer and property signature.
10846
10847 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10848
10849         * pending.cs (IsVirtualFilter): Faster implementation.
10850
10851 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10852
10853         * typemanager.cs: Avoid inclusion of same assembly more than once.
10854
10855 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10856
10857         * cs-parser.jay: Fixed problem where the last assembly attribute
10858           has been applied also to following declaration (class, struct, etc.)
10859           
10860 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10861
10862         * class.cs: Added error CS0538, CS0539 reporting.
10863         Fixed crash on Microsoft runtime when field type is void.
10864
10865         * cs-parser.jay: Added error CS0537 reporting.
10866
10867         * pending.cs: Added error CS0535 reporting.
10868         Improved error report for errors CS0536, CS0534.
10869
10870 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10871
10872         Merge a few bits from the Anonymous Method MCS tree.
10873
10874         * statement.cs (ToplevelBlock): New class for toplevel methods,
10875         will hold anonymous methods, lifted variables.
10876
10877         * cs-parser.jay: Create toplevel blocks for delegates and for
10878         regular blocks of code. 
10879
10880 2004-01-20  Martin Baulig  <martin@ximian.com>
10881
10882         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10883         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10884         and `NeedExplicitReturn'; added `IsLastStatement'.
10885         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10886         have a `ReturnLabel' or we're not unreachable.
10887
10888         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10889         child's reachability; don't just override ours with it.  Fixes
10890         #58058 (lluis's example).
10891         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10892         InFinally(), InLoop(), InSwitch() and
10893         BreakCrossesTryCatchBoundary() methods.
10894
10895         * statement.cs (Return): Do all error checking in Resolve().
10896         Unless we are the last statement in a top-level block, always
10897         create a return label and jump to it.
10898         (Break, Continue): Do all error checking in Resolve(); also make
10899         sure we aren't leaving a `finally'.
10900         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10901         statement in a top-level block.
10902         (Block.Flags): Added `IsDestructor'.
10903         (Block.IsDestructor): New public property.
10904
10905 2004-01-20  Martin Baulig  <martin@ximian.com>
10906
10907         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10908
10909 2004-01-20  Martin Baulig  <martin@ximian.com>
10910
10911         * statement.cs (Statement.ResolveUnreachable): New public method.
10912         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10913         (Block.Resolve): Resolve unreachable statements.
10914
10915 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10916
10917         * expression.cs: We need to fix the case where we do
10918         not have a temp variable here.
10919
10920         * assign.cs: Only expression compound assignments need
10921         temporary variables.
10922
10923 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10924
10925         * flowanalysis.cs: Reduce memory allocation in a few ways:
10926           - A block with no variables should not allocate a bit
10927             vector for itself.
10928           - A method with no out parameters does not need any tracking
10929             for assignment of the parameters, so we need not allocate
10930             any data for it.
10931           - The arrays:
10932                 public readonly Type[] VariableTypes;
10933                 public readonly string[] VariableNames;
10934             Are redundant. The data is already stored in the variable
10935             map, so we need not allocate another array for it.
10936           - We need to add alot of checks for if (params | locals) == null
10937             due to the first two changes.
10938
10939 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10942         implement IMemoryLocation, we store a copy on a local variable and
10943         take the address of it.  Patch from Benjamin Jemlich
10944
10945         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10946         to use a special "type_name_expression" rule which reduces the
10947         number of "QualifiedIdentifier" classes created, and instead
10948         directly creates MemberAccess expressions.
10949
10950 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10951
10952         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10953         that fixes #52853.  Null literal assignment to ValueType
10954
10955         * class.cs (MethodData.Emit): Instead of checking the name of the
10956         method to determine if its a destructor, create a new derived
10957         class from Method called Destructor, and test for that.  
10958
10959         * cs-parser.jay: Create a Destructor object instead of a Method.  
10960
10961         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10962
10963         Fixes: 52933
10964
10965 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * expression.cs (Binary.ResolveOperator): Perform an implicit
10968         conversion from MethodGroups to their delegate types on the
10969         Addition operation.
10970
10971         * delegate.cs: Introduce a new class DelegateCreation that is the
10972         base class for `NewDelegate' and `ImplicitDelegateCreation',
10973         factor some code in here.
10974
10975         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10976         conversion from MethodGroups to compatible delegate types. 
10977
10978         * ecore.cs (Expression.Resolve): Do not flag error 654
10979         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10980         we allow conversions from MethodGroups to delegate types now.
10981
10982         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10983         assignments in v2 either.
10984
10985 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10986
10987         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10988         static read-only fields in ctors.
10989
10990         Applied patch from Benjamin Jemlich 
10991
10992         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10993
10994 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10995
10996         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10997         here to return true, as they can be used like this:
10998
10999                 (XXX) int.MEMBER ()
11000
11001         Fixed 49836 and all the other dups
11002
11003 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11004
11005         * driver.cs: Implement /win32res and /win32icon.
11006
11007 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * cs-parser.jay: Add a rule to improve error handling for the
11010         common mistake of placing modifiers after the type.
11011
11012 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * cs-parser.jay (interface_event_declaration): Catch
11015         initialization of events on interfaces, and report cs0068
11016
11017         * cs-parser.jay (interface_event_declaration): Catch
11018         initialization of events. 
11019
11020         * ecore.cs: Better report missing constructors.
11021
11022         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11023         the error reporting done in the wrong place.  Fix.
11024
11025         * expression.cs (Binary.ResolveOperator): Catch the 
11026         operator + (E x, E y) error earlier, and later allow for implicit
11027         conversions in operator +/- (E e, U x) from U to the underlying
11028         type of E.
11029
11030         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11031         52596, if the container class is abstract, the default constructor
11032         is protected otherwise its public (before, we were always public).
11033
11034         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11035         fixed statement.
11036
11037         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11038         Jemlich that fixes bug #52597, MCS was generating invalid code for
11039         idisposable structs.   Thanks to Ben for following up with this
11040         bug as well.
11041
11042 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * driver.cs: Allow assemblies without code to be generated, fixes
11045         52230.
11046
11047 2004-01-07  Nick Drochak <ndrochak@gol.com>
11048
11049         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11050
11051 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * cs-parser.jay: Add rules to improve error reporting if fields or
11054         methods are declared at the namespace level (error 116)
11055
11056         * Add rules to catch event add/remove
11057
11058 2004-01-04  David Sheldon <dave-mono@earth.li>
11059
11060   * expression.cs: Added matching ")" to error message for 
11061   CS0077
11062
11063 2004-01-03 Todd Berman <tberman@gentoo.org>
11064
11065         * ecore.cs, attribute.cs:
11066         Applying fix from #52429.
11067
11068 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11069
11070         * ecore.cs, expression.cs, statement.cs:
11071         Total rewrite of how we handle branching. We
11072         now handle complex boolean expressions with fewer
11073         jumps. As well if (x == 0) no longer emits a ceq.
11074
11075         if (x is Foo) is much faster now, because we generate
11076         better code.
11077
11078         Overall, we get a pretty big improvement on our benchmark
11079         tests. The code we generate is smaller and more readable.
11080
11081         I did a full two-stage bootstrap. The patch was reviewed
11082         by Martin and Miguel.
11083
11084 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11085
11086         * cs-parser.jay: Make primary_expression not take a QI.
11087         we dont need this because the member_access rule covers
11088         us here. So we replace the rule with just IDENTIFIER.
11089
11090         This has two good effects. First, we remove a s/r conflict.
11091         Second, we allocate many fewer QualifiedIdentifier objects.
11092
11093 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11094
11095         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11096         set the correct information via SRE. This prevents
11097         hanging on the MS runtime. Fixes #29374.
11098
11099 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11100
11101         * convert.cs: correctly handle conversions to value types
11102         from Enum and ValueType as unboxing conversions.
11103
11104         Fixes bug #52569. Patch by Benjamin Jemlich.
11105
11106 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11107
11108         * expression.cs (BetterConversion): Prefer int -> uint
11109         over int -> ulong (csc's behaviour). This fixed bug #52046.
11110
11111 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11112
11113         * decl.cs (MemberCache.FindMembers): now returns a
11114         MemberInfo [].
11115
11116         * typemanager.cs: In general, go with with ^^.
11117         (CopyNewMethods): take an IList.
11118         (RealMemberLookup): Only allocate an arraylist
11119         if we copy from two sets of methods.
11120
11121         This change basically does two things:
11122         1) Fewer array lists allocated due to CopyNewMethods.
11123         2) the explicit cast in MemberList costed ALOT.
11124
11125 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11126
11127         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11128         a hashtable to avoid needless string allocations when an identifier is
11129         used more than once (the common case).
11130
11131 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11132
11133         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11134         is broken, it will not return anything. So, we
11135         have to use the information we have in mcs to
11136         do the task.
11137
11138         * typemanager.cs: Add a cache for GetInterfaces,
11139         since this will now be used more often (due to ^^)
11140
11141         (GetExplicitInterfaces) New method that gets the
11142         declared, not effective, interfaces on a type
11143         builder (eg, if you have interface IFoo, interface
11144         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11145         { IBar }.
11146
11147         This patch makes MCS able to bootstrap itself on
11148         Windows again.
11149
11150 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11151
11152         * expression.cs: Remove the Nop's that Miguel put
11153         in by mistake.
11154
11155 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11156
11157         * report.cs, codegen.cs: Give the real stack trace to
11158         the error when an exception is thrown.
11159
11160 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11161
11162         * decl.cs: only allocate hashtables for ifaces if 
11163         it is an iface!
11164
11165 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11166
11167         * expression.cs: fix the error from cs0121-2.cs
11168         (a parent interface has two child interfaces that
11169         have a function with the same name and 0 params
11170         and the function is called through the parent).
11171
11172 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11173
11174         * class.cs, rootcontext.cs, typmanager.cs: do not
11175         leak pointers.
11176
11177 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11178
11179         * codegen.cs: remove stack for the ec flow branching.
11180         It is already a linked list, so no need.
11181
11182 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11183
11184         * Makefile: Allow custom profiler here.
11185
11186 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11187
11188         * typemanager.cs (LookupType):
11189           - Use a static char [], because split takes
11190             a param array for args, so it was allocating
11191             every time.
11192           - Do not store true in a hashtable, it boxes.
11193
11194 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11195
11196         * flowanalysis.cs: bytify common enums.
11197
11198 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11199
11200         * modifiers.cs: Add a new set of flags for the
11201         flags allowed on explicit interface impls.
11202         * cs-parser.jay: catch the use of modifiers in
11203         interfaces correctly.
11204         * class.cs: catch private void IFoo.Blah ().
11205
11206         All related to bug #50572.
11207
11208 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11209
11210         * decl.cs: Rewrite the consistant accessability checking.
11211         Accessability is not linear, it must be implemented in
11212         a tableish way. Fixes #49704.
11213
11214 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11215
11216         * expression.cs: Handle negation in a checked context.
11217         We must use subtraction from zero. Fixes #38674.
11218
11219 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11220
11221         * class.cs: Ignore static void main in DLLs.
11222         * rootcontext.cs: Handle the target type here,
11223         since we are have to access it from class.cs
11224         * driver.cs: account for the above.
11225
11226 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11227
11228         * report.cs: Give line numbers and files if available.
11229
11230 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11231
11232         * driver.cs: Implement /addmodule.
11233
11234         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11235         ModuleBuilders.
11236
11237 2003-12-20  Martin Baulig  <martin@ximian.com>
11238
11239         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11240         (FieldBase.IsAssigned): Removed this field.
11241         (FieldBase.SetAssigned): New public method.
11242         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11243
11244 2003-12-20  Martin Baulig  <martin@ximian.com>
11245
11246         * expression.cs (LocalVariableReference.DoResolve): Don't set
11247         `vi.Used' if we're called from DoResolveLValue().
11248
11249         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11250         returns the usage vector it just merged into the current one -
11251         pass this one to UsageWarning().
11252         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11253         of the `EmitContext', don't call this recursively on our children.
11254
11255 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11256
11257         * driver.cs: Implement /target:module.
11258
11259 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11260
11261         * support.cs (CharArrayHashtable): New helper class.
11262
11263         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11264         char arrays, not strings, so we can avoid creating a string in
11265         consume_identifier if the identifier is a keyword.
11266
11267 2003-12-16  Martin Baulig  <martin@ximian.com>
11268
11269         * statement.cs (LocalInfo.Assigned): Removed this property.
11270         (LocalInfo.Flags): Removed `Assigned'.
11271         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11272         and uses flow analysis.
11273         (Block.UsageWarning): Made this method private.
11274         (Block.Resolve): Call UsageWarning() if appropriate.
11275
11276         * expression.cs (LocalVariableReference.DoResolve): Always set
11277         LocalInfo.Used here.
11278
11279 2003-12-13  Martin Baulig  <martin@ximian.com>
11280
11281         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11282         any value here; we're now using flow analysis to figure out
11283         whether a statement/block returns a value.
11284
11285 2003-12-13  Martin Baulig  <martin@ximian.com>
11286
11287         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11288         working again.
11289         (FlowBranching.MergeFinally): Don't call
11290         `branching.CheckOutParameters()' here, this is called in
11291         MergeTopBlock().
11292         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11293         when adding the `finally' vector.       
11294
11295 2003-12-13  Martin Baulig  <martin@ximian.com>
11296
11297         * flowanalysis.cs
11298         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11299         actually work and also fix #48962.
11300
11301 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11302
11303         * decl.cs: Do not check System.Object for nested types,
11304         since we know it does not have any. Big bang for buck:
11305
11306         BEFORE:
11307            Run 1:   8.35 seconds
11308            Run 2:   8.32 seconds
11309            corlib:  17.99 seconds
11310         AFTER:
11311            Run 1:   8.17 seconds
11312            Run 2:   8.17 seconds
11313            corlib:  17.39 seconds
11314
11315 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11316
11317         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11318         time we are returning 0 members, so we save alot here.
11319
11320 2003-12-11  Martin Baulig  <martin@ximian.com>
11321
11322         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11323         `MergeChild()', also just take the `FlowBranching' as argument;
11324         call Merge() on it and return the result.
11325         (FlowBranching.Merge): We don't need to do anything if we just
11326         have one sibling.
11327
11328 2003-12-11  Martin Baulig  <martin@ximian.com>
11329
11330         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11331         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11332         Maurer for this idea.
11333
11334 2003-12-11  Martin Baulig  <martin@ximian.com>
11335
11336         * flowanalysis.cs (MergeResult): This class is now gone; we now
11337         use the `UsageVector' for this.  The reason for this is that if a
11338         branching just has one sibling, we don't need to "merge" them at
11339         all - that's the next step to do.
11340         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11341         `MergeResult'.
11342
11343 2003-12-11  Martin Baulig  <martin@ximian.com>
11344
11345         Reworked flow analyis and made it more precise and bug-free.  The
11346         most important change is that we're now using a special `Reachability'
11347         class instead of having "magic" meanings of `FlowReturns'.  I'll
11348         do some more cleanups and optimizations and also add some more
11349         documentation this week.
11350
11351         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11352         largely reworked this class.
11353         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11354         the new `Reachability' class instead of having "magic" values here.
11355         (FlowBranching): We're now using an instance of `Reachability'
11356         instead of having separate `Returns', `Breaks' etc. fields.
11357
11358         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11359         based on flow analysis; ignore the return value of block.Emit ().
11360
11361 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11362
11363         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11364         if they are private.
11365
11366 2003-12-09  Martin Baulig  <martin@ximian.com>
11367
11368         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11369         call them directly on the UsageVector.
11370
11371 2003-12-09  Martin Baulig  <martin@ximian.com>
11372
11373         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11374         Changed return type from `FlowReturns' to `Reachability'.
11375
11376 2003-12-09  Martin Baulig  <martin@ximian.com>
11377
11378         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11379         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11380         `Reachable' fields with a single `Reachability' one.
11381
11382 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11383
11384         * class.cs (FindMembers): Remove foreach's.
11385
11386         Bootstrap times:
11387
11388         BEFORE
11389                 Run 1:   8.74 seconds
11390                 Run 2:   8.71 seconds
11391
11392         AFTER
11393                 Run 1:   8.64 seconds
11394                 Run 2:   8.58 seconds
11395
11396
11397 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11398
11399         * cs-parser.jay:
11400         * gen-treedump.cs:
11401         * statement.cs:
11402         This patch does a few things:
11403                 1. EmptyStatement is now a singleton, so it is never reallocated.
11404                 2. All blah is EmptyStatement constructs have been changed to
11405                    blah == EmptyStatement.Value, which is much faster and valid
11406                    now that EmptyStatement is a singleton.
11407                 3. When resolving a block, rather than allocating a new array for
11408                    the non-empty statements, empty statements are replaced with
11409                    EmptyStatement.Value
11410                 4. Some recursive functions have been made non-recursive.
11411         Mainly the performance impact is from (3), however (1) and (2) are needed for
11412         this to work. (4) does not make a big difference in normal situations, however
11413         it makes the profile look saner.
11414
11415         Bootstrap times:
11416
11417         BEFORE
11418         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11419         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11420         Total memory allocated: 56397 KB
11421
11422         AFTER
11423         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11424         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11425         Total memory allocated: 55666 KB
11426
11427 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11428
11429         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11430         than the hashtable in a hashtable version
11431
11432         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11433         we always end up concating a string. This results in a huge perf
11434         loss, because many strings have to be tracked by the GC. In this
11435         patch, we first use a hashtable that works with two keys, so that
11436         the strings do not need to be concat'ed.
11437
11438         Bootstrap times:
11439         BEFORE
11440                 Run 1:   8.74 seconds
11441                 Run 2:   8.71 seconds
11442
11443         AFTER
11444                 Run 1:   8.65 seconds
11445                 Run 2:   8.56 seconds
11446
11447 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11448
11449         * Makefile: Add a new target `do-time' that does a quick and simple
11450         profile, leaving easy to parse output.
11451
11452 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11453
11454         * codegen.cs (Init): Create the dynamic assembly with 
11455         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11456
11457 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11458
11459         * support.cs: Make the PtrHashtable use only one
11460         instance of its comparer.
11461
11462 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11463
11464         * typemanager.cs: Fix lookup of GetNamespaces.
11465
11466 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11467
11468         * expression.cs: Removed redundant line.
11469
11470         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11471         ArrayLists, use for loops with bounds.  
11472
11473         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11474         arraylist.
11475
11476         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11477         arraylists, use for loop with bounds.
11478
11479         The above three changes give us a 0.071 second performance
11480         improvement out of 3.294 seconds down to 3.223.  On my machine
11481         the above changes reduced the memory usage by 1,387 KB during
11482         compiler bootstrap.
11483
11484         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11485         QualifiedIdentifiers.  Before we created a new string through
11486         concatenation, and mostly later on, the result would be
11487         manipulated by DecomposeQI through string manipulation.
11488
11489         This reduced the compiler memory usage for bootstrapping from
11490         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11491         compile times in 0.05 seconds.
11492
11493 2003-11-28  Dick Porter  <dick@ximian.com>
11494
11495         * support.cs: Do string compares with the Invariant culture.
11496
11497         * rootcontext.cs: 
11498         * gen-treedump.cs: 
11499         * expression.cs: 
11500         * driver.cs: 
11501         * decl.cs: 
11502         * codegen.cs: 
11503         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11504         the comparison is done with the Invariant culture.
11505
11506 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11507
11508         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11509         GetEnumerator method.
11510
11511         (ProbeCollectionType): Iterate starting at the most specific type
11512         upwards looking for a GetEnumerator
11513
11514         * expression.cs: Shift count can be up to 31 for int/uint and 63
11515         for long/ulong.
11516
11517 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11518
11519         * statement.cs (Block.LookupLabel): Also look for the label on the
11520         children blocks.  Use a hash table to keep track of visited
11521         nodes. 
11522
11523         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11524         we actually did transform the other operand, otherwise fall back
11525         to the common codepath that casts to long.
11526
11527         * cs-tokenizer.cs: Use the same code pattern as the int case.
11528         Maybe I should do the parsing myself, and avoid depending on the
11529         Parse routines to get this done.
11530
11531 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11532
11533         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11534         which fixes bug 51347.  This time test it.
11535
11536         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11537         attributes for example can not tell the difference between these.
11538         The difference was only a syntax feature of the language. 
11539
11540         * attribute.cs: Apply attributes to delegates.
11541
11542         * delegate.cs: Call the apply attributes method.
11543
11544 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11545
11546         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11547         comparing 0 vs Byte.MinValue, not the value
11548
11549         (ImplicitConversionRequired): When reporting a conversion error,
11550         use error 31 to print out the constant error instead of the
11551         simpler 29.
11552
11553         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11554         which fixes bug 51347.
11555
11556 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11557
11558         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11559         which fixes the -warnaserror command line option.
11560
11561 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * cfold.cs (DoNumericPromotions): During constant folding of
11564         additions on UIntConstant, special case intconstants with
11565         IntConstants like we do on the expression binary operator. 
11566
11567 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11568
11569         * convert.cs (ImplicitReferenceConversion): We were missing a case
11570         (System.Enum are not value types or class types, so we need to
11571         classify them separatedly).
11572
11573         * driver.cs: We do not support error 2007.
11574
11575 2003-11-12 Jackson Harper <jackson@ximian.com>
11576
11577         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11578         system directory. Also use the full file name so users can
11579         libraries names mscorlib-o-tron.dll in a non system dir.
11580
11581 2003-11-10  Martin Baulig  <martin@ximian.com>
11582
11583         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11584         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11585         calling `ResolveType()' on them, directly assign their `Type'.
11586
11587 2003-11-08  Martin Baulig  <martin@ximian.com>
11588
11589         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11590         return value and the `out parent' parameter.
11591         (TypeContainer.DefineType): Moved the CS0644 check into
11592         GetClassBases().  Don't pass the interface types to the
11593         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11594         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11595
11596         * ecore.cs (TypeExpr.IsAttribute): New property.
11597         (TypeExpr.GetInterfaces): New method.
11598
11599         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11600         TypeExpr instead of a Type.
11601         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11602         (Interface.DefineType): Don't pass the interface types to the
11603         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11604         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11605
11606         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11607         instead of a `Type[]'.
11608         (TypeManager.RegisterBuilder): Likewise.
11609         (TypeManager.AddUserInterface): Likewise.
11610         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11611         `Type[]' and also return a `TypeExpr[]'.
11612         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11613
11614 2003-11-08  Martin Baulig  <martin@ximian.com>
11615
11616         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11617         Expression.     
11618
11619 2003-11-08  Martin Baulig  <martin@ximian.com>
11620
11621         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11622         TypeManager.ResolveExpressionTypes().
11623
11624         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11625         instead of an Expression.
11626         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11627         (TypeExpression): New public class; formerly known as `TypeExpr'.
11628
11629         * expression.cs (ComposedCast): Derive from TypeExpr.
11630
11631         * typemanager.cs (TypeManager.system_*_expr): These are now
11632         TypExpr's instead of Expression's.
11633         (TypeManager.ResolveExpressionTypes): New public static function;
11634         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11635         of them.        
11636
11637 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11638
11639         * expression.cs (New.DoResolve): Do not dereference value that
11640         might be a null return.
11641
11642         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11643         sure that the constant value has the right type.  Fixes an
11644         unreported bug, similar to 50425.
11645
11646         * const.cs (Const.LookupConstantValue): Call
11647         ImplicitStandardConversionExists before doing a conversion to
11648         avoid havng the TypeManager.ChangeType do conversions.
11649
11650         Reduced the number of casts used
11651
11652         (Const.ChangeType): New routine to enable reuse of the constant
11653         type changing code from statement.
11654
11655         * typemanager.cs (ChangeType): Move common initialization to
11656         static global variables.
11657
11658         Fixes #50425.
11659
11660         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11661         every value type to go through, even if it was void.  Fix that. 
11662
11663         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11664         character of the define, and the is_identifier_part_character for
11665         the rest of the string.
11666
11667 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11668
11669         * expression.cs (UnaryMutator.EmitCode): When I updated
11670         LocalVariableReference.DoResolve, I overdid it, and dropped an
11671         optimization done on local variable references.
11672
11673 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11674
11675         * ecore.cs: Convert the return from Ldlen into an int.
11676
11677 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11680         the accessibility, this is a special case for toplevel non-public
11681         classes (internal for instance).
11682
11683 2003-10-20  Nick Drochak <ndrochak@gol.com>
11684
11685         * ecore.cs: Fix typo and build.  Needed another right paren.
11686
11687 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11688
11689         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11690         `internal' case regular and protected, but not allowing protected
11691         to be evaluated later.  Bug 49840
11692
11693 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11694
11695         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11696         to kb.Nlast, and not the kb.nFirst to isolate the switch
11697         statement.
11698
11699         Extract the underlying type, so enumerations of long/ulong are
11700         treated like long/ulong.
11701
11702 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11703
11704         * expression.cs (New): Overload the meaning of RequestedType to
11705         track the possible creation of the NewDelegate type, since
11706         DoResolve is invoked more than once for new constructors on field
11707         initialization.
11708
11709         See bugs: #48800 and #37014
11710
11711         * cs-parser.jay (declare_local_constants): Take an arraylist
11712         instead of a single constant.
11713
11714         (local_constant_declaration): It should take a
11715         constant_declarators, not a constant_declarator.  Fixes 49487
11716
11717         * convert.cs: Fix error report.
11718
11719 2003-10-13 Jackson Harper <jackson@ximian.com>
11720
11721         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11722         bug #49611
11723
11724 2003-10-09  Martin Baulig  <martin@ximian.com>
11725
11726         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11727         to the .ctor.
11728         (MethodCore.DoDefineParameters): Removed the TypeContainer
11729         argument; use the DeclSpace which was passed to the .ctor instead.
11730         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11731         TypeContainer; we only need a DeclSpace here.
11732
11733 2003-10-09  Martin Baulig  <martin@ximian.com>
11734
11735         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11736         to the .ctor.
11737         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11738         EmitContext's .ctor.    
11739
11740 2003-10-09  Martin Baulig  <martin@ximian.com>
11741
11742         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11743         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11744         AsAccessible(), moved them as well.
11745
11746         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11747
11748 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11749
11750         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11751
11752 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11755         generation for >=, as spotted by Paolo, bug 48679.  
11756         Patch from David Waite.
11757
11758         * cs-tokenizer.cs: Add handling for #pragma.
11759
11760         * cs-parser.jay: Allow for both yield and yield return in the
11761         syntax.  The anti-cobolization of C# fight will go on!
11762
11763         * class.cs (TypeBuilder.DefineType): Catch error condition here
11764         (Parent.DefineType erroring out and returning null).
11765
11766         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11767         coping with enumerations variables, we were mistakenly processing
11768         them as a regular value type instead of built-in types.  Fixes the
11769         bug #48063
11770
11771         * typemanager.cs (IsBuiltinOrEnum): New method.
11772
11773 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11774
11775         * cs-parser.jay: Upgrade: yield now needs the return clause.
11776
11777 2003-09-19  Martin Baulig  <martin@ximian.com>
11778
11779         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11780         `MemberCache parent' argument.  Normally, an interface doesn't
11781         have a parent type except System.Object, but we use this in gmcs
11782         for generic type parameters.
11783
11784 2003-09-18  Martin Baulig  <martin@ximian.com>
11785
11786         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11787         on `type.IsInterface'; don't check whether the type has a parent
11788         to determine whether it's an interface.
11789
11790 2003-09-15  Martin Baulig  <martin@ximian.com>
11791
11792         * class.cs (TypeContainer.DefineType): Added an error flag to
11793         avoid reporting duplicate CS0146's ("class definition is
11794         circular.").
11795
11796         * driver.cs (Driver.MainDriver): Abort if
11797         RootContext.ResolveTree() reported any errors.
11798
11799 2003-09-07  Martin Baulig  <martin@ximian.com>
11800
11801         * report.cs (Error, Warning): Added overloaded versions which take
11802         a `params object[] args' and call String.Format().
11803
11804 2003-09-07  Martin Baulig  <martin@ximian.com>
11805
11806         * decl.cs (DeclSpace..ctor): Don't call
11807         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11808         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11809         (DeclSpace.RecordDecl): New method.
11810
11811         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11812
11813 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11814
11815         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11816         value attributes to be applied to ParameterBuilders.
11817
11818         * class.cs (MethodCore.LabelParameters): Make static and more
11819         generic so that it can be used from other places - like interface
11820         methods, for instance.
11821
11822         * interface.cs (Interface.Emit): Call LabelParameters before
11823         emitting attributes on the InterfaceMethod.
11824
11825 2003-08-26  Martin Baulig  <martin@ximian.com>
11826
11827         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11828         resolving aliases; fixes #47927.
11829
11830 2003-08-26  Martin Baulig  <martin@ximian.com>
11831
11832         * statement.cs (Using.DoResolve): This is internally emitting a
11833         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11834         do not always return.  Fixes #47681.
11835
11836 2003-08-26  Martin Baulig  <martin@ximian.com>
11837
11838         * decl.cs (MemberCore): Moved WarningNotHiding(),
11839         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11840         into MemberBase.
11841         (AdditionResult): Make this nested in DeclSpace.
11842         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11843         argument; call NamespaceEntry.Define() unless we're nested in a
11844         class or struct.
11845
11846         * namespace.cs (Namespace.DefineName): New public function.  This
11847         is called from DeclSpace's .ctor to add 
11848         (Namespace.Lookup): Include DeclSpaces in the lookup.
11849
11850         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11851
11852         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11853
11854 2003-08-25  Martin Baulig  <martin@ximian.com>
11855
11856         * convert.cs (Convert.ExplicitReferenceConversion): When
11857         converting from an interface type to a class, unbox if the target
11858         type is a struct type.  Fixes #47822.
11859
11860 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11861
11862         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11863         #47854.
11864
11865 2003-08-22  Martin Baulig  <martin@ximian.com>
11866
11867         * class.cs (TypeManager.DefineType): When defining a nested type,
11868         call DefineType() on our parent; fixes #47801.
11869
11870 2003-08-22  Martin Baulig  <martin@ximian.com>
11871
11872         * class.cs (MethodData.Define): While checking if a method is an
11873         interface implementation, improve the test a bit more to fix #47654.
11874
11875 2003-08-22  Martin Baulig  <martin@ximian.com>
11876
11877         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11878         correctly; fixes #47722.
11879
11880 2003-08-22  Martin Baulig  <martin@ximian.com>
11881
11882         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11883         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11884
11885         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11886
11887 2003-08-22  Martin Baulig  <martin@ximian.com>
11888
11889         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11890         can only be assigned in static constructors.  Fixes #47161.
11891
11892 2003-08-22  Martin Baulig  <martin@ximian.com>
11893
11894         Rewrote and improved the flow analysis code.
11895
11896         * flowbranching.cs (FlowBranching): Make this class abstract.
11897         (FlowBranching.CreateBranching): New static function to create a
11898         new flow branching.
11899         (FlowBranchingBlock, FlowBranchingException): New classes.
11900         (FlowBranching.UsageVector.Type): New public readonly field.
11901         (FlowBranching.UsageVector.Breaks): Removed the setter.
11902         (FlowBranching.UsageVector.Returns): Removed the setter.
11903         (FlowBranching.UsageVector): Added Break(), Return(),
11904         NeverReachable() and Throw() methods to modify the reachability.
11905         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11906         done by FlowBranching.Merge().
11907         (FlowBranching.UsageVector.MergeChild): New method; merges the
11908         merge result into the current vector.
11909         (FlowBranching.Merge): New abstract method to merge a branching.
11910
11911 2003-08-12  Martin Baulig  <martin@ximian.com>
11912
11913         * expression.cs (Indirection.CacheTemporaries): Create the
11914         LocalTemporary with the pointer type, not its element type.
11915
11916 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11917
11918         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11919         token was a keyword or not.
11920
11921         Add `error' options where an IDENTIFIER was expected;  Provide
11922         CheckToken and CheckIdentifierToken convenience error reporting
11923         functions. 
11924
11925         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11926
11927         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11928         NameSpaceEntry NameSpaceEntry.
11929
11930         (LookupInterfaceOrClass): Avoid creating a full qualified name
11931         from namespace and name: avoid doing lookups when we know the
11932         namespace is non-existant.   Use new Tree.LookupByNamespace which
11933         looks up DeclSpaces based on their namespace, name pair.
11934
11935         * driver.cs: Provide a new `parser verbose' to display the
11936         exception thrown during parsing.  This is turned off by default
11937         now, so the output of a failure from mcs is more graceful.
11938
11939         * namespace.cs: Track all the namespaces defined in a hashtable
11940         for quick lookup.
11941
11942         (IsNamespace): New method
11943
11944 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11945
11946         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11947         we know that we need to concatenate (full typename can never be
11948         null). 
11949
11950         * class.cs: ditto.
11951
11952         * statement.cs: Use a bitfield;  Do not initialize to null things
11953         which are done by the constructor by default.
11954
11955         * cs-parser.jay: bug fix, parameter was 4, not 3.
11956
11957         * expression.cs: Just use the property;
11958
11959         * statement.cs: No need for GetVariableInfo method.
11960
11961 2003-08-08  Martin Baulig  <martin@ximian.com>
11962
11963         * flowanalysis.cs (FlowReturns): This is now nested in the
11964         `FlowBranching' class.
11965         (MyBitVector): Moved this here from statement.cs.
11966         (FlowBranching.SiblingType): New enum type.
11967         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11968
11969 2003-08-07  Martin Baulig  <martin@ximian.com>
11970
11971         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11972         `FlowBranching' class and called `BranchingType'.
11973
11974 2003-08-07  Martin Baulig  <martin@ximian.com>
11975
11976         * flowanalysis.cs: Moved all the control flow analysis code into
11977         its own file.
11978
11979 2003-08-07  Martin Baulig  <martin@ximian.com>
11980
11981         * assign.cs (Assign.DoResolve): `target' must either be an
11982         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11983         #37319.
11984
11985 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11986
11987         * expression.cs (BinaryMethod): This kind of expression is created by the
11988         Binary class if it determines that the operator has to be handled
11989         by a method.
11990
11991         (BinaryDelegate): This kind of expression is created if we are
11992         dealing with a + or - operator on delegates.
11993
11994         (Binary): remove method, argumetns, and DelegateOperator: when
11995         dealing with methods, 
11996
11997         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11998
11999         * statement.cs (Block): use bitfields for the three extra booleans
12000         we had in use.   Remove unused topblock parameter.
12001
12002         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12003
12004         * assign.cs: Drop extra unneeded tests.
12005
12006 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12009
12010         * statement.cs (Foreach): Use VariableStorage instead of
12011         LocalBuilders.   
12012
12013         * codegen.cs (VariableStorage): New class used by clients that
12014         require a variable stored: locals or fields for variables that
12015         need to live across yield.
12016
12017         Maybe provide a convenience api for EmitThis+EmitLoad?
12018
12019         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12020         these bad boys.
12021
12022 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12023
12024         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12025         RemapParameterLValue): New methods that are used to turn a
12026         precomputed FieldInfo into an expression like this:
12027
12028                 instance.FieldInfo
12029
12030         The idea is to use this instead of making LocalVariableReference
12031         have more than one meaning.
12032
12033         * cs-parser.jay: Add error production to BASE.
12034
12035         * ecore.cs: Deal with TypeManager.GetField returning null, which
12036         is now a valid return value.
12037
12038         (FieldExprNoAddress): New expression for Fields whose address can
12039         not be taken.
12040
12041         * expression.cs (LocalVariableReference): During the resolve
12042         phases, create new expressions if we are in a remapping context.
12043         Remove code that dealt with remapping here.
12044
12045         (ParameterReference): same.
12046
12047         (ProxyInstance): New expression, like the `This' expression, but
12048         it is born fully resolved.  We know what we are doing, so remove
12049         the errors that are targeted to user-provided uses of `this'.
12050
12051         * statement.cs (Foreach): our variable is now stored as an
12052         Expression;  During resolution, follow the protocol, dont just
12053         assume it will return this.
12054
12055 2003-08-06  Martin Baulig  <martin@ximian.com>
12056
12057         * support.cs (SeekableStreamReader.cs): New public class.
12058
12059         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12060         SeekableStreamReader instead of the normal StreamReader.
12061
12062 2003-08-04  Martin Baulig  <martin@ximian.com>
12063
12064         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12065         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12066         deambiguate casts and delegate invocations.
12067         (parenthesized_expression): Use the new tokens to ensure this is
12068         not a cast of method invocation.
12069
12070         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12071         when reading a `)' and Deambiguate_CloseParens () was previously
12072         called.
12073
12074         * expression.cs (ParenthesizedExpression): New class.  This is
12075         just used for the CS0075 test.
12076         (Binary.DoResolve): Check for CS0075.   
12077
12078 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12079
12080         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12081         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12082         reference comparison.
12083
12084         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12085         examine the ReturnType for equality - this is necessary in the
12086         cases of implicit and explicit operators whose signature also
12087         includes the return type.
12088
12089 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12090
12091         * namespace.cs: Cache the result of the namespace computation,
12092         instead of computing it every time.
12093
12094 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12095
12096         * decl.cs: Use a global arraylist that we reuse over invocations
12097         to avoid excesive memory consumption.  Reduces memory usage on an
12098         mcs compile by one meg (45 average).
12099
12100         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12101         private, work around that.
12102
12103 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * literal.cs (IntLiteral): Define Zero and One static literals. 
12106
12107         * cs-parser.jay (integer_literal): use static literals to reduce
12108         memory usage for the most used literals (0, 1 and -1).  211kb
12109         reduced in memory usage.
12110
12111         Replace all calls to `new ArrayList' with `new
12112         ArrayList(4)' which is a good average number for most allocations,
12113         and also requires only 16 bytes of memory for its buffer by
12114         default. 
12115
12116         This reduced MCS memory usage in seven megabytes for the RSS after
12117         bootstrapping.
12118
12119 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12120
12121         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12122         handle params methods the correct way by forming only one
12123         applicable set with params and normal methods in them. Earlier we
12124         were looking at params methods only if we found no normal methods
12125         which was not the correct thing to do.
12126
12127         (Invocation.BetterFunction): Take separate arguments indicating
12128         when candidate and the best method are params methods in their
12129         expanded form.
12130
12131         This fixes bugs #43367 and #46199.
12132
12133         * attribute.cs: Documentation updates.
12134
12135         (CheckAttribute): Rename to CheckAttributeTarget.
12136         (GetValidPlaces): Rename to GetValidTargets.
12137
12138         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12139         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12140
12141         Fixes bug #44468.
12142
12143 2003-07-28  Martin Baulig  <martin@ximian.com>
12144
12145         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12146         name when looking up the base class of a nested class.  Fixes #46977.
12147
12148 2003-07-26  Martin Baulig  <martin@ximian.com>
12149
12150         * expression.cs (Indexers.Indexer): New nested struct; contains
12151         getter, setter and the indexer's type.
12152         (Indexers.Properties): This is now an ArrayList of
12153         Indexers.Indexer's.
12154         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12155         indexer doesn't have any getters.
12156
12157         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12158         for embedded property and indexer assignments.
12159
12160 2003-07-26  Martin Baulig  <martin@ximian.com>
12161
12162         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12163         preprocessor directive is not the first non-whitespace character
12164         on a line.
12165
12166 2003-07-26  Martin Baulig  <martin@ximian.com>
12167
12168         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12169         namespace parsing, follow the spec more closely.
12170
12171         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12172         NamespaceEntry.Lookup().
12173
12174 2003-07-25  Martin Baulig  <martin@ximian.com>
12175
12176         * MethodCore.cs (OverridesSomething): New public field; it's set
12177         from TypeContainer.DefineMembers if this method overrides
12178         something (which doesn't need to be a method).  Fix #39462.
12179
12180 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12181
12182         * typemanager.cs (GetMembers): Ensure that the list of members is
12183         reversed. This keeps things in sync.
12184
12185         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12186         find an AttributeUsage attribute.
12187
12188         * expression.cs (Invocation.OverloadResolve): Perform the check
12189         which disallows Invoke to be directly called on a Delegate.
12190
12191         (Error_InvokeOnDelegate): Report error cs1533.
12192
12193 2003-07-25  Martin Baulig  <martin@ximian.com>
12194
12195         * expression.cs (Indexers.GetIndexersForType): Only look in the
12196         interface hierarchy if the requested type is already an
12197         interface.  Fixes #46788 while keeping #46502 fixed.
12198
12199 2003-07-25  Martin Baulig  <martin@ximian.com>
12200
12201         * class.cs (TypeContainer.DefineMembers): Check whether all
12202         readonly fields have been assigned and report warning CS0649 if
12203         not.
12204
12205         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12206         a valuetype.
12207
12208 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12209
12210         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12211         returned from GetMethods to make things consistent with the
12212         assumptions MCS makes about ordering of methods.
12213
12214         This should comprehensively fix bug #45127 and it does :-)
12215
12216         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12217         ordering is actually reverse.
12218
12219         * Clean up some debug messages I left lying around.
12220
12221         * interface.cs (Populate*): Get rid of code which emits attributes
12222         since the stage in which we emit attributes is the 'Emit' stage,
12223         not the define stage.
12224
12225         (Emit): Move attribute emission for interface members here.
12226
12227 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12228
12229         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12230         closely: we eliminate methods in base types when we have an
12231         applicable method in a top-level type.
12232
12233         Please see section 14.5.5.1 for an exact description of what goes
12234         on. 
12235
12236         This fixes bug #45127 and a host of other related to corlib compilation.
12237
12238         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12239         array is the method corresponding to the top-level type (this is
12240         because of the changes made to icall.c) so we change this
12241         accordingly.
12242
12243         (MethodGroupExpr.Name): This too.
12244
12245         * typemanager.cs (GetElementType): New method which does the right
12246         thing when compiling corlib. 
12247
12248         * everywhere: Make use of the above in the relevant places.
12249
12250 2003-07-22  Martin Baulig  <martin@ximian.com>
12251
12252         * cs-parser.jay (invocation_expression): Moved
12253         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12254         `cast_expression', but create a InvocationOrCast which later
12255         resolves to either an Invocation or a Cast.
12256
12257         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12258         method; call this before EmitStatement() to make sure that this
12259         expression can be used as a statement.
12260
12261         * expression.cs (InvocationOrCast): New class; resolves to either
12262         an Invocation or a Cast.
12263
12264         * statement.cs (StatementExpression): Call ResolveStatement() on
12265         the ExpressionStatement before emitting it.
12266
12267 2003-07-21  Martin Baulig  <martin@ximian.com>
12268
12269         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12270         `ref' and `out' attributes match; fixes #46220.
12271         (MemberAccess.ResolveMemberAccess): You can't reference a type
12272         through an expression; fixes #33180.
12273         (Indexers.GetIndexersForType): Don't return the indexers from
12274         interfaces the class implements; fixes #46502.
12275
12276 2003-07-21  Martin Baulig  <martin@ximian.com>
12277
12278         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12279         CS0661 checks; fixes bug #30442.
12280
12281 2003-07-21  Martin Baulig  <martin@ximian.com>
12282
12283         * decl.cs (AdditionResult): Added `Error'.
12284
12285         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12286
12287         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12288         makes cs0031.cs actually work.
12289
12290 2003-07-20  Martin Baulig  <martin@ximian.com>
12291
12292         * namespace.cs: Fixed that bug which caused a crash when compiling
12293         the debugger's GUI.
12294
12295 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12296
12297         * typemanager.cs (LookupTypeReflection): Never expose types which
12298         are NotPublic, NestedPrivate, NestedAssembly, or
12299         NestedFamANDAssem.  We used to return these, and later do a check
12300         that would report a meaningful error, but the problem is that we
12301         would not get the real match, if there was a name override.
12302
12303 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12304
12305         * namespace.cs (Namespace, Name): Do not compute the namespace
12306         name dynamically, compute it in the constructor.  This reduced
12307         memory usage by 1697 KB.
12308
12309         * driver.cs: Use --pause to pause at the end.
12310
12311 2003-07-17  Peter Williams  <peter@newton.cx>
12312
12313         * Makefile: Change the name of the test target so that it doesn't
12314         conflict with the recursive test target.
12315
12316 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12317
12318         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12319         AddressOf): Do not use EmitThis, that was wrong, use the actual
12320         this pointer.
12321
12322 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12323
12324         * class.cs (MethodData.Define): While checking if a method is an
12325         interface implementation, improve the test: If we are not public
12326         (use new test here: use the computed MethodAttributes directly,
12327         instead of the parsed modifier flags) check if the `implementing'
12328         method comes from an interface or not.
12329
12330         * pending.cs (VerifyPendingMethods): Slightly better error
12331         message.
12332
12333         * makefile: add test target that does the mcs bootstrap.
12334
12335 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12336
12337         * interface.cs (Define): Do nothing here since there are no
12338         members to populate etc. Move the attribute emission out of here
12339         since this was just totally the wrong place to put it. Attribute
12340         application happens during the 'Emit' phase, not in the 'Define'
12341         phase.
12342
12343         (Emit): Add this method and move the attribute emission here
12344
12345         * rootcontext.cs (EmitCode): Call the Emit method on interface
12346         types too.
12347
12348 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12349
12350         * expression.cs (OverloadResolve): Report error only if Location
12351         is not 'Null' which means that there was a probe going on.
12352
12353 2003-07-14  Martin Baulig  <martin@ximian.com>
12354
12355         * expression.cs (ConditionalLogicalOperator): New public class to
12356         implement user defined conditional logical operators.
12357         This is section 14.11.2 in the spec and bug #40505.
12358
12359 2003-07-14  Martin Baulig  <martin@ximian.com>
12360
12361         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12362
12363 2003-07-14  Martin Baulig  <martin@ximian.com>
12364
12365         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12366
12367         * ecore.cs (IVariable.VerifyFixed): New interface method.
12368
12369         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12370         operator, check whether the variable is actually fixed.  Fixes bug
12371         #36055.  Set a variable definitely assigned when taking its
12372         address as required by the spec.
12373
12374         * statement.cs (LocalInfo.IsFixed): New field.
12375         (LocalInfo.MakePinned): Set `IsFixed' to true.
12376
12377 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12378
12379         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12380         for .ctors, ensure that we only ask for members declared in the
12381         attribute type (BindingFlags.DeclaredOnly).
12382
12383         Fixes bug #43632.
12384
12385         * expression.cs (Error_WrongNumArguments): Report error 1501
12386         correctly the way CSC does.
12387
12388 2003-07-13  Martin Baulig  <martin@ximian.com>
12389
12390         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12391         lookup on the fully qualified name, to make things like "X.X" work
12392         where "X.X" is a fully qualified type name, but we also have a
12393         namespace "X" in the using list.  Fixes #41975.
12394
12395 2003-07-13  Martin Baulig  <martin@ximian.com>
12396
12397         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12398         function. If we're a CompoundAssign, we need to create an embedded
12399         CompoundAssign, not an embedded Assign.
12400         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12401         Fixes #45854.
12402
12403 2003-07-13  Martin Baulig  <martin@ximian.com>
12404
12405         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12406         work to fix bug #46088.
12407
12408 2003-07-13  Ravi Pratap <ravi@ximian.com>
12409
12410         * class.cs (Operator.Emit): Do not emit attributes here - it is
12411         taken care of by the Method class that we delegate too. This takes
12412         care of bug #45876.
12413
12414 2003-07-10  Martin Baulig  <martin@ximian.com>
12415
12416         * expression.cs (TypeOfVoid): New class.
12417         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12418
12419 2003-07-10  Martin Baulig  <martin@ximian.com>
12420
12421         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12422         bug #35957.
12423
12424 2003-07-10  Martin Baulig  <martin@ximian.com>
12425
12426         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12427         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12428
12429         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12430
12431         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12432
12433 2003-07-10  Martin Baulig  <martin@ximian.com>
12434
12435         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12436         of decimal.  Fixes #42850.
12437
12438         NOTE: I also fixed the created byte blob, but this doesn't work on
12439         the MS runtime and csc never produces any byte blobs for decimal
12440         arrays.
12441
12442 2003-07-10  Martin Baulig  <martin@ximian.com>
12443
12444         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12445         structs; fixes #32068.
12446         (Block.AddChildVariableNames): Fixed #44302.
12447
12448 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12449
12450         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12451
12452 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * attribute.cs: And this test is onger needed.
12455
12456 2003-07-08  Martin Baulig  <martin@ximian.com>
12457
12458         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12459         inaccessible types.  Fixes #36313.
12460
12461         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12462
12463         * namespace.cs (NamespaceEntry): Create implicit entries for all
12464         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12465         implicit entries for N1.N2 and N1.
12466
12467 2003-07-08  Martin Baulig  <martin@ximian.com>
12468
12469         Rewrote the handling of namespaces to fix a lot of the issues
12470         wrt. `using' aliases etc.
12471
12472         * namespace.cs (Namespace): Splitted this class into a
12473         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12474
12475         * typemanager.cs (TypeManager.IsNamespace): Removed.
12476         (TypeManager.ComputeNamespaces): Only compute namespaces from
12477         loaded assemblies here, not the namespaces from the assembly we're
12478         currently compiling.
12479
12480 2003-07-08  Martin Baulig  <martin@ximian.com>
12481
12482         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12483
12484 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12487         already fixed it.  
12488
12489         I thought about the memory savings here, but LookupTypeReflection
12490         is used under already very constrained scenarios.  Compiling
12491         corlib or mcs only exposes one hit, so it would not really reduce
12492         any memory consumption.
12493
12494 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12495
12496         * typemanager.cs: fixes bug #45889 by only adding public types from
12497         other assemblies to the list of known types.
12498
12499 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12500
12501         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12502         on the type we resolved.
12503
12504 2003-07-05  Martin Baulig  <martin@ximian.com>
12505
12506         * pending.cs (PendingImplementation.ParentImplements): Don't
12507         create the proxy if the parent is abstract.
12508
12509         * class.cs (TypeContainer.DefineIndexers): Process explicit
12510         interface implementations first.  Fixes #37714.
12511
12512 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12513
12514         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12515         defined recursively;  but since we modify the input parameters
12516         (left is set to `this' temporarily), we reset this value if the
12517         left_is_explicit is false, which gives the original semantics to
12518         the code.  
12519
12520         * literal.cs (NullPointer): new class used to represent a null
12521         literal in a pointer context.
12522
12523         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12524         type is a pointer, use a NullPointer object instead of a
12525         NullLiteral.   Closes 43687
12526
12527         (ExplicitConversion): Convert pointer values using
12528         the conv opcode to the proper type.
12529
12530         * ecore.cs (New): change ValueTypeVariable property into a method,
12531         that returns whether the valuetype is suitable for being used.
12532
12533         * expression.cs (Binary.DoNumericPromotions): Only return if we
12534         the int constant was a valid uint, and we can return both left and
12535         right as uints.  If not, we continue processing, to trigger the
12536         type conversion.  This fixes 39018.
12537
12538         * statement.cs (Block.EmitMeta): During constant resolution, set
12539         the CurrentBlock property on the emitcontext, so that we resolve
12540         constants propertly.
12541
12542 2003-07-02  Martin Baulig  <martin@ximian.com>
12543
12544         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12545         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12546
12547         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12548         than emitting it here.
12549
12550         * statement.cs: Fixed some more flow analysis bugs.
12551
12552 2003-07-02  Martin Baulig  <martin@ximian.com>
12553
12554         * class.cs (MethodData.Define): When implementing interface
12555         methods, set Final unless we're Virtual.
12556
12557         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12558         check work for interface methods.
12559
12560 2003-07-01  Martin Baulig  <martin@ximian.com>
12561
12562         * ecore.cs (EmitContext.This): Replaced this property with a
12563         GetThis() method which takes a Location argument.  This ensures
12564         that we get the correct error location for a CS0188.
12565
12566 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12567
12568         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12569         ImplicitStandardConversion.
12570
12571         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12572
12573 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12574
12575         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12576         optimization.
12577
12578 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12579
12580         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12581         constructors.
12582
12583         (MethodData.Define): Turn off initlocals for unsafe methods.
12584
12585 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12586
12587         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12588         complete;  Fixes #37521.
12589
12590         * delegate.cs: Use Modifiers.TypeAttr to compute the
12591         TypeAttributes, instead of rolling our own.  This makes the flags
12592         correct for the delegates.
12593
12594 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12595
12596         * class.cs (Constructor.Define): Set the private flag for static
12597         constructors as well.
12598
12599         * cs-parser.jay (statement_expression): Set the return value to
12600         null, to avoid a crash when we catch an error.
12601
12602 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * cs-parser.jay: Applied patch from Jackson that adds support for
12605         extern and unsafe modifiers to destructor declarations.
12606
12607         * expression.cs: Report error 21 if the user is trying to index a
12608         System.Array.
12609
12610         * driver.cs: Add an error message, suggested by the bug report.
12611
12612         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12613         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12614
12615 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12616
12617         * namespace.cs: Add some information to reduce FAQs.
12618
12619 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12620
12621         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12622         underlying enumeration types.  Fixes #43915.
12623
12624         * expression.cs: Treat ushort/short as legal values to be used in
12625         bitwise operations.
12626
12627 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12628
12629         * delegate.cs: transfer custom attributes for paramenters from
12630         the delegate declaration to Invoke and BeginInvoke.
12631
12632 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12633
12634         * attribute.cs: handle custom marshalers and emit marshal info
12635         for fields, too.
12636
12637 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12638
12639         * makefile.gnu: Added anonymous.cs to the compiler sources.
12640
12641 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * iterators.cs: Change the name of the proxy class to include two
12644         underscores.
12645
12646         * cs-parser.jay: Update grammar to include anonymous methods.
12647
12648         * anonymous.cs: new file.
12649
12650 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * class.cs (Field.Define): Add missing test for pointers and
12653         safety. 
12654
12655 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12656
12657         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12658         we use the stobj opcode.
12659
12660         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12661         since it wasn't the correct fix. 
12662
12663         It still is puzzling that we are required to use stobj for IntPtr
12664         which seems to be a ValueType.
12665
12666 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12667
12668         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12669         during regular simple name resolution.   Now, the trick is that
12670         instead of returning for processing the simplename, we do a
12671         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12672         contextual lookup type).   If a match is found, return that, if
12673         not, return for further composition.
12674
12675         This fixes long-standing 30485.
12676
12677         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12678         using the address to initialize an object, do an Stobj instead of
12679         using the regular Stelem.
12680
12681         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12682         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12683         Because if we are a BaseIndexerAccess that value will be true.
12684         Fixes 43643.
12685
12686         * statement.cs (GotoCase.Resolve): Return after reporting an
12687         error, do not attempt to continue. 
12688
12689         * expression.cs (PointerArithmetic.Emit): If our operand is a
12690         long, convert our constants to match the operand before
12691         multiplying.  Convert to I type before adding.   Fixes 43670.
12692
12693 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12694
12695         * enum.cs (ImplicitConversionExists) : Rename to
12696         ImplicitEnumConversionExists to remove ambiguity. 
12697
12698         * ecore.cs (NullCast): New type of cast expression class which
12699         basically is very similar to EmptyCast with the difference being
12700         it still is a constant since it is used only to cast a null to
12701         something else
12702         (eg. (string) null)
12703
12704         * convert.cs (ImplicitReferenceConversion): When casting a null
12705         literal, we return a NullCast.
12706
12707         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12708         should be around anymore.
12709
12710         The renaming (reported was slightly wrong). Corrections:
12711
12712         ConvertImplicitStandard -> ImplicitConversionStandard
12713         ConvertExplicitStandard -> ExplicitConversionStandard
12714
12715         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12716         before passing them in !
12717
12718         * convert.cs (ImplicitConversionStandard): When comparing for
12719         equal expr and target types, ensure that expr is not a
12720         NullLiteral.
12721
12722         In general, we must not be checking (expr_type ==
12723         target_type) in the top level conversion methods
12724         (ImplicitConversion, ExplicitConversion etc). This checking is
12725         done in the methods that they delegate to.
12726
12727 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12728
12729         * convert.cs: Move Error_CannotConvertType,
12730         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12731         ImplicitNumericConversion, ImplicitConversionExists,
12732         ImplicitUserConversionExists, StandardConversionExists,
12733         FindMostEncompassedType, FindMostSpecificSource,
12734         FindMostSpecificTarget, ImplicitUserConversion,
12735         ExplicitUserConversion, GetConversionOperators,
12736         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12737         TryImplicitIntConversion, Error_CannotConvertImplicit,
12738         ConvertImplicitRequired, ConvertNumericExplicit,
12739         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12740         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12741         its own file.
12742
12743         Perform the following renames:
12744
12745         StandardConversionExists -> ImplicitStandardConversionExists
12746         ConvertImplicit -> ImplicitConversion
12747         ConvertImplicitStandard -> ImplicitStandardConversion
12748         TryImplicitIntConversion -> ImplicitIntConversion
12749         ConvertImplicitRequired -> ImplicitConversionRequired
12750         ConvertNumericExplicit -> ExplicitNumericConversion
12751         ConvertReferenceExplicit -> ExplicitReferenceConversion
12752         ConvertExplicit -> ExplicitConversion
12753         ConvertExplicitStandard -> ExplicitStandardConversion
12754
12755 2003-05-19  Martin Baulig  <martin@ximian.com>
12756
12757         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12758         (TypeInfo): Added support for structs having structs as fields.
12759
12760         * ecore.cs (FieldExpr): Implement IVariable.
12761         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12762         VariableInfo for the field.
12763
12764 2003-05-18  Martin Baulig  <martin@ximian.com>
12765
12766         * expression.cs (This.DoResolve): Report a CS0027 if we're
12767         emitting a field initializer.
12768
12769 2003-05-18  Martin Baulig  <martin@ximian.com>
12770
12771         * expression.cs (This.ResolveBase): New public function.
12772         (This.DoResolve): Check for CS0188.
12773
12774         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12775         This.Resolve().
12776
12777         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12778         `instance_expression' to null if we don't have any non-static
12779         methods.
12780
12781 2003-05-18  Martin Baulig  <martin@ximian.com>
12782
12783         Reworked the way how local variables and parameters are handled by
12784         the flow analysis code.
12785
12786         * statement.cs (TypeInfo, VariableMap): New public classes.
12787         (VariableInfo): New public class.  This is now responsible for
12788         checking whether a variable has been assigned.  It is used for
12789         parameters and local variables.
12790         (Block.EmitMeta): Take the InternalParameters as argument; compute
12791         the layout of the flow vectors here.
12792         (Block.LocalMap, Block.ParameterMap): New public properties.
12793         (FlowBranching): The .ctor doesn't get the InternalParameters
12794         anymore since Block.EmitMeta() now computes the layout of the flow
12795         vector.
12796         (MyStructInfo): This class is now known as `StructInfo' and nested
12797         in `TypeInfo'; we don't access this directly anymore.
12798
12799         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12800         property and removed IsAssigned(), IsFieldAssigned(),
12801         SetAssigned() and SetFieldAssigned(); we now call them on the
12802         VariableInfo so we don't need to duplicate this code everywhere.
12803
12804         * expression.cs (ParameterReference): Added `Block block' argument
12805         to the .ctor.
12806         (LocalVariableReference, ParameterReference, This): The new
12807         VariableInfo class is now responsible for all the definite
12808         assignment stuff.
12809
12810         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12811         IsParameterAssigned, SetParameterAssigned): Removed.
12812
12813 2003-05-18  Martin Baulig  <martin@ximian.com>
12814
12815         * typemanager.cs (InitCoreTypes): Try calling
12816         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12817         the 3-args-version.  Corlib now also needs our `void_type'.
12818         (GetMethod): Added overloaded version which takes an optional
12819         `bool report_errors' to allow lookups of optional methods.
12820
12821 2003-05-12  Martin Baulig  <martin@ximian.com>
12822
12823         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12824         only used for locals and not for parameters.
12825
12826 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12827
12828         * support.cs (InternalParameters.ParameterType): Return the
12829         ExternalType of the parameter.
12830
12831         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12832         they were unused.
12833
12834 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12835
12836         * class.cs (MethodData.Define): Do not set the `newslot' on
12837         interface members, if they are also flagged as "override".
12838
12839         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12840         better code for ++i and i++.  This only works for static fields
12841         and local variables.
12842
12843         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12844         want to pull the DeclSpace out of the builder_to_declspace instead
12845         of the TypeBuilder (like in TypeContainer.FindMembers).
12846
12847         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12848         instead of LookupTypeContainer.  Fixes the crash on .NET for
12849         looking up interface members.
12850
12851         * const.cs: Create our own emit context during the Definition
12852         stage, so that constants are evaluated in the proper context, when
12853         a recursive definition happens.
12854
12855 2003-05-11  Martin Baulig  <martin@ximian.com>
12856
12857         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12858         new block for a switch section.
12859         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12860         the adding/lookup in the switch block.  Fixes #39828.
12861
12862 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12863
12864         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12865         functionality: I needed to convert the data after I had performed
12866         the add/sub operation into the operands type size.
12867
12868         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12869         pass the type for the box operation, otherwise the resulting
12870         object would have been of type object.
12871
12872         (BoxedCast): Add constructor to specify the type to box as.
12873
12874 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12875
12876         * iterators.cs: I was reusing the `count' variable inadvertently,
12877         take steps to not allow this to happen.
12878
12879 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12880
12881         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12882         by creating an array at the point where the params starts and
12883         putting all those arguments there, then adjusting the size of the
12884         array.
12885
12886 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12887
12888         * expression.cs (New.AddressOf): Implement interface
12889         IMemoryLocation.  This is used when the `new' operator is used in
12890         the context of an invocation to a method on a value type.
12891
12892         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12893         example. 
12894
12895         * namespace.cs: Also check the using aliases here.
12896
12897         * driver.cs: Move the test for using validity after the types have
12898         been entered, so we do a single pass that also includes the using
12899         aliases. 
12900
12901         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12902         in the regular case.   CreateSiblingForFinally is doing extra
12903         error checking.
12904
12905         * attribute.cs (GetAttributeArgumentExpression): Store the result
12906         on an out value, and use the return value to indicate failure
12907         instead of using null (which is a valid return for Constant.GetValue).
12908
12909         * statement.cs: Perform the analysis flow for the increment
12910         portion after the statement, because this will be the real flow of
12911         execution.  Fixes #42385
12912
12913         * codegen.cs (EmitContext.EmitArgument,
12914         EmitContext.EmitStoreArgument): New helper functions when the
12915         RemapToProxy flag is set.
12916
12917         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12918         function.
12919
12920         Add support for remapping parameters. 
12921
12922         * iterators.cs: Propagate parameter values;  Store parameter
12923         values in the proxy classes.
12924
12925 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12926
12927         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12928         need a proxy reference;  I do not know what I was thinking
12929
12930         * cs-parser.jay (constructor_initializer): catch another error,
12931         and display nice message.
12932
12933         (field_declaration): catch void field declaration
12934         to flag a better error. 
12935
12936         * class.cs (MemberBase.CheckBase): Report an error instead of a
12937         warning if a new protected member is declared in a struct. 
12938         (Field.Define): catch the error of readonly/volatile.
12939
12940         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12941
12942         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12943         volatile variable is taken
12944
12945 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * statement.cs (Fixed.Resolve): Report an error if we are not in
12948         an unsafe context.
12949
12950 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12951
12952         * typemanager.cs: reuse the code that handles type clashes for
12953         delegates and enumerations.
12954
12955         * class.cs (Report28): Always report.
12956
12957         * expression.cs (EncodeAsAttribute): Allow nulls here.
12958
12959 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12960
12961         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12962         the functionality for testing whether an expression is valid for
12963         an attribute here.  Also handle the case of arrays of elements
12964         being stored. 
12965
12966         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12967         encoding a linear array into an array of objects that are suitable
12968         to be passed to an CustomAttributeBuilder.
12969
12970         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12971
12972         * ecore.cs: (FieldExpr): Handle field remapping here.
12973
12974         * iteratators.cs: Pass the instance variable (if the method is an
12975         instance method) to the constructors, so we can access the field
12976         variables on the class.
12977
12978         TODO: Test this with structs.  I think the THIS variable on
12979         structs might have to be a pointer, and not a refenrece
12980
12981 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12982
12983         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12984         local variables to fields in a proxy class.
12985
12986         * iterators.cs (PopulateProxy): Rename our internal fields to
12987         <XXX>.  
12988         Create a <THIS> field if we are an instance method, so we can
12989         reference our parent container variables.
12990         (MapVariable): Called back from the EmitContext code to enter a
12991         new variable to field mapping into the proxy class (we just create
12992         a FieldBuilder).
12993
12994         * expression.cs
12995         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12996         for using the remapped locals to fields.
12997
12998         I placed the code here, because that gives the same semantics to
12999         local variables, and only changes the Emit code.
13000
13001         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13002         statements inside iterators.
13003         (VariableInfo): Add a FieldBuilder for the cases when we are
13004         remapping local variables to fields in a proxy class
13005
13006         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13007         current_block != null.
13008
13009         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13010         not cope with strings, as it has been moved to the
13011         TableSwitchEmit.  Fixed bug in switch generation.
13012
13013         * expression.cs (New.DoResolve): Provide more context for the user
13014         when reporting an error.
13015
13016         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13017         pointers. 
13018
13019         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13020         check the permissions for it.  Note than in a type-resolution
13021         context the check was already present in DeclSpace.ResolveType,
13022         but was missing from the MemberAccess.
13023
13024         (ArrayCreation.CheckIndices): warn if the user has
13025         more nested levels of expressions, but there are no more
13026         dimensions specified.  Avoids crash on bug 41906.
13027
13028 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13029
13030         * statement.cs (Block): replace Implicit bool, for a generic
13031         flags.   
13032         New flag: `Unchecked'.  This is used during the EmitMeta phase
13033         (which is out-of-line with the regular Resolve/Emit process for a
13034         statement, as this is done ahead of time, but still gets a chance
13035         to call constant resolve).
13036
13037         (Block.Flags): new enum for adding a new flag.
13038
13039         (Block.EmitMeta): track the state of unchecked.
13040
13041         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13042         to enable constant resolution to work there as well.
13043
13044 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * typemanager.cs (ienumerable_type): Also look up
13047         System.Collections.IEnumerable. 
13048
13049 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13050
13051         TODO: Test more than one conditional per method.
13052
13053         * class.cs (Indexer.Define): Report the location where the user is
13054         referencing the unsupported feature.
13055
13056         (MethodData): Overload the use of `conditionals' to
13057         minimize the creation of needless ArrayLists.   This saves roughly
13058         212kb on my machine.
13059
13060         (Method): Implement the new IIteratorContainer interface.
13061         (Method.SetYields): Implement the method by setting the ModFlags
13062         to contain METHOD_YIELDS.
13063
13064         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13065         which just got set to null.
13066
13067         * iterators.cs: New file.
13068
13069         (Yield, YieldBreak): New statements.
13070
13071         * statement.cs (Return.Resolve): Flag an error if we are used in
13072         an iterator method.
13073
13074         * codegen.cs (InIterator): New flag set if the code is being
13075         compiled in an iterator method.
13076
13077         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13078         internal modifier, and we just use it to avoid adding extra
13079         fields, as this is seldom used.  
13080
13081         * cs-parser.jay: Add yield_statement (yield and yield break).
13082
13083         * driver.cs: New flag -v2 to turn on version 2 features. 
13084
13085         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13086         hashtable when v2 is enabled.
13087
13088 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13091         there is already a namespace defined with this name.
13092
13093         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13094         people upgraded their corlibs.
13095
13096         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13097         always use fully qualified types, no need to use the compiler
13098         front end.
13099
13100         (TypeManager.IsNamespace): Use binarysearch.
13101
13102         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13103         AddDelegate): I did not quite use the new IsValid API properly: I
13104         have to pass the short-name and the fullname.  I was passing only
13105         the basename instead of the fullname sometimes. 
13106
13107         (TypeContainer.DefineType): call NamespaceClash.
13108
13109         * interface.cs (Interface.DefineType): use NamespaceClash before
13110         defining the type.
13111
13112         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13113         defining the type.
13114
13115         * enum.cs: (Enum.DefineType): use NamespaceClash before
13116         defining the type.
13117
13118         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13119         speed increase.  First, use the negative_hits cache when we get a
13120         negative.  Second, add the type with its full original name
13121         instead of the new . and + encoded name (reflection uses + to
13122         separate type from a nested type).  Use LookupTypeReflection
13123         directly which bypasses the type->name hashtable (that we already
13124         know does not contain the type.
13125
13126         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13127         location/container type. 
13128
13129         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13130
13131 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13132
13133         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13134
13135         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13136         method is being referenced in the method group from a static
13137         context, and report error 120 if so.
13138
13139         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13140         Error118. 
13141
13142         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13143         is created, we create the A namespace).
13144
13145         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13146         Fixes #41591
13147
13148 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13151         invocation to ModuleBuilder.GetType with the same values will
13152         return a new type instance, so we need to cache its return
13153         values. 
13154
13155         * expression.cs (Binary.ResolveOperator): Only allow the compare
13156         operators on enums if they are of the same type.
13157
13158         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13159         types of ValueType on their own case.  Before we were giving them
13160         the same treatment as objects.
13161
13162         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13163         fullname.  Short name is used to compare against container name.
13164         Fullname is used to check against defined namespace names.
13165
13166         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13167         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13168
13169         (Method.CheckBase): Call parent.
13170         (MemberBase.CheckBase): Check for protected members on sealed
13171         classes.
13172         (PropertyBase.CheckBase): Call parent.
13173         (Field.Define): Call parent.
13174
13175         * report.cs: Negative error codes are now mapped to 8000 - code,
13176         so that the display is render more nicely.
13177
13178         * typemanager.cs: Do not use try/catch, instead report a regular
13179         error. 
13180
13181         (GetPointerType, GetReferenceType): These methods provide
13182         mechanisms to obtain the T* and T& from a T.  We had the code
13183         previously scattered around the code base, and it also used
13184         TypeManager.LookupType that would go through plenty of caches.
13185         This one goes directly to the type source.
13186
13187         In some places we did the Type.GetType followed by
13188         ModuleBuilder.GetType, but not in others, so this unifies the
13189         processing as well.
13190
13191         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13192         statements now that we have namespace information.
13193
13194         * typemanager.cs (IsNamespace): New method, returns whether the
13195         string presented is a namespace or not.
13196
13197         (ComputeNamespaces): New public entry point, computes the list of
13198         available namespaces, using the GetNamespaces API call in Mono, or
13199         the slower version in MS.NET.   
13200
13201         Now before we start the semantic analysis phase, we have a
13202         complete list of namespaces including everything that the user has
13203         provided.
13204
13205         Deleted old code to cache namespaces in .nsc files.
13206
13207 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13208
13209         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13210         class/struct location definition Location for the implicit
13211         constructor location.
13212
13213         (Operator.Define): Use the location of the operator for the
13214         implicit Method definition.
13215
13216         (Constructor.Emit): use the constructor location for the implicit
13217         base initializer constructor.
13218
13219         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13220         and the Expression class now contains two new methods:
13221
13222         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13223         isolate type lookup from the rest of the resolution process.
13224
13225         Since we use Expressions to hold type definitions due to the way
13226         we parse the input we have historically overloaded Resolve to
13227         perform the Type lookups if a special flag is passed.  Now this is
13228         eliminated and two methods take their place. 
13229
13230         The differences in the two methods between xStep and xTerminal is
13231         that xStep is involved in our current lookup system that uses
13232         SimpleNames to compose a name, while xTerminal is used just to
13233         catch the case where the simplename lookup failed.
13234
13235 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13236
13237         * expression.cs (ResolveMemberAccess): Remove redundant code.
13238         TypeExpr expressions are always born fully resolved.
13239
13240         * interface.cs (PopulateMethod): Do not lookup the types twice.
13241         We were doing it once during SemanticAnalysis and once during
13242         PopulateMethod.
13243
13244         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13245         in local variable type definitions, were being returned as a
13246         SimpleName (we decomposed everything into a string), that is
13247         because primary_expression was being used instead of a type in the
13248         grammar (reduce/reduce conflicts).
13249
13250         The part that was wrong is that we converted the expression into a
13251         string (an oversimplification in one hand, compounded with primary
13252         expressions doing string concatenation).
13253
13254         So things like:
13255
13256         A.B.C [] x;
13257
13258         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13259         using clauses from working on this particular context.  And a type
13260         was being matched directly against "A.B.C[]".
13261
13262         We now use the correct approach, and allow for ComposedCast to be
13263         part of the unary expression.  So the "A.B.C []" become a composed
13264         cast of "A.B.C" (as a nested group of MemberAccess with a
13265         SimpleName at the end) plus the rank composition "[]". 
13266
13267         Also fixes 35567
13268
13269 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13270
13271         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13272         for the access level checking.
13273
13274         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13275         `TypeContainer container', because I kept getting confused when I
13276         was debugging this code.
13277
13278         * expression.cs (Indexers): Instead of tracking getters/setters,
13279         we now track them in parallel.  We create one arraylist less, but
13280         most importantly it is possible now for the LValue code to find a
13281         matching get for a set.
13282
13283         (IndexerAccess.DoResolveLValue): Update the code.
13284         GetIndexersForType has been modified already to extract all the
13285         indexers from a type.  The code assumed it did not.
13286
13287         Also make the code set the correct return type for the indexer.
13288         This was fixed a long time ago for properties, but was missing for
13289         indexers.  It used to be void_type.
13290
13291         (Binary.Emit): Test first for doubles instead of
13292         floats, as they are more common.
13293
13294         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13295         when dealing with floats and the <=, >= operators.  This fixes bug
13296         #39314 
13297
13298         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13299         to load the array value by emitting a load on the foreach variable
13300         type.  This was incorrect.  
13301
13302         We now emit the code to load an element using the the array
13303         variable type, and then we emit the conversion operator.
13304
13305         Fixed #40176
13306
13307 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13308
13309         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13310
13311 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13312
13313         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13314         test for protection before we test for signatures. 
13315
13316         (MethodSignature.ToString): implement.
13317
13318         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13319         to the case where we reduced into a LongConstant.
13320
13321         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13322         depend on whether the information is acurrate, because the
13323         Microsoft runtime will always claim that the array type is public,
13324         regardless of the real state.
13325
13326         If the type is a pointer, another problem happens: the type is
13327         reported as non-public in Microsoft.  
13328
13329         In both cases we have to call CheckAccessLevel recursively with
13330         the underlying type as the argument to be tested.
13331
13332 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * assign.cs (Assign.Emit): If we are dealing with a compound
13335         assignment expression, we should use the code path that stores the
13336         intermediate result in a temporary value.  This fixes #40903.
13337
13338         *expression.cs (Indirection.ToString): Provide ToString method for
13339         debugging. 
13340
13341 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13342
13343         * class.cs: Null out fields holding references to Block objects so
13344         they can be garbage collected.
13345
13346         * expression.cs (OverloadResolve): Remove unused local.
13347
13348 2003-04-07  Martin Baulig  <martin@ximian.com>
13349
13350         * codegen.cs (EmitContext.CurrentFile): New public field.
13351         (EmitContext.Mark): Use the CurrentFile to check whether the
13352         location is in the correct file.
13353         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13354
13355 2003-04-07  Martin Baulig  <martin@ximian.com>
13356
13357         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13358
13359         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13360         location.  [FIXME: The location argument which gets passed to this
13361         method is sometimes wrong!]
13362
13363 2003-04-07  Nick Drochak <ndrochak@gol.com>
13364
13365         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13366
13367 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13368
13369         * expression.cs (Indirection.EmitAssign): We were using the
13370         temporary, but returning immediately instead of continuing the
13371         EmitAssing flow.
13372
13373 2003-04-06  Martin Baulig  <martin@ximian.com>
13374
13375         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13376         if it's a nested child, but also deriving from the outer class.
13377         See test 190.cs.
13378
13379         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13380         nested child, but also deriving from the outer class.  See
13381         test-190.cs.
13382         (FilterWithClosure): We may access private members of the outer
13383         class if we're a nested child and deriving from the outer class.
13384         (RealMemberLookup): Only set `closure_private_ok' if the
13385         `original_bf' contained BindingFlags.NonPublic.
13386
13387 2003-04-05  Martin Baulig  <martin@ximian.com>
13388
13389         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13390
13391 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13392
13393         * class.cs (Event.Define): Do not allow abstract events to have
13394         initializers. 
13395
13396 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13397
13398         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13399         block in event declarations.
13400
13401         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13402         value type, get its address.
13403
13404         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13405         leaving a class on the stack instead of a boolean value (int
13406         0/1).  Change the code so we compare against null, and then the
13407         result against zero.
13408
13409         * class.cs (TypeContainer.GetClassBases): We were checking for the
13410         parent class being sealed too late.
13411
13412         * expression.cs (Binary.Emit): For <= and >= when dealing with
13413         floating point values, use cgt.un and clt.un instead of cgt and
13414         clt alone.
13415
13416 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13417
13418         * statement.cs: Apply the same optimization as MS: skip the 
13419         GetEnumerator returning an IEnumerator, and use the one returning a 
13420         CharEnumerator instead. This allows us to avoid the try-finally block 
13421         and the boxing.
13422
13423 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13424
13425         * cs-parser.jay: Attributes cannot be applied to
13426                          namespaces. Fixes #40473
13427
13428 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13429
13430         * class.cs:
13431         (Add*): check if the name is valid using the full name for constants,
13432         fields, properties and events.
13433
13434 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13435
13436         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13437         char constants to be part of the enumeration.
13438
13439         * expression.cs (Conditional.DoResolve): Add support for operator
13440         true. Implements the missing functionality from 14.12
13441
13442         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13443         operator true/false as required by the spec.
13444
13445         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13446         implicit conversion to boolean.
13447
13448         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13449         also one where the type implements `operator true'. 
13450
13451         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13452         get an expression that will invoke operator true based on an
13453         expression.  
13454
13455         (GetConversionOperators): Removed the hack that called op_True
13456         here.  
13457
13458         (Expression.ResolveBoolean): Move this from Statement.
13459
13460 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13461
13462         * ecore.cs (FieldExpr): do not allow initialization of initonly
13463         fields on derived classes
13464
13465 2003-03-13  Martin Baulig  <martin@ximian.com>
13466
13467         * statement.cs (Block.Emit): Call ig.BeginScope() and
13468         ig.EndScope() when compiling with debugging info; call
13469         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13470
13471 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13472
13473         * expression.cs (Indexers): Do not construct immediately, allow
13474         for new members to be appended as we go.  Fixes 38143
13475
13476 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13477
13478         * expression.cs: save/restore context when resolving an unchecked
13479         expression.
13480
13481 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * cfold.cs: Catch division by zero in modulus operator during
13484         constant folding.
13485
13486 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * interface.cs (Interface.DefineMembers): Avoid defining members
13489         twice. 
13490
13491 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13492
13493         * driver.cs: handle the +/- options for -noconfig
13494
13495         * statement.cs (Unckeched.Resolve): Also track the state of
13496         unchecked in the Resolve phase.
13497
13498 2003-02-27  Martin Baulig  <martin@ximian.com>
13499
13500         * ecore.cs (Expression.MemberLookup): Don't create a
13501         MethodGroupExpr for something which is not a method.  Fixes #38291.
13502
13503 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * class.cs (MemberBase.CheckParameters): Also check that the type
13506         is unmanaged if it is a pointer.
13507
13508         * expression.cs (SizeOf.Resolve): Add location information.
13509
13510         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13511         a managed type is declared.
13512
13513         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13514         parameter modifiers as well.  Fixes bug 38606
13515
13516         * class.cs: Very sad.  Am backing out the speed up changes
13517         introduced by the ArrayList -> Array in the TypeContainer, as they
13518         were not actually that much faster, and introduced a bug (no error
13519         reports on duplicated methods).
13520
13521         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13522         source first, this will guarantee that we have a valid expression
13523         before calling in lower levels functions that will require a
13524         resolved object.  Then use this original_source in the
13525         target.ResolveLValue instead of the original source that was
13526         passed to us.
13527
13528         Another change.  Use target.Resolve instead of LValueResolve.
13529         Although we are resolving for LValues, we will let the Assign code
13530         take care of that (it will be called again from Resolve).  This
13531         basically allows code like this:
13532
13533         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13534         class Y { void A (X x) { x [0] += o; }
13535
13536         The problem was that the indexer was trying to resolve for
13537         set_Item (idx, object o) and never finding one.  The real set_Item
13538         was set_Item (idx, X).  By delaying the process we get the right
13539         semantics. 
13540
13541         Fixes bug 36505
13542
13543 2003-02-23  Martin Baulig  <martin@ximian.com>
13544
13545         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13546         while calling DoEmit ().
13547
13548         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13549         source files; if you use the #line directive inside a method, the
13550         compiler stops emitting line numbers for the debugger until it
13551         reaches the end of the method or another #line directive which
13552         restores the original file.
13553
13554 2003-02-23  Martin Baulig  <martin@ximian.com>
13555
13556         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13557
13558 2003-02-23  Martin Baulig  <martin@ximian.com>
13559
13560         * statement.cs (Block.AddChildVariableNames): We need to call this
13561         recursively, not just for our immediate children.
13562
13563 2003-02-23  Martin Baulig  <martin@ximian.com>
13564
13565         * class.cs (Event.Define): Always make the field private, like csc does.
13566
13567         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13568         actually work, fixes bug #37521.
13569
13570 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * delegate.cs: When creating the various temporary "Parameters"
13573         classes, make sure that we call the ComputeAndDefineParameterTypes
13574         on those new parameters (just like we do with the formal ones), to
13575         allow them to be resolved in the context of the DeclSpace.
13576
13577         This fixes the bug that Dick observed in Bugzilla #38530.
13578
13579 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13580
13581         * expression.cs (ResolveMemberAccess): When resolving a constant,
13582         do not attempt to pull a constant if the value was not able to
13583         generate a valid constant.
13584
13585         * const.cs (LookupConstantValue): Do not report more errors than required.
13586
13587 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13588
13589         * expression.cs: fixes bug #38328.
13590
13591 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * class.cs: Changed all the various members that can be part of a
13594         class from being an ArrayList to be an Array of the right type.
13595         During the DefineType type_list, interface_list, delegate_list and
13596         enum_list are turned into types, interfaces, delegates and enums
13597         arrays.  
13598
13599         And during the member population, indexer_list, event_list,
13600         constant_list, field_list, instance_constructor_list, method_list,
13601         operator_list and property_list are turned into their real arrays.
13602
13603         Although we could probably perform this operation earlier, for
13604         good error reporting we need to keep the lists and remove the
13605         lists for longer than required.
13606
13607         This optimization was triggered by Paolo profiling the compiler
13608         speed on the output of `gen-sample-program.pl' perl script. 
13609
13610         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13611         not crash in methods like MemberLookupFailed that use this field.  
13612
13613         This problem arises when the compiler fails to resolve a type
13614         during interface type definition for example.
13615
13616 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13617
13618         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13619         inherit from System.Object, so we have to stop at null, not only
13620         when reaching System.Object.
13621
13622 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13625         DeclaredOnly because the parent indexer might have had a different
13626         name, but did not loop until the top of the hierarchy was reached.
13627
13628         The problem this one fixes is 35492: when a class implemented an
13629         indexer from an interface, we were getting the interface method
13630         (which was abstract) and we were flagging an error (can not invoke
13631         abstract method).
13632
13633         This also keeps bug 33089 functioning, and test-148 functioning.
13634
13635         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13636         out if a method is special is to see if it is declared in a
13637         property or event, or whether it is one of the predefined operator
13638         names.   This should fix correctly #36804.
13639
13640 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13641
13642         The goal here is to remove the dependency on EmptyCast.Peel ().
13643         Killing it completely.
13644
13645         The problem is that currently in a number of places where
13646         constants are expected, we have to "probe" for an EmptyCast, and
13647         Peel, which is not the correct thing to do, as this will be
13648         repetitive and will likely lead to errors. 
13649
13650         The idea is to remove any EmptyCasts that are used in casts that
13651         can be reduced to constants, so we only have to cope with
13652         constants. 
13653
13654         This bug hunt was triggered by Bug 37363 and the desire to remove
13655         the duplicate pattern where we were "peeling" emptycasts to check
13656         whether they were constants.  Now constants will always be
13657         constants.
13658
13659         * ecore.cs: Use an enumconstant here instead of wrapping with
13660         EmptyCast.  
13661
13662         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13663         throwing me off.  By handling this we can get rid of a few hacks.
13664
13665         * statement.cs (Switch): Removed Peel() code.
13666
13667 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * class.cs: Location information for error 508
13670
13671         * expression.cs (New.DoResolve): Add a guard against double
13672         resolution of an expression.  
13673
13674         The New DoResolve might be called twice when initializing field
13675         expressions (see EmitFieldInitializers, the call to
13676         GetInitializerExpression will perform a resolve on the expression,
13677         and later the assign will trigger another resolution
13678
13679         This leads to bugs (#37014)
13680
13681         * delegate.cs: The signature for EndInvoke should contain any ref
13682         or out parameters as well.  We were not doing this in the past. 
13683
13684         * class.cs (Field.Define): Do not overwrite the type definition
13685         inside the `volatile' group.  Turns out that volatile enumerations
13686         were changing the type here to perform a validity test, which
13687         broke conversions. 
13688
13689 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13690
13691         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13692         and structs, we do not want to load the instance variable
13693
13694         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13695         enum_type has to be handled like an object reference (implicit
13696         conversions exists from this to object), but the regular IsClass
13697         and IsValueType tests will never return true for this one.
13698
13699         Also we use TypeManager.IsValueType instead of type.IsValueType,
13700         just for consistency with the rest of the code (this is only
13701         needed if we ever use the construct exposed by test-180.cs inside
13702         corlib, which we dont today).
13703
13704 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13705
13706         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13707         just InternalCall.
13708
13709 2003-02-09  Martin Baulig  <martin@ximian.com>
13710
13711         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13712         (Namespace.DefineNamespaces): New static public method; this is
13713         called when we're compiling with debugging to add all namespaces
13714         to the symbol file.
13715
13716         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13717         pass it to the Namespace's .ctor.
13718
13719         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13720         and MethodBase arguments; pass the namespace ID to the symwriter;
13721         pass the MethodBase instead of the token to the symwriter.
13722         (SymbolWriter.DefineNamespace): New method to add a namespace to
13723         the symbol file.
13724
13725 2003-02-09  Martin Baulig  <martin@ximian.com>
13726
13727         * symbolwriter.cs: New file.  This is a wrapper around
13728         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13729         methods here in near future.
13730
13731 2003-02-09  Martin Baulig  <martin@ximian.com>
13732
13733         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13734         ILGenerator.MarkSequencePoint() which are actually used by the
13735         symbol writer.
13736
13737 2003-02-09  Martin Baulig  <martin@ximian.com>
13738
13739         * location.cs (SourceFile): New public sealed class.  This
13740         contains the name and an index which is used in the location's token.
13741         (Location): Reserve an appropriate number of bits in the token for
13742         the source file instead of walking over that list, this gives us a
13743         really huge performance improvement when compiling with debugging.
13744
13745         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13746         `SourceFile' argument instead of a string.
13747         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13748         but don't parse/tokenize here, we need to generate the list of all
13749         source files before we do that.
13750         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13751         the files.
13752
13753         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13754         instead of a string.
13755
13756         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13757         of a string.
13758
13759 2003-02-09  Martin Baulig  <martin@ximian.com>
13760
13761         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13762         filename on `#line default'.
13763
13764 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13765
13766         * statement.cs: don't clear the pinned var when the fixed statement
13767         returns from the method (fixes bug#37752).
13768
13769 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13770
13771         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13772         to IsValueType.
13773
13774 2003-02-07  Martin Baulig  <martin@ximian.com>
13775
13776         * driver.cs: Removed the `--debug-args' command line argument.
13777
13778         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13779         automatically by the AsssemblyBuilder.
13780         (CodeGen.InitializeSymbolWriter): We don't need to call any
13781         initialization function on the symbol writer anymore.  This method
13782         doesn't take any arguments.
13783
13784 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13785
13786         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13787         from referenced assemblies as well.
13788
13789 2003-02-02  Martin Baulig  <martin@ximian.com>
13790
13791         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13792
13793 2003-02-02  Martin Baulig  <martin@ximian.com>
13794
13795         * class.cs (Constructor.Emit): Open the symbol writer before
13796         emitting the constructor initializer.
13797         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13798         single-stepping through constructor initializers.
13799
13800 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13801
13802         * class.cs: Handle error 549: do not allow virtual methods in
13803         sealed classes. 
13804
13805 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13806
13807         * decl.cs: Check access levels when resolving types
13808
13809 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13810
13811         * statement.cs: Add parameters and locals set in catch blocks that might 
13812         return to set vector
13813
13814 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13815
13816         * class.cs (Operator): Set the SpecialName flags for operators.
13817
13818         * expression.cs (Invocation.DoResolve): Only block calls to
13819         accessors and operators on SpecialName methods.
13820
13821         (Cast.TryReduce): Handle conversions from char constants.
13822
13823
13824 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13825
13826         * statement.cs: small memory and time optimization in FlowBranching.
13827
13828 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13829
13830         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13831         problem that the last fix but in the other sid (Set).
13832
13833         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13834         access when there is no indexer in the hierarchy.
13835
13836 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13837
13838         * class.cs: Combine some if statements.
13839
13840 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13841
13842         * driver.cs: fixed bug #37187.
13843
13844 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13845
13846         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13847         any indexer, it's needed to build a list with all the indexers in the
13848         hierarchy (AllGetters), else we have problems. Fixes #35653.
13849
13850 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13851
13852         * class.cs (MethodData.Define): It is wrong for an interface
13853         implementation to be static in both cases: explicit and implicit.
13854         We were only handling this in one case.
13855
13856         Improve the if situation there to not have negations.
13857
13858         * class.cs (Field.Define): Turns out that we do not need to check
13859         the unsafe bit on field definition, only on usage.  Remove the test.
13860
13861 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13862
13863         * driver.cs: use assembly.Location instead of Codebase (the latest
13864         patch made mcs fail when using MS assemblies).
13865
13866 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13867
13868         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13869         get the path to *corlib.dll.
13870
13871 2003-01-21  Nick Drochak <ndrochak@gol.com>
13872
13873         * cs-tokenizer.cs:
13874         * pending.cs:
13875         * typemanager.cs: Remove compiler warnings
13876
13877 2003-01-20  Duncan Mak  <duncan@ximian.com>
13878
13879         * AssemblyInfo.cs: Bump the version number to 0.19.
13880
13881 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13882
13883         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13884
13885 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13886
13887         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13888
13889 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13890
13891         * cs-parser.jay: Small fix: we were not comparing the constructor
13892         name correctly.   Thanks to Zoltan for the initial pointer.
13893
13894 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13895
13896         * cs-tokenizer.cs: Set file name when specified with #line
13897
13898 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13899
13900         * cs-parser.jay: Only perform the constructor checks here if we
13901         are named like the class;  This will help provider a better
13902         error.  The constructor path is taken when a type definition is
13903         not found, but most likely the user forgot to add the type, so
13904         report that rather than the constructor error.
13905
13906 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13907
13908         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13909         allocations.
13910
13911 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13912
13913         * cs-parser.jay: Add cleanup call.
13914
13915 2003-01-13  Duncan Mak  <duncan@ximian.com>
13916
13917         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13918         consistent with other methods.
13919
13920 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13921
13922         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13923
13924 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13925
13926         * attribute.cs: only set GuidAttr to true when we have a
13927         GuidAttribute.
13928
13929 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13930
13931         * ecore.cs:
13932         * expression.cs:
13933         * typemanager.cs: fixes to allow mcs compile corlib with the new
13934         Type.IsSubclassOf fix.
13935
13936 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * expression.cs (LocalVariableReference.DoResolve): Classify a
13939         constant as a value, not as a variable.   Also, set the type for
13940         the variable.
13941
13942         * cs-parser.jay (fixed_statement): take a type instead of a
13943         pointer_type, so we can produce a better error message later.
13944
13945         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13946         as an error.  
13947
13948         (For.DoEmit): Make inifinite loops have a
13949         non-conditional branch back.
13950
13951         (Fixed.DoEmit): First populate the pinned variables, then emit the
13952         statement, then clear the variables.  Before I was emitting the
13953         code once for each fixed piece.
13954
13955
13956 2003-01-08  Martin Baulig  <martin@ximian.com>
13957
13958         * statement.cs (FlowBranching.MergeChild): A break in a
13959         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13960
13961 2003-01-08  Martin Baulig  <martin@ximian.com>
13962
13963         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13964         lives in the same number space than `param_map'.  Fixes #36154.
13965
13966 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13967
13968         * cs-parser.jay (constructor_declaration): Set the
13969         Constructor.ModFlags before probing for it.  This makes the
13970         compiler report 514, 515 and 132 (the code was there, but got
13971         broken). 
13972
13973         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13974         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13975         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13976
13977 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13978
13979         * enum.cs: create the enum static fields using the enum type.
13980
13981 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13982
13983         * class.cs: don't try to create the ParamBuilder for the return
13984         type if it's not needed (and handle it breaking for the ms runtime
13985         anyway).
13986
13987 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13988
13989         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13990
13991 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13992
13993         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13994         the command.   This showed up while compiling the JANET source
13995         code, which used \r as its only newline separator.
13996
13997 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13998
13999         * class.cs (Method.Define): If we are an operator (because it
14000         reuses our code), then set the SpecialName and HideBySig.  #36128
14001
14002 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14005         exception, report error 120 `object reference required'.
14006
14007         * driver.cs: Add --pause option, used during to measure the size
14008         of the process as it goes with --timestamp.
14009
14010         * expression.cs (Invocation.DoResolve): Do not allow methods with
14011         SpecialName to be invoked.
14012
14013 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14016         number before adding it.
14017
14018 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14019
14020         * ecore.cs (StandardImplicitConversion): When in an unsafe
14021         context, we allow conversion between void * to any other pointer
14022         type. This fixes bug #35973.
14023
14024 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14025
14026         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14027         is not thrown when extensionless outputs are used 
14028
14029 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14030
14031         * rootcontext.cs: fixed compilation of corlib.
14032
14033 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14034
14035         * attribute.cs (Attributes.Contains): Add new method.
14036
14037         * class.cs (MethodCore.LabelParameters): if the parameter is an
14038         `out' parameter, check that no attribute `[In]' has been passed.
14039
14040         * enum.cs: Handle the `value__' name in an enumeration.
14041
14042 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14043
14044         * decl.cs: Added special case to allow overrides on "protected
14045         internal" methods
14046
14047 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14048
14049         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14050         since it makes much more sense.
14051
14052         (Attributes.ctor): Don't require a Location parameter.
14053
14054         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14055
14056         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14057         since we already have that information per attribute.
14058
14059         * everywhere : make appropriate changes.
14060
14061         * class.cs (LabelParameters): Write the code which actually
14062         applies attributes to the return type. We can't do this on the MS
14063         .NET runtime so we flag a warning in the case an exception is
14064         thrown.
14065
14066 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14067
14068         * const.cs: Handle implicit null conversions here too.
14069
14070 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14071
14072         * class.cs (MethodCore.LabelParameters): Remove the extra
14073         Type [] parameter since it is completely unnecessary. Instead
14074         pass in the method's attributes so that we can extract
14075         the "return" attribute.
14076
14077 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14078
14079         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14080         of ignoring it and letting the compile continue.
14081
14082         * typemanager.cs (ChangeType): use an extra argument to return an
14083         error condition instead of throwing an exception.
14084
14085 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14086
14087         * expression.cs (Unary.TryReduce): mimic the code for the regular
14088         code path.  Perform an implicit cast in the cases where we can
14089         implicitly convert to one of the integral types, and then reduce
14090         based on that constant.   This fixes bug #35483.
14091
14092 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14093
14094         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14095
14096 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14097
14098         * namespace.cs: fixed bug #35489.
14099
14100 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * class.cs: Remove some dead code.
14103
14104         * cs-parser.jay: Estimate the number of methods needed
14105         (RootContext.MethodCount);
14106
14107         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14108         numbers instead of StringBuilders.
14109
14110         * support.cs (PtrHashtable): Add constructor with initial size;
14111         We can now reduce reallocations of the method table.
14112
14113 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14114
14115         * attribute.cs (ApplyAttributes): Keep track of the emitted
14116         attributes on a per-target basis. This fixes bug #35413.
14117
14118 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14119
14120         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14121         default to the Windows 1252 encoding.
14122
14123         (UnixParseOption): Support version, thanks to Alp for the missing
14124         pointer. 
14125
14126         * AssemblyInfo.cs: Add nice assembly information.
14127
14128         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14129         (bug 35169).
14130
14131         * cs-parser.jay: Allow a trailing comma before the close bracked
14132         in the attribute_section production.
14133
14134         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14135         address of the instance was being taken, I will take this out,
14136         because we take the address of the object immediately here.
14137
14138 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14139
14140         * typemanager.cs (AreMultipleAllowed): Take care of the most
14141         obvious case where attribute type is not in the current assembly -
14142         stupid me ;-)
14143
14144 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14147         definitions, instead of doing that afterwards.  
14148
14149         Also we use a nice little hack, depending on the constructor, we
14150         know if we are a "composed" name or a simple name.  Hence, we
14151         avoid the IndexOf test, and we avoid 
14152
14153         * codegen.cs: Add code to assist in a bug reporter to track down
14154         the source of a compiler crash. 
14155
14156 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14157
14158         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14159         types have been emitted for a given element and flag an error
14160         if something which does not have AllowMultiple set is used more
14161         than once.
14162
14163         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14164         attribute types and their corresponding AllowMultiple properties
14165
14166         (AreMultipleAllowed): Check the property for a given type.
14167
14168         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14169         property in the case we have a TypeContainer.
14170
14171         (Attributes.AddAttribute): Detect duplicates and just skip on
14172         adding them. This trivial fix catches a pretty gross error in our
14173         attribute emission - global attributes were being emitted twice!
14174
14175         Bugzilla bug #33187 is now fixed.
14176
14177 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14178
14179         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14180         instead of pp_and).
14181
14182         * expression.cs (Binary.ResolveOperator): I can only use the
14183         Concat (string, string, string) and Concat (string, string,
14184         string, string) if the child is actually a concatenation of
14185         strings. 
14186
14187 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14188
14189         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14190         context where we need a 2-character lookahead.
14191
14192         * pending.cs (PendingImplementation): Rework so we can keep track
14193         of interface types all the time, and flag those which were
14194         implemented by parents as optional.
14195
14196 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * expression.cs (Binary.ResolveOperator): Use
14199         String.Concat(string,string,string) or
14200         String.Concat(string,string,string,string) when possible. 
14201
14202         * typemanager: More helper methods.
14203
14204
14205 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14206
14207         * pending.cs: remove the bogus return from GetMissingInterfaces()
14208         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14209
14210 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14211
14212         * namespace.cs: avoid duplicated 'using xxx' being added to
14213         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14214         when we get more than one 'using' statement for the same namespace.
14215         Report a CS0105 warning for it.
14216
14217 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14218
14219         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14220         of calling getChar/putback, uses internal knowledge of it.    
14221
14222         (xtoken): Reorder tokenizer so most common patterns are checked
14223         first.  This reduces the compilation time in another 5% (from 8.11s
14224         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14225
14226         The parsing time is 22% of the compilation in mcs, and from that
14227         64% is spent on the tokenization process.  
14228
14229         I tried using a binary search for keywords, but this is slower
14230         than the hashtable.  Another option would be to do a couple of
14231         things:
14232
14233                 * Not use a StringBuilder, instead use an array of chars,
14234                   with a set value.  Notice that this way we could catch
14235                   the 645 error without having to do it *afterwards*.
14236
14237                 * We could write a hand-parser to avoid the hashtable
14238                   compares altogether.
14239
14240         The identifier consumption process takes 37% of the tokenization
14241         time.  Another 15% is spent on is_number.  56% of the time spent
14242         on is_number is spent on Int64.Parse:
14243
14244                 * We could probably choose based on the string length to
14245                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14246                   computations. 
14247
14248         Another 3% is spend on wrapping `xtoken' in the `token' function.
14249
14250         Handle 0xa0 as whitespace (#34752)
14251
14252 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14253
14254         * typemanager.cs (IsCLRType): New routine to tell whether a type
14255         is one of the builtin types.  
14256
14257         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14258         typecode in more places instead of doing pointer comparissions.
14259         We could leverage some knowledge about the way the typecodes are
14260         laid out.
14261
14262         New code to cache namespaces in assemblies, it is currently not
14263         invoked, to be used soon.
14264
14265         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14266
14267         * expression.cs (Binary.ResolveOperator): specially handle
14268         strings, and do not perform user-defined operator overloading for
14269         built-in types.
14270
14271 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14272
14273         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14274         internalcall as it is a pretty simple operation;  Avoid whenever
14275         possible to call Char.IsLetter.
14276
14277         (consume_identifier): Cut by half the number of
14278         hashtable calls by merging the is_keyword and GetKeyword behavior.
14279
14280         Do not short-circuit, because if we do, we
14281         report errors (ie, #if false && true would produce an invalid
14282         directive error);
14283
14284
14285 2002-11-24  Martin Baulig  <martin@ximian.com>
14286
14287         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14288         check constant ranges and report a CS0221.  Fixes #33186.
14289
14290 2002-11-24  Martin Baulig  <martin@ximian.com>
14291
14292         * cs-parser.jay: Make this work for uninitialized variable
14293         declarations in the `for' initializer.  Fixes #32416.
14294
14295 2002-11-24  Martin Baulig  <martin@ximian.com>
14296
14297         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14298         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14299
14300 2002-11-24  Martin Baulig  <martin@ximian.com>
14301
14302         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14303         argument; if true, we also check for user-defined conversions.
14304         This is only needed if both arguments are of a user-defined type.
14305         Fixes #30443, added test-175.cs.
14306         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14307
14308         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14309
14310 2002-11-24  Martin Baulig  <martin@ximian.com>
14311
14312         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14313         function to get the store opcode.
14314         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14315         only emit the Ldelema if the store opcode is Stobj.  You must run
14316         both test-34 and test-167 to test this.  Fixes #34529.
14317
14318 2002-11-23  Martin Baulig  <martin@ximian.com>
14319
14320         * ecore.cs (Expression.MemberLookup): Added additional
14321         `qualifier_type' argument which is used when we're being called
14322         from MemberAccess.DoResolve() and null if we're called from a
14323         SimpleName lookup.
14324         (Expression.MemberLookupFailed): New method to report errors; this
14325         does the CS1540 check and reports the correct error message.
14326
14327         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14328         argument for the CS1540 check and redone the way how we're dealing
14329         with private members.  See the comment in the source code for details.
14330         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14331         `closure_start_type' to `closure_qualifier_type' and check whether
14332         it's not null.  It was not this filter being broken, it was just
14333         being called with the wrong arguments.
14334
14335         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14336         and pass it the correct `qualifier_type'; this also does the error
14337         handling for us.
14338
14339 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14340
14341         * expression.cs (Invocation.EmitParams): If the we are dealing
14342         with a non-built-in value type, load its address as well.
14343
14344         (ArrayCreation): Use a a pretty constant instead
14345         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14346         static initializers.  
14347
14348         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14349         because they are not really value types, just glorified integers. 
14350
14351         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14352
14353         * ecore.cs: Remove redundant code for enumerations, make them use
14354         the same code path as everything else, fixes the casting issue
14355         with enumerations in Windows.Forms.
14356
14357         * attribute.cs: Do only cast to string if it is a string, the
14358         validation happens later.
14359
14360         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14361         people upgrade their corlibs.
14362
14363         * ecore.cs: Oops, enumerations were not following the entire code path
14364
14365 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14366
14367         * typemanager.cs (FilterWithClosure): Commented out the test for
14368         1540 in typemanager.cs, as it has problems when accessing
14369         protected methods from a parent class (see test-174.cs). 
14370
14371         * attribute.cs (Attribute.ValidateGuid): new method.
14372         (Attribute.Resolve): Use above.
14373
14374 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14375
14376         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14377
14378         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14379         handling for enumerations, as we only needed the TypeContainer
14380         functionality to begin with (this is required for the fix below to
14381         work for enums that reference constants in a container class for
14382         example). 
14383
14384         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14385
14386         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14387         a valid TypeBuilder to perform lookups on.o
14388
14389         * class.cs (InheritableMemberSignatureCompare): Use true in the
14390         call to GetGetMethod and GetSetMethod, because we are comparing
14391         the signature, and we need to get the methods *even* if they are
14392         private. 
14393
14394         (PropertyBase.CheckBase): ditto.
14395
14396         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14397         GotoCase.Resolve): Use Peel on EmpytCasts.
14398
14399         * ecore.cs (EmptyCast): drop child, add Peel method.
14400
14401 2002-11-17  Martin Baulig  <martin@ximian.com>
14402
14403         * ecore.cs (EmptyCast.Child): New public property.
14404
14405         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14406         label resolved to an EmptyCast.  Fixes #34162.
14407         (GotoCase.Resolve): Likewise.
14408         (Block.EmitMeta): Likewise.
14409
14410 2002-11-17  Martin Baulig  <martin@ximian.com>
14411
14412         * expression.cs (Invocation.BetterConversion): Prefer int over
14413         uint; short over ushort; long over ulong for integer literals.
14414         Use ImplicitConversionExists instead of StandardConversionExists
14415         since we also need to check for user-defined implicit conversions.
14416         Fixes #34165.  Added test-173.cs.
14417
14418 2002-11-16  Martin Baulig  <martin@ximian.com>
14419
14420         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14421         with the `true' and `false' literals.  Fixes #33151.
14422
14423 2002-11-16  Martin Baulig  <martin@ximian.com>
14424
14425         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14426         October 22nd; don't do the cs1540 check for static members.
14427
14428         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14429         now using our own filter here and doing the cs1540 check again.
14430
14431 2002-11-16  Martin Baulig  <martin@ximian.com>
14432
14433         * support.cs (InternalParameters): Don't crash if we don't have
14434         any fixed parameters.  Fixes #33532.
14435
14436 2002-11-16  Martin Baulig  <martin@ximian.com>
14437
14438         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14439         when looking up static methods to make this work on Windows.
14440         Fixes #33773.
14441
14442 2002-11-16  Martin Baulig  <martin@ximian.com>
14443
14444         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14445         a setter rather than using PropertyInfo.CanWrite.
14446
14447 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14448
14449         * class.cs: Allow acces to block member by subclasses. Fixes build
14450         breaker.
14451
14452 2002-11-14  Martin Baulig  <martin@ximian.com>
14453
14454         * class.cs (Constructor.Emit): Added the extern/block check.
14455         Fixes bug #33678.
14456
14457 2002-11-14  Martin Baulig  <martin@ximian.com>
14458
14459         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14460         iteration while looking for indexers, this is needed because the
14461         indexer may have a different name in our base classes.  Fixed the
14462         error reporting (no indexers at all, not get accessor, no
14463         overloaded match).  Fixes bug #33089.
14464         (IndexerAccess.DoResolveLValue): Likewise.
14465
14466 2002-11-14  Martin Baulig  <martin@ximian.com>
14467
14468         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14469         indexers.  Fixes the first part of bug #33089.
14470         (MethodSignature.InheritableMemberSignatureCompare): Added support
14471         for properties.
14472
14473 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14474
14475         * attribute.cs (Attribute.Resolve): Catch the
14476         NullReferenceException and report it since it isn't supposed to
14477         happen. 
14478
14479 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14482         LogicalOr and LogicalAnd that can benefit from recursively
14483         handling EmitBranchable.  The code now should be nice for Paolo.
14484
14485 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14488         the Type lookups, as we perform quite a number of lookups on
14489         non-Types.  This can be removed once we can deterministically tell
14490         whether we have a type or a namespace in advance.
14491
14492         But this might require special hacks from our corlib.
14493
14494         * TODO: updated.
14495
14496         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14497         and double which avoids a conversion from an integer to a double.
14498
14499         * expression.cs: tiny optimization, avoid calling IsConstant,
14500         because it effectively performs the lookup twice.
14501
14502 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14503
14504         But a bogus return here to keep the semantics of the old code
14505         until the Mono runtime is fixed.
14506
14507         * pending.cs (GetMissingInterfaces): New method used to remove all
14508         the interfaces that are already implemented by our parent
14509         classes from the list of pending methods. 
14510
14511         * interface.cs: Add checks for calls after ResolveTypeExpr.
14512
14513 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14514
14515         * class.cs (Class.Emit): Report warning 67: event not used if the
14516         warning level is beyond 3.
14517
14518         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14519         being a NullLiteral.
14520
14521         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14522         specifiers. 
14523
14524         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14525         path that might fail if a type can not be resolved.
14526
14527         * expression.cs (Binary.Emit): Emit unsigned versions of the
14528         operators. 
14529
14530         * driver.cs: use error 5.
14531
14532 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14533
14534         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14535
14536 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14537
14538         * cs-parser.jay (switch_section): A beautiful patch from Martin
14539         Baulig that fixed 33094.
14540
14541 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14542
14543         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14544         Check whether the base is abstract and report an error if so.
14545
14546         * expression.cs (IndexerAccess.DoResolveLValue,
14547         IndexerAccess.DoResolve): ditto. 
14548
14549         (Invocation.DoResolve): ditto.
14550
14551         (Invocation.FullMethodDesc): Improve the report string.
14552
14553         * statement.cs (Block): Eliminate IsVariableDefined as it is
14554         basically just a wrapper for GetVariableInfo.
14555
14556         * ecore.cs (SimpleName): Use new 
14557
14558         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14559         type, as we return the actual parameter ref/unref state on a
14560         different call.
14561
14562 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * support.cs: Return proper flags REF/OUT fixing the previous
14565         commit.  
14566
14567         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14568         not used to mean `ref' but `ref or out' in ParameterReference
14569
14570         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14571         full type signature instead of calling TypeManger.CSharpName
14572         ourselves. 
14573
14574         * support.cs (InternalParameters.ParameterDesc): Do not compare
14575         directly to the modflags, because REF/OUT will actually be bitsets
14576         if set. 
14577
14578         * delegate.cs (VerifyMethod): Check also the modifiers.
14579
14580         * cs-tokenizer.cs: Fix bug where floating point values with an
14581         exponent where a sign was missing was ignored.
14582
14583         * driver.cs: Allow multiple assemblies to be specified in a single
14584         /r: argument
14585
14586 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14587
14588         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14589         because identifiers after a parenthesis would end up in this kind
14590         of production, and we needed to desamiguate it for having casts
14591         like:
14592
14593                 (UserDefinedType *) xxx
14594
14595 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14598         we should set on the Bindingflags.NonPublic, but not turn on
14599         private_ok.  private_ok controls whether a Private member is
14600         returned (this is chekced on the filter routine), while the
14601         BindingFlags.NonPublic just controls whether private/protected
14602         will be allowed.   This fixes the problem part of the problem of
14603         private properties being allowed to be used in derived classes.
14604
14605         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14606         so we can call the children DoResolveLValue method (this will
14607         properly signal errors on lvalue assignments to base properties)
14608
14609         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14610         getter are null, and we have a property info, we know that this
14611         happened because the lookup failed, so we report an error 122 for
14612         protection level violation.
14613
14614         We also silently return if setter and getter are null in the
14615         resolve functions, this condition only happens if we have flagged
14616         the error before.  This is the other half of the problem. 
14617
14618         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14619         not have accessibility information, that is why we were returning
14620         true in the filter function in typemanager.cs.
14621
14622         To properly report 122 (property is inaccessible because of its
14623         protection level) correctly, we report this error in ResolveAccess
14624         by failing if both the setter and the getter are lacking (ie, the
14625         lookup failed). 
14626
14627         DoResolve and DoLResolve have been modified to check for both
14628         setter/getter being null and returning silently, the reason being
14629         that I did not want to put the knowledge about this error in upper
14630         layers, like:
14631
14632         int old = Report.Errors;
14633         x = new PropertyExpr (...);
14634         if (old != Report.Errors)
14635                 return null;
14636         else
14637                 return x;
14638
14639         So the property expr is returned, but it is invalid, so the error
14640         will be flagged during the resolve process. 
14641
14642         * class.cs: Remove InheritablePropertySignatureCompare from the
14643         class, as we no longer depend on the property signature to compute
14644         whether it is possible to implement a method or not.
14645
14646         The reason is that calling PropertyInfo.GetGetMethod will return
14647         null (in .NET, in Mono it works, and we should change this), in
14648         cases where the Get Method does not exist in that particular
14649         class.
14650
14651         So this code:
14652
14653         class X { public virtual int A { get { return 1; } } }
14654         class Y : X { }
14655         class Z : Y { public override int A { get { return 2; } } }
14656
14657         Would fail in Z because the parent (Y) would not have the property
14658         defined.  So we avoid this completely now (because the alternative
14659         fix was ugly and slow), and we now depend exclusively on the
14660         method names.
14661
14662         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14663         reference method, instead of using the property.
14664
14665         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14666         routines are gone now.
14667
14668         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14669         names, they were incorrectly named.
14670
14671         * cs-tokenizer.cs: Return are more gentle token on failure. 
14672
14673         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14674         had an out-of-sync index variable, which caused it to remove from
14675         the list of pending methods the wrong method sometimes.
14676
14677 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14678
14679         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14680         CanWrite, because those refer to this particular instance of the
14681         property, and do not take into account the fact that we can
14682         override single members of a property.
14683
14684         Constructor requires an EmitContext.  The resolution process does
14685         not happen here, but we need to compute the accessors before,
14686         because the resolution does not always happen for properties.
14687
14688         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14689         subclass, before we did not update this flag, but we did update
14690         bindingflags. 
14691
14692         (GetAccessors): Drop this routine, as it did not work in the
14693         presence of partially overwritten set/get methods. 
14694
14695         Notice that this broke the cs1540 detection, but that will require
14696         more thinking. 
14697
14698 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14699
14700         * class.cs:
14701         * codegen.cs:
14702         * driver.cs: issue a warning instead of an error if we don't support
14703         debugging for the platform. Also ignore a couple of errors that may
14704         arise when trying to write the symbols. Undo my previous patch.
14705
14706 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14707
14708         * driver.cs: ignore /debug switch except for Unix platforms.
14709
14710 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14711
14712         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14713
14714 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * driver.cs: Do not make mcs-debug conditional, so we do not break
14717         builds that use it.
14718
14719         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14720         review this patch.  But basically after all the children variables
14721         have been merged, the value of "Breaks" was not being set to
14722         new_breaks for Switch blocks.  I think that it should be set after
14723         it has executed.  Currently I set this to the value of new_breaks,
14724         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14725         conservative, but I do not understand this code very well.
14726
14727         I did not break anything in the build, so that is good ;-)
14728
14729         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14730
14731 2002-10-20  Mark Crichton  <crichton@gimp.org>
14732
14733         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14734
14735 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14736
14737         * cfold.cs: Fixed compile blocker.
14738
14739 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * driver.cs: I was chekcing the key, not the file.
14742
14743 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14744
14745         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14746         message that we were generating - we just need to silently return
14747         a null.
14748
14749 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14750
14751         * class.cs (Event.Define): Change my previous commit, as this
14752         breaks the debugger.  This is a temporary hack, as it seems like
14753         the compiler is generating events incorrectly to begin with.
14754
14755         * expression.cs (Binary.ResolveOperator): Added support for 
14756         "U operator - (E x, E y)"
14757
14758         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14759         y)".
14760
14761         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14762         init-only variables, but this path did not take into account that
14763         there might be also instance readonly variables.  Correct this
14764         problem. 
14765
14766         This fixes bug 32253
14767
14768         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14769         delegates as well.
14770
14771         * driver.cs: Change the extension for modules to `netmodule'
14772
14773         * cs-parser.jay: Improved slightly the location tracking for
14774         the debugger symbols.
14775
14776         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14777         modifiers that were specified instead of the hardcoded value
14778         (FamAndAssem).  This was basically ignoring the static modifier,
14779         and others.  Fixes 32429.
14780
14781         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14782         fixed a bug in the process (32476)
14783
14784         * expression.cs (ArrayAccess.EmitAssign): Patch from
14785         hwang_rob@yahoo.ca that fixes bug 31834.3
14786
14787 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14788
14789         * driver.cs: Make the module extension .netmodule.
14790
14791 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14792
14793         * driver.cs: Report an error if the resource file is not found
14794         instead of crashing.
14795
14796         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14797         false, like Emit does.
14798
14799 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14800
14801         * typemanager.cs: Remove unused private member.  Also reported mcs
14802         bug to report this as a warning like csc.
14803
14804 2002-10-15  Martin Baulig  <martin@gnome.org>
14805
14806         * statement.cs (Statement.Emit): Made this a virtual method; emits
14807         the line number info and calls DoEmit().
14808         (Statement.DoEmit): New protected abstract method, formerly knows
14809         as Statement.Emit().
14810
14811         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14812
14813 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14814
14815         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14816         have fixed a remaining problem: not every AddXXXX was adding a
14817         fully qualified name.  
14818
14819         Now everyone registers a fully qualified name in the DeclSpace as
14820         being defined instead of the partial name.  
14821
14822         Downsides: we are slower than we need to be due to the excess
14823         copies and the names being registered this way.  
14824
14825         The reason for this is that we currently depend (on the corlib
14826         bootstrap for instance) that types are fully qualified, because
14827         we dump all the types in the namespace, and we should really have
14828         types inserted into the proper namespace, so we can only store the
14829         basenames in the defined_names array.
14830
14831 2002-10-10  Martin Baulig  <martin@gnome.org>
14832
14833         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14834         from bug #31834, see the bug report for a testcase which is
14835         miscompiled.
14836
14837 2002-10-10  Martin Baulig  <martin@gnome.org>
14838
14839         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14840         flow analysis code for this.
14841
14842         * statement.cs (Do, While, For): Tell the flow analysis code about
14843         infinite loops.
14844         (FlowBranching.UsageVector): Added support for infinite loops.
14845         (Block.Resolve): Moved the dead code elimination here and use flow
14846         analysis to do it.
14847
14848 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * class.cs (Field.Define): Catch cycles on struct type
14851         definitions. 
14852
14853         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14854         fields if the fields are static.  We only need to check instance
14855         fields. 
14856
14857         * expression.cs (As.DoResolve): Test for reference type.
14858
14859         * statement.cs (Using.ResolveExpression): Use
14860         ConvertImplicitRequired, not ConvertImplicit which reports an
14861         error on failture
14862         (Using.ResolveLocalVariableDecls): ditto.
14863
14864         * expression.cs (Binary.ResolveOperator): Report errors in a few
14865         places where we had to.
14866
14867         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14868
14869 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * expression.cs: Use StoreFromPtr instead of extracting the type
14872         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14873
14874         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14875         an enumeration value to a System.Enum, but System.Enum is not a
14876         value type, but an class type, so we need to box.
14877
14878         (Expression.ConvertExplicit): One codepath could return
14879         errors but not flag them.  Fix this.  Fixes #31853
14880
14881         * parameter.cs (Resolve): Do not allow void as a parameter type.
14882
14883 2002-10-06  Martin Baulig  <martin@gnome.org>
14884
14885         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14886         if it's a class type and not a struct.  Fixes #31815.
14887
14888 2002-10-06  Martin Baulig  <martin@gnome.org>
14889
14890         * statement.cs: Reworked the flow analysis code a bit to make it
14891         usable for dead code elimination.
14892
14893 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14894
14895         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14896
14897 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14898
14899         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14900         to fix the test 165, will investigate deeper.
14901
14902 2002-10-04  Martin Baulig  <martin@gnome.org>
14903
14904         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14905         finally blocks actually work.
14906         (Try.Resolve): We don't need to create a sibling for `finally' if
14907         there is no finally block.
14908
14909 2002-10-04  Martin Baulig  <martin@gnome.org>
14910
14911         * class.cs (Constructor.Define): The default accessibility for a
14912         non-default constructor is private, not public.
14913
14914 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14915
14916         * class.cs (Constructor): Make AllowedModifiers public, add
14917         EXTERN.
14918
14919         * cs-parser.jay: Perform the modifiers test here, as the
14920         constructor for the Constructor class usually receives a zero
14921         because of the way we create it (first we create, later we
14922         customize, and we were never checking the modifiers).
14923
14924         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14925         is a version of LookupTypeReflection that includes the type-name
14926         cache.  This can be used as a fast path for functions that know
14927         the fully qualified name and are only calling into *.GetType() to
14928         obtain a composed type.
14929
14930         This is also used by TypeManager.LookupType during its type
14931         composition.
14932
14933         (LookupType): We now also track the real type name, as sometimes
14934         we can get a quey for the real type name from things like
14935         ComposedCast.  This fixes bug 31422.
14936
14937         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14938         complete type fullname, it does not have to go through the type
14939         resolution system to obtain the composed version of the type (for
14940         obtaining arrays or pointers).
14941
14942         (Conditional.Emit): Use the EmitBoolExpression to
14943         generate nicer code, as requested by Paolo.
14944
14945         (ArrayCreation.CheckIndices): Use the patch from
14946         hwang_rob@yahoo.ca to validate the array initializers. 
14947
14948 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * class.cs (ConstructorInitializer.Emit): simplify code by using
14951         Invocation.EmitCall, and at the same time, fix the bugs in calling
14952         parent constructors that took variable arguments. 
14953
14954         * ecore.cs (Expression.ConvertNumericExplicit,
14955         Expression.ImplicitNumericConversion): Remove the code that
14956         manually wrapped decimal (InternalTypeConstructor call is now gone
14957         as well).
14958
14959         * expression.cs (Cast.TryReduce): Also handle decimal types when
14960         trying to perform a constant fold on the type.
14961
14962         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14963
14964         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14965         that only turned off an error report, and did nothing else. 
14966
14967 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * driver.cs: Handle and ignore /fullpaths
14970
14971 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * expression.cs (Binary.ResolveOperator): Catch the case where
14974         DoNumericPromotions returns true, 
14975
14976         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14977
14978 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14979
14980         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14981         report error 70.
14982
14983 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14986         conversion exists, but it is also required that the conversion be
14987         performed.  This manifested in "(Type64Enum) 2".  
14988
14989         * class.cs (TypeManager.AddMethod): The fix is not to change
14990         AddEnum, because that one was using a fully qualified name (every
14991         DeclSpace derivative does), but to change the AddMethod routine
14992         that was using an un-namespaced name.  This now correctly reports
14993         the duplicated name.
14994
14995         Revert patch until I can properly fix it.  The issue
14996         is that we have a shared Type space across all namespaces
14997         currently, which is wrong.
14998
14999         Options include making the Namespace a DeclSpace, and merge
15000         current_namespace/current_container in the parser.
15001
15002 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * cs-parser.jay: Improve error reporting when we get a different
15005         kind of expression in local_variable_type and
15006         local_variable_pointer_type. 
15007
15008         Propagate this to avoid missleading errors being reported.
15009
15010         * ecore.cs (ImplicitReferenceConversion): treat
15011         TypeManager.value_type as a target just like object_type.   As
15012         code like this:
15013
15014         ValueType v = 1;
15015
15016         Is valid, and needs to result in the int 1 being boxed before it
15017         is assigned to the value type v.
15018
15019         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15020         to validate the enumeration name.
15021
15022         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15023         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15024         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15025
15026         * ecore.cs (TryImplicitIntConversion): When doing an
15027         implicit-enumeration-conversion, check if the type is 64-bits and
15028         perform a conversion before passing to EnumConstant.
15029
15030 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15031
15032         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15033         report ambiguous type references.  Unlike the MS version, we
15034         report what the ambiguity is.   Innovation at work ;-)
15035
15036         (DeclSpace.FindType): Require a location argument to
15037         display when we display an ambiguous error.
15038
15039         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15040
15041         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15042
15043         * expression.cs (EmitDynamicInitializers): Apply patch from
15044         hwang_rob@yahoo.ca that fixes the order in which we emit our
15045         initializers. 
15046
15047 2002-09-21  Martin Baulig  <martin@gnome.org>
15048
15049         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15050         delegate takes no arguments.
15051
15052 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15055         from integers.
15056
15057         * expression.cs: Extract the underlying type.
15058
15059         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15060
15061         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15062
15063 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15064
15065         * class.cs (TypeContainer.DefineType): We can not use the nice
15066         PackingSize with the size set to 1 DefineType method, because it
15067         will not allow us to define the interfaces that the struct
15068         implements.
15069
15070         This completes the fixing of bug 27287
15071
15072         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15073         means also structs.  This fixes part of the problem. 
15074         (Expresion.ImplicitReferenceConversionExists): ditto.
15075
15076         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15077         error if there were no errors reported during the type lookup
15078         process, to avoid duplicates or redundant errors.  Without this
15079         you would get an ambiguous errors plus a type not found.  We have
15080         beaten the user enough with the first error.  
15081
15082         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15083         reference. 
15084
15085         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15086         during the resolution process, stop the lookup, this avoids
15087         repeated error reports (same error twice).
15088
15089         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15090
15091         * typemanager.cs (LookupType): Redo the type lookup code to match
15092         the needs of System.Reflection.  
15093
15094         The issue is that System.Reflection requires references to nested
15095         types to begin with a "+" sign instead of a dot.  So toplevel
15096         types look like: "NameSpace.TopLevelClass", and nested ones look
15097         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15098         levels. 
15099
15100 2002-09-19  Martin Baulig  <martin@gnome.org>
15101
15102         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15103         says that a method always returns or always throws an exception,
15104         don't report the CS0161.
15105
15106         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15107         set `Returns = new_returns'.
15108
15109 2002-09-19  Martin Baulig  <martin@gnome.org>
15110
15111         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15112         to an enum constant, check for a CS0176.
15113
15114 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15115
15116         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15117         for operators that must be in pairs and report errors.
15118
15119         * ecore.cs (SimpleName.DoResolveType): During the initial type
15120         resolution process, when we define types recursively, we must
15121         check first for types in our current scope before we perform
15122         lookups in the enclosing scopes.
15123
15124         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15125
15126         (Invocation.VerifyArgumentsCompat): Call
15127         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15128         I thought we were supposed to always call this, but there are a
15129         few places in the code where we dont do it.
15130
15131 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15132
15133         * driver.cs: Add support in -linkres and -resource to specify the
15134         name of the identifier.
15135
15136 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15137
15138         * ecore.cs (StandardConversionExists): Sync with the conversion
15139         code: allow anything-* to void* conversions.
15140
15141         (FindMostSpecificSource): Use an Expression argument
15142         instead of a Type, because we might be handed over a Literal which
15143         gets a few more implicit conversions that plain types do not.  So
15144         this information was being lost.
15145
15146         Also, we drop the temporary type-holder expression when not
15147         required.
15148
15149 2002-09-17  Martin Baulig  <martin@gnome.org>
15150
15151         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15152         this is an explicit interface implementation.
15153
15154 2002-09-17  Martin Baulig  <martin@gnome.org>
15155
15156         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15157         different `IndexerName' attributes.
15158
15159         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15160         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15161         virtual CommonResolve().
15162
15163 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15164
15165         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15166         and convert that to the UnderlyingType.
15167
15168         * statement.cs (Foreach.Resolve): Indexers are just like variables
15169         or PropertyAccesses.
15170
15171         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15172         inside quoted strings, we were not doing this before.
15173
15174 2002-09-16  Martin Baulig  <martin@gnome.org>
15175
15176         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15177         resolve it.  This is needed for the definite assignment check of the
15178         instance expression, fixes bug #29846.
15179         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15180
15181 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15182
15183         * parameter.cs: Fix compile error.  Cannot reference static member
15184         from an instance object.  Is this an mcs bug?
15185
15186 2002-09-14  Martin Baulig  <martin@gnome.org>
15187
15188         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15189         multiple times.  Fixes bug #30295, added test-166.cs.
15190
15191 2002-09-14  Martin Baulig  <martin@gnome.org>
15192
15193         * statement.cs (Block.Emit): Don't emit unreachable code.
15194         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15195         `break' statements.
15196         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15197
15198 2002-09-14  Martin Baulig  <martin@gnome.org>
15199
15200         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15201         is set.
15202
15203 2002-09-14  Martin Baulig  <martin@gnome.org>
15204
15205         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15206         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15207         be false on the ms runtime.
15208
15209 2002-09-13  Martin Baulig  <martin@gnome.org>
15210
15211         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15212         the CS0038 error message.
15213
15214 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15215
15216         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15217         constant inside, return it.
15218
15219 2002-09-12  Martin Baulig  <martin@gnome.org>
15220
15221         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15222         implicit conversion can be done between enum types.
15223
15224         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15225         check whether an implicit conversion to the current enum's UnderlyingType
15226         exists and report an error if not.
15227
15228         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15229         without debugging support.
15230
15231         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15232         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15233
15234 2002-09-12  Martin Baulig  <martin@gnome.org>
15235
15236         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15237
15238         * ecore.cs (IMemberExpr.DeclaringType): New property.
15239         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15240         nonstatic member of an outer type (CS0038).
15241
15242 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15243
15244         * driver.cs: Activate the using-error detector at warning level
15245         4 (at least for MS-compatible APIs).
15246
15247         * namespace.cs (VerifyUsing): Small buglett fix.
15248
15249         * pending.cs (PendingImplementation): pass the container pointer. 
15250
15251         * interface.cs (GetMethods): Allow for recursive definition.  Long
15252         term, I would like to move every type to support recursive
15253         definitions, not the current ordering mechanism that we have right
15254         now.
15255
15256         The situation is this: Attributes are handled before interfaces,
15257         so we can apply attributes to interfaces.  But some attributes
15258         implement interfaces, we will now handle the simple cases
15259         (recursive definitions will just get an error).  
15260
15261         * parameter.cs: Only invalidate types at the end if we fail to
15262         lookup all types.  
15263
15264 2002-09-09  Martin Baulig  <martin@gnome.org>
15265
15266         * ecore.cs (PropertyExpr.Emit): Also check for
15267         TypeManager.system_int_array_get_length so this'll also work when
15268         compiling corlib.  Fixes #30003.
15269
15270 2002-09-09  Martin Baulig  <martin@gnome.org>
15271
15272         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15273         and throw an exception if we can't get the type's size.  Fixed #30040,
15274         added test-165.cs.
15275
15276 2002-09-09  Martin Baulig  <martin@gnome.org>
15277
15278         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15279
15280         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15281         context.  Fixes bug #30027.
15282
15283         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15284         virtual functions.  Fixes bug #30043, added test-164.cs.
15285
15286 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15287
15288         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15289
15290 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15291
15292         * driver.cs: Use an object to get the windows codepage since it's not a
15293         static property.
15294
15295 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * statement.cs (For.Emit): for infinite loops (test == null)
15298         return whether there is a break inside, not always "true".
15299
15300         * namespace.cs (UsingEntry): New struct to hold the name of the
15301         using definition, the location where it is defined, and whether it
15302         has been used in a successful type lookup.
15303
15304         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15305         strings.
15306
15307         * decl.cs: ditto.
15308
15309 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15310
15311         * attribute.cs : Fix incorrect code which relied on catching
15312         a NullReferenceException to detect a null being passed in
15313         where an object was expected.
15314
15315 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * statement.cs (Try): flag the catch variable as assigned
15318
15319         * expression.cs (Cast): Simplified by using ResolveType instead of
15320         manually resolving.
15321
15322         * statement.cs (Catch): Fix bug by using ResolveType.
15323
15324 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15325
15326         * expression.cs (BetterConversion): Special case for when we have
15327         a NullLiteral as the argument and we have to choose between string
15328         and object types - we choose string the way csc does.
15329
15330         * attribute.cs (Attribute.Resolve): Catch the
15331         NullReferenceException and report error #182 since the Mono
15332         runtime no more has the bug and having this exception raised means
15333         we tried to select a constructor which takes an object and is
15334         passed a null.
15335
15336 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15337
15338         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15339         message (1502, 1503) when we can't locate a method after overload
15340         resolution. This is much more informative and closes the bug
15341         Miguel reported.
15342
15343         * interface.cs (PopulateMethod): Return if there are no argument
15344         types. Fixes a NullReferenceException bug.
15345
15346         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15347         expressions too. Previously we were checking only in one place for
15348         positional arguments leaving out named arguments.
15349
15350         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15351         type to the enum type is not allowed. Remove code corresponding to
15352         that.
15353
15354         (ConvertNumericExplicit): Allow explicit conversions from
15355         the underlying type to enum type. This precisely follows the spec
15356         and closes a bug filed by Gonzalo.
15357
15358 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15359
15360         * compiler.csproj:
15361         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15362
15363 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15364
15365         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15366         it was important that we stored the right value after the
15367         reduction in `converted'.
15368
15369 2002-09-04  Martin Baulig  <martin@gnome.org>
15370
15371         * location.cs (Location.SymbolDocument): Use full pathnames for the
15372         source files.
15373
15374 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15375
15376         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15377         of the expression resolve mechanism, because that will catch the
15378         SimpleName error failures.
15379
15380         (Conditional): If we can not resolve the
15381         expression, return, do not crash.
15382
15383 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15384
15385         * cs-tokenizer.cs:
15386         (location): display token name instead of its number.
15387
15388 2002-08-28  Martin Baulig  <martin@gnome.org>
15389
15390         * expression.cs (Binary.ResolveOperator): Don't silently return
15391         but return an error if an operator cannot be applied between two
15392         enum types.
15393
15394 2002-08-28  Martin Baulig  <martin@gnome.org>
15395
15396         * class.cs (Constructor.Define): Set the permission attributes
15397         correctly instead of making all constructors public.
15398
15399 2002-08-28  Martin Baulig  <martin@gnome.org>
15400
15401         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15402         for private members before reporting a CS0103; if we find anything,
15403         it's a CS0122.
15404
15405 2002-08-28  Martin Baulig  <martin@gnome.org>
15406
15407         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15408         to check whether `closure_start_type == closure_invocation_type',
15409         we also need to check whether `m.DeclaringType == closure_invocation_type'
15410         before bypassing the permission checks.  We might be accessing
15411         protected/private members from the base class.
15412         (TypeManager.RealMemberLookup): Only set private_ok if private
15413         members were requested via BindingFlags.NonPublic.
15414
15415         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15416
15417         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15418         MethodGroupExpr.IsExplicitImpl if appropriate.
15419         (Invocation.DoResolve): Don't report the CS0120 for explicit
15420         interface implementations.
15421
15422 2002-08-27  Martin Baulig  <martin@gnome.org>
15423
15424         * expression.cs (Invocation.DoResolve): If this is a static
15425         method and we don't have an InstanceExpression, we must report
15426         a CS0120.
15427
15428 2002-08-25  Martin Baulig  <martin@gnome.org>
15429
15430         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15431         `==' between a valuetype and an object.
15432
15433 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15434
15435         * ecore.cs (TypeExpr): Provide a ToString method.
15436
15437 2002-08-24  Martin Baulig  <martin@gnome.org>
15438
15439         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15440         now called proggie.dbg and it's a binary file.
15441
15442 2002-08-23  Martin Baulig  <martin@gnome.org>
15443
15444         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15445
15446 2002-08-23  Martin Baulig  <martin@gnome.org>
15447
15448         * struct.cs (MyStructInfo.ctor): Make this work with empty
15449         structs; it's not allowed to use foreach() on null.
15450
15451 2002-08-23  Martin Baulig  <martin@gnome.org>
15452
15453         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15454         writer the full pathname of the generated assembly.
15455
15456 2002-08-23  Martin Baulig  <martin@gnome.org>
15457
15458         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15459         A `finally' block never returns or breaks; improved handling of
15460         unreachable code.
15461
15462 2002-08-23  Martin Baulig  <martin@gnome.org>
15463
15464         * statement.cs (Throw.Resolve): Allow `throw null'.
15465
15466 2002-08-23  Martin Baulig  <martin@gnome.org>
15467
15468         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15469         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15470         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15471         MemberLookup would return a wrong event if this is an explicit
15472         interface implementation and the class has an event with the same
15473         name.
15474
15475 2002-08-23  Martin Baulig  <martin@gnome.org>
15476
15477         * statement.cs (Block.AddChildVariableNames): New public method.
15478         (Block.AddChildVariableName): Likewise.
15479         (Block.IsVariableNameUsedInChildBlock): Likewise.
15480         (Block.AddVariable): Check whether a variable name has already
15481         been used in a child block.
15482
15483         * cs-parser.jay (declare_local_variables): Mark all variable names
15484         from the current block as being used in a child block in the
15485         implicit block.
15486
15487 2002-08-23  Martin Baulig  <martin@gnome.org>
15488
15489         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15490         find the symbol writer.
15491
15492         * driver.cs: csc also allows the arguments to /define being
15493         separated by commas, not only by semicolons.
15494
15495 2002-08-23  Martin Baulig  <martin@gnome.org>
15496
15497         * interface.cs (Interface.GetMembers): Added static check for events.
15498
15499 2002-08-15  Martin Baulig  <martin@gnome.org>
15500
15501         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15502         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15503
15504         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15505         why the MethodData.EmitDestructor() change was necessary.
15506
15507 2002-08-20  Martin Baulig  <martin@gnome.org>
15508
15509         * class.cs (TypeContainer.FindMembers): Added static check for events.
15510
15511         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15512
15513         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15514         use Type.GetEvents(), not Type.FindMembers().
15515
15516 2002-08-20  Martin Baulig  <martin@gnome.org>
15517
15518         * decl.cs (MemberCache): Added a special method cache which will
15519         be used for method-only searched.  This ensures that a method
15520         search will return a MethodInfo with the correct ReflectedType for
15521         inherited methods.      
15522
15523 2002-08-20  Martin Baulig  <martin@gnome.org>
15524
15525         * decl.cs (DeclSpace.FindMembers): Made this public.
15526
15527 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15528
15529         * delegate.cs: fixed build on windows.
15530         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15531
15532 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15533
15534         * ecore.cs (StandardConversionExists): Return a false
15535         if we are trying to convert the void type to anything else
15536         since that is not allowed.
15537
15538         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15539         we flag error 70 in the event an event is trying to be accessed
15540         directly from outside the declaring type.
15541
15542 2002-08-20  Martin Baulig  <martin@gnome.org>
15543
15544         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15545         MemberCache from typemanager.cs to decl.cs.
15546
15547 2002-08-19  Martin Baulig  <martin@gnome.org>
15548
15549         * class.cs (TypeContainer): Implement IMemberContainer.
15550         (TypeContainer.DefineMembers): Create the MemberCache.
15551         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15552         return public members if BindingFlags.Public was given, check
15553         whether members are static.
15554
15555 2002-08-16  Martin Baulig  <martin@gnome.org>
15556
15557         * decl.cs (DeclSpace.Define): Splitted this in Define and
15558         DefineMembers.  DefineMembers is called first and initializes the
15559         MemberCache.
15560
15561         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15562         DefineMembers() on all our DeclSpaces.
15563
15564         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15565         but call DefineMembers() on all nested interfaces.  We call their
15566         Define() in our new Define() function.
15567
15568         * interface.cs (Interface): Implement IMemberContainer.
15569         (Interface.Define): Moved all code except the attribute stuf to
15570         DefineMembers().
15571         (Interface.DefineMembers): Initialize the member cache.
15572
15573         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15574         need this anymore since we can use MemberCache.FindMembers directly.
15575
15576 2002-08-19  Martin Baulig  <martin@gnome.org>
15577
15578         * typemanager.cs (MemberCache): When creating the cache for an
15579         interface type, add all inherited members.
15580         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15581         to `out bool used_cache' and documented it.
15582         (TypeManager.MemberLookup): If we already used the cache in the first
15583         iteration, we don't need to do the interfaces check.
15584
15585 2002-08-19  Martin Baulig  <martin@gnome.org>
15586
15587         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15588         here from IMemberFinder and don't implement this interface anymore.
15589         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15590
15591         * typemanager.cs (IMemberFinder): This interface is now only used by
15592         classes which actually support the member cache.
15593         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15594         since we only put DeclSpaces into this Hashtable.
15595         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15596         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15597
15598 2002-08-16  Martin Baulig  <martin@gnome.org>
15599
15600         * typemanager.cs (ICachingMemberFinder): Removed.
15601         (IMemberFinder.MemberCache): New property.
15602         (TypeManager.FindMembers): Merged this with RealFindMembers().
15603         This function will never be called from TypeManager.MemberLookup()
15604         so we can't use the cache here, just the IMemberFinder.
15605         (TypeManager.MemberLookup_FindMembers): Check whether the
15606         IMemberFinder has a MemberCache and call the cache's FindMembers
15607         function.
15608         (MemberCache): Rewrote larger parts of this yet another time and
15609         cleaned it up a bit.
15610
15611 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * driver.cs (LoadArgs): Support quoting.
15614
15615         (Usage): Show the CSC-like command line arguments.
15616
15617         Improved a few error messages.
15618
15619 2002-08-15  Martin Baulig  <martin@gnome.org>
15620
15621         * typemanager.cs (IMemberContainer.Type): New property.
15622         (IMemberContainer.IsInterface): New property.
15623
15624         The following changes are conditional to BROKEN_RUNTIME, which is
15625         defined at the top of the file.
15626
15627         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15628         class'es members, but add all members from TypeHandle.ObjectType
15629         if we're an interface.
15630         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15631         is the current type.
15632         (MemberCache.CacheEntry.Container): Removed this field.
15633         (TypeHandle.GetMembers): Include inherited members.
15634
15635 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15636
15637         * typemanager.cs: fixed compilation and added a comment on a field that
15638         is never used.
15639
15640 2002-08-15  Martin Baulig  <martin@gnome.org>
15641
15642         * class.cs (ConstructorInitializer.Resolve): In the
15643         Expression.MemberLookup call, use the queried_type as
15644         invocation_type.
15645
15646         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15647         declared' attribute, it's always true.
15648         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15649         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15650         temporary wrapper for FindMembers which tells MemberLookup whether
15651         members from the base classes are included in the return value.
15652         This will go away soon.
15653         (TypeManager.MemberLookup): Use this temporary hack here; once the
15654         new MemberCache is completed, we don't need to do the DeclaredOnly
15655         looping here anymore since the MemberCache will take care of this.
15656         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15657         (MemberCache): When creating the MemberCache for a class, get
15658         members from the current class and all its base classes.
15659         (MemberCache.CacheEntry.Container): New field.  This is a
15660         temporary hack until the Mono runtime is fixed to distinguish
15661         between ReflectedType and DeclaringType.  It allows us to use MCS
15662         with both the MS runtime and the unfixed Mono runtime without
15663         problems and without accecting performance.
15664         (MemberCache.SearchMembers): The DeclaredOnly looping from
15665         TypeManager.MemberLookup is now done here.      
15666
15667 2002-08-14  Martin Baulig  <martin@gnome.org>
15668
15669         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15670         Type.GetFields on dynamic types but get the fields from the
15671         corresponding TypeContainer.
15672         (MyStructInfo.GetStructInfo): Added check for enum types.
15673
15674         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15675         (MemberList.SyncRoot): Implemented.
15676         (TypeManager.FilterWithClosure): No need to check permissions if
15677         closure_start_type == closure_invocation_type, don't crash if
15678         closure_invocation_type is null.
15679
15680 2002-08-13  Martin Baulig  <martin@gnome.org>
15681
15682         Rewrote TypeContainer.FindMembers to use a member cache.  This
15683         gives us a speed increase of about 35% for the self-hosting MCS
15684         build and of about 15-20% for the class libs (both on GNU/Linux).
15685
15686         * report.cs (Timer): New class to get enhanced profiling.  This
15687         whole class is "TIMER" conditional since it remarkably slows down
15688         compilation speed.
15689
15690         * class.cs (MemberList): New class.  This is an IList wrapper
15691         which we're now using instead of passing MemberInfo[]'s around to
15692         avoid copying this array unnecessarily.
15693         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15694         (ICachingMemberFinder, IMemberContainer): New interface.
15695         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15696         has already been checked, otherwise use it for the name comparision.
15697         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15698         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15699         if possible.  Returns a MemberList, not a MemberInfo [].
15700         (TypeHandle): New class, implements IMemberContainer.  We create
15701         one instance of this class per type, it contains a MemberCache
15702         which is used to do the member lookups.
15703         (MemberCache): New class.  Each instance of this class contains
15704         all members of a type and a name-based hash table.
15705         (MemberCache.FindMembers): This is our new member lookup
15706         function.  First, it looks up all members of the requested name in
15707         the hash table.  Then, it walks this list and sorts out all
15708         applicable members and returns them.
15709
15710 2002-08-13  Martin Baulig  <martin@gnome.org>
15711
15712         In addition to a nice code cleanup, this gives us a performance
15713         increase of about 1.4% on GNU/Linux - not much, but it's already
15714         half a second for the self-hosting MCS compilation.
15715
15716         * typemanager.cs (IMemberFinder): New interface.  It is used by
15717         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15718         Enum, Delegate or Interface.
15719         (TypeManager.finder_to_member_finder): New PtrHashtable.
15720         (TypeManager.finder_to_container): Removed.
15721         (TypeManager.finder_to_delegate): Removed.
15722         (TypeManager.finder_to_interface): Removed.
15723         (TypeManager.finder_to_enum): Removed.
15724
15725         * interface.cs (Interface): Implement IMemberFinder.
15726
15727         * delegate.cs (Delegate): Implement IMemberFinder.
15728
15729         * enum.cs (Enum): Implement IMemberFinder.
15730
15731         * class.cs (TypeContainer): Implement IMemberFinder.
15732
15733 2002-08-12  Martin Baulig  <martin@gnome.org>
15734
15735         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15736
15737 2002-08-12  Martin Baulig  <martin@gnome.org>
15738
15739         * ecore.cs (ITypeExpression): New interface for expressions which
15740         resolve to a type.
15741         (TypeExpression): Renamed to TypeLookupExpression.
15742         (Expression.DoResolve): If we're doing a types-only lookup, the
15743         expression must implement the ITypeExpression interface and we
15744         call DoResolveType() on it.
15745         (SimpleName): Implement the new ITypeExpression interface.
15746         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15747         hack, the situation that we're only looking up types can't happen
15748         anymore when this method is called.  Moved the type lookup code to
15749         DoResolveType() and call it.
15750         (SimpleName.DoResolveType): This ITypeExpression interface method
15751         is now doing the types-only lookup.
15752         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15753         (ResolveFlags): Added MaskExprClass.
15754
15755         * expression.cs (MemberAccess): Implement the ITypeExpression
15756         interface.
15757         (MemberAccess.DoResolve): Added support for a types-only lookup
15758         when we're called via ITypeExpression.DoResolveType().
15759         (ComposedCast): Implement the ITypeExpression interface.
15760
15761         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15762         Expression.Resolve() with ResolveFlags.Type instead.
15763
15764 2002-08-12  Martin Baulig  <martin@gnome.org>
15765
15766         * interface.cs (Interface.Define): Apply attributes.
15767
15768         * attribute.cs (Attribute.ApplyAttributes): Added support for
15769         interface attributes.
15770
15771 2002-08-11  Martin Baulig  <martin@gnome.org>
15772
15773         * statement.cs (Block.Emit): Only check the "this" variable if we
15774         do not always throw an exception.
15775
15776         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15777         whether the property has a set accessor.
15778
15779 2002-08-11  Martin Baulig  <martin@gnome.org>
15780
15781         Added control flow analysis support for structs.
15782
15783         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15784         with control flow analysis turned off.
15785         (IVariable): New interface.
15786         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15787         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15788         (FieldExpr.DoResolve): Resolve the instance expression with flow
15789         analysis turned off and do the definite assignment check after the
15790         resolving when we know what the expression will resolve to.
15791
15792         * expression.cs (LocalVariableReference, ParameterReference):
15793         Implement the new IVariable interface, only call the flow analysis
15794         code if ec.DoFlowAnalysis is true.
15795         (This): Added constructor which takes a Block argument.  Implement
15796         the new IVariable interface.
15797         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15798         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15799         This does the definite assignment checks for struct members.
15800
15801         * class.cs (Constructor.Emit): If this is a non-static `struct'
15802         constructor which doesn't have any initializer, call
15803         Block.AddThisVariable() to tell the flow analysis code that all
15804         struct elements must be initialized before control returns from
15805         the constructor.
15806
15807         * statement.cs (MyStructInfo): New public class.
15808         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15809         argument to this indexer.  If non-zero, check an individual struct
15810         member, not the whole struct.
15811         (FlowBranching.CheckOutParameters): Check struct members.
15812         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15813         overloaded versions of these methods which take an additional
15814         `int field_idx' argument to check struct members.
15815         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15816         overloaded versions of these methods which take an additional
15817         `string field_name' argument to check struct member.s
15818         (VariableInfo): Implement the IVariable interface.
15819         (VariableInfo.StructInfo): New public property.  Returns the
15820         MyStructInfo instance of the variable if it's a struct or null.
15821         (Block.AddThisVariable): New public method.  This is called from
15822         Constructor.Emit() for non-static `struct' constructor which do
15823         not have any initializer.  It creates a special variable for the
15824         "this" instance variable which will be checked by the flow
15825         analysis code to ensure that all of the struct's fields are
15826         initialized before control returns from the constructor.
15827         (UsageVector): Added support for struct members.  If a
15828         variable/parameter is a struct with N members, we reserve a slot
15829         in the usage vector for each member.  A struct is considered fully
15830         initialized if either the struct itself (slot 0) or all its
15831         members are initialized.
15832
15833 2002-08-08  Martin Baulig  <martin@gnome.org>
15834
15835         * driver.cs (Driver.MainDriver): Only report an error CS5001
15836         if there were no compilation errors.
15837
15838         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15839         `UnsafeContext' property to determine whether the parent is in
15840         unsafe context rather than checking the parent's ModFlags:
15841         classes nested in an unsafe class are unsafe as well.
15842
15843 2002-08-08  Martin Baulig  <martin@gnome.org>
15844
15845         * statement.cs (UsageVector.MergeChildren): Distinguish between
15846         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15847         we return.  Added test17() and test18() to test-154.cs.
15848
15849 2002-08-08  Martin Baulig  <martin@gnome.org>
15850
15851         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15852         Family access, make sure the invoking type isn't a subclass of the
15853         queried type (that'd be a CS1540).
15854
15855         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15856         this method which takes an additional `Type invocation_type'.
15857
15858         * expression.cs (BaseAccess.DoResolve): Use the base type as
15859         invocation and query type.
15860         (MemberAccess.DoResolve): If the lookup failed and we're about to
15861         report a CS0122, try a lookup with the ec.ContainerType - if this
15862         succeeds, we must report a CS1540.
15863
15864 2002-08-08  Martin Baulig  <martin@gnome.org>
15865
15866         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15867         (MethodGroupExpr): Implement the IMemberExpr interface.
15868
15869         * expression (MemberAccess.ResolveMemberAccess): No need to have
15870         any special code for MethodGroupExprs anymore, they're now
15871         IMemberExprs.   
15872
15873 2002-08-08  Martin Baulig  <martin@gnome.org>
15874
15875         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15876         Family, FamANDAssem and FamORAssem permissions.
15877         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15878
15879 2002-08-08  Martin Baulig  <martin@gnome.org>
15880
15881         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15882         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15883         or loop block.
15884
15885 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15886
15887         * driver.cs: implemented /resource option to embed managed resources.
15888
15889 2002-08-07  Martin Baulig  <martin@gnome.org>
15890
15891         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15892         (FieldBase.HasFieldInitializer): New public property.
15893         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15894         returns the field initializer and makes sure it is only resolved once.
15895         (TypeContainer.EmitFieldInitializers): Call
15896         FieldBase.GetInitializerExpression to get the initializer, this ensures
15897         that it isn't resolved multiple times.
15898
15899         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15900         the resolving process (SimpleName/MemberLookup) that we're currently
15901         emitting a field initializer (which must not access any instance members,
15902         this is an error CS0236).
15903
15904         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15905         argument, if the `IsFieldInitializer' flag is set, we must report and
15906         error CS0236 and not an error CS0120.   
15907
15908 2002-08-07  Martin Baulig  <martin@gnome.org>
15909
15910         * ecore.cs (IMemberExpr): New public interface.
15911         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15912         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15913         if the expression is an IMemberExpr.
15914
15915         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15916         to be null, implicitly default to `this' if we're non-static in
15917         this case.  Simplified the code a lot by using the new IMemberExpr
15918         interface.  Also fixed bug #28176 here.
15919
15920 2002-08-06  Martin Baulig  <martin@gnome.org>
15921
15922         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15923         ParameterReferences during semantic analysis so that we can do a
15924         type-only search when resolving Cast, TypeOf and SizeOf.
15925         (block): Pass the `current_local_parameters' to the Block's
15926         constructor.
15927
15928         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15929         argument to the constructor.
15930         (ConstructorInitializer.Resolve): Create a temporary implicit
15931         block with the parameters.
15932
15933         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15934         references here if we aren't doing a type-only search.
15935
15936         * statement.cs (Block): Added constructor which takes a
15937         `Parameters parameters' argument.
15938         (Block.Parameters): New public property.
15939
15940         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15941         to `Parameters' and made it public readonly.
15942
15943 2002-08-06  Martin Baulig  <martin@gnome.org>
15944
15945         * ecore.cs (Expression.Warning): Made this public as well.
15946
15947         * report.cs (Report.Debug): Print the contents of collections.
15948
15949 2002-08-06  Martin Baulig  <martin@gnome.org>
15950
15951         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15952         used to tell Resolve() which kinds of expressions it may return.
15953         (Expression.Resolve): Added overloaded version of this method which
15954         takes a `ResolveFlags flags' argument.  This can be used to tell
15955         Resolve() which kinds of expressions it may return.  Reports a
15956         CS0118 on error.
15957         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15958         ResolveFlags.SimpleName.
15959         (Expression.Error118): Added overloaded version of this method which
15960         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15961         which kinds of expressions are allowed.
15962
15963         * expression.cs (Argument.ResolveMethodGroup): New public method.
15964         Resolves an argument, but allows a MethodGroup to be returned.
15965         This is used when invoking a delegate.
15966
15967         * TODO: Updated a bit.
15968
15969 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15970
15971         Fixed compilation with csc.
15972
15973         * ecore.cs: Expression.Error made public. Is this correct? Should
15974         Warning be made public too?
15975
15976         * expression.cs: use ea.Location instead of ea.loc.
15977         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15978
15979 2002-08-06  Martin Baulig  <martin@gnome.org>
15980
15981         * ecore.cs (Expression.loc): Moved the location here instead of
15982         duplicating it in all derived classes.
15983         (Expression.Location): New public property.
15984         (Expression.Error, Expression.Warning): Made them non-static and
15985         removed the location argument.
15986         (Expression.Warning): Added overloaded version which takes an
15987         `int level' argument.
15988         (Expression.Error118): Make this non-static and removed the
15989         expression and location arguments.
15990         (TypeExpr): Added location argument to the constructor.
15991
15992         * expression.cs (StaticCallExpr): Added location argument to
15993         the constructor.
15994         (Indirection, PointerArithmetic): Likewise.
15995         (CheckedExpr, UnCheckedExpr): Likewise.
15996         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15997         (StringPtr): Likewise.
15998
15999
16000 2002-08-05  Martin Baulig  <martin@gnome.org>
16001
16002         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16003
16004         * assign.cs (Assign.DoResolve): Check whether the source
16005         expression is a value or variable.
16006
16007         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16008         while resolving the corresponding blocks.
16009
16010         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16011         an error, don't silently return null.
16012
16013         * statement.cs (Block.AddVariable): Do the error reporting here
16014         and distinguish between CS0128 and CS0136.
16015         (Block.DoResolve): Report all unused labels (warning CS0164).
16016         (LabeledStatement): Pass the location to the constructor.
16017         (LabeledStatement.HasBeenReferenced): New property.
16018         (LabeledStatement.Resolve): Set it to true here.
16019
16020         * statement.cs (Return.Emit): Return success even after reporting
16021         a type mismatch error (CS0126 or CS0127), this is what csc does and
16022         it avoids confusing the users with any consecutive errors.
16023
16024 2002-08-05  Martin Baulig  <martin@gnome.org>
16025
16026         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16027
16028         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16029
16030         * expression.cs (MemberAccess.DoResolve): Silently return if an
16031         error has already been reported.
16032
16033         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16034         error has already been reported.
16035
16036 2002-08-05  Martin Baulig  <martin@gnome.org>
16037
16038         * statement.cs (UsageVector): Only initialize the `parameters'
16039         vector if we actually have any "out" parameters.
16040
16041 2002-08-05  Martin Baulig  <martin@gnome.org>
16042
16043         * expression.cs (Binary.ResolveOperator): When combining delegates,
16044         they must have the same type.
16045
16046 2002-08-05  Martin Baulig  <martin@gnome.org>
16047
16048         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16049         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16050         work with the ms runtime and we also don't need it: if we're a
16051         PropertyBuilder and not in the `indexer_arguments' hash, then we
16052         are a property and not an indexer.
16053
16054         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16055         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16056         since the latter one doesn't work with the ms runtime.
16057
16058 2002-08-03  Martin Baulig  <martin@gnome.org>
16059
16060         Fixed bugs #27998 and #22735.
16061
16062         * class.cs (Method.IsOperator): New public field.
16063         (Method.CheckBase): Report CS0111 if there's already a method
16064         with the same parameters in the current class.  Report CS0508 when
16065         attempting to change the return type of an inherited method.
16066         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16067         and it's not marked abstract or extern.
16068         (PropertyBase): New abstract base class for Property and Indexer.
16069         (PropertyBase.CheckBase): Moved here from Property and made it work
16070         for indexers.
16071         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16072         the same so we can reuse it there.
16073         (Property, Indexer): Derive from PropertyBase.
16074         (MethodSignature.inheritable_property_signature_filter): New delegate
16075         to find properties and indexers.
16076
16077         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16078         argument and improved error reporting.
16079
16080         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16081         EmptyReadOnlyParameters and made it a property.
16082
16083         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16084         version of this method which takes a `PropertyInfo indexer'.
16085         (TypeManager.RegisterIndexer): New method.
16086
16087         * class.cs: Added myself as author of this file :-)
16088
16089 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16090
16091         * class.cs: fixed compilation on windoze.
16092
16093 2002-08-03  Martin Baulig  <martin@gnome.org>
16094
16095         * interface.cs (Interface.GetInterfaceBases): Check whether all
16096         base interfaces are at least as accessible than the current one.
16097
16098         * class.cs (TypeContainer.GetClassBases): Check whether base types
16099         are at least as accessible than the current type.
16100         (TypeContainer.AsAccessible): Implemented and made non-static.
16101         (MemberBase.CheckParameters): Report errors if the accessibility
16102         checks fail.
16103
16104         * delegate.cs (Delegate.Delegate): The default visibility is
16105         internal for top-level types and private for nested types.
16106         (Delegate.Define): Report errors if the accessibility checks fail.
16107
16108         * enum.cs (Enum.Enum): The default visibility is internal for
16109         top-level types and private for nested types.
16110         (Enum.DefineType): Compute the correct visibility.
16111
16112         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16113         function which takes a `bool is_toplevel' instead of a TypeContainer.
16114
16115         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16116         builtin type.
16117
16118 2002-08-02  Martin Baulig  <martin@gnome.org>
16119
16120         * expression.cs (LocalVariableReferenc): Added constructor which
16121         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16122         (LocalVariableReference.IsReadOnly): New property.
16123         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16124         variable is readonly, use our own readonly flag to do this; you can
16125         use the new constructor to get a writable reference to a read-only
16126         variable.
16127
16128         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16129         reference to the local variable.
16130
16131 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16132
16133         * rootcontext.cs (ResolveCore): Also include System.Exception
16134
16135         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16136         we reach an EmptyStatement.
16137
16138         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16139         is also fine.
16140
16141         * expression.cs (Binary.ResolveOperator): Check error result in
16142         two places.
16143
16144         use brtrue/brfalse directly and avoid compares to null.
16145
16146 2002-08-02  Martin Baulig  <martin@gnome.org>
16147
16148         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16149         Fixes bug #28407, added test-155.cs.
16150
16151 2002-08-01  Martin Baulig  <martin@gnome.org>
16152
16153         * class.cs (Event.EmitDefaultMethod): Make this work with static
16154         events.  Fixes #28311, added verify-3.cs.
16155
16156 2002-08-01  Martin Baulig  <martin@gnome.org>
16157
16158         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16159         `is_disposable' fields.
16160         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16161         `hm.is_disposable' if we're using the collection pattern.
16162         (Foreach.EmitCollectionForeach): Use the correct type for the
16163         enumerator's local variable, only emit the try/finally block if
16164         necessary (fixes #27713).
16165
16166 2002-08-01  Martin Baulig  <martin@gnome.org>
16167
16168         * ecore.cs (Expression.report118): Renamed to Error118 and made
16169         it public static.
16170
16171         * statement.cs (Throw.Resolve): Check whether the expression is of
16172         the correct type (CS0118) and whether the type derives from
16173         System.Exception (CS0155).
16174         (Catch.Resolve): New method.  Do the type lookup here and check
16175         whether it derives from System.Exception (CS0155).
16176         (Catch.CatchType, Catch.IsGeneral): New public properties.
16177
16178         * typemanager.cs (TypeManager.exception_type): Added.
16179
16180 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16181
16182         * driver.cs: Updated About function.
16183
16184 2002-07-31  Martin Baulig  <martin@gnome.org>
16185
16186         Implemented Control Flow Analysis.
16187
16188         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16189         (EmitContext.CurrentBranching): Added.
16190         (EmitContext.StartFlowBranching): Added.
16191         (EmitContext.EndFlowBranching): Added.
16192         (EmitContext.KillFlowBranching): Added.
16193         (EmitContext.IsVariableAssigned): Added.
16194         (EmitContext.SetVariableAssigned): Added.
16195         (EmitContext.IsParameterAssigned): Added.
16196         (EmitContext.SetParameterAssigned): Added.
16197         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16198         Added control flow analysis stuff here.
16199
16200         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16201         resolve the expression as lvalue.
16202         (LocalVariableReference.DoResolve): Check whether the variable has
16203         already been assigned.
16204         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16205         the parameter as assigned here.
16206         (ParameterReference.DoResolve): Check whether the parameter has already
16207         been assigned.
16208         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16209         expression as lvalue.
16210
16211         * statement.cs (FlowBranching): New class for the flow analysis code.
16212         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16213         (LabeledStatement.IsDefined): New public property.
16214         (LabeledStatement.AddUsageVector): New public method to tell flow
16215         analyis that the label may be reached via a forward jump.
16216         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16217         flow analysis.
16218         (VariableInfo.Number): New public field.  This is used by flow analysis
16219         to number all locals of a block.
16220         (Block.CountVariables): New public property.  This is the number of
16221         local variables in this block (including the locals from all parent
16222         blocks).
16223         (Block.EmitMeta): Number all the variables.
16224
16225         * statement.cs: Added flow analysis support to all classes.
16226
16227 2002-07-31  Martin Baulig  <martin@gnome.org>
16228
16229         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16230         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16231         then use this argument.
16232
16233         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16234
16235         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16236         use this to specify /define options.
16237
16238 2002-07-29  Martin Baulig  <martin@gnome.org>
16239
16240         * statement.cs (Fixed): Moved all code that does variable lookups
16241         and resolvings from Emit to Resolve.
16242
16243         * statement.cs (For): Moved all code that does variable lookups
16244         and resolvings from Emit to Resolve.
16245
16246         * statement.cs (Using): Moved all code that does variable lookups
16247         and resolvings from Emit to Resolve.
16248
16249 2002-07-29  Martin Baulig  <martin@gnome.org>
16250
16251         * attribute.cs (Attribute.Resolve): Explicitly catch a
16252         System.NullReferenceException when creating the
16253         CustromAttributeBuilder and report a different warning message.
16254
16255 2002-07-29  Martin Baulig  <martin@gnome.org>
16256
16257         * support.cs (ParameterData.ParameterName): Added method to
16258         get the name of a parameter.
16259
16260         * typemanager.cs (TypeManager.IsValueType): New public method.
16261
16262 2002-07-29  Martin Baulig  <martin@gnome.org>
16263
16264         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16265         is a flag which specifies that it's either ref or out.
16266         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16267         the out parameter to `out Parameter.Modifier mod', also set the
16268         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16269
16270         * support.cs (InternalParameters.ParameterModifier): Distinguish
16271         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16272         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16273
16274         * expression.cs (Argument.GetParameterModifier): Distinguish
16275         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16276         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16277
16278 2002-07-29  Martin Baulig  <martin@gnome.org>
16279
16280         * expression.cs (ParameterReference.ParameterReference): Added
16281         `Location loc' argument to the constructor.
16282
16283         * cs-parser.jay: Pass location to ParameterReference.
16284
16285 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16286
16287         * statement.cs (Try): Initialize the location.
16288
16289         * cs-parser.jay: pass location to Try.
16290
16291         * expression.cs (Unary.Reduce): Change the prototype to return
16292         whether a constant fold could be performed or not.  The result is
16293         returned in an out parameters.  In the case of Indirection and
16294         AddressOf, we want to perform the full tests.
16295
16296 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16297
16298         * statement.cs (Statement.Emit): Flag dead code.
16299
16300 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16301
16302         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16303
16304 2002-07-27  Martin Baulig  <martin@gnome.org>
16305
16306         * class.cs (MethodData.Define): Put back call to
16307         TypeManager.AddMethod(), accidentally commented this out.
16308
16309         * report.cs (Debug): New public method to print debugging information,
16310         this is `[Conditional ("DEBUG")]'.
16311
16312 2002-07-26  Martin Baulig  <martin@gnome.org>
16313
16314         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16315         (switch_statement): Push the current_block to the switch_stack and
16316         pop it again when we're done with the switch.
16317         (switch_section): The new block is a child of the current_block.
16318         Fixes bug #24007, added test-152.cs.
16319
16320 2002-07-27  Martin Baulig  <martin@gnome.org>
16321
16322         * expression.cs (Invocation.EmitArguments): When calling a varargs
16323         function with only its fixed arguments, we need to pass an empty
16324         array.
16325
16326 2002-07-27  Martin Baulig  <martin@gnome.org>
16327
16328         Mono 0.13 has been released.
16329
16330 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16331
16332         * driver.cs: Rename --resource to --linkres, because that is what
16333         we do currently, we dont support --resource yet.
16334
16335         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16336
16337 2002-07-25  Martin Baulig  <martin@gnome.org>
16338
16339         * class.cs (MethodData): New public class.  This is a `method builder'
16340         class for a method or one accessor of a Property/Indexer/Event.
16341         (MethodData.GetMethodFlags): Moved here from MemberBase.
16342         (MethodData.ApplyAttributes): Likewise.
16343         (MethodData.ApplyObsoleteAttribute): Likewise.
16344         (MethodData.ApplyConditionalAttribute): Likewise.
16345         (MethodData.ApplyDllImportAttribute): Likewise.
16346         (MethodData.CheckAbstractAndExternal): Likewise.
16347         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16348         (MethodData.Emit): Formerly known as Method.Emit().
16349         (MemberBase): Moved everything which was specific to a single
16350         accessor/method to MethodData.
16351         (Method): Create a new MethodData and call Define() and Emit() on it.
16352         (Property, Indexer, Event): Create a new MethodData objects for each
16353         accessor and call Define() and Emit() on them.
16354
16355 2002-07-25  Martin Baulig  <martin@gnome.org>
16356
16357         Made MethodCore derive from MemberBase to reuse the code from there.
16358         MemberBase now also checks for attributes.
16359
16360         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16361         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16362         as virtual.
16363         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16364         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16365         (MemberBase.ApplyAttributes): New virtual method; applies the
16366         attributes to a method or accessor.
16367         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16368         (MemberBase.ApplyConditionalAttribute): Likewise.
16369         (MemberBase.ApplyDllImportAttribute): Likewise.
16370         (MemberBase.CheckAbstractAndExternal): Likewise.
16371         (MethodCore.ParameterTypes): This is now a property instead of a
16372         method, it's initialized from DoDefineParameters().
16373         (MethodCore.ParameterInfo): Removed the set accessor.
16374         (MethodCore.DoDefineParameters): New protected virtual method to
16375         initialize ParameterTypes and ParameterInfo.
16376         (Method.GetReturnType): We can now simply return the MemberType.
16377         (Method.GetMethodFlags): Override the MemberBase version and add
16378         the conditional flags.
16379         (Method.CheckBase): Moved some code from Define() here, call
16380         DoDefineParameters() here.
16381         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16382         here to avoid some larger code duplication.
16383         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16384         ensure that abstract and external accessors don't declare a body.
16385
16386         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16387         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16388         lookup in the attribute's parent classes, so we need to abort as soon
16389         as we found the first match.
16390         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16391         the attribute has no arguments.
16392
16393         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16394         of a Method.
16395
16396 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16397
16398         * cs-parser.jay: reverted previous patch.
16399
16400 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16401
16402         * cs-parser.jay: fixed bug #22119.
16403
16404 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16405
16406         * attribute.cs: fixed compilation. The error was:
16407         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16408         be assigned to before control leaves the current method."
16409         [FIXME:  Filed as bug #28186: MCS must report this error.]
16410
16411 2002-07-25  Martin Baulig  <martin@gnome.org>
16412
16413         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16414         method to pull the condition name ouf of a Conditional attribute.
16415         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16416         the obsolete message and error flag out of an Obsolete attribute.
16417
16418         * class.cs (Method.GetMethodFlags): New public method to get the
16419         TypeManager.MethodFlags for this method.
16420         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16421         private methods.
16422         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16423         if we're overriding a virtual function, set the new private variable
16424         `parent_method'; call the new TypeManager.AddMethod().
16425
16426         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16427         the MethodBuilder and the Method in a PtrHashtable.
16428         (TypeManager.builder_to_method): Added for this purpose.
16429         (TypeManager.MethodFlags): Added IsObsoleteError.
16430         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16431         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16432         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16433         the message from the attribute.
16434
16435 2002-07-24  Martin Baulig  <martin@gnome.org>
16436
16437         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16438         preprocessor directives, ensure that the argument to #define/#undef is
16439         exactly one identifier and that it's actually an identifier.
16440
16441         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16442         did not work ....
16443
16444 2002-07-24  Martin Baulig  <martin@gnome.org>
16445
16446         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16447         initialize it to TypeManager.object_type in the constructor.
16448         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16449         of the `hm.get_current' method if we're using the collection pattern.
16450         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16451         for the explicit conversion to make it work when we're using the collection
16452         pattern and the `Current' property has a different return type than `object'.
16453         Fixes #27713.
16454
16455 2002-07-24  Martin Baulig  <martin@gnome.org>
16456
16457         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16458         does not match, but don't report any errors.  This method is called in
16459         order for all methods in a MethodGroupExpr until a matching method is
16460         found, so we don't want to bail out if the first method doesn't match.
16461         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16462         matches, report the 123.  Fixes #28070.
16463
16464 2002-07-24  Martin Baulig  <martin@gnome.org>
16465
16466         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16467         TypeManager.TypeToCoreType() to the top of the method so the
16468         following equality checks will work.  Fixes #28107.
16469
16470 2002-07-24  Martin Baulig  <martin@gnome.org>
16471
16472         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16473         operand is of type uint, and the other operand is of type sbyte,
16474         short or int, the operands are converted to type long." -
16475         Actually do what this comment already told us.  Fixes bug #28106,
16476         added test-150.cs.
16477
16478 2002-07-24  Martin Baulig  <martin@gnome.org>
16479
16480         * class.cs (MethodBase): New abstract class.  This is now a base
16481         class for Property, Indexer and Event to avoid some code duplication
16482         in their Define() and DefineMethods() methods.
16483         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16484         generic methods for Define() and DefineMethods().
16485         (FieldBase): Derive from MemberBase, not MemberCore.
16486         (Property): Derive from MemberBase, not MemberCore.
16487         (Property.DefineMethod): Moved all the code from this method to the
16488         new MethodBase.DefineAccessor(), just call it with appropriate
16489         argumetnts.
16490         (Property.Define): Call the new Property.DoDefine(), this does some
16491         sanity checks and we don't need to duplicate the code everywhere.
16492         (Event): Derive from MemberBase, not MemberCore.
16493         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16494         accessors, this will also make them work with interface events.
16495         (Indexer): Derive from MemberBase, not MemberCore.
16496         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16497         (Indexer.Define): Use the new MethodBase functions.
16498
16499         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16500         argument to the constructor.
16501         (Interface.FindMembers): Added support for interface events.
16502         (Interface.PopluateEvent): Implemented.
16503
16504         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16505
16506 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16507
16508         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16509         but this is required to check for a method name being the same as
16510         the containing class.  
16511
16512         Handle this now.
16513
16514 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16515
16516         * interface.cs: initialize variable.
16517
16518 2002-07-23  Martin Baulig  <martin@gnome.org>
16519
16520         Implemented the IndexerName attribute in interfaces.
16521
16522         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16523         name if this is an explicit interface implementation.
16524         (Indexer.InterfaceIndexerName): New public variable.  If we're
16525         implementing an interface indexer, this is the IndexerName in that
16526         interface.  Otherwise, it's the IndexerName.
16527         (Indexer.DefineMethod): If we're implementing interface indexer,
16528         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16529         and Pending.ImplementIndexer methods.
16530         (Indexer.Define): Also define the PropertyBuilder if we're
16531         implementing an interface indexer and this is neither an explicit
16532         interface implementation nor do the IndexerName match the one in
16533         the interface.
16534
16535         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16536         If a method is defined here, then we always need to create a proxy
16537         for it.  This is used when implementing interface indexers.
16538         (Pending.IsInterfaceIndexer): New public method.
16539         (Pending.ImplementIndexer): New public method.
16540         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16541         This is used when implementing interface indexers to define a proxy
16542         if necessary.
16543         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16544         define a proxy if necessary.
16545
16546         * interface.cs (Interface.IndexerName): New public variable.
16547         (Interface.PopulateIndexer): Set the IndexerName.
16548         (Interface.DefineIndexers): New private method.  Populate all the
16549         indexers and make sure their IndexerNames match.
16550
16551         * typemanager.cs (IndexerPropertyName): Added support for interface
16552         indexers.
16553
16554 2002-07-22  Martin Baulig  <martin@gnome.org>
16555
16556         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16557         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16558         ret if HasReturnLabel.
16559         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16560         variables.
16561
16562         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16563         and set the ec.LoopBeginTryCatchLevel.
16564         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16565         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16566         the current ec.TryCatchLevel, the branch goes out of an exception
16567         block.  In this case, we need to use Leave and not Br.
16568
16569 2002-07-22  Martin Baulig  <martin@gnome.org>
16570
16571         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16572         block unless the block does not always return or it is contained in
16573         another try { ... } catch { ... } block.  Fixes bug #26506.
16574         Added verify-1.cs to the test suite.
16575
16576 2002-07-22  Martin Baulig  <martin@gnome.org>
16577
16578         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16579         then we do not always return.  Fixes bug #24985.
16580
16581 2002-07-22  Martin Baulig  <martin@gnome.org>
16582
16583         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16584         lookup on a per-class level; ie. walk up the class hierarchy until we
16585         found at least one applicable method, then choose the best among them.
16586         Fixes bug #24463 and test-29.cs.
16587
16588 2002-07-22  Martin Baulig  <martin@gnome.org>
16589
16590         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16591         return types of the methods.  The return type is not part of the
16592         signature and we must not check it to make the `new' modifier work.
16593         Fixes bug #27999, also added test-147.cs.
16594         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16595
16596         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16597         on the method's return type.
16598
16599 2002-07-21  Martin Baulig  <martin@gnome.org>
16600
16601         * assign.cs: Make this work if the rightmost source is a constant and
16602         we need to do an implicit type conversion.  Also adding a few more tests
16603         to test-38.cs which should have caught this.
16604
16605         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16606         target in the makefile for this.  The makefile.gnu is primarily intended
16607         for end-users who don't want to debug the compiler.
16608
16609 2002-07-21  Martin Baulig  <martin@gnome.org>
16610
16611         * assign.cs: Improved the Assign class so it can now handle embedded
16612         assignments (X = Y = Z = something).  As a side-effect this'll now also
16613         consume less local variables.  test-38.cs now passes with MCS, added
16614         a few new test cases to that test.
16615
16616 2002-07-20  Martin Baulig  <martin@gnome.org>
16617
16618         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16619         instructions.  Fixes bug #27977, also added test-146.cs.
16620
16621 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16622
16623         * cs-tokenizer.cs: fixed getHex ().
16624
16625 2002-07-19  Martin Baulig  <martin@gnome.org>
16626
16627         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16628         not Type.GetType() to lookup the array type.  This is needed when
16629         we're constructing an array of a user-defined type.
16630         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16631         single-dimensional arrays, but also for single-dimensial arrays of
16632         type decimal.
16633
16634 2002-07-19  Martin Baulig  <martin@gnome.org>
16635
16636         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16637         this function is called, it's not allowed to share LocalBuilders
16638         among ILGenerators.
16639
16640 2002-07-19  Martin Baulig  <martin@gnome.org>
16641
16642         * expression.cs (Argument.Resolve): Report an error 118 when trying
16643         to pass a type as argument.
16644
16645 2002-07-18  Martin Baulig  <martin@gnome.org>
16646
16647         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16648         Conv_R_Un for the signed `long' type.
16649
16650 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16651
16652         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16653         `expr' for the temporary result, as that will fail if we do
16654         multiple resolves on the same expression.
16655
16656 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16657
16658         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16659         ec.TypeContainer for looking up aliases. 
16660
16661         * class.cs (TypeContainer): Remove LookupAlias from here.
16662
16663         * decl.cs (DeclSpace); Move here.
16664
16665 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16666
16667         * class.cs (FindMembers): Only call filter if the constructor
16668         bulider is not null.
16669
16670         Also handle delegates in `NestedTypes' now.  Now we will perform
16671         type lookups using the standard resolution process.  This also
16672         fixes a bug.
16673
16674         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16675         This uses Expressions (the limited kind that can be parsed by the
16676         tree) instead of strings.
16677
16678         * expression.cs (ComposedCast.ToString): Implement, used to flag
16679         errors since now we have to render expressions.
16680
16681         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16682         FormArrayType. 
16683
16684         * ecore.cs (SimpleName.ToString): ditto.
16685
16686         * cs-parser.jay: Instead of using strings to assemble types, use
16687         Expressions to assemble the type (using SimpleName, ComposedCast,
16688         MemberAccess).  This should fix the type lookups in declarations,
16689         because we were using a different code path for this.
16690
16691         * statement.cs (Block.Resolve): Continue processing statements
16692         even when there is an error.
16693
16694 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16695
16696         * class.cs (Event.Define): Also remove the `remove' method from
16697         the list of pending items.
16698
16699         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16700         generate more compact code. 
16701
16702 2002-07-17  Martin Baulig  <martin@gnome.org>
16703
16704         * const.cs (Const.LookupConstantValue): Add support for constant
16705         `unchecked' and `checked' expressions.
16706         Also adding test case test-140.cs for this.
16707
16708 2002-07-17  Martin Baulig  <martin@gnome.org>
16709
16710         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16711         check whether mi.ReturnType implements the IEnumerator interface; the
16712         `==' and the IsAssignableFrom() will fail in this situation.
16713
16714 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16715
16716         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16717         here too.
16718
16719 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16720
16721         * expression.cs: fixed bug #27811.
16722
16723 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16726         Molaro: when we are a ref, the value already contains a pointer
16727         value, do not take the address of it.
16728
16729 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16730         * removed mb-parser.jay and mb-tokenizer.cs
16731
16732 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16733
16734         * expression.cs: check against the building corlib void type.
16735
16736 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16737
16738         * ecore.cs: fix for valuetype static readonly fields: when 
16739         initializing them, we need their address, not the address of a copy.
16740
16741 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16742
16743         * typemanager.cs: register also enum_type in corlib.
16744
16745 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16746
16747         * class.cs: allow calling this (but not base) initializers in structs.
16748
16749 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16750
16751         * ecore.cs: make sure we compare against the building base types
16752         in GetTypeSize ().
16753
16754 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16755
16756         * typemanager.cs: fix TypeToCoreType() to handle void and object
16757         (corlib gets no more typerefs after this change).
16758
16759 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16760
16761         * expression.cs (ArrayCreation.EmitArrayArguments): use
16762         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16763
16764         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16765         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16766         array indexes, the runtime actually forbids them.
16767
16768         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16769         for array arguments here.
16770
16771         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16772         instead of the default for ValueTypes.
16773
16774         (New.DoEmit): Use IsValueType instead of
16775         IsSubclassOf (value_type)
16776         (New.DoResolve): ditto.
16777         (Invocation.EmitCall): ditto.
16778
16779         * assign.cs (Assign): ditto.
16780
16781         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16782         Statements *are* currently doing part of their resolution during
16783         Emit.  
16784
16785         Expressions do always resolve during resolve, but statements are
16786         only required to propagate resolution to their children.
16787
16788 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16789
16790         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16791
16792         (LoadAssembly): Do not add the dll if it is already specified
16793
16794         (MainDriver): Add the System directory to the link path at the end,
16795         after all the other -L arguments. 
16796
16797         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16798         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16799         ldelem.u1) and using the opposite for sbytes.
16800
16801         This fixes Digger, and we can finally run it.
16802
16803         * driver.cs (UnixParseOption): Move the option parsing here.  
16804         (CSCParseOption): Implement CSC-like parsing of options.
16805
16806         We now support both modes of operation, the old Unix way, and the
16807         new CSC-like way.  This should help those who wanted to make cross
16808         platform makefiles.
16809
16810         The only thing broken is that /r:, /reference: and /lib: are not
16811         implemented, because I want to make those have the same semantics
16812         as the CSC compiler has, and kill once and for all the confussion
16813         around this.   Will be doing this tomorrow.
16814
16815         * statement.cs (Unsafe.Resolve): The state is checked during
16816         resolve, not emit, so we have to set the flags for IsUnsfe here.
16817
16818 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16819
16820         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16821         not catch the Error_ObjectRefRequired in SimpleName (as it is
16822         possible to have a class/instance variable name that later gets
16823         deambiguated), we have to check this here.      
16824
16825 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16826
16827         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16828         make static and put into Expression.
16829
16830         (Event.Define): Register the private field of the event with the 
16831         TypeManager so that GetFieldFromEvent can get at it.
16832
16833         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16834         keep track of the private field associated with an event which
16835         has no accessors.
16836
16837         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16838         private field.
16839
16840         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16841
16842 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16843
16844         * expression.cs (Binary.EmitBranchable): this routine emits the
16845         Binary expression in a branchable context.  This basically means:
16846         we need to branch somewhere, not just get the value on the stack.
16847
16848         This works together with Statement.EmitBoolExpression.
16849
16850         * statement.cs (Statement.EmitBoolExpression): Use
16851         EmitBranchable. 
16852
16853 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16854
16855         * statement.cs (For): Reduce the number of jumps in loops.
16856
16857         (For): Implement loop inversion for the For statement.
16858
16859         (Break): We can be breaking out of a Try/Catch controlled section
16860         (foreach might have an implicit try/catch clause), so we need to
16861         use Leave instead of Br.
16862
16863         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16864         now).  If the instace expression supports IMemoryLocation, we use
16865         the AddressOf method from the IMemoryLocation to extract the
16866         address instead of emitting the instance.
16867
16868         This showed up with `This', as we were emitting the instance
16869         always (Emit) instead of the Address of This.  Particularly
16870         interesting when This is a value type, as we dont want the Emit
16871         effect (which was to load the object).
16872
16873 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16876
16877         * statement.cs (Checked): Set the CheckedState during the resolve
16878         process too, as the ConvCast operations track the checked state on
16879         the resolve process, and not emit.
16880
16881         * cs-parser.jay (namespace_member_declaration): Flag that we have
16882         found a declaration when we do.  This is used to flag error 1529
16883
16884         * driver.cs: Report ok when we display the help only.
16885
16886 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16887
16888         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16889
16890 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16891
16892         * cs-tokenizer.cs (define): We also have to track locally the
16893         defines.  AllDefines is just used for the Conditional Attribute,
16894         but we also need the local defines for the current source code. 
16895
16896 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * statement.cs (While, For, Do): These loops can exit through a
16899         Break statement, use this information to tell whether the
16900         statement is the last piece of code.
16901
16902         (Break): Flag that we break.
16903
16904         * codegen.cs (EmitContexts): New `Breaks' state variable.
16905
16906 2002-07-03  Martin Baulig  <martin@gnome.org>
16907
16908         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16909         modifiers in method declarations in structs.  Otherwise, you won't
16910         be able to override things like Object.Equals().
16911
16912 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16913
16914         * class.cs (Method, Property, Indexer): Do not allow the public
16915         modifier to be used in explicit interface implementations.
16916
16917         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16918         override modifiers in method declarations in structs
16919
16920 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16921
16922         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16923         integer or real overflow, report an error
16924
16925 2002-07-02  Martin Baulig  <martin@gnome.org>
16926
16927         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16928         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16929         to tell the runtime about our newly created System.Object and
16930         System.ValueType types.
16931
16932 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16933
16934         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16935         struct instead of Ldarg/Starg.
16936
16937 2002-07-02  Martin Baulig  <martin@gnome.org>
16938
16939         * expression.cs (Indirection.Indirection): Call
16940         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16941
16942 2002-07-02  Martin Baulig  <martin@gnome.org>
16943
16944         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16945         ValueType, call TypeManager.TypeToCoreType() on it.
16946         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16947         the OpCodes.Newarr argument.
16948
16949 2002-07-02  Martin Baulig  <martin@gnome.org>
16950
16951         * expression.cs (Invocation.EmitCall): When compiling corlib,
16952         replace all calls to the system's System.Array type to calls to
16953         the newly created one.
16954
16955         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16956         System.Array methods.
16957         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16958         from the system's System.Array type which must be replaced.
16959
16960 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16961
16962         * typemanager.cs: load unverifiable_code_ctor so we can build
16963         corlib using the correct type. Avoid using GetTypeCode() with
16964         TypeBuilders.
16965         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16966         TypeManager.object_type to allow building corlib.
16967
16968 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16969
16970         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16971
16972 2002-07-01  Martin Baulig  <martin@gnome.org>
16973
16974         * class.cs: Make the last change actually work, we need to check
16975         whether `ifaces != null' to avoid a crash.
16976
16977 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16978
16979         * class.cs: when we build structs without fields that implement
16980         interfaces, we need to add the interfaces separately, since there is
16981         no API to both set the size and add the interfaces at type creation
16982         time.
16983
16984 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16985
16986         * expression.cs: the dimension arguments to the array constructors
16987         need to be converted if they are a long.
16988
16989 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16990
16991         * class.cs: don't emit ldarg.0 if there is no parent constructor
16992         (fixes showstopper for corlib).
16993
16994 2002-06-29  Martin Baulig  <martin@gnome.org>
16995
16996         MCS now compiles corlib on GNU/Linux :-)
16997
16998         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16999         ie. check for MethodImplOptions.InternalCall.
17000
17001         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17002         and TypeManager.attribute_type are null, so we must explicitly check
17003         whether parent is not null to find out whether it's an attribute type.
17004         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17005         and SetBuilder, not only if the property is neither abstract nor external.
17006         This is necessary to set the MethodImplOptions on the accessor methods.
17007         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17008         SetBuilder, see Property.Emit().
17009
17010         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17011         populate "System.Object", "System.ValueType" and "System.Attribute" since
17012         they've already been populated from BootCorlib_PopulateCoreTypes().
17013
17014 2002-06-29  Martin Baulig  <martin@gnome.org>
17015
17016         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17017         is the NullLiteral, we also need to make sure that target_type is not
17018         an enum type.   
17019
17020 2002-06-29  Martin Baulig  <martin@gnome.org>
17021
17022         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17023         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17024         before calling BootstrapCorlib_ResolveDelegate ().
17025
17026 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17027
17028         * statement.cs: fixed build-breaker. All tests passed ok.
17029
17030 2002-06-27  Martin Baulig  <martin@gnome.org>
17031
17032         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17033         for System.Decimal when compiling corlib.
17034
17035 2002-06-27  Martin Baulig  <martin@gnome.org>
17036
17037         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17038         switch blocks which contain nothing but a default clause.
17039
17040 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17041
17042        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17043
17044 2002-06-27  Martin Baulig  <martin@gnome.org>
17045
17046         * ecore.cs (PropertyExpr.PropertyExpr): Call
17047         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17048
17049         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17050         is already a TypeBuilder.
17051
17052 2002-06-27  Martin Baulig  <martin@gnome.org>
17053
17054         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17055         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17056         the "from an array-type to System.Array" case.  This makes it work
17057         when compiling corlib.
17058
17059 2002-06-27  Martin Baulig  <martin@gnome.org>
17060
17061         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17062         non-static PropertyExpr, set its InstanceExpression.  This makes
17063         the `ICollection.Count' property work in System/Array.cs.
17064
17065 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17066
17067         * driver.cs: Made error handling more consistent.  Errors now
17068         tracked by Report class, so many methods which used to return int
17069         now return void.  Main() now prints success/failure and 
17070         errors/warnings message.
17071
17072         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17073         the magic number return values (123 and 124).  Now, if the
17074         expected error occurs, the compiler exits with success (exit value
17075         0).  If the compilation completes without seeing that particular
17076         error, the compiler exits with failure (exit value 1).  The
17077         makefile in mcs/errors has been changed to handle the new behaviour.
17078
17079         * report.cs: Made 'expected error' number a property and renamed
17080         it from 'Probe' to 'ExpectedError'.
17081
17082         * genericparser.cs: Removed error handling support, since it is
17083         now all done by Report class.
17084
17085         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17086         class, so parse() no longer returns an int.
17087
17088         * namespace.cs: Use Report.Error instead of GenericParser.error
17089
17090 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17093         TypeContainer.AddOperator): At the front of the list put the
17094         explicit implementations, so they get resolved/defined first. 
17095
17096 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17097
17098         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17099         interface type is implemented by this TypeContainer.  Used during
17100         explicit interface implementation.
17101
17102         (Property.Define, Indexer.Define, Method.Define): Validate that
17103         the given interface in the explicit implementation is one of the
17104         base classes for the containing type.
17105
17106         Also if we are explicitly implementing an interface, but there is
17107         no match in the pending implementation table, report an error.
17108
17109         (Property.Define): Only define the property if we are
17110         not explicitly implementing a property from an interface.  Use the
17111         correct name also for those properties (the same CSC uses,
17112         although that is really not needed).
17113
17114         (Property.Emit): Do not emit attributes for explicitly implemented
17115         properties, as there is no TypeBuilder.
17116
17117         (Indexer.Emit): ditto.
17118
17119         Hiding then means that we do not really *implement* a pending
17120         implementation, which makes code fail.
17121
17122 2002-06-22  Martin Baulig  <martin@gnome.org>
17123
17124         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17125         the return value of Object.GetType().  [FIXME: we need to do this whenever
17126         we get a type back from the reflection library].
17127
17128 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17129
17130         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17131
17132 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * attribute.cs: Return null if we can not look up the type.
17135
17136         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17137         the interface types found.
17138
17139         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17140         interface types found.
17141
17142         * typemanager.cs (GetInterfaces): Make this routine returns alll
17143         the interfaces and work around the lame differences between
17144         System.Type and System.Reflection.Emit.TypeBuilder in the results
17145         result for GetInterfaces.
17146
17147         (ExpandInterfaces): Given an array of interface types, expand and
17148         eliminate repeated ocurrences of an interface.  This expands in
17149         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17150         be IA, IB, IC.
17151
17152 2002-06-21  Martin Baulig  <martin@gnome.org>
17153
17154         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17155         on System.Enum.
17156
17157 2002-06-21  Martin Baulig  <martin@gnome.org>
17158
17159         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17160         and called with one of the core types, return the corresponding typebuilder for
17161         that type.
17162
17163         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17164         element type.
17165
17166 2002-06-21  Martin Baulig  <martin@gnome.org>
17167
17168         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17169         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17170         (Expression.ConvertReferenceExplicit): Likewise.
17171
17172         * expression.cs (ElementAccess.DoResolve): Likewise.
17173         (ElementAccess.DoResolveLValue): Likewise.
17174
17175 2002-06-10  Martin Baulig  <martin@gnome.org>
17176
17177         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17178         add the "value" parameter to the parameter list.
17179
17180         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17181         to our caller.
17182
17183 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17184
17185         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17186         the argument to an int, uint, long or ulong, per the spec.  Also
17187         catch negative constants in array creation.
17188
17189 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17190
17191         * class.cs: do not allow the same interface to appear twice in
17192         the definition list.
17193
17194 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17195
17196         * ecore.cs: don't use ldlen with System.Array.
17197
17198 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17199
17200         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17201
17202 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17203
17204         * modifiers.cs: produce correct field attributes for protected
17205         internal. Easy fix so miguel can work on ther harder stuff:-)
17206
17207 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17208
17209         * pending.cs: New file.  Move the code from class.cs here.
17210         Support clearning the pending flag for all methods (when not doing
17211         explicit interface implementation).
17212
17213 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17214
17215         * rootcontext.cs: added a couple more types needed to bootstrap.
17216
17217 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17218
17219         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17220         constructor in the type, instead of any constructor in the type
17221         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17222         a bug in the Mono runtime when applying the params attribute). 
17223
17224 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17225         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17226
17227 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17228
17229         * expression.cs (Unary.ResolveOperator): Use TypeManager
17230         to resolve the type.
17231
17232 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17233
17234         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17235         attached.
17236
17237         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17238         with each member too.
17239
17240         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17241         field builders too - this takes care of the enum member case.
17242
17243 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17244
17245         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17246         address-of operator on both value types and pointers.
17247
17248 2002-06-10  Martin Baulig  <martin@gnome.org>
17249
17250         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17251         PropertyBuilder to the `property_builders' list.
17252
17253         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17254         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17255         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17256         find any indexers which are inherited from an interface.
17257
17258 2002-06-09  Martin Baulig  <martin@gnome.org>
17259
17260         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17261         the same type as the constant if necessary.  There's also a test-130.cs
17262         for this.
17263
17264         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17265
17266         * typemanager.cs (TypeManager.ChangeType): Previously known as
17267         Enum.ChangeEnumType().
17268
17269 2002-06-09  Martin Baulig  <martin@gnome.org>
17270
17271         * expression.cs (Cast.TryReduce): Added support for consts.
17272
17273 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17274
17275         * class.cs (Accessor): Hold attributes information so we can pass
17276         it along.
17277
17278         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17279         Modify to pass in attributes attached to the methods.
17280
17281         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17282
17283         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17284         to handle the Accessor kind :-)
17285
17286         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17287
17288 2002-06-08  Martin Baulig  <martin@gnome.org>
17289
17290         * expression.cs (Unary.TryReduceNegative): Added support for
17291         ULongConstants.
17292
17293 2002-06-08  Martin Baulig  <martin@gnome.org>
17294
17295         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17296         name can't be found in the `defined_names' - the caller will do a
17297         MemberLookup in this case and thus find methods in System.Enum
17298         such as Enum.IsDefined().
17299
17300 2002-06-08  Martin Baulig  <martin@gnome.org>
17301
17302         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17303         Convert.ChangeType() which works with TypeBuilder created types.
17304         (Enum.LookupEnumValue, Enum.Define): Use it here.
17305
17306         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17307         `TypeBuilder.BaseType != null' check.
17308         (TypeContainer.FindMembers): Only lookup parent members if we
17309         actually have a parent.
17310         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17311         (ConstructorInitializer.Resolve): Likewise.
17312
17313         * interface.cs (Interface.FindMembers): Added
17314         `TypeBuilder.BaseType != null' check.
17315
17316         * rootcontext.cs (RootContext.ResolveCore): Added
17317         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17318         classes_second_stage.
17319
17320         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17321         debug_type and trace_type when compiling with --nostdlib.       
17322
17323 2002-06-07  Martin Baulig  <martin@gnome.org>
17324
17325         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17326         (AddField): Set it to true when adding a non-static field.
17327         (DefineType): Use `have_nonstatic_fields' to find out whether we
17328         have non-static fields, not `Fields != null'.
17329
17330 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17331
17332         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17333         dereferencing a null on the static-field code path)
17334
17335 2002-05-30  Martin Baulig  <martin@gnome.org>
17336
17337         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17338         to take command line arguments.  Use reflection to call the new
17339         custom `Initialize' function on the symbol writer and pass it the
17340         command line arguments.
17341
17342         * driver.cs (--debug-args): New command line argument to pass command
17343         line arguments to the symbol writer.
17344
17345 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17346
17347         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17348         the target type for indexers and properties.  Thanks to Joe for
17349         catching this.
17350
17351 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17352
17353         * typemanager.cs (MethodFlags): returns the method flags
17354         (Obsolete/ShouldIgnore) that control warning emission and whether
17355         the invocation should be made, or ignored. 
17356
17357         * expression.cs (Invocation.Emit): Remove previous hack, we should
17358         not do this on matching a base type, we should do this based on an attribute
17359
17360         Only emit calls to System.Diagnostics.Debug and
17361         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17362         on the command line.
17363
17364         * rootcontext.cs: Global settings for tracing and debugging.
17365
17366         * cs-tokenizer.cs (define): New utility function to track
17367         defines.   Set the global settings for TRACE and DEBUG if found.
17368
17369 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17370
17371         * interface.cs (Populate*): Pass in the TypeContainer as well as
17372         the DeclSpace as parameters so that we can create EmitContexts and
17373         then use that to apply attributes etc.
17374
17375         (PopulateMethod, PopulateEvent, PopulateProperty)
17376         (PopulateIndexer): Apply attributes everywhere.
17377
17378         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17379         etc.
17380
17381         (ApplyAttributes): Update accordingly.
17382
17383         We now apply interface attributes for all members too.
17384
17385 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * class.cs (Indexer.Define); Correctly check if we are explicit
17388         implementation (instead of checking the Name for a ".", we
17389         directly look up if the InterfaceType was specified).
17390
17391         Delay the creation of the PropertyBuilder.
17392
17393         Only create the PropertyBuilder if we are not an explicit
17394         interface implementation.   This means that explicit interface
17395         implementation members do not participate in regular function
17396         lookups, and hence fixes another major ambiguity problem in
17397         overload resolution (that was the visible effect).
17398
17399         (DefineMethod): Return whether we are doing an interface
17400         implementation. 
17401
17402         * typemanager.cs: Temporary hack until we get attributes in
17403         interfaces (Ravi is working on that) and we get IndexerName
17404         support in interfaces.
17405
17406         * interface.cs: Register the indexers as properties.
17407
17408         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17409         warning, I have verified that this is a bug in the .NET runtime
17410         (JavaScript suffers of the same problem).
17411
17412         * typemanager.cs (MemberLookup): When looking up members for
17413         interfaces, the parent of an interface is the implicit
17414         System.Object (so we succeed in searches of Object methods in an
17415         interface method invocation.  Example:  IEnumerable x;  x.ToString
17416         ()) 
17417
17418 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * class.cs (Event): Events should also register if they do
17421         implement the methods that an interface requires.
17422
17423         * typemanager.cs (MemberLookup); use the new GetInterfaces
17424         method. 
17425
17426         (GetInterfaces): The code used to lookup interfaces for a type is
17427         used in more than one place, factor it here. 
17428
17429         * driver.cs: Track the errors at the bottom of the file, we kept
17430         on going.
17431
17432         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17433         instance if the method we are calling is static!
17434
17435 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17436
17437         * attribute.cs (ApplyAttributes): Make this function filter out
17438         the IndexerName attribute (as that attribute in reality is never
17439         applied) and return the string constant for the IndexerName
17440         attribute. 
17441
17442         * class.cs (TypeContainer.Emit): Validate that all the indexers
17443         have the same IndexerName attribute, and if so, set the
17444         DefaultName attribute on the class. 
17445
17446         * typemanager.cs: The return value might contain other stuff (not
17447         only methods).  For instance, consider a method with an "Item"
17448         property and an Item method.
17449
17450         * class.cs: If there is a problem with the parameter types,
17451         return. 
17452
17453 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17454
17455         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17456         looks at user defined conversion after making a call to 
17457         StandardConversionExists - we need this for overload resolution.
17458
17459         * expression.cs : Update accordingly the various method calls.
17460
17461         This fixes 2 bugs filed against implicit user defined conversions 
17462
17463 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17464
17465         * statement.cs: Track the result of the assignment.
17466
17467 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17468
17469         * expression.cs (MemberAccess): Improved error reporting for
17470         inaccessible members.
17471
17472 2002-05-22  Martin Baulig  <martin@gnome.org>
17473
17474         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17475         itself with debugging support.
17476
17477 2002-05-22  Martin Baulig  <martin@gnome.org>
17478
17479         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17480         Removed, this isn't needed anymore.
17481
17482 2002-05-20  Martin Baulig  <martin@gnome.org>
17483
17484         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17485         be underlying type for an enum.
17486
17487 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17488
17489         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17490         that splits out the loading of just the core types.
17491
17492         * rootcontext.cs (ResolveCore): Split the struct resolution in
17493         two, so we can load the enumeration underlying types before any
17494         enums are used.
17495
17496         * expression.cs (Is): Bandaid until we fix properly Switch (see
17497         bug #24985 for details).
17498
17499         * typemanager.cs (ImplementsInterface): The hashtable will contain
17500         a null if there are no interfaces implemented.
17501
17502 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17503
17504         * cs-parser.jay (indexer_declarator): It is fine to have array
17505         parameters
17506
17507 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17508
17509         * typemanager.cs: (RegisterBuilder): New function used to register
17510         TypeBuilders that implement interfaces.  Since
17511         TypeBuilder.GetInterfaces (as usual) does not work with lame
17512         Reflection.Emit. 
17513         (AddUserType): register interfaces.
17514
17515         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17516         dealing with TypeBuilder.  Also, arrays are showing up as
17517         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17518         methods can not be invoked on them!
17519
17520         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17521         (ImplicitReferenceConversionExists): Split out from
17522         StandardConversionExists. 
17523
17524         * expression.cs (As): We were only implementing one of the three
17525         cases for the as operator.  We now implement them all.
17526         (Is): Implement the various other cases for Is as well.
17527
17528         * typemanager.cs (CACHE): New define used to control if we want or
17529         not the FindMembers cache.  Seems to have a negative impact on
17530         performance currently
17531
17532         (MemberLookup): Nested types have full acess to
17533         enclosing type members
17534
17535         Remove code that coped with instance/static returns for events, we
17536         now catch this in RealFindMembers.
17537
17538         (RealFindMembers): only perform static lookup if the instance
17539         lookup did not return a type or an event.  
17540
17541 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * assign.cs (CompoundAssign): We pass more semantic information
17544         now to Compound Assignments than we did before: now we have all
17545         the information at hand, and now we resolve the target *before* we
17546         do the expression expansion, which allows the "CacheValue" method
17547         to have the effect we intended (before, a [x] += 1 would generate
17548         two differen ArrayAccess expressions from the ElementAccess,
17549         during the resolution process).
17550
17551         (CompoundAssign.DoResolve): Resolve target and original_source here.
17552
17553 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17554
17555         * expression.cs (ArrayAccess): dropped debugging information. 
17556
17557         * typemanager.cs: Small bug fix: I was always returning i_members,
17558         instead of one of i_members or s_members (depending on which had
17559         the content).
17560
17561         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17562         method is invoked before any code generation takes place, and it
17563         is a mechanism to inform that the expression will be invoked more
17564         than once, and that the method should use temporary values to
17565         avoid having side effects
17566
17567         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17568
17569         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17570         implementation.
17571
17572         * expression.cs (Indirection, ArrayAccess): Add support for
17573         CacheTemporaries in these two bad boys. 
17574
17575         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17576         ldobj or ldind_ref.  
17577         (StoreFromPtr): Handle stobj as well.
17578
17579         * expression.cs (UnaryMutator): Share more code.
17580
17581         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17582         down: I was not tracking the Filter function as well, which
17583         was affecting the results of the cache.
17584
17585 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * attribute.cs: Remove the hack to handle the CharSet property on
17588         StructLayouts. 
17589
17590 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17591
17592         * attribute.cs (DoResolve): More uglyness, we now only try to
17593         resolve the attribute partially, to extract the CharSet
17594         information (only if we are a StructLayout attribute).  Otherwise 
17595
17596         (GetExtraTypeInfo): Add some code to conditionally kill in the
17597         future this.   I am more and more convinced that the .NET
17598         framework has special code to handle the attribute setting on
17599         certain elements.
17600
17601         * expression.cs (IsParamsMethodApplicable): Revert my previous
17602         foreach change here, it was wrong.
17603
17604 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17607         (pp_expr): do not abort on unknown input, just return.
17608         (eval): abort if there are pending chars.
17609
17610         * attribute.cs (Attribute.Resolve): Positional parameters are
17611         optional.  Deal with that case.
17612
17613         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17614         the Ansi/Unicode/Auto information for the type.
17615
17616         (TypeContainer.DefineType): instantiate the EmitContext here, as
17617         we will be using it during the type definition (to resolve
17618         attributes) and during the emit phase.
17619
17620         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17621         to pull type information out of the attributes
17622
17623         (Attribute.Resolve): track the constructor builder, and allow for
17624         multiple invocations (structs and classes will use this).
17625
17626         * ecore.cs (MemberLookupFinal): new version with all the
17627         parameters customizable.
17628
17629         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17630         constructors.  Return if the result value is null (as the error
17631         would have been flagged already by MemberLookupFinal)
17632
17633         Do not allow instances of abstract classes or interfaces to be
17634         created.
17635
17636         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17637         We have to compare the assembly property here when dealing with
17638         FamANDAssem and Assembly access modifiers, because we might be
17639         creating an assembly from *modules* (that means that we are not
17640         getting TypeBuilders for types defined in other modules that are
17641         part of this assembly).
17642
17643         (Method.Emit): If the method is marked abstract and has a body,
17644         emit an error. 
17645
17646         (TypeContainer.DefineMembers): If both the defined member and the
17647         parent name match are methods, then do not emit any warnings: let
17648         the Method.Define routine take care of flagging warnings.  But if
17649         there is a mismatch (method overrides something else, or method is
17650         overriwritten by something, then emit warning).
17651
17652         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17653         set to null, this means `do not check for the return type on the
17654         signature'. 
17655
17656         (Method.Define): set the return type for the method signature to
17657         null, so that we get methods with the same name and parameters and
17658         different return types.  This is used to flag warning 114 (you are
17659         hiding a method, and you probably want to use the new/override
17660         keywords instead).
17661
17662         * typemanager.cs (MemberLookup): Implemented proper access
17663         control, closing a long standing set of bug reports.  The problem
17664         was that the Framework only has two bits: Public and NonPublic,
17665         and NonPublic includes private and protected methods, but we need
17666         to enforce the FamANDAssem, FamOrAssem and Family. 
17667
17668 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17669
17670         * statement.cs (GotoCase): Return true: Ammounts to giving up
17671         knowledge on whether we return or not, and letting the other case
17672         be responsible for it.
17673
17674 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17675
17676         * driver.cs: Do not load directories for each file processed, only
17677         do it if there is a pattern.
17678
17679         * ecore.cs: Report readonly assigns here as well, as we might have
17680         been resolved only by MemberAccess.
17681
17682         (SimpleName.SimpleNameResolve): Also be useful for LValue
17683         resolution.   We need this to propagate assign to local readonly variables
17684
17685         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17686         do not want to reuse potential criteria memory.
17687
17688         * class.cs (MyEventBuilder): Set reflected_type;
17689
17690         * ecore.cs (Constantify): Added support for constifying bools.
17691
17692         (RootContext.LookupType): Added a cache for values looked up in
17693         the declaration space.
17694
17695         * typemanager.cs (FindMembers): Now is a front-end to
17696         RealFindMembers, and provides a two-level hashtable-based cache to
17697         the request.  
17698
17699         15% performance improvement: from 22.5 to 19.2 seconds.
17700
17701         * expression.cs (IsParamsMethodApplicable): use foreach.
17702         (Invocation.DoResolve): ditto.
17703         (New.DoResolve): ditto.
17704         (ArrayCreation.DoResolve): ditto.
17705
17706         * ecore.cs (FindMostEncompassingType): use foreach.
17707
17708         * delegate.cs (NewDelegate.DoResolve): Use foreach
17709
17710         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17711         (RemoveMethods): use foreach.
17712
17713         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17714         nested foreach statements instead of for, and also break out of
17715         the inner loop once a match is found.
17716
17717         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17718
17719 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17720
17721         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17722         we actually unwrap the expression to allow for extra information
17723         to be extracted. 
17724
17725         * expression.cs: Use Shr_Un on unsigned operations. 
17726
17727 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17728
17729         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17730         applicable operators was not being considered correctly. This closes
17731         the bug Miguel reported.
17732
17733 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17734
17735         * attribute.cs: check that the type derives from System.Attribute
17736         and report the correct error in that case (moved the duplicate code to
17737         its own method, too).
17738
17739 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17740
17741         * attribute.cs: lookup attribute type name as the spec says: first the
17742         bare attribute name and then name + "Attribute" (nant compiles with
17743         mcs after this fix).
17744
17745 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17746
17747         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17748         Because of the way we parse things, we should try to see if a
17749         UIntConstant can fit in an integer.
17750
17751 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17752
17753         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17754         when we are in an explicit context.
17755
17756         (ConvertReferenceExplicit): When converting from Iface type S to Class
17757         T make sure the rules are implemented as an OR.
17758
17759         * parameter.cs (ParameterType): Make it a property for now although the
17760         purpose really isn't anything immediate.
17761
17762         * expression.cs (Is*Applicable): Do better checking on the parameter type
17763         of a ref/out parameter. The ones from the system assemblies are already 
17764         marked with the correct type so we don't need to do any correction.
17765
17766         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17767         the object type is standard too so include that.
17768
17769 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17770
17771         * ecore.cs (StandardConversionExists): Augment with missing code:
17772         deal with IntConstant, LongConstants and Enumerations.
17773
17774         * assign.cs: Report the error, instead of failing silently
17775
17776         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17777         typecontainer that they are declared, because the
17778         typecontainer/namespace will have the list of using clauses that
17779         need to be applied.
17780
17781         Assembly Attributes were escaping the normal registration
17782         mechanism. 
17783
17784         (EmitCode): Apply attributes within an EmitContext that represents
17785         the container they were declared on.
17786
17787         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17788
17789 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17790
17791         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17792         Revamp completely - make much cleaner as we now operate only
17793         on a set of Types.
17794
17795         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17796         to implement the logic detailed in the spec more correctly.
17797
17798         (UserDefinedConversion): Update accordingly.
17799
17800 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * statement.cs: Return flow analysis information up.
17803
17804         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17805         and the default.
17806
17807         (token): Do not consume an extra character before calling
17808         decimal_digits.
17809
17810 2002-05-06  Piers Haken <piersh@friskit.com>
17811
17812         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17813
17814 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17815
17816         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17817         EmitContext during the instance constructor initializer
17818         resolution, to stop access to instance variables.
17819
17820         This is mandated by the spec, last paragraph of the `constructor
17821         initializers' section. 
17822
17823 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17824
17825         * cs-parser.jay, class.cs (Accessor): new class used to represent
17826         an accessor (get or set).  In the past we used `null' to represent
17827         a missing accessor.  But this is ambiguous because there was no
17828         way to tell in abstract indexers/properties if one of them was
17829         specified.
17830
17831         Now there is a way of addressing that.
17832
17833         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17834         instead of FindMembers.
17835
17836         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17837         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17838
17839         * attribute.cs: Treat indexers and properties as the same in terms
17840         of applying attributes
17841
17842         * ecore.cs (FindMostEncompassedType): Use statically initialized
17843         EmptyExpressions()s like we do elsewhere to avoid creating useless
17844         objects (and we take this out of the tight loop).
17845
17846         (GetConversionOperators): Move the code to extract the actual
17847         operators to a separate routine to clean things up.
17848
17849 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17850
17851         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17852         events are always registered FieldBuilders.
17853
17854         * class.cs (FieldBase): New class shared by Fields 
17855
17856         * delegate.cs: If we are a toplevel delegate, use our full name.
17857         If we are a nested delegate, then only use our tail name.
17858
17859 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17860
17861         * expression.cs (IsApplicable): Ensure that we add the "&" to
17862         ref/out types before comparing it with the type of the argument.
17863
17864         (IsParamsMethodApplicable): Ditto.
17865
17866         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17867         silly me ;-)
17868
17869         * delegate.cs : Handle the case when we have more than one applicable
17870         method. Flag an error only when we finish checking all.
17871
17872 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * expression.cs: Add support for boolean static initializers.
17875
17876 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17879
17880         * parameter.cs (ComputeParameterTypes,
17881         ComputeAndDefineParameterTypes): Better error handling: now we
17882         clear the `types' cache if we fail during any of the type lookups.
17883         We also return the status code correctly to our caller
17884
17885         * delegate.cs: If we fail to define a delegate, abort the extra
17886         steps. 
17887
17888         * expression.cs (Binary.ResolveOperator): for
17889         operator==(object,object) and operator !=(object, object) we also
17890         have to verify that there is an implicit conversion from one to
17891         the other.
17892
17893         (ArrayAccess.DoResolve): Array Access can operate on
17894         non-variables. 
17895
17896 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17897
17898         * assign.cs (CompoundAssign): A new class used as a "flag" that
17899         the assignment actually is happening as part of a compound
17900         assignment operator.
17901
17902         During compound assignment, a few new rules exist to enable things
17903         like:
17904
17905         byte b |= 1 + 2
17906
17907         From the spec:
17908
17909         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17910         to the type of x) if y is implicitly convertible to the type of x,
17911         and the operator is a builtin operator and the return type of the
17912         operator is explicitly convertible to the type of x. 
17913
17914         * rootcontext.cs: Reset warning level to 2.  4 catches various
17915         "interesting" features in mcs, we must clean this up at some
17916         point, but currently am trying to kill other bugs ;-)
17917
17918         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17919         in container classes as well.  
17920
17921         * expression.cs (Binary.ResolveOperator): Handle string case
17922         before anything else (as operator overloading does emit an error
17923         before doing anything else).
17924
17925         This code could go away when we move to a table driven model, but
17926         i could not come up with a good plan last night.
17927
17928 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17929
17930         * typemanager.cs (CSharpName): reimplementation using regex.
17931         * class.cs: added null check for fields in Emit
17932         * rootcontext.cs: set warninglevel to 4
17933
17934 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17935
17936         * typemanager.cs (CSharpName): reimplemented with Lupus
17937         suggestion.
17938
17939 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * statement.cs (If): correclty implement Resolve, because we were
17942         not catching sem errors in there.  The same process is needed
17943         everywhere else. 
17944         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17945
17946
17947         (Statement.Warning_DeadCodeFound): Factorize code.
17948         (While): Report dead code here too.
17949
17950         (Statement): Added Resolve virtual method to allow
17951         for resolution split from the emit code.
17952
17953 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17954
17955         * statement.cs (EmitBoolExpression): No longer try to resolve the
17956         expression here.    
17957         (MakeBoolean): New utility function that resolve, implicitly
17958         converts to boolean and tags the expression. 
17959
17960
17961         (If, Do): Implement dead code elimination.
17962         (While): Implement loop inversion
17963
17964         (Do, While, For, If): Resolve the expression prior to calling our
17965         code generation.
17966
17967 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17968
17969         * class.cs:
17970           - added method Report28 (warning: program has more than one entry point)
17971           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17972           - modified method Method.Define, the part at the end of the method
17973
17974         * rootcontext.cs: added static public Location EntryPointLocation;
17975           
17976         * ../errors/cs0028.cs : Add test case for the above warning.              
17977
17978         * typemanager.cs:
17979           - modified method CSharpName to allow arrays of primitive type to
17980             be printed nicely (e.g. instead of System.Int32[][] it now prints
17981             int[][])
17982           - added method CSharpSignature: returns the signature of a method
17983             in string format to be used in reporting errors, warnings, etc.
17984
17985         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17986         with String.Empty.
17987
17988 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17989
17990         * delegate.cs (Define): Fix extremely silly bug where I was
17991         setting the type of the 'object' parameter of the BeginInvoke
17992         method to System.IAsyncResult instead of System.Object ;-)
17993
17994 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17997         here. 
17998
17999         (Constructor.Emit): return if we fail to initialize the
18000         constructor.  Another door closed!  
18001
18002         * expression.cs (New.DoResolve): Improve error message (from -6 to
18003         1501).  Use DeclaredOnly lookup to find the exact constructor.
18004
18005         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18006         loop.  This is useful.
18007
18008         * cs-parser.jay: Adjust the default parameters so that destructors
18009         have the proper signature.
18010
18011 2002-04-26  Martin Baulig  <martin@gnome.org>
18012
18013         * driver.cs (LoadAssembly): If `assembly' contains any characters
18014         which are only valid in path names and not in assembly names
18015         (currently slash, backslash and point), use Assembly.LoadFrom ()
18016         instead of Assembly.Load () on the `assembly' (before iteration
18017         over the link_paths).
18018
18019 2002-04-26  Martin Baulig  <martin@gnome.org>
18020
18021         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18022
18023 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18024
18025         * class.cs (Property): use the new typemanager.MemberLookup
18026
18027         (TypeContainer.MemberLookup): Implement using the
18028         TypeManager.MemberLookup now. 
18029
18030         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18031         and return MemberInfos, so that these can be used without an
18032         EmitContext (what we had before).
18033
18034 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18035
18036         * expression.cs: Fix the case where the argument to params if the
18037         type of the params.  I omitted handling this before.   Fixed
18038
18039 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18040
18041         * driver.cs: Call BootCorlib_PopulateCoreType
18042
18043         * class.cs (Property.CheckBase): Check for properties only, not
18044         for all members. 
18045
18046         * interface.cs: Temporary hack: try/catch around the
18047         CustomAttributeBuilder, because I am getting an exception that I
18048         do not understand.
18049
18050         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18051         types whose definitions are required to be there (attributes are
18052         defined before standard types).
18053
18054         Compute definitions as we boot the various types, as they are used
18055         immediately (value_type class will need object_type, but if we do
18056         not initialize object_type, we will pass a null, which will let
18057         the runtime pick the System.Object from the existing corlib, which
18058         is not what we want).
18059
18060 2002-04-22  Patrik Torstensson <totte@labs2.com>
18061
18062         * cs-tokenizer.cs: fixed a number of trim() issues.
18063
18064 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18065
18066         * expression.cs (Argument.Type): Ensure that we return the correct
18067         type when we have out or ref parameters [in which case we 
18068         append a "&"].
18069
18070 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * class.cs (Property, Indexer): Allow extern modifier in there. 
18073
18074         * typemanager.cs (InitBaseTypes): Initializes object_type and
18075         value_type, since those will be used early on during the bootstrap
18076         process to compile corlib.
18077
18078         (InitCoreTypes): Move code from here to InitBaseTypes.
18079
18080 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18081
18082         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18083         single-dimension arrays as using the ldlen opcode.  
18084
18085         Daniel Lewis discovered this optimization.  
18086
18087         * typemanager.cs: Add signature for System.Array::get_Length
18088
18089 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18090
18091         * statement.cs: report the error when the foreach does not apply to an
18092         array nor a collection.
18093
18094 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18095
18096         * expression.cs: Add implicit conversions to the operator ~.
18097
18098         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18099
18100         * typemanager.cs: Locate the decimal constructor.
18101
18102 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18103
18104         * attribute.cs: use the new property of TypeOf.
18105         * expression.cs: added 'get' property around typearg.
18106
18107         These changes fix a build breaker reported by NickD. Is this the
18108         correct way to fix?  If not, please, revert my changes and make it
18109         work :-).
18110
18111 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18112
18113         * attribute.cs: Add support for typeof in attribute invocations.
18114         I am not sure that this is right though.
18115
18116 2002-04-14  Duncan Mak  <duncan@ximian.com>
18117
18118         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18119         Binary.Operator.Division case.
18120
18121 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18122
18123         * class.cs (DefineType): Ensure that we do a proper check on
18124         attribute types and also register it with the TypeManager.
18125
18126         (TypeContainer.Targets): The default for attribute types is
18127         AttributeTargets.All.
18128
18129         * attribute.cs (ApplyAttributes): Registering the attribute type
18130         is done elsewhere, not when we discover we have a Usage attribute.
18131
18132 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18133
18134         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18135         and get rid of is_delegate parameter.
18136
18137         * everywhere : update.
18138
18139 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18140
18141         * cs-parser.jay (compilation_unit): Revamp completely to use
18142         some new ideas that I got from Rhys' grammar to solve the problems
18143         with assembly level attributes.
18144
18145         (outer_declaration): New grammar production.
18146
18147         (attribute_sections): Add.
18148
18149         (opt_attributes): Base on attribute_sections
18150
18151         (namespace_declaration): Allow opt_attributes to tackle the case
18152         when we have assembly level attributes - we are clever in this
18153         regard now ;-)
18154
18155         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18156         attributes in the non-global context.
18157
18158         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18159         instead of SetGlobalAttributes.
18160
18161         * class.cs, rootcontext.cs : Ensure we define and generate 
18162         attribute types before anything else.
18163
18164         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18165         and flag the new error -20 for the case when the attribute type
18166         does not have valid targets specified. csc does not catch this.
18167
18168         * ../errors/errors.txt : update for error # -20
18169
18170 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18171
18172         * support.cs (InternalParameters.ParameterModifier): Do some null
18173         checking and return sane values.
18174
18175         * class.cs (Method.Define): If we are a PInvoke method, ensure
18176         that we are static and extern. Report error # 601
18177
18178         * ../errors/cs0601.cs : Add test case for the above error.
18179
18180 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18181
18182         * rootcontext.cs (attribute_types): We need to keep type of
18183         all attribute types separately and emit code for them first.
18184
18185         (RegisterAttribute) : Implement.
18186
18187         * class.cs (DefineType): Check if the current Type is a custom
18188         attribute type and register it accordingly.
18189
18190         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18191         adding the first attribute twice and rename to
18192
18193         (SetGlobalAttributes): this.
18194
18195         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18196         lookups.
18197
18198         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18199         if we are processing global arguments. Hmm, I am unsure of this.
18200
18201 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18202
18203         * expression.cs: added static array of strings to avoid calling
18204         Enum.ToString () for Operator in Binary. Significant recover of
18205         performance.
18206
18207 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18208
18209         * class.cs (FindMembers): Allow the Builders of the various
18210         members to be null.  If they are skip them.  This only happens
18211         during the PInvoke declaration.
18212
18213 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18214
18215         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18216         failure, so we do not keep going afterwards.
18217
18218         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18219         wanted to pass `false' as the `is_delegate' argument.  If this is
18220         the case, why not use delegate_type == null to mean `is_delegate =
18221         false' and anything else as is_delegate = true.
18222
18223 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18224
18225         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18226         code for the section, not the beginning of the tests.
18227
18228 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18229
18230         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18231
18232         * expression.cs (Binary): same.  Warn about errors where we have
18233         Enum/Enum in operator + as well.
18234
18235 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18236
18237         * statement.cs:
18238                 - added support for switch(bool)
18239                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18240                 - add TableSwitchEmit() to handle table-based switch statements
18241
18242 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18243
18244         * expression.cs (Invocation.OverloadResolve): Factor out code which
18245         does parameter compatibility checking with arguments so that we can 
18246         re-use the code even from Delegate.VerifyApplicability
18247
18248         (VerifyArgumentsCompat): Move above code here.
18249
18250         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18251         and instead make a call to the above method.
18252
18253 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18254
18255         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18256         We use it to keep track of classes which are attribute types.
18257
18258 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18259
18260         * delegate.cs (Delegate.Define): Correctly define the types in the
18261         presence of fixed and array parameters.
18262
18263         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18264         doing FindMembers.
18265
18266         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18267         include NonPublic after the first iteration.
18268
18269         * class.cs (Indexer.CheckBase): Only check if both parents are
18270         non-null. 
18271
18272         * cs-parser.jay (accessor_body): If empty, set to null.
18273
18274         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18275         same code path here to resolve constants names that we did have in
18276         MemberAccess.DoResolve.  There is too much code duplicated here.
18277
18278 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18281
18282         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18283         to MakeUnionSet.
18284
18285         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18286         tokens, numbers and strings.
18287
18288         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18289         parenthesis.
18290
18291         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18292         asyncronous parameters and the regular parameters.  
18293
18294         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18295         specify the target directory.
18296
18297         * expression.cs: (This.DoResolve): Simplify
18298         (As.Emit): Optimize, do not generate IsInst if the expression is
18299         always of the given type.
18300
18301         (Is.DoResolve): Bug fix, we were reporting both always/never for
18302         the is expression.
18303
18304         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18305         creating too many unnecessary arrays.
18306
18307 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18310         fields instead of rolling our own initializer.   Takes care of all
18311         implicit conversions, and drops unnecessary static checks/argument.
18312
18313 2002-03-31  Dick Porter  <dick@ximian.com>
18314
18315         * driver.cs: use the GetDirectories() return values properly, and
18316         use "/" as path separator.
18317
18318 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18319
18320         * expression.cs (Unary): Optimize - - expr into expr.
18321         (Binary): Optimize a + (-b) into a -b.
18322
18323         * codegen.cs (CodeGen): Made all methods static.
18324
18325 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18326
18327         * rootcontext.cs: 
18328
18329         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18330         TypeBuilder property.
18331
18332         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18333         instead. 
18334
18335         * tree.cs: Removed the various RecordXXXX, and replaced with a
18336         single RecordDecl.  Removed all the accessor methods, and just
18337         left a single access point Type 
18338
18339         * enum.cs: Rename DefineEnum to DefineType.
18340
18341         * decl.cs: New abstract method `DefineType' used to unify the
18342         Defines for Enumerations, Interfaces, TypeContainers and
18343         Delegates.
18344
18345         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18346         LookupBaseClasses method that used to live in class.cs and
18347         interface.cs here, and renamed to FindType.
18348
18349         * delegate.cs: Implement DefineType.  Take advantage of the
18350         refactored pattern for locating the parent builder without taking
18351         the parent_builder argument (which we know does not work if we are
18352         nested, and triggering a toplevel definition).
18353
18354 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18355
18356         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18357         accessibility of a member has changed during override and report
18358         an error if so.
18359
18360         * class.cs (Method.Define, Property.Define): Only complain on
18361         overrides if the method is private, any other accessibility is
18362         fine (and since we just checked the permission is the same, we are
18363         good to go).
18364
18365         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18366         and elif are processed always.  The other pre-processing
18367         directives are only processed if we are "taking" the path
18368
18369 2002-03-29  Martin Baulig  <martin@gnome.org>
18370
18371         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18372         current location is not Null.
18373
18374         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18375         a separate method so we can profile it.
18376
18377         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18378         `span.Seconds' are just seconds, but no minutes or hours.
18379         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18380
18381 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18382
18383         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18384         Remove the gratuitous set of Final:
18385
18386                                 // If an interface implementation, then we can set Final.
18387                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18388                                     implementing.DeclaringType.IsInterface)
18389                                         flags |= MethodAttributes.Final;
18390
18391         I do not know what I was smoking when I used that.
18392
18393
18394         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18395         step into fixing the name resolution issues for delegates and
18396         unifying the toplevel name resolution.
18397
18398 2002-03-28  Martin Baulig  <martin@gnome.org>
18399
18400         * class.cs (Method.Emit): If we have a symbol writer, call its
18401         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18402         tell it about the current method.
18403
18404         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18405         writer that we're going to emit the first byte of IL code for a new
18406         statement (a new source line).
18407         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18408         EmitContext.Mark() before emitting any code.
18409
18410         * location.cs (SymbolDocument): Return null when we're Null.
18411
18412         * statement.cs (Statement): Moved the `Location loc' variable here.
18413         (Statement.EmitBoolExpression): If we have a symbol writer, call
18414         ec.Mark() before emitting any code to tell it that we're at the
18415         beginning of a new statement.
18416         (StatementExpression): Added `Location' argument to the constructor.
18417         (Block): Added public readonly variable `StartLocation' and public
18418         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18419         (Block): Added constructor which takes a start and end location.
18420         (Block.SetEndLocation): New method. This sets the end location.
18421         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18422         local variables we create.
18423         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18424         each statement and do also mark the begin and end of the block.
18425
18426         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18427         tell it the current lexer.Location, use Location.Null for the end of the
18428         block.
18429         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18430         current block, set its end location using SetEndLocation().
18431         (statement_expression): StatementExpression constructor now takes the
18432         lexer.Location as additional argument.
18433         (for_statement, declare_local_variables): Likewise.
18434         (declare_local_variables): When creating a new implicit block, use the
18435         new Block constructor and pass it the lexer.Location.
18436
18437 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18440         members also on the parent interfaces recursively.
18441
18442 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18443
18444         * report.cs: Use new formats, since Gonzalo finished the missing
18445         bits. 
18446
18447         * expression.cs (Binary.ResolveOperator): added missing operator|
18448         operator& and operator^ for bool/bool.
18449
18450         * cs-parser.jay: CheckDef now takes a Location argument that is
18451         used to report errors more precisly (instead of reporting the end
18452         of a definition, we try to track something which is a lot closer
18453         to the source of the problem).
18454
18455         * cs-tokenizer.cs: Track global token use, so we can properly flag
18456         the use of #define/#undef after the first token has been seen.
18457
18458         Also, rename the reportXXXX to Error_DescriptiveName
18459
18460         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18461         TypeContainer, so that Enum and Interface can use this too.
18462
18463         * class.cs (TypeContainer.LookupInterfaceOrClass,
18464         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18465         `builder' argument.  Typically this was used to pass the parent
18466         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18467         the definition).  
18468
18469         The problem is that a nested class could trigger the definition of
18470         a toplevel class, and the builder would be obviously wrong in that
18471         case. 
18472
18473         So we drop this argument, and we compute dynamically the
18474         TypeBuilder/ModuleBuilder (the correct information was available
18475         to us anyways from DeclSpace.Parent)
18476
18477         * interface.cs (Interface.DefineInterface): Drop builder
18478         parameter cleanup like class.cs
18479
18480         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18481         like class.cs
18482
18483         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18484         values. 
18485
18486         (Try.Emit): Propagate the returns value from the statement.
18487
18488         (Return.Emit): Even if we are leavning 
18489
18490         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18491
18492         * modifiers.cs: Fix the computation of MethodAttributes flags.
18493
18494 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18495
18496         * driver.cs: allow compilation of files that start with '/'.
18497         Add a default case when checking the argument of --target.
18498
18499 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18500
18501         * interface.cs: Implement the same search algorithm for types in
18502         the interface code.
18503
18504         * delegate.cs: Do not allow multiple definition.
18505
18506         * Recovered ChangeLog that got accidentally amputated
18507
18508         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18509
18510         * rootcontext.cs: Load manually enum to allow core classes to
18511         contain enumerations.
18512
18513         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18514         Update to new static methods in TypeManager.
18515
18516         * typemanager.cs (GetMethod, GetConstructor): Use our
18517         implementation of FindMembers to find the members, since during
18518         corlib compilation, the types are TypeBuilders and GetMethod and
18519         GetConstructor do not work.
18520
18521         Make all methods in TypeManager static.
18522
18523         (InitCodeHelpers): Split the functionality from
18524         the InitCodeTypes function.
18525
18526         * driver.cs: Call InitCodeHelpers after we have populated the
18527         types. 
18528
18529         * cs-parser.jay (delegate_declaration): we did not used to compute
18530         the delegate name correctly for void delegates.
18531
18532 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18533
18534         * rootcontext.cs (RootContext): Init the interface_resolve_order
18535         and type_container_resolve_order always.
18536
18537         (ResolveCore, BootstrapCorlib_ResolveClass,
18538         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18539         compiler when compiling with --nostdlib
18540
18541         * class.cs (TypeContainer.DefineType): Check that our parent is
18542         not null.  This test is most important when we are bootstraping
18543         the core types.
18544
18545         * codegen.cs: Split out the symbol writing code.
18546
18547 2002-03-25  Martin Baulig  <martin@gnome.org>
18548
18549         * driver.cs (-g): Made -g an alias for --debug.
18550
18551 2002-03-24  Martin Baulig  <martin@gnome.org>
18552
18553         * codegen.cs (SymbolWriter): New public variable. Returns the
18554         current symbol writer.
18555         (CodeGen): Added `bool want_debugging_support' argument to the
18556          constructor. If true, tell the ModuleBuild that we want debugging
18557         support and ask it for the ISymbolWriter.
18558         (Save): If we have a symbol writer, call it's Close() method after
18559         saving the assembly.
18560
18561         * driver.c (--debug): New command line argument to create a
18562         debugger information file.
18563
18564         * location.cs (SymbolDocument): New public property. Returns an
18565         ISymbolDocumentWriter object for the current source file or null
18566         if we don't have a symbol writer.
18567
18568 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18569
18570         * driver.cs (LoadAssembly): Correctly return when all the paths
18571         have been tried and not before.
18572
18573         * statement.cs (Switch.Emit): return the actual coverage for this
18574         statement (returns/not-returns)
18575
18576         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18577         switch of the statement if we are the last switch section.  That
18578         kills two problems: try/catch problems (we used to emit an empty
18579         nop at the end) and switch statements where all branches would
18580         return. 
18581
18582 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * driver.cs: Add default assemblies (the equivalent to the
18585         Microsoft CSC.RSP file)
18586
18587         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18588         also update tokens_seen and set it to false.
18589
18590         * driver.cs: Implement --recurse for Mike.
18591
18592         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18593         correctly splitting out the paths.
18594
18595 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18596
18597         * interface.cs (Interface.PopulateProperty): Instead of using
18598         `parent' as the declaration space for the set parameters, use
18599         `this' 
18600
18601         * support.cs (InternalParameters): InternalParameters constructor
18602         takes a DeclSpace instead of a TypeContainer.
18603
18604         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18605         types are being initialized, load the address of it before calling
18606         the function.  
18607
18608         (New): Provide a mechanism to disable the generation of local
18609         value type temporaries when the caller will be providing us with
18610         an address to store it.
18611
18612         (ArrayCreation.EmitDynamicInitializers): Use it.
18613
18614 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18615
18616         * expression.cs (Invocation.EmitArguments): Only probe for array
18617         property if there is more than one argument.  Sorry about that.
18618
18619         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18620         empty param arrays.
18621
18622         * class.cs (Method.LabelParameters): Fix incorrect code path that
18623         prevented the `ParamArrayAttribute' from being applied to the
18624         params attribute.
18625
18626 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18627
18628         * support.cs (ReflectionParameters): Correctly compute whether the
18629         last argument is a params array.  Fixes the problem with
18630         string.Split ('a')
18631
18632         * typemanager.cs: Make the assemblies array always be non-null
18633         (empty, but non-null)
18634
18635         * tree.cs (RecordDecl): New function that abstracts the recording
18636         of names.  This reports error 101, and provides a pointer to the
18637         previous declaration.  Fixes a crash in the compiler.
18638
18639         * cs-parser.jay (constructor_declaration): Update to new grammar,
18640         and provide a constructor_body that can be empty.
18641
18642 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * driver.cs: Add support for --resources.
18645
18646         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18647         Make all types for the various array helper methods be integer.
18648
18649         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18650         CheckState to ConvCast.
18651
18652         (ConvCast): Now it takes a `checked' state argument, to avoid
18653         depending on the emit context for the conversion, and just using
18654         the resolve time setting.
18655
18656         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18657         instead of Invocation.EmitArguments.  We do not emit the original
18658         arguments, instead we emit those which have been converted to
18659         unsigned int expressions.
18660
18661         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18662
18663         * codegen.cs: ditto.
18664
18665         * expression.cs (LocalVariableReference): Drop the use of the
18666         Store function that depended on the variable index.
18667
18668         * statement.cs (VariableInfo): Drop the `Idx' property from this
18669         class, as this is not taking into account the indexes for
18670         temporaries tat we generate during the execution, getting the
18671         indexes wrong.
18672
18673         * class.cs: First emit class initializers, then call the parent
18674         constructor. 
18675
18676         * expression.cs (Binary): Fix opcode emision.
18677         (UnaryMutator.EmitCode): Support checked code generation
18678
18679         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18680         matches for events for both the Static and Instance scans,
18681         pointing to the same element.   Fix that.
18682
18683 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18684
18685         * rootcontext.cs (ResolveTree): Always set the
18686         interface_resolve_order, because nested interfaces will be calling
18687         into us.
18688
18689         * class.cs (GetInterfaceOrClass): Track the same resolution
18690         process used by TypeManager.LookupType.  This fixes the nested
18691         type lookups in class declarations (separate path from
18692         LookupType). 
18693
18694         (TypeContainer.DefineType): Also define nested interfaces.
18695         (TypeContainer.RegisterOrder): New public function used to
18696         register the order in which child interfaces need to be closed.
18697
18698         Nested interfaces need to be closed after their parents have been
18699         created. 
18700
18701         * interface.cs (InterfaceAttr): Put all the logic for computing
18702         the interface attribute here. 
18703
18704         (DefineInterface): Register our interface order with the
18705         RootContext or with the TypeContainer depending on the case.
18706
18707 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * cs-parser.jay: rework foreach statement to work with the new
18710         changes to the policy on SimpleNames.
18711
18712         * report.cs: support Stacktrace on warnings as well.
18713
18714         * makefile: drop --unsafe and /unsafe from the compile.
18715
18716 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18717
18718         * ecore.cs (StandardConversionExists): Modify to take an Expression
18719         as the first parameter. Ensure we do null -> reference type conversion
18720         checking.
18721
18722         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18723         temporary Expression objects.
18724
18725 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18726
18727         * interface.cs: workaround bug in method overloading resolution
18728         (there is already a bugzilla bug for it).
18729
18730 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18731
18732         We could also solve this problem by having a separate path for
18733         performing type lookups, instead of DoResolve, we could have a
18734         ResolveType entry point, and only participating pieces of the
18735         production (simplename, deref, array) would implement this. 
18736
18737         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18738         signal SimpleName to only resolve type names and not attempt to
18739         resolve anything else.
18740
18741         * expression.cs (Cast): Set the flag.
18742
18743         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18744
18745         * class.cs: Only report 108 if there is no `new' modifier.
18746
18747         * cs-parser.jay: rework foreach statement to work with the new
18748         changes to the policy on SimpleNames.
18749
18750         * report.cs: support Stacktrace on warnings as well.
18751
18752         * makefile: drop --unsafe and /unsafe from the compile.
18753
18754 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18757         lookups here, instead of doing that at parse time.  This means
18758         that our grammar will not introduce `LocalVariableReferences' as
18759         expressions at this point.  That solves the problem of code like
18760         this:
18761
18762         class X {
18763            static void Main ()
18764            { int X = 1;
18765             { X x = null }}}
18766
18767         This is only half the fix.  The full fix requires parameters to
18768         also be handled in this way.
18769
18770         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18771         makes the use more obvious of the DeclSpace.  The
18772         ec.TypeContainer.TypeBuilder is now only used to pull the
18773         TypeBuilder for it.
18774
18775         My theory is that I can get rid of the TypeBuilder completely from
18776         the EmitContext, and have typecasts where it is used (from
18777         DeclSpace to where it matters).  
18778
18779         The only pending problem is that the code that implements Aliases
18780         is on TypeContainer, and probably should go in DeclSpace.
18781
18782         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18783         lookups here, instead of doing that at parse time.  This means
18784         that our grammar will not introduce `LocalVariableReferences' as
18785         expressions at this point.  That solves the problem of code like
18786         this:
18787
18788         class X {
18789            static void Main ()
18790            { int X = 1;
18791             { X x = null }}}
18792
18793         This is only half the fix.  The full fix requires parameters to
18794         also be handled in this way.
18795
18796         * class.cs (Property.DefineMethod): When implementing an interface
18797         method, set newslot, when implementing an abstract method, do not
18798         set the flag (before we tried never setting it, or always setting
18799         it, which is the difference).
18800         (Indexer.DefineMethod): same.
18801         (Method.DefineMethod): same.
18802
18803         * ecore.cs: Only set the status used flag if we get back a Field.
18804
18805         * attribute.cs: Temporary hack, so Paolo can keep working.
18806
18807 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18808
18809         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18810         the unmanaged type in the case we have a MarshalAs attribute.
18811
18812         (Resolve): Handle the case when we are parsing the special MarshalAs
18813         attribute [we need to store the unmanaged type to use later]
18814
18815         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18816         MarshalAs Attribute.
18817
18818         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18819         on parameters and accordingly set the marshalling info.
18820
18821 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18822
18823         * class.cs: Optimizing slightly by removing redundant code after
18824         we switched to the `NoTypes' return value.
18825         (Property.DefineMethod): use NoTypes here too.
18826
18827         This fixes the bug I introduced in my last batch of changes.
18828
18829 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18830
18831         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18832
18833         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18834         Enums since those are types too. 
18835
18836         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18837
18838         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18839         thanks to a call during the lookup process.
18840
18841 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * statement.cs (Foreach): Lots of work to accomodate a particular
18844         kind of foreach statement that I had not kept in mind.  It is
18845         possible to have foreachs on classes that provide a GetEnumerator
18846         method that return objects that implement the "pattern" for using
18847         a foreach, there is no need to support GetEnumerator
18848         specifically. 
18849
18850         This is needed to compile nant.
18851
18852         * decl.cs: Only report 114 if the member is not `Finalize' and if
18853         the warning level is at least 2.
18854
18855         * class.cs: Moved the compare function from Method to
18856         MethodSignature. 
18857
18858         (MethodSignature.InheritableMemberSignatureCompare): Add new
18859         filter function that is used to extract inheritable methods from a
18860         class. 
18861
18862         (Method.Define): Use the new `inheritable_method_signature_filter'
18863         delegate
18864
18865         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18866         command. 
18867
18868 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18869
18870         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18871
18872         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18873
18874         * expression.cs: Pass location information to
18875         ConvertImplicitStandard. 
18876
18877         * class.cs: Added debugging code to track return values from
18878         interfaces. 
18879
18880 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * expression.cs (Is.DoResolve): If either side of the `is' is an
18883         interface, do not flag the warning.
18884
18885         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18886         for interfaces
18887
18888         * report.cs: Allow for --fatal to be used with --probe.
18889
18890         * typemanager.cs (NoTypes): Move the definition for the empty Type
18891         array here. 
18892
18893         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18894         properties. 
18895         (TypeContainer.DefineProxy): New function used to proxy to parent
18896         implementations when implementing interfaces.
18897         (TypeContainer.ParentImplements): used to lookup if our parent
18898         implements a public function that is required by an interface.
18899         (TypeContainer.VerifyPendingMethods): Hook this up.
18900
18901         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18902         `modules' and `assemblies' arraylists into arrays.  We only grow
18903         these are the very early start up of the program, so this improves
18904         the speedof LookupType (nicely measured).
18905
18906         * expression.cs (MakeByteBlob): Replaced unsafe code with
18907         BitConverter, as suggested by Paolo.
18908
18909         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18910         folding of string concatenation, but if either side is a string,
18911         and the other is not, then return null, and let the runtime use
18912         the concatenation on the string plus the object (using
18913         `Object.ToString'). 
18914
18915 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18916
18917         Constant Folding has been implemented now.
18918
18919         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18920         the error instead on types that are not supported in one's
18921         complement. 
18922
18923         * constant.cs (Constant and all children): New set of functions to
18924         perform implict and explicit conversions.
18925
18926         * ecore.cs (EnumConstant): Implement the new functions to perform
18927         conversion by proxying to the child expression.
18928
18929         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18930         own separate setting that can not be turned off from the command
18931         line using --unchecked or --checked and is only controlled using
18932         the checked/unchecked statements and expressions.  This setting is
18933         used by the constant folder to flag errors.
18934
18935         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18936         ConstantCheckState as well.   
18937
18938         During Resolve, they also have to flag the state, because the
18939         constant folder runs completely in the Resolve phase.
18940
18941         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18942         well.
18943
18944 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18945
18946         * cfold.cs: New file, this file contains the constant folder.
18947
18948         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18949         argument to track whether we are using the resulting address to
18950         load or store a value and provide better error messages. 
18951
18952         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18953         new AddressOf arguments.
18954
18955         * statement.cs (Foreach.EmitCollectionForeach): Update
18956
18957         * expression.cs (Argument.Emit): Call AddressOf with proper
18958         arguments to track usage.
18959
18960         (New.DoEmit): Call AddressOf with new arguments.
18961
18962         (Unary.Emit): Adjust AddressOf call.
18963
18964 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18965
18966         * cs-parser.jay (member_access): Change the case for pre-defined types
18967         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18968         this suggestion.
18969
18970         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18971         a method body.
18972
18973         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18974         essentially like methods and apply attributes like MethodImplOptions to them too.
18975
18976         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18977         not being null.
18978
18979         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18980         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18981         is the DeclSpace.
18982
18983         * Update code everywhere accordingly.
18984
18985         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18986
18987         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18988
18989 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18990
18991         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18992         try performing lookups against those instead of jumping straight into using
18993         the 'using' clauses.
18994
18995         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18996
18997         (LookupType): Perform lookups in implicit parents too.
18998
18999         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19000         sequence as RootContext.LookupType. 
19001
19002         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19003         the various cases of namespace lookups into this method.
19004
19005 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19006
19007         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19008         in positional arguments)
19009
19010         * class.cs (Operator): Update the AllowedModifiers to contain
19011         extern. 
19012
19013         * cs-parser.jay: Update operator declaration to allow for the
19014         operator body to be empty.
19015
19016         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19017         values. 
19018
19019 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19020
19021         * class.cs (Method.Emit): Label parameters.
19022
19023         * driver.cs: Return 1 or 0 as the program exit code.
19024
19025 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * expression.cs: Special case the `null' object when trying to
19028         auto-compute the type, as anything can be explicitly converted to
19029         that. 
19030
19031         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19032         spotting this Paolo.
19033
19034         (Expression.ImplicitNumericConversion): Perform comparissions of
19035         the type using the underlying type in the case of an enumeration
19036         rather than using the enumeration type for the compare.
19037
19038         Cope with the underlying == type case, which is not possible to
19039         catch before. 
19040
19041         (Expression.ConvertNumericExplicit): Perform comparissions of
19042         the type using the underlying type in the case of an enumeration
19043         rather than using the enumeration type for the compare.
19044
19045         * driver.cs: If the user does not supply an extension, assume .exe
19046
19047         * cs-parser.jay (if_statement): Rewrote so that we can track the
19048         location for the if statement.
19049
19050         * expression.cs (Binary.ConstantFold): Only concat strings when
19051         the operation is "+", not everything ;-)
19052
19053         * statement.cs (Statement.EmitBoolExpression): Take a location
19054         argument. 
19055         (If, While, Do): Track location.
19056
19057         * expression.cs (Binary.ResolveOperator): In the object + string
19058         case, I was missing a call to ConvertImplicit
19059
19060 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19061
19062         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19063         Location arguments. Ensure we use RootContext.LookupType to do our work
19064         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19065
19066         * interface.cs (PopulateMethod): Handle the type of the parameter being
19067         null gracefully.
19068
19069         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19070         have a params method with no fixed arguments and a call is made with no
19071         arguments.
19072
19073 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19076         the verbatim-string-literal
19077
19078         * support.cs (InternalParameters.ParameterModifier): handle null
19079         fixed parameters.
19080         (InternalParameters.ParameterType): ditto.
19081
19082         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19083         duplicating the name of the variable parameter.
19084         (GetParameterByName): Fix bug where we were not looking up array
19085         paramters if they were the only present (thanks Paolo!).
19086         (GetParameterInfo): We only have an empty set of types if both
19087         fixed and array are set to null.
19088         (GetParameterInfo-idx): Handle FixedParameter == null
19089
19090         * cs-parser.jay: Handle the case where there is no catch
19091         statements (missing null test).
19092
19093 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * driver.cs (MainDriver): Be conservative on our command line
19096         handling.
19097
19098         Catch DirectoryNotFoundException when calling GetFiles.
19099
19100         (SplitPathAndPattern): Used to split the input specification into
19101         a path and a pattern that we can feed to Directory.GetFiles.
19102
19103 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19104
19105         * statement.cs (Fixed): Implement the last case of the Fixed
19106         statement (string handling).
19107
19108         * expression.cs (StringPtr): New class used to return a char * to
19109         a string;  Used by the Fixed statement.
19110
19111         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19112
19113         * expression.cs (Binary.ResolveOperator): Remove redundant
19114         MemberLookup pn parent type.
19115         Optimize union call, we do not need a union if the types are the same.
19116         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19117         type.
19118
19119         Specialize the use of MemberLookup everywhere, instead of using
19120         the default settings. 
19121
19122         (StackAlloc): Implement stackalloc keyword.
19123
19124         * cs-parser.jay: Add rule to parse stackalloc.
19125
19126         * driver.cs: Handle /h, /help, /?
19127
19128         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19129         before we supported unsafe code.
19130
19131         * makefile: add --unsafe to the self compilation of mcs.
19132
19133 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * expression.cs (PointerArithmetic): New class that is used to
19136         perform pointer arithmetic.
19137         (Binary.Resolve): Handle pointer arithmetic
19138         Handle pointer comparission.
19139         (ArrayPtr): Utility expression class that is used to take the
19140         address of an array.
19141
19142         (ElementAccess): Implement array access for pointers
19143
19144         * statement.cs (Fixed): Implement fixed statement for arrays, we
19145         are missing one more case before we are done.
19146
19147         * expression.cs (Indirection): Implement EmitAssign and set the
19148         ExprClass to Variable.  This allows pointer dereferences to be
19149         treated as variables, and to have values assigned to them.
19150
19151         * ecore.cs (Expression.StoreFromPtr): New utility function to
19152         store values dereferencing.
19153
19154 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19155
19156         * expression.cs (Binary.ResolveOperator): Ensure that we are
19157         not trying to operate on a void type - this fixes the reported
19158         bug.
19159
19160         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19161         the parent implementation is sealed.
19162
19163         * ../errors/cs0239.cs : Add.
19164
19165         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19166
19167         * typemanager.cs (unverifiable_code_type): Corresponds to 
19168         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19169         which have unsafe code in them.
19170
19171         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19172         unsafe context.
19173
19174 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19175
19176         * cs-tokenizer.cs: Add support for @"litreal strings"
19177
19178         Make tokenizer accept pre-processor directives
19179         on any column (remove the old C-like limitation). 
19180
19181         * rootcontext.cs (EmitCode): Emit any global attributes.
19182         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19183
19184         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19185
19186         * cs-parser.jay: Add support for global attributes.  
19187
19188 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * expression.cs (Indirection): New helper class.  Unary will
19191         create Indirection classes to be able to implement the
19192         IMemoryLocation interface on it.
19193
19194 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19195
19196         * cs-parser.jay (fixed_statement): reference the right statement.
19197
19198         * statement.cs (Fixed.Emit): Finish implementing the fixed
19199         statement for the &x case.
19200
19201 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19202
19203         * class.cs (Property.Define, Method.Define): Remove newslot when
19204         `implementing'.  
19205
19206         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19207         wrong.  NewSlot should only be used if the `new' keyword is present.
19208
19209         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19210         locating our system dir.  Sorry about this.
19211
19212 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19213
19214         * driver.cs (GetSystemDir): Compute correctly the location of our
19215         system assemblies.  I was using the compiler directory instead of
19216         the library directory.
19217
19218 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19219
19220         * expression.cs (BetterFunction): Put back in what Miguel commented out
19221         since it is the correct fix. The problem is elsewhere ;-)
19222
19223         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19224         parameters of the parms method are themselves compatible or not !
19225
19226         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19227         to check that a class implements an interface before saying that an implicit
19228         conversion was allowed. Use ImplementsInterface to do the checking.
19229
19230 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19231
19232         * class.cs (Method.Define): Track whether we are an explicit
19233         implementation or not.  And only call DefineMethodOverride if we
19234         are an explicit implementation.
19235
19236         (Property.DefineMethod): Ditto.
19237
19238 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19239
19240         * expression.cs (BetterFunction): Catch hideous bug which was
19241          preventing us from detecting ambiguous calls due to implicit casts i.e
19242         cs0121.
19243
19244 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19245
19246         * support.cs (Pair): Remove un-needed method.  I figured why I was
19247         getting the error in cs-parser.jay, the variable in a foreach loop
19248         is readonly, and the compiler does not really treat this as a variable.
19249
19250         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19251         instead of EQUALS in grammar.  
19252
19253         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19254
19255         * expression.cs (Unary.DoResolve): Check whether the argument is
19256         managed or not.
19257
19258 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19259
19260         * support.cs: Api for Pair to set a value.  Despite the fact that
19261         the variables are public the MS C# compiler refuses to compile
19262         code that accesses the field if the variable is part of a foreach
19263         statement. 
19264
19265         * statement.cs (Fixed): Begin implementation of the fixed
19266         statement.
19267
19268         (Block.AddVariable): Return the VariableInfo on success and null
19269         on failure instead of true/false. 
19270
19271         * cs-parser.jay (foreach): Catch errors on variables already
19272         defined (we were ignoring this value before) and properly unwind
19273         the block hierarchy
19274
19275         (fixed_statement): grammar for the fixed statement.
19276
19277 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19280         pointer types to be incretemented.
19281
19282         (SizeOf): Implement.
19283
19284         * cs-parser.jay (pointer_member_access): Implement
19285         expr->IDENTIFIER production.
19286
19287         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19288         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19289         on safe contexts.
19290
19291         (Unary): Implement indirection.
19292
19293         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19294         use in non-unsafe context).
19295
19296         (SimpleName.DoResolve): Check for pointers in field access on safe
19297         contexts. 
19298
19299         (Expression.LoadFromPtr): Factor the load-indirect code in this
19300         function.  This was duplicated in UnboxCast and ParameterReference
19301
19302 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19303
19304         * expression.cs (ComposedCast): report an error if a pointer cast
19305         is used in a safe region.
19306
19307         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19308         pointer type casts in unsafe context.
19309
19310         * codegen.cs (EmitContext): Set up IsUnsafe.
19311
19312         * cs-parser.jay (non_expression_type): Add productions for pointer
19313         casts. 
19314
19315         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19316         code.  We should not use force into static mode if the method is
19317         not virtual.  Fixes bug in MIS
19318
19319         * statement.cs (Do.Emit, While.Emit, For.Emit,
19320         Statement.EmitBoolExpression): Add support to Do and While to
19321         propagate infinite loop as `I do return' semantics.
19322
19323         Improve the For case to also test for boolean constants.
19324
19325         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19326         to the list of attributes we can add.
19327
19328         Remove `EmitContext' argument.
19329
19330         * class.cs (Method.Define): Apply parameter attributes.
19331         (Constructor.Define): Apply parameter attributes.
19332         (MethodCore.LabelParameters): Move here the core of labeling
19333         parameters. 
19334
19335         * support.cs (ReflectionParameters.ParameterModifier,
19336         InternalParameters.ParameterModifier): Use IsByRef on the type and
19337         only return the OUT bit for these parameters instead of in/out/ref
19338         flags.
19339
19340         This is because I miss-understood things.  The ParameterInfo.IsIn
19341         and IsOut represent whether the parameter has the [In] and [Out]
19342         attributes set.  
19343
19344 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * ecore.cs (FieldExpr.Emit): Release temporaries.
19347
19348         * assign.cs (LocalTemporary.Release): new function.
19349
19350         * codegen.cs (EmitContext.GetTemporaryStorage,
19351         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19352         temporary storage.  Now we can "put back" localbuilders when we
19353         are done with them
19354
19355 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19356
19357         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19358         need to make a copy of the variable to generate verifiable code.
19359
19360 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19361
19362         * driver.cs: Compute dynamically the system directory.
19363
19364         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19365         Slower, but more generally useful.  Used by the abstract
19366         registering implementation. 
19367
19368         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19369         the rules for the special rule on Type/instances.  First check if
19370         we have the same name, and if so, try that special static path
19371         rather than the instance path.
19372
19373 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19376         for, while and if.
19377
19378         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19379         Enum, ValueType, Delegate or Array for non-corlib compiles.
19380
19381         * cs-tokenizer.cs: Catch long identifiers (645)
19382
19383         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19384         piece of code.
19385
19386         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19387         fix, we were returning too early, so we were not registering
19388         pending methods from abstract classes.
19389
19390         Do not register pending methods if the class is abstract.
19391
19392         * expression.cs (Conditional.DoResolve): Report circular implicit
19393         conversions when we neecd to compute it for conditional
19394         expressions. 
19395
19396         (Is.DoResolve): If the expression is always of the provided type,
19397         flag warning 183.  If the expression can not ever be of the
19398         provided type flag warning 184.
19399
19400         * class.cs: Catch 169 as well.
19401
19402         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19403         read. 
19404
19405 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19406
19407         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19408
19409 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19410
19411         * interface.cs: (PopulateMethod): Check for pointers being defined
19412         only if the unsafe context is active.
19413         (PopulateProperty): ditto.
19414         (PopulateIndexer): ditto.
19415
19416         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19417         specified.  If pointers are present, make sure that they are
19418         present in an unsafe context.
19419         (Constructor, Constructor.Define): ditto.
19420         (Field, Field.Define): ditto.
19421         (Property, Property.Define): ditto.
19422         (Event, Event.Define): ditto.
19423
19424         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19425         hashtable if there are classes or structs defined.
19426
19427         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19428         code, as the constant resolution moved.
19429
19430         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19431         the metadata, so we can flag error 133. 
19432
19433         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19434         pointer is being declared in an unsafe context.
19435
19436 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * modifiers.cs (Modifiers.Check): Require a Location argument.
19439         Report error 227 for Unsafe use.
19440
19441         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19442
19443         * statement.cs (For.Emit): If the test is null, then report that
19444         we do `return', as we wont reach anything afterwards.
19445
19446         (Switch.SwitchGoverningType): Track the expression that matched
19447         the conversion.
19448
19449         * driver.cs: Allow negative numbers as an error code to flag.
19450
19451         * cs-parser.jay: Handle 1551.
19452
19453         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19454
19455 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19456
19457         * cs-parser.jay: Report 1518 (type declaration can only contain
19458         class, struct, interface, enum or delegate)
19459
19460         (switch_label): Report 1523 (keywords `case' or `default' must
19461         preced code)
19462
19463         (opt_switch_sections): Report 1522 (empty switch)
19464
19465         * driver.cs: Report 1515 (response file specified multiple times)
19466         Report 1516 (Source file specified multiple times).
19467
19468         * expression.cs (Argument.Resolve): Signal 1510
19469
19470         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19471         access not allowed in static code)
19472
19473 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19474
19475         * typemanager.cs (IsPointerType): Utility method which we are going
19476         to need a lot.
19477
19478         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19479         the object type, so we take care of that.
19480
19481         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19482
19483         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19484         added to non-params parameters :-)
19485
19486         * typemanager.cs (CSharpName): Include 'void' type too. 
19487
19488         (void_ptr_type): Include in the set of core types.
19489
19490         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19491         duplicating code.
19492
19493         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19494         an unsafe context.
19495
19496         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19497         completely forgotten about it.
19498
19499 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19500
19501         * cs-parser.jay (pointer_type): Add. This begins our implementation
19502         of parsing rules for unsafe code.
19503
19504         (unsafe_statement): Implement.
19505
19506         (embedded_statement): Modify to include the above.
19507
19508         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19509
19510         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19511         if the current context is an unsafe one.
19512
19513         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19514         are handled differently, we need separate rules for them.
19515
19516         (local_variable_declaration): Update to use local_variable_pointer_type
19517         to allow variable declarations of unmanaged pointer types.
19518
19519         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19520         in unsafe contexts.
19521
19522         * ../errors/cs0214.cs : Add.
19523
19524 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19525
19526         * makefile: remove 'response' file when cleaning.
19527
19528 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19529
19530         * cs-parser.jay: Report 1524.
19531
19532 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19533
19534         * typemanager.cs (RegisterMethod): drop checking if we have
19535         registered this from here
19536
19537 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * class.cs (Method.EmitDestructor): Implement calling our base
19540         destructor. 
19541
19542         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19543         value of InFinally.
19544
19545         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19546         this routine and will wrap the call in a try/catch block.  Deal
19547         with the case.
19548
19549 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19550
19551         * ecore.cs (Expression.MemberLookup): instead of taking a
19552         parameter `same_type' that was used to tell whether we could
19553         access private members we compute our containing type from the
19554         EmitContext.
19555
19556         (FieldExpr): Added partial support for volatile fields.  This does
19557         not work for volatile fields exposed from assemblies, as I can not
19558         figure out how to extract the modreq from it.
19559
19560         Updated all the source files to use this.
19561
19562         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19563         because it is referenced by MemberLookup very often. 
19564
19565 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19566
19567         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19568         TypeBuilder.GetCustomAttributes to retrieve what we need.
19569
19570         Get rid of redundant default_member_attr_type as this is the same as
19571         default_member_type which already exists.
19572
19573         * interface.cs, attribute.cs : Update accordingly.
19574
19575 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19576
19577         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19578         work for TYpeBuilders though.  Ravi, can you please fix this?
19579
19580         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19581
19582         * expression.cs (Argument.Emit): Handle the case of ref objects
19583         being passed to ref functions;  
19584
19585         (ParameterReference.EmitLoad): Loads the content of the pointer
19586         without dereferencing.
19587
19588 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19591
19592 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19593
19594         * class.cs (Indexer.DefineMethod): Incorporate the interface
19595         type in the name of the method if we are doing explicit interface
19596         implementation.
19597
19598         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19599
19600         (BetterConversion): Fix extremely trivial bug where we were referring to
19601         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19602         again !
19603
19604         * ../errors/bug16.cs : Add although we have fixed it.
19605
19606 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * expression.cs (BaseIndexer): Begin implementation.
19609
19610         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19611
19612         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19613         production directly to remove a shift/reduce, and implement
19614         explicit interface implementation.
19615
19616         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19617         after a floating point suffix.
19618
19619         * expression.cs (DoNumericPromotions): Improved the conversion for
19620         uint/uint.  If we have a constant, we avoid doing a typecast to a
19621         larger type.
19622
19623         * class.cs (Indexer): Implement explicit interface implementation
19624         for indexers.
19625
19626 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19627
19628         * class.cs: make the default instance constructor public and hidebysig.
19629
19630 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19631
19632         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19633         so we can call it from elsewhere.
19634
19635         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19636         we emit it internally if the class has a defined indexer; otherwise the user
19637         emits it by decorating the class definition with the DefaultMemberAttribute.
19638
19639         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19640         attribute is not used on a type which defines an indexer.
19641
19642         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19643         character when we skip whitespace.
19644
19645         * ../errors/cs0646.cs : Add.
19646
19647 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19648
19649         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19650         again. 
19651
19652         * makefile: Add practical target `mcs3.exe' which builds the third
19653         generation compiler. 
19654
19655         * expression.cs (New): Fix structures constructor calling.
19656
19657         * class.cs (Property, Method, Indexer): Emit Final flag on the
19658         method if we are an interface implementation and we are not
19659         abstract. 
19660
19661         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19662         whether this property is referencing a `base' method.
19663
19664         * expression.cs (Invocation.EmitCall): take an extra argument:
19665         is_base, this is used to determine whether the `call' or
19666         `callvirt' opcode should be used.
19667
19668
19669         * delegate.cs: update EmitCall.
19670
19671         * class.cs (Method.Define): Set NewSlot for the cases where we are
19672         not implementing an interface method.
19673
19674         (Property.Define): ditto.
19675
19676 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19677
19678         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19679         'r'.  Allows mcs to parse itself fully.
19680
19681 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19682
19683         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19684         of the number of initializers that require the InitializeArray method.
19685
19686         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19687         update the above field where necessary.
19688
19689         (MakeByteBlob): Update accordingly.
19690
19691         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19692         greater than 2.
19693
19694         (EmitDynamicInitializers): Update in accordance with the new optimization.
19695
19696         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19697         same OpCode applies.
19698
19699         * cs-parser.jay : Fix some glaring errors I introduced.
19700
19701 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19702
19703         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19704         so that we can check for name clashes there too.
19705
19706         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19707         for interface indexers.
19708
19709         * interfaces.cs (Define): Emit the default member attribute.
19710
19711         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19712         variable was being referred to while setting the value ;-)
19713
19714 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19715
19716         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19717         byte-by-byte information when we know the data is zero.
19718
19719         Make the block always a multiple of 4, because
19720         DefineInitializedData has a bug.
19721
19722         * assign.cs: Fix, we should assign from the temporary, not from
19723         the source. 
19724
19725         * expression.cs (MakeByteBlob): Fix my incorrect code.
19726
19727 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19728
19729         * typemanager.cs (EnumToUnderlying): This function is used to get
19730         the underlying type from an enumeration, because it does not
19731         always work. 
19732
19733         * constant.cs: Use the I4_S form for values between -128 and 127.
19734
19735         * statement.cs (Block.LookupLabel): Looks up a label.
19736         (Block): Drop support for labeled blocks.
19737
19738         (LabeledStatement): New kind of statement that represents a label
19739         only.
19740
19741         (Goto): Finally implement this bad boy.
19742
19743         * cs-parser.jay: Update to reflect new mechanism to implement
19744         labels.
19745
19746 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19747
19748         * codegen.cs (EmitContext.This): a codegen property that keeps the
19749         a single instance of this instead of creating many different this
19750         instances. 
19751
19752         * delegate.cs (Delegate.DoResolve): Update to use the property;
19753
19754         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19755
19756         * expression.cs (BaseAccess.DoResolve): Ditto.
19757
19758 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19759
19760         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19761         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19762
19763         (InitCoreTypes): Update accordingly.
19764
19765         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19766         so we can quickly store the state.
19767
19768         (ApplyAttributes): Set the correct implementation flags
19769         for InternalCall methods.
19770
19771 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19772
19773         * expression.cs (EmitCall): if a method is not virtual, then do
19774         not use callvirt on it.
19775
19776         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19777         user defined stuff) requires the use of stobj, which takes an
19778         address on the stack instead of an array and an index.  So emit
19779         the Ldelema operation for it.
19780
19781         (EmitStoreOpcode): Use stobj for valuetypes.
19782
19783         (UnaryMutator.EmitCode): Use the right 1 value depending on
19784         whether we are dealing with int64/uint64, float or doubles.
19785
19786         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19787         constructors that I implemented last night.
19788
19789         (Constructor.IsDefault): Fix to work properly for static
19790         constructors.
19791
19792         * cs-parser.jay (CheckDef): report method signature errors.
19793         Update error number 103 to be 132.
19794
19795         * decl.cs: New AdditionResult enumeration value: MethodExists.
19796         Although we do this check for methods later on in the semantic
19797         analysis, catching repeated default constructors is so easy that
19798         we catch these here. 
19799
19800         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19801         promotions code.
19802
19803         (ParameterReference.EmitAssign, Emit): handle
19804         bools as bytes.
19805
19806         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19807         (ArrayAccess.EmitStoreOpcode): ditto.
19808
19809         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19810
19811         * expression.cs (MakeByteBlob): Complete all the missing types
19812         (uint, short, ushort, byte, sbyte)
19813
19814         * class.cs: Only init instance field initializers on instance
19815         constructors. 
19816
19817         Rename `constructors' to instance_constructors. 
19818
19819         (TypeContainer.AddConstructor): Only add constructors to the list
19820         if it is not static.
19821
19822         Make sure that we handle default_static_constructor independently
19823         everywhere where we handle instance_constructors
19824
19825 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * class.cs: Do not lookup or create a base initializer for a
19828         static constructor.
19829
19830         (ConstructorInitializer.Resolve): use the proper type to lookup
19831         for constructors.
19832
19833         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19834
19835         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19836         in DeclSpace. 
19837
19838         * decl.cs: CloseType is now an virtual method, the default
19839         implementation just closes this type.
19840
19841 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19842
19843         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19844         to PreserveSig by default. Also emit HideBySig on such methods.
19845
19846         Basically, set the defaults to standard values.
19847
19848         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19849         argument, if candidate is better, it can't be worse than the best !
19850
19851         (Invocation): Re-write bits to differentiate between methods being
19852         applicable in their expanded form and their normal form - for params
19853         methods of course.
19854
19855         Get rid of use_standard everywhere as only standard conversions are allowed
19856         in overload resolution. 
19857
19858         More spec conformance.
19859
19860 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19861
19862         * driver.cs: Add --timestamp, to see where the compiler spends
19863         most of its time.
19864
19865         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19866         `this' in static code.
19867
19868         (SimpleName.DoResolve): Implement in terms of a helper function
19869         that allows static-references to be passed upstream to
19870         MemberAccess.
19871
19872         (Expression.ResolveWithSimpleName): Resolve specially simple
19873         names when called by MemberAccess to implement the special
19874         semantics. 
19875
19876         (Expression.ImplicitReferenceConversion): Handle conversions from
19877         Null to reference types before others, as Null's type is
19878         System.Object. 
19879
19880         * expression.cs (Invocation.EmitCall): Handle the special case of
19881         calling methods declared on a reference type from a ValueType
19882         (Base classes System.Object and System.Enum)
19883
19884         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19885         the left hand side is a TypeExpr, not on every enumeration. 
19886
19887         (Binary.Resolve): If types are reference types, then do a cast to
19888         object on operators != and == of both arguments.
19889
19890         * typemanager.cs (FindMembers): Extract instance and static
19891         members if requested.
19892
19893         * interface.cs (PopulateProperty): Use void_type instead of null
19894         as the return type for the setter method.
19895
19896         (PopulateIndexer): ditto.
19897
19898 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19899
19900         * support.cs (ReflectionParameters): Fix minor bug where we
19901         were examining the wrong parameter for the ParamArray attribute.
19902
19903         Cope with requests for the type of the parameter at position
19904         greater than the params parameter's. We now return the element
19905         type of the params array as that makes more sense.
19906
19907         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19908         accordingly as we no longer have to extract the element type
19909         ourselves.
19910
19911         (Invocation.OverloadResolve): Update.
19912
19913 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19914
19915         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19916         against IEnumerator, test whether the return value is a descendant
19917         of the IEnumerator interface.
19918
19919         * class.cs (Indexer.Define): Use an auxiliary method to implement
19920         the other bits of the method definition.  Begin support for
19921         explicit interface implementation.
19922
19923         (Property.DefineMethod): Use TypeManager.void_type instead of null
19924         for an empty return value.
19925
19926 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19927
19928         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19929         dealing with a FieldExpr which is composed of a FieldBuilder, in
19930         the code path we did extract the constant, but we should have
19931         obtained the underlying value to be able to cast it (otherwise we
19932         end up in an infinite loop, this is what Ravi was running into).
19933
19934         (ArrayCreation.UpdateIndices): Arrays might be empty.
19935
19936         (MemberAccess.ResolveMemberAccess): Add support for section
19937         14.5.4.1 that deals with the special case of E.I when E is a type
19938         and something else, that I can be a reference to a static member.
19939
19940         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19941         handle a particular array type to create byte blobs, it is just
19942         something we dont generate byteblobs for.
19943
19944         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19945         arguments. 
19946
19947         * location.cs (Push): remove the key from the hashtable that we
19948         are about to add.   This happens for empty files.
19949
19950         * driver.cs: Dispose files after we have parsed them.
19951
19952         (tokenize): new function that only runs the tokenizer on its
19953         input, for speed testing.
19954
19955 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19956
19957         * class.cs (Event.Define): Define the private field only if there
19958         are no accessors defined.
19959
19960         * expression.cs (ResolveMemberAccess): If there is no associated
19961         field with the event, that means we have an event defined with its
19962         own accessors and we should flag error cs0070 since transforming
19963         ourselves into a field is not valid in that case.
19964
19965         * ecore.cs (SimpleName.DoResolve): Same as above.
19966
19967         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19968         and charset to sane values.
19969
19970 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19971
19972         * assign.cs (DoResolve): Perform check on events only if they 
19973         are being accessed outside the declaring type.
19974
19975         * cs-parser.jay (event_declarations): Update rules to correctly
19976         set the type of the implicit parameter etc.
19977
19978         (add_accessor, remove_accessor): Set current local parameters.
19979
19980         * expression.cs (Binary): For delegate addition and subtraction,
19981         cast the return value from the method into the appropriate delegate
19982         type.
19983
19984 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19985
19986         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19987         of these as the workaround is unnecessary.
19988
19989         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19990         delegate data - none of that is needed at all.
19991
19992         Re-write bits to extract the instance expression and the delegate method
19993         correctly.
19994
19995         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19996         on delegates too.
19997
19998         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19999         of attaching attributes instead of duplicating code everywhere.
20000
20001         * everywhere : Update code to do attribute emission using the above method.
20002
20003 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20004
20005         * expression.cs (IsParamsMethodApplicable): if there are not
20006         parameters, return immediately.
20007
20008         * ecore.cs: The 0 literal can be implicity converted to an enum
20009         type. 
20010
20011         (SimpleName.DoResolve): First lookup the type, then lookup the
20012         members. 
20013
20014         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20015         want to get its address.  If the InstanceExpression is not
20016         addressable, store the result in a temporary variable, then get
20017         the address of it.
20018
20019         * codegen.cs: Only display 219 errors on warning level or above. 
20020
20021         * expression.cs (ArrayAccess): Make it implement the
20022         IMemoryLocation interface.
20023
20024         (Binary.DoResolve): handle the operator == (object a, object b)
20025         and operator != (object a, object b) without incurring into a
20026         BoxedCast (because 5 != o should never be performed).
20027
20028         Handle binary enumerator operators.
20029
20030         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20031         value type, otherwise use Ldelem_ref.
20032
20033         Use precomputed names;
20034
20035         (AddressOf): Implement address of
20036
20037         * cs-parser.jay (labeled_statement): Fix recursive block
20038         addition by reworking the production.
20039
20040         * expression.cs (New.DoEmit): New has a special case:
20041                 
20042                  If we are dealing with a ValueType, we have a few
20043                  situations to deal with:
20044                 
20045                     * The target of New is a ValueType variable, that is
20046                       easy, we just pass this as the variable reference
20047                 
20048                     * The target of New is being passed as an argument,
20049                       to a boxing operation or a function that takes a
20050                       ValueType.
20051                 
20052                       In this case, we need to create a temporary variable
20053                       that is the argument of New.
20054
20055
20056 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20057
20058         * rootcontext.cs (LookupType): Check that current_type is not null before
20059         going about looking at nested types.
20060
20061         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20062         not implement the IAssignMethod interface any more.
20063
20064         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20065         where we tranform them into FieldExprs if they are being resolved from within
20066         the declaring type.
20067
20068         * ecore.cs (SimpleName.DoResolve): Do the same here.
20069
20070         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20071
20072         * ../errors/bug10.cs : Add.
20073
20074         * ../errors/cs0070.cs : Add.
20075
20076         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20077
20078         * assign.cs : Get rid of EventIsLocal everywhere.
20079
20080 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * ecore.cs (ConvertIntLiteral): finished the implementation.
20083
20084         * statement.cs (SwitchLabel): Convert the value we are using as a
20085         key before looking up the table.
20086
20087 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * codegen.cs (EmitTopBlock): Require a Location argument now.
20090
20091         * cs-parser.jay (constructor_declarator): We need to setup
20092         current_local_parameters before we parse the
20093         opt_constructor_initializer, to allow the variables to be bound
20094         to the constructor arguments.
20095
20096         * rootcontext.cs (LookupType): First lookup nested classes in our
20097         class and our parents before we go looking outside our class.
20098
20099         * expression.cs (ConstantFold): Extract/debox the values at the
20100         beginnning. 
20101
20102         * rootcontext.cs (EmitCode): Resolve the constants first before we
20103         resolve the types.  This is not really needed, but it helps debugging.
20104
20105         * statement.cs: report location.
20106
20107         * cs-parser.jay: pass location to throw statement.
20108
20109         * driver.cs: Small bug fix.
20110
20111         * report.cs: Updated format to be 4-zero filled digits.
20112
20113 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20114
20115         * expression.cs (CheckIndices): Fix minor bug where the wrong
20116         variable was being referred to ;-)
20117
20118         (DoEmit): Do not call EmitStaticInitializers when the 
20119         underlying type is System.Object.
20120
20121 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20122
20123         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20124         and do the usual workaround for SRE.
20125
20126         * class.cs (MyEventBuilder.EventType): New member to get at the type
20127         of the event, quickly.
20128
20129         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20130
20131         * assign.cs (Assign.DoResolve): Handle the case when the target
20132         is an EventExpr and perform the necessary checks.
20133
20134         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20135         interface.
20136
20137         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20138
20139         (EventExpr): Set the type in the constructor itself since we 
20140         are meant to be born fully resolved.
20141
20142         (EventExpr.Define): Revert code I wrote earlier.
20143                 
20144         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20145         instance expression is null. The instance expression is a This in that case
20146         or a null, depending on whether it is a static method or not.
20147
20148         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20149         refers to more than one method.
20150
20151         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20152         and accordingly flag errors.
20153
20154 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20155
20156         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20157
20158 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20159
20160         * location.cs (ToString): Provide useful rutine.
20161
20162 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20165         objects, return the actual integral boxed.
20166
20167         * statement.cs (SwitchLabel): define an ILLabel for each
20168         SwitchLabel. 
20169
20170         (Switch.CheckSwitch): If the value is a Literal, extract
20171         the underlying literal.
20172
20173         Also in the unused hashtable we had, add the SwitchLabel so we can
20174         quickly look this value up.
20175
20176         * constant.cs: Implement a bunch of new constants.  Rewrite
20177         Literal based on this.  Made changes everywhere to adapt to this.
20178
20179         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20180         dereferencing array only once, and also copes with enumrations.
20181
20182         bytes are two bytes wide, not one.
20183
20184         (Cast): Perform constant conversions.
20185
20186         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20187         wrappers to the literals here.
20188
20189         * expression.cs (DoNumericPromotions): long literals can converted
20190         to ulong implicity (this is taken care of elsewhere, but I was
20191         missing this spot).
20192
20193         * ecore.cs (Expression.Literalize): Make the return type Literal,
20194         to improve type checking.
20195
20196         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20197
20198 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20199
20200         * literal.cs: Revert code from ravi that checked the bounds.  The
20201         bounds are sane by the definition of the type itself. 
20202
20203         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20204         need to actually look up in our parent hierarchy for interfaces
20205         implemented. 
20206
20207         * const.cs: Use the underlying type for enumerations
20208
20209         * delegate.cs: Compute the basename for the delegate creation,
20210         that should fix the delegate test case, and restore the correct
20211         Type Lookup semantics in rootcontext
20212
20213         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20214         referencing a nested type with the Reflection API is using the "+"
20215         sign. 
20216
20217         * cs-parser.jay: Do not require EOF token at the end.
20218
20219 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20220
20221         * rootcontext.cs (LookupType): Concatenate type names with
20222         a '.' instead of a '+' The test suite passes again.
20223
20224         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20225         field of the enumeration.
20226
20227         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20228         the case when the member is an EventExpr.
20229
20230         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20231         static has an associated instance expression.
20232
20233         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20234
20235         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20236
20237         * class.cs (Event.Define): Register event and perform appropriate checks
20238         for error #111.
20239
20240         We define the Add and Remove methods even if the use provides none because
20241         in that case, we provide default implementations ourselves.
20242
20243         Define a private field of the type of the event. This is done by the CSC compiler
20244         and we should be doing it too ;-)
20245
20246         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20247         More methods we use in code we generate.
20248
20249         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20250         is important.
20251
20252         (InitCoreTypes): Update accordingly for the above.
20253
20254         * class.cs (Event.Emit): Generate code for default accessors that we provide
20255
20256         (EmitDefaultMethod): Do the job in the above.
20257
20258         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20259         appropriate place.
20260
20261 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20264         builders even if we were missing one.
20265
20266         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20267         pass the Basename as our class name instead of the Name.  The
20268         basename will be correctly composed for us.
20269
20270         * parameter.cs (Paramters): Now takes a Location argument.
20271
20272         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20273         make all the code call directly LookupType in RootContext and take
20274         this chance to pass the Location information everywhere.
20275
20276         * Everywhere: pass Location information.
20277
20278 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20279
20280         * class.cs (Constructor.Define): Updated way of detecting the
20281         length of the parameters.
20282
20283         (TypeContainer.DefineType): Use basename as the type name for
20284         nested types.
20285
20286         (TypeContainer.Define): Do not recursively define types here, as
20287         definition is taken care in order by the RootContext.
20288
20289         * tree.cs: Keep track of namespaces in a per-file basis.
20290
20291         * parameter.cs (Parameter.ComputeSignature): Update to use
20292         DeclSpace. 
20293
20294         (Parameters.GetSignature): ditto.
20295
20296         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20297         instead of a TypeContainer.
20298
20299         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20300         resolve names.  Because we need to be resolve in our context, not
20301         our parents.
20302
20303         * driver.cs: Implement response files.
20304
20305         * class.cs (TypeContainer.DefineType): If we are defined, do not
20306         redefine ourselves.
20307
20308         (Event.Emit): Emit the code for add/remove handlers.
20309         (Event.Define): Save the MethodBuilders for add/remove.
20310
20311         * typemanager.cs: Use pair here too.
20312
20313         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20314         DictionaryEntry requires the first argument to be non-null.  
20315
20316         (enum_declaration): Compute full name for registering the
20317         enumeration.
20318
20319         (delegate_declaration): Instead of using
20320         formal_parameter_list, use opt_formal_parameter_list as the list
20321         can be empty.
20322
20323         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20324         (EventParsing): New property that controls whether `add' and
20325         `remove' are returned as tokens or identifiers (for events);
20326
20327 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20328
20329         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20330         use MyEventBuilder only and let it wrap the real builder for us.
20331
20332         (MyEventBuilder): Revamp constructor etc.
20333
20334         Implement all operations that we perform on EventBuilder in precisely the same
20335         way here too.
20336
20337         (FindMembers): Update to use the EventBuilder member.
20338
20339         (Event.Emit): Update accordingly.
20340
20341 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20342
20343         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20344         by calling the appropriate methods.
20345
20346         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20347         useful.
20348
20349         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20350
20351 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20352
20353         * delegate.cs (Delegate.Populate): Check that the return type
20354         and various parameters types are indeed accessible.
20355
20356         * class.cs (Constructor.Define): Same here.
20357
20358         (Field.Define): Ditto.
20359
20360         (Event.Define): Ditto.
20361
20362         (Operator.Define): Check that the underlying Method defined itself
20363         correctly - so it's MethodBuilder should not be null.
20364
20365         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20366         expression happens to be null.
20367
20368         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20369         members but as of now we don't seem to be able to do anything really useful with it.
20370
20371         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20372         not the EventBuilder.
20373
20374 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20375
20376         * cs-tokenizer.cs: Add support for defines.
20377         Add support for #if, #elif, #else, #endif
20378
20379         (eval_var): evaluates a variable.
20380         (eval): stubbed for evaluating functions.
20381
20382         * cs-parser.jay: Pass the defines information
20383
20384         * driver.cs: Add --define command line option.
20385
20386         * decl.cs: Move MemberCore here.
20387
20388         Make it the base class for DeclSpace.  This allows us to catch and
20389         report 108 and 109 for everything now.
20390
20391         * class.cs (TypeContainer.Define): Extract all the members
20392         before populating and emit the warning 108 (new keyword required
20393         to override) instead of having each member implement this.
20394
20395         (MemberCore.Define): New abstract method, we will be using this in
20396         the warning reporting engine in Populate.
20397
20398         (Operator.Define): Adjust to new MemberCore protocol. 
20399
20400         * const.cs (Const): This does not derive from Expression, it is a
20401         temporary object we use to create fields, it is a MemberCore. 
20402
20403         * class.cs (Method.Define): Allow the entry point to be in a
20404         specific class.
20405
20406         * driver.cs: Rewrite the argument handler to clean it up a bit.
20407
20408         * rootcontext.cs: Made it just an auxiliary namespace feature by
20409         making everything static.
20410
20411         * driver.cs: Adapt code to use RootContext type name instead of
20412         instance variable.
20413
20414         * delegate.cs: Remove RootContext argument.
20415
20416         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20417         argument. 
20418
20419         * class.cs (Event.Define): The lookup can fail.
20420
20421         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20422
20423         * expression.cs: Resolve the this instance before invoking the code.
20424
20425 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20426
20427         * cs-parser.jay: Add a production in element_access that allows
20428         the thing to become a "type" reference.  This way we can parse
20429         things like "(string [])" as a type.
20430
20431         Note that this still does not handle the more complex rules of
20432         casts. 
20433
20434
20435         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20436
20437         * ecore.cs: (CopyNewMethods): new utility function used to
20438         assemble the list of methods from running FindMembers.
20439
20440         (MemberLookup): Rework FindMembers so that 
20441
20442 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20443
20444         * class.cs (TypeContainer): Remove Delegates who fail to be
20445         defined.
20446
20447         * delegate.cs (Populate): Verify that we dont get null return
20448         values.   TODO: Check for AsAccessible.
20449
20450         * cs-parser.jay: Use basename to emit error 574 (destructor should
20451         have the same name as container class), not the full name.
20452
20453         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20454         possible representation.  
20455
20456         Also implements integer type suffixes U and L.
20457
20458 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20459
20460         * expression.cs (ArrayCreation.DoResolve): We need to do the
20461         argument resolution *always*.
20462
20463         * decl.cs: Make this hold the namespace.  Hold the root context as
20464         well.
20465         (LookupType): Move here.
20466
20467         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20468
20469         * location.cs (Row, Name): Fixed the code, it was always returning
20470         references to the first file.
20471
20472         * interface.cs: Register properties defined through interfaces.
20473
20474         * driver.cs: Add support for globbing on the command line
20475
20476         * class.cs (Field): Make it derive from MemberCore as well.
20477         (Event): ditto.
20478
20479 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20480
20481         * class.cs (Event::Define): Check that the type of the event is a delegate
20482         type else flag error #66.
20483
20484         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20485         same.
20486
20487         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20488         values of EntryPoint, CharSet etc etc.
20489
20490         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20491
20492         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20493         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20494         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20495         which needs this to do its work.
20496
20497         * ../errors/cs0066.cs : Add.
20498
20499 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20500
20501         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20502         helper functions.
20503
20504         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20505         clears out the parameters field.
20506         (MemberSignatureCompare): Cleanup
20507
20508         (MemberCore): New base class used to share code between MethodCore
20509         and Property.
20510
20511         (RegisterRequiredImplementations) BindingFlags.Public requires
20512         either BindingFlags.Instace or Static.  Use instance here.
20513
20514         (Property): Refactored code to cope better with the full spec.
20515
20516         * parameter.cs (GetParameterInfo): Return an empty array instead
20517         of null on error.
20518
20519         * class.cs (Property): Abstract or extern properties have no bodies.
20520
20521         * parameter.cs (GetParameterInfo): return a zero-sized array.
20522
20523         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20524         method modifier validation to the typecontainer so we can reuse
20525         this on properties.
20526
20527         (MethodCore.ParameterTypes): return an empty sized array of types.
20528
20529         (Property.Define): Test property modifier validity.
20530
20531         Add tests for sealed/override too.
20532
20533         (Method.Emit): abstract or extern methods have no bodies.
20534
20535 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20536
20537         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20538         thing.
20539
20540         (Method::Define, ::Emit): Modify accordingly.
20541
20542         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20543
20544         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20545
20546         * makefile: Pass in /unsafe.
20547
20548 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20549
20550         * class.cs (MakeKey): Kill routine.
20551
20552         * class.cs (TypeContainer.Define): Correctly define explicit
20553         method implementations (they require the full interface name plus
20554         the method name).
20555
20556         * typemanager.cs: Deply the PtrHashtable here and stop using the
20557         lame keys.  Things work so much better.
20558
20559         This of course broke everyone who depended on `RegisterMethod' to
20560         do the `test for existance' test.  This has to be done elsewhere.
20561
20562         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20563         the object stupid Equals method (because, that like fails all over
20564         the place).  We still do not use it.
20565
20566         * class.cs (TypeContainer.SetRequiredInterface,
20567         TypeContainer.RequireMethods): Killed these two routines and moved
20568         all the functionality to RegisterRequiredImplementations.
20569
20570         (TypeContainer.RegisterRequiredImplementations): This routine now
20571         registers all the implementations required in an array for the
20572         interfaces and abstract methods.  We use an array of structures
20573         which can be computed ahead of time to reduce memory usage and we
20574         also assume that lookups are cheap as most classes will not
20575         implement too many interfaces.
20576
20577         We also avoid creating too many MethodSignatures.
20578
20579         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20580         clear the "pending" bit if we find that there are problems with
20581         the declaration.
20582
20583         (TypeContainer.VerifyPendingMethods): Update to report errors of
20584         methods that look like implementations but are not.
20585
20586         (TypeContainer.Define): Add support for explicit interface method
20587         implementation. 
20588
20589 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20590
20591         * typemanager.cs: Keep track of the parameters here instead of
20592         being a feature of the TypeContainer.
20593
20594         * class.cs: Drop the registration of parameters here, as
20595         InterfaceMethods are also interface declarations.
20596
20597         * delegate.cs: Register methods with the TypeManager not only with
20598         the TypeContainer.  This code was buggy.
20599
20600         * interface.cs: Full registation here.
20601
20602 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20603
20604         * expression.cs: Remove reducer for binary expressions, it can not
20605         be done this way.
20606
20607         * const.cs: Put here the code that used to go into constant.cs
20608
20609         * constant.cs: Put here the code for constants, this is a new base
20610         class for Literals.
20611
20612         * literal.cs: Make Literal derive from Constant.
20613
20614 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20615
20616         * statement.cs (Return.Emit): Report error 157 if the user
20617         attempts to return from a finally block.
20618
20619         (Return.Emit): Instead of emitting a return, jump to the end of
20620         the function.
20621
20622         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20623         LocalBuilder to store the result of the function.  ReturnLabel is
20624         the target where we jump.
20625
20626
20627 2001-12-09  Radek Doulik  <rodo@ximian.com>
20628
20629         * cs-parser.jay: remember alias in current namespace
20630
20631         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20632         namespaces
20633
20634         * class.cs (LookupAlias): lookup alias in my_namespace
20635
20636         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20637         aliases hashtable
20638         (LookupAlias): lookup alias in this and if needed in parent
20639         namespaces
20640
20641 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * support.cs: 
20644
20645         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20646         making things static.  I need this to avoid passing the
20647         TypeContainer when calling ParameterType.
20648
20649         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20650         that did string manipulation to compute the type and then call
20651         GetType.  Use Parameter.ParameterType instead.
20652
20653         * cs-tokenizer.cs: Consume the suffix for floating values.
20654
20655         * expression.cs (ParameterReference): figure out whether this is a
20656         reference parameter or not.  Kill an extra variable by computing
20657         the arg_idx during emission.
20658
20659         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20660         function that returns whether a parameter is an out/ref value or not.
20661
20662         (Parameter.ParameterType): The type of the parameter (base,
20663         without ref/out applied).
20664
20665         (Parameter.Resolve): Perform resolution here.
20666         (Parameter.ExternalType): The full type (with ref/out applied).
20667
20668         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20669         support for expressions on the using statement.
20670
20671 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20672
20673         * statement.cs (Using.EmitLocalVariableDecls): Split the
20674         localvariable handling of the using statement.
20675
20676         (Block.EmitMeta): Keep track of variable count across blocks.  We
20677         were reusing slots on separate branches of blocks.
20678
20679         (Try.Emit): Emit the general code block, we were not emitting it. 
20680
20681         Check the type of the declaration to be an IDisposable or
20682         something that can be implicity converted to it. 
20683
20684         Emit conversions if required.
20685
20686         * ecore.cs (EmptyExpression): New utility class.
20687         (Expression.ImplicitConversionExists): New utility function.
20688
20689 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20690
20691         * statement.cs (Using): Implement.
20692
20693         * expression.cs (LocalVariableReference): Support read only variables.
20694
20695         * statement.cs: Remove the explicit emit for the Leave opcode.
20696         (VariableInfo): Add a readonly field.
20697
20698 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20699
20700         * ecore.cs (ConvCast): new class used to encapsulate the various
20701         explicit integer conversions that works in both checked and
20702         unchecked contexts.
20703
20704         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20705         properly generate the overflow opcodes.
20706
20707 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * statement.cs: The correct type for the EmptyExpression is the
20710         element_type, not the variable type.  Ravi pointed this out.
20711
20712 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20713
20714         * class.cs (Method::Define): Handle PInvoke methods specially
20715         by using DefinePInvokeMethod instead of the usual one.
20716
20717         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20718         above to do the task of extracting information and defining the method.
20719
20720 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20721
20722         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20723         of the condition for string type.
20724
20725         (Emit): Move that here. 
20726
20727         (ArrayCreation::CheckIndices): Keep string literals in their expression
20728         form.
20729
20730         (EmitDynamicInitializers): Handle strings appropriately.
20731
20732 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20733
20734         * codegen.cs (EmitContext): Replace multiple variables with a
20735         single pointer to the current Switch statement.
20736
20737         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20738         EmitContext.
20739
20740 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20741
20742         * statement.cs 
20743
20744         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20745         default'.
20746
20747         (Foreach.Emit): Foreach on arrays was not setting
20748         up the loop variables (for break/continue).
20749
20750         (GotoCase): Semi-implented.
20751
20752 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20753
20754         * attribute.cs (CheckAttribute): Handle system attributes by using
20755         Attribute.GetAttributes to examine information we need.
20756
20757         (GetValidPlaces): Same here.
20758
20759         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20760
20761         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20762
20763         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20764
20765         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20766
20767         (Method::Emit): Handle the case when we are a PInvoke method.
20768
20769 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20770
20771         * expression.cs: Use ResolveWithSimpleName on compound names.
20772
20773 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20774
20775         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20776         before trying to reduce it.
20777
20778         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20779
20780         * constant.cs (LookupConstantValue): Implement.
20781
20782         (EmitConstant): Use the above in emitting the constant.
20783
20784         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20785         that are user-defined by doing a LookupConstantValue on them.
20786
20787         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20788         too, like above.
20789
20790 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20791
20792         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20793
20794         (BaseAccess.DoResolve): Implement.
20795
20796         (MemberAccess.DoResolve): Split this routine into a
20797         ResolveMemberAccess routine that can be used independently
20798
20799 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20800
20801         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20802         As that share bits of the implementation.  Is returns a boolean,
20803         while As returns the Type that is being probed.
20804
20805 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20806
20807         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20808         instead of a Literal - much easier.
20809
20810         (EnumInTransit): Remove - utterly useless :-)
20811
20812         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20813
20814         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20815
20816         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20817         chain when we have no associated expression.
20818
20819 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20820
20821         * constant.cs (Define): Use Location while reporting the errror.
20822
20823         Also emit a warning when 'new' is used and there is no inherited
20824         member to hide.
20825
20826         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20827         populated.
20828
20829         (LookupEnumValue): Implement to lookup an enum member's value and define it
20830         if necessary.
20831
20832         (Populate): Re-write accordingly to use the above routine.
20833
20834 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20835
20836         * expression.cs (This): Fix prototype for DoResolveLValue to
20837         override the base class DoResolveLValue.
20838
20839         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20840         declarations) 
20841
20842         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20843         (we need to load the address of the field here).  This fixes
20844         test-22. 
20845
20846         (FieldExpr.DoResolveLValue): Call the DoResolve
20847         function to initialize the Instance expression.
20848
20849         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20850         correctly the GetEnumerator operation on a value type.
20851
20852         * cs-parser.jay: Add more simple parsing error catches.
20853
20854         * statement.cs (Switch): Add support for string switches.
20855         Handle null specially.
20856
20857         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20858
20859 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20860
20861         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20862
20863         (declare_local_constant): New helper function.
20864
20865         * statement.cs (AddConstant): Keep a separate record of constants
20866
20867         (IsConstant): Implement to determine if a variable is a constant.
20868
20869         (GetConstantExpression): Implement.
20870
20871         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20872
20873         * statement.cs (IsVariableDefined): Re-write.
20874
20875 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20876
20877         * class.cs (TypeContainer::FindMembers): Look for constants
20878         in the case when we are looking for MemberTypes.Field
20879
20880         * expression.cs (MemberAccess::DoResolve): Check that in the
20881         case we are a FieldExpr and a Literal, we are not being accessed
20882         by an instance reference.
20883
20884         * cs-parser.jay (local_constant_declaration): Implement.
20885
20886         (declaration_statement): Implement for constant declarations.
20887
20888 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20889
20890         * statement.cs (Switch): Catch double defaults.
20891
20892         (Switch): More work on the switch() statement
20893         implementation.  It works for integral values now, need to finish
20894         string support.
20895
20896
20897 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20900         integer literals into other integer literals.  To be used by
20901         switch. 
20902
20903 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20904
20905         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20906         some memory.
20907
20908         (EmitDynamicInitializers): Cope with the above since we extract data
20909         directly from ArrayData now.
20910
20911         (ExpectInitializers): Keep track of whether initializers are mandatory
20912         or not.
20913
20914         (Bounds): Make it a hashtable to prevent the same dimension being 
20915         recorded for every element in that dimension.
20916
20917         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20918         from being found.
20919
20920         Also fix bug which was causing the indices to be emitted in the reverse
20921         order.
20922
20923 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20924
20925         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20926         unfinished.  They do not work, because the underlying code is
20927         sloppy.
20928
20929 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20930
20931         * cs-parser.jay: Remove bogus fixme.
20932
20933         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20934         on Switch statement.
20935
20936 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20937
20938         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20939         the same. 
20940
20941         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20942         parameter. Apparently, any expression is allowed. 
20943
20944         (ValidateInitializers): Update accordingly.
20945
20946         (CheckIndices): Fix some tricky bugs thanks to recursion.
20947
20948         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20949         I was being completely brain-dead.
20950
20951         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20952         and re-write acordingly.
20953
20954         (DelegateInvocation): Re-write accordingly.
20955
20956         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20957
20958         (MakeByteBlob): Handle types more correctly.
20959
20960         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20961         initialization from expressions but it is incomplete because I am a complete
20962         Dodo :-|
20963
20964 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20965
20966         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20967         on If.  Basically, we have to return `true' (ie, we do return to
20968         our caller) only if both branches of the if return.
20969
20970         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20971         short-circuit operators, handle them as short circuit operators. 
20972
20973         (Cast.DoResolve): Resolve type.
20974         (Cast.Cast): Take an expression as the target type.
20975
20976         * cs-parser.jay (cast_expression): Remove old hack that only
20977         allowed a limited set of types to be handled.  Now we take a
20978         unary_expression and we resolve to a type during semantic
20979         analysis.
20980
20981         Use the grammar productions from Rhys to handle casts (this is
20982         not complete like Rhys syntax yet, we fail to handle that corner
20983         case that C# has regarding (-x), but we will get there.
20984
20985 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20986
20987         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20988         field which is an array type.
20989
20990         * cs-parser.jay (declare_local_variables): Support array initialization too.
20991
20992         * typemanager.cs (MakeKey): Implement.
20993
20994         (everywhere): Use the above appropriately.
20995
20996         * cs-parser.jay (for_statement): Update for array initialization while
20997         declaring variables.
20998
20999         * ecore.cs : The error message was correct, it's the variable's names that
21000         were misleading ;-) Make the code more readable.
21001
21002         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21003         the correct type etc.
21004
21005         (ConvertExplicit): Handle Enum types by examining the underlying type.
21006
21007 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21008
21009         * parameter.cs (GetCallingConvention): Always return
21010         CallingConventions.Standard for now.
21011
21012 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21015         and `r' after calling DoNumericPromotions.
21016
21017         * ecore.cs: Fix error message (the types were in the wrong order).
21018
21019         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21020         BindingFlags.Instance as well 
21021
21022         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21023         implicit int literal conversion in an empty cast so that we
21024         propagate the right type upstream.
21025
21026         (UnboxCast): new class used to unbox value types.
21027         (Expression.ConvertExplicit): Add explicit type conversions done
21028         by unboxing.
21029
21030         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21031         the target type before applying the implicit LongLiterals to ULong
21032         literal cast.
21033
21034 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21035
21036         * cs-parser.jay (for_statement): Reworked the way For works: now
21037         we declare manually any variables that are introduced in
21038         for_initializer to solve the problem of having out-of-band code
21039         emition (that is what got for broken).
21040
21041         (declaration_statement): Perform the actual variable declaration
21042         that used to be done in local_variable_declaration here.
21043
21044         (local_variable_declaration): Do not declare anything, just pass
21045         the information on a DictionaryEntry
21046
21047 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21048
21049         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21050         re-write of the logic to now make it recursive.
21051
21052         (UpdateIndices): Re-write accordingly.
21053
21054         Store element data in a separate ArrayData list in the above methods.
21055
21056         (MakeByteBlob): Implement to dump the array data into a byte array.
21057
21058 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21059
21060         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21061         into CheckIndices.
21062
21063         * constant.cs (Define): Implement.
21064
21065         (EmitConstant): Re-write fully.
21066
21067         Pass in location info.
21068
21069         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21070         respectively.
21071
21072         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21073         DictionaryEntry since we need location info too.
21074
21075         (constant_declaration): Update accordingly.
21076
21077         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21078         code into another method : UpdateIndices.
21079
21080 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21081
21082         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21083         some type checking etc.
21084
21085 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21086
21087         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21088         bits to provide dimension info if the user skips doing that.
21089
21090         Update second constructor to store the rank correctly.
21091
21092 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21093
21094         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21095         and try to implement.
21096
21097         * ../errors/cs0150.cs : Add.
21098
21099         * ../errors/cs0178.cs : Add.
21100
21101 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21102
21103         * statement.cs: Implement foreach on multi-dimensional arrays. 
21104
21105         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21106         name of the params argument.
21107
21108         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21109         initializing the array.
21110
21111         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21112         we can use this elsewhere.
21113
21114         * statement.cs: Finish implementation of foreach for single
21115         dimension arrays.
21116
21117         * cs-parser.jay: Use an out-of-band stack to pass information
21118         around, I wonder why I need this.
21119
21120         foreach_block: Make the new foreach_block the current_block.
21121
21122         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21123         function used to return a static Parameters structure.  Used for
21124         empty parameters, as those are created very frequently.
21125
21126         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21127
21128 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21129
21130         * interface.cs : Default modifier is private, not public. The
21131         make verify test passes again.
21132
21133 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21134
21135         * support.cs (ReflectionParameters): Fix logic to determine
21136         whether the last parameter is a params one. Test 9 passes again.
21137
21138         * delegate.cs (Populate): Register the builders we define with
21139         RegisterParameterForBuilder. Test 19 passes again.
21140
21141         * cs-parser.jay (property_declaration): Reference $6 instead
21142         of $$ to get at the location.
21143
21144         (indexer_declaration): Similar stuff.
21145
21146         (attribute): Ditto.
21147
21148         * class.cs (Property): Register parameters for the Get and Set methods
21149         if they exist. Test 23 passes again.
21150
21151         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21152         call to EmitArguments as we are sure there aren't any params arguments. 
21153         Test 32 passes again.
21154
21155         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21156         IndexOutOfRangeException. 
21157
21158         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21159         Test 33 now passes again.
21160
21161 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21162
21163         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21164         broke a bunch of things.  Will have to come up with a better way
21165         of tracking locations.
21166
21167         * statement.cs: Implemented foreach for single dimension arrays.
21168
21169 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21170
21171         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21172         an error.  This removes the lookup from the critical path.
21173
21174         * cs-parser.jay: Removed use of temporary_loc, which is completely
21175         broken. 
21176
21177 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * support.cs (ReflectionParameters.ParameterModifier): Report
21180         whether the argument is a PARAMS argument or not.
21181
21182         * class.cs: Set the attribute `ParamArrayAttribute' on the
21183         parameter argument.
21184
21185         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21186         and cons_param_array_attribute (ConstructorInfo for
21187         ParamArrayAttribute)., 
21188
21189         * codegen.cs: Emit the return using the `Return' statement, that
21190         way we can report the error correctly for missing return values. 
21191
21192         * class.cs (Method.Emit): Clean up.
21193
21194         * expression.cs (Argument.Resolve): Take another argument: the
21195         location where this argument is used.  Notice that this is not
21196         part of the "Argument" class as to reduce the size of the
21197         structure (we know the approximate location anyways).
21198
21199         Test if the argument is a variable-reference, if not, then
21200         complain with a 206.
21201
21202         (Argument.Emit): Emit addresses of variables.
21203
21204         (Argument.FullDesc): Simplify.
21205
21206         (Invocation.DoResolve): Update for Argument.Resolve.
21207
21208         (ElementAccess.DoResolve): ditto.
21209
21210         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21211         method should be virtual, as this method is always virtual.
21212
21213         (NewDelegate.DoResolve): Update for Argument.Resolve.
21214
21215         * class.cs (ConstructorInitializer.DoResolve): ditto.
21216
21217         * attribute.cs (Attribute.Resolve): ditto.
21218
21219 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21220
21221         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21222
21223         * expression.cs (ParameterReference): Drop IStackStorage and implement
21224         IAssignMethod instead. 
21225
21226         (LocalVariableReference): ditto.
21227
21228         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21229         IAssignMethod instead. 
21230
21231 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21232
21233         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21234         enumerations that are used in heavily used structures derive from
21235         byte in a laughable and pathetic attempt to reduce memory usage.
21236         This is the kind of pre-optimzations that you should not do at
21237         home without adult supervision.
21238
21239         * expression.cs (UnaryMutator): New class, used to handle ++ and
21240         -- separatedly from the other unary operators.  Cleans up the
21241         code, and kills the ExpressionStatement dependency in Unary.
21242
21243         (Unary): Removed `method' and `Arguments' from this class, making
21244         it smaller, and moving it all to SimpleCall, so I can reuse this
21245         code in other locations and avoid creating a lot of transient data
21246         strucutres when not required.
21247
21248         * cs-parser.jay: Adjust for new changes.
21249
21250 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21251
21252         * enum.cs (Enum.Populate): If there is a failure during
21253         definition, return
21254
21255         * cs-parser.jay (opt_enum_base): we used to catch type errors
21256         here, but this is really incorrect.  The type error should be
21257         catched during semantic analysis.
21258
21259 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21260
21261         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21262         current_local_parameters as expected since I, in my stupidity, had forgotten
21263         to do this :-)
21264
21265         * attribute.cs (GetValidPlaces): Fix stupid bug.
21266
21267         * class.cs (Method::Emit): Perform check on applicability of attributes.
21268
21269         (Constructor::Emit): Ditto.
21270
21271         (Field::Emit): Ditto.
21272
21273         (Field.Location): Store location information.
21274
21275         (Property, Event, Indexer, Operator): Ditto.
21276
21277         * cs-parser.jay (field_declaration): Pass in location for each field.
21278
21279         * ../errors/cs0592.cs : Add.
21280
21281 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21282
21283         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21284
21285         (InitCoreTypes): Update accordingly.
21286
21287         (RegisterAttrType, LookupAttr): Implement.
21288
21289         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21290         info about the same.
21291
21292         (Resolve): Update to populate the above as necessary.
21293
21294         (Error592): Helper.
21295
21296         (GetValidPlaces): Helper to the above.
21297
21298         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21299
21300         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21301
21302 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21303
21304         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21305
21306         * ../errors/cs0617.cs : Add.
21307
21308 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21309
21310         * enum.cs (Emit): Rename to Populate to be more consistent with what
21311         we expect it to do and when exactly it is called.
21312
21313         * class.cs, rootcontext.cs : Update accordingly.
21314
21315         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21316         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21317
21318         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21319
21320         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21321         of a fieldinfo using the above, when dealing with a FieldBuilder.
21322
21323 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21324
21325         * ../errors/cs0031.cs : Add.
21326
21327         * ../errors/cs1008.cs : Add.
21328
21329         * ../errrors/cs0543.cs : Add.
21330
21331         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21332         enum type.
21333
21334         (FindMembers): Implement.
21335
21336         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21337         enums and delegates too.
21338
21339         (enum_types): Rename to builder_to_enum.
21340
21341         (delegate_types): Rename to builder_to_delegate.
21342
21343         * delegate.cs (FindMembers): Implement.
21344
21345 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21346
21347         * typemanager.cs (IsEnumType): Implement.
21348
21349         * enum.cs (Emit): Re-write parts to account for the underlying type
21350         better and perform checking etc.
21351
21352         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21353         of the underlying type.
21354
21355         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21356         value
21357
21358         * enum.cs (error31): Helper to report error #31.
21359
21360         * cs-parser.jay (enum_declaration): Store location of each member too.
21361
21362         * enum.cs (member_to_location): New hashtable. 
21363
21364         (AddEnumMember): Update location hashtable.
21365
21366         (Emit): Use the location of each member while reporting errors.
21367
21368 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21369
21370         * cs-parser.jay: A for_initializer if is a
21371         local_variable_declaration really ammount to have an implicit
21372         block with the variable declaration and no initializer for for.
21373
21374         * statement.cs (For.Emit): Cope with null initializers.
21375
21376         This fixes the infinite loop on for initializers.
21377
21378 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21379
21380         * enum.cs: More cleanup.
21381
21382         * ecore.cs: Remove dead code.
21383
21384         * class.cs (Property.Emit): More simplification.
21385         (Event.Emit): ditto.
21386
21387         Reworked to have less levels of indentation.
21388
21389 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21390
21391         * class.cs (Property): Emit attributes.
21392
21393         (Field): Ditto.
21394
21395         (Event): Ditto.
21396
21397         (Indexer): Ditto.
21398
21399         (Operator): Ditto.
21400
21401         * enum.cs (Emit): Ditto.
21402
21403         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21404         Enums too.
21405
21406         * class.cs (Field, Event, etc.): Move attribute generation into the
21407         Emit method everywhere.
21408
21409         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21410         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21411         as we had no way of defining nested enums !
21412
21413         * rootcontext.cs : Adjust code accordingly.
21414
21415         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21416
21417 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21418
21419         * expression.cs (EvalConstantExpression): Move into ecore.cs
21420
21421         * enum.cs (Enum): Rename some members and make them public and readonly
21422         according to our convention.
21423
21424         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21425         nothing else.
21426
21427         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21428
21429         (Enum::Emit): Write a simple version for now which doesn't try to compute
21430         expressions. I shall modify this to be more robust in just a while.
21431
21432         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21433
21434         (TypeContainer::CloseType): Create the Enum types too.
21435
21436         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21437
21438         * expression.cs (EvalConstantExpression): Get rid of completely.
21439
21440         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21441         user-defined values and other cases.
21442
21443         (IsValidEnumLiteral): Helper function.
21444
21445         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21446         out there in the case we had a literal FieldExpr.
21447
21448         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21449
21450         (Literalize): Revamp a bit to take two arguments.
21451
21452         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21453
21454 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21455
21456         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21457
21458         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21459
21460         (Resolve): Use the above to ensure we have proper initializers.
21461
21462 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21463
21464         * expression.cs (Expression::EvalConstantExpression): New method to 
21465         evaluate constant expressions.
21466
21467         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21468
21469 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21470
21471         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21472         in an array.
21473
21474         (Binary.ResolveOperator): Handle operator != (object a, object b)
21475         and operator == (object a, object b);
21476
21477         (Binary.DoNumericPromotions): Indicate whether the numeric
21478         promotion was possible.
21479
21480         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21481         Implement.  
21482
21483         Made the ArrayAccess implement interface IAssignMethod instead of
21484         IStackStore as the order in which arguments are passed reflects
21485         this.
21486
21487         * assign.cs: Instead of using expr.ExprClass to select the way of
21488         assinging, probe for the IStackStore/IAssignMethod interfaces.
21489
21490         * typemanager.cs: Load InitializeArray definition.
21491
21492         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21493         static data that can be used to initialize arrays. 
21494
21495 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21496
21497         * expression.cs: Handle operator== and operator!= for booleans.
21498
21499         (Conditioal.Reduce): Implement reducer for the ?: operator.
21500
21501         (Conditional.Resolve): Implement dead code elimination.
21502
21503         (Binary.Resolve): Catch string literals and return a new
21504         concatenated string.
21505
21506         (Unary.Reduce): Implement reduction of unary expressions.
21507
21508         * ecore.cs: Split out the expression core handling here.
21509
21510         (Expression.Reduce): New method used to perform constant folding
21511         and CSE.  This is needed to support constant-expressions. 
21512
21513         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21514         targets, and optimize for !x.
21515
21516 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21517
21518         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21519         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21520         set custom atttributes.
21521
21522         * literal.cs (Literal::GetValue): New abstract method to return the actual
21523         value of the literal, cast as an object.
21524
21525         (*Literal): Implement GetValue method.
21526
21527         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21528         expressions to the arraylist but objects of type Argument.
21529
21530         * class.cs (TypeContainer::Emit): Emit our attributes too.
21531
21532         (Method::Emit, Constructor::Emit): Ditto.
21533
21534         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21535         to be ignoring earlier.
21536
21537 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21538
21539         * attribute.cs (AttributeSection::Define): Implement to do the business
21540         of constructing a CustomAttributeBuilder.
21541
21542         (Attribute): New trivial class. Increases readability of code.  
21543
21544         * cs-parser.jay : Update accordingly.
21545
21546         (positional_argument_list, named_argument_list, named_argument): New rules
21547
21548         (attribute_arguments): Use the above so that we are more correct.
21549
21550 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21551
21552         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21553         to perform all checks for a method with a params parameter.
21554
21555         (Invocation::OverloadResolve): Update to use the above method and therefore
21556         cope correctly with params method invocations.
21557
21558         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21559         params too.
21560
21561         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21562         constructors in our parent too because we can't afford to miss out on 
21563         protected ones ;-)
21564
21565         * attribute.cs (AttributeSection): New name for the class Attribute
21566
21567         Other trivial changes to improve readability.
21568
21569         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21570         use the new class names.
21571
21572 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21573
21574         * class.cs (Method::Define): Complete definition for params types too
21575
21576         (Indexer::Define): Ditto.
21577
21578         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21579         Cope everywhere with a request for info about the array parameter.
21580
21581 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21582
21583         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21584
21585         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21586         local_variable_type to extract the string corresponding to the type.
21587
21588         (local_variable_type): Fixup the action to use the new helper method.
21589
21590         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21591         go.
21592
21593         * expression.cs : Clean out code which uses the above.
21594
21595 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21596
21597         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21598         and bale out if necessary by returning a false.
21599
21600         (RegisterProperty): Ditto.
21601
21602         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21603         and print out appropriate error messages.
21604
21605         * interface.cs (everywhere): Ditto.
21606
21607         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21608         location to constructor.
21609
21610         * class.cs (Property, Event, Indexer): Update accordingly.
21611
21612         * ../errors/cs111.cs : Added.
21613
21614         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21615         of a method, as laid down by the spec.
21616
21617         (Invocation::OverloadResolve): Use the above method.
21618
21619 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21620
21621         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21622         now take a TypeContainer and a Parameters object.
21623
21624         (ParameterData): Modify return type of ParameterModifier method to be 
21625         Parameter.Modifier and not a string.
21626
21627         (ReflectionParameters, InternalParameters): Update accordingly.
21628
21629         * expression.cs (Argument::GetParameterModifier): Same here.
21630
21631         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21632         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21633         symbol in it at all so maybe this is only for now.
21634
21635 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21636
21637         * support.cs (InternalParameters): Constructor now takes an extra argument 
21638         which is the actual Parameters class.
21639
21640         (ParameterDesc): Update to provide info on ref/out modifiers.
21641
21642         * class.cs (everywhere): Update call to InternalParameters to pass in
21643         the second argument too.
21644
21645         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21646         to return the modifier info [ref/out etc]
21647
21648         (InternalParameters, ReflectionParameters): Implement the above.
21649
21650         * expression.cs (Argument::ParameterModifier): Similar function to return
21651         info about the argument's modifiers.
21652
21653         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21654         too.
21655
21656         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21657         a new SetFormalParameters object which we pass to InternalParameters.
21658
21659 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21660
21661         * expression.cs (NewArray): Merge into the ArrayCreation class.
21662
21663 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21664
21665         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21666         NewUserdefinedArray into one as there wasn't much of a use in having
21667         two separate ones.
21668
21669         * expression.cs (Argument): Change field's name to ArgType from Type.
21670
21671         (Type): New readonly property which returns the proper type, taking into 
21672         account ref/out modifiers.
21673
21674         (everywhere): Adjust code accordingly for the above.
21675
21676         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21677         whether we are emitting for a ref or out parameter.
21678
21679         * expression.cs (Argument::Emit): Use the above field to set the state.
21680
21681         (LocalVariableReference::Emit): Update to honour the flag and emit the
21682         right stuff.
21683
21684         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21685
21686         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21687
21688         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21689
21690         (ReflectionParameters, InternalParameters): Implement the above method.
21691
21692         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21693         reporting errors.
21694
21695         (Invocation::FullMethodDesc): Ditto. 
21696
21697 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21698
21699         * cs-parser.jay: Add extra production for the second form of array
21700         creation. 
21701
21702         * expression.cs (ArrayCreation): Update to reflect the above
21703         change. 
21704
21705         * Small changes to prepare for Array initialization.
21706
21707 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21708
21709         * typemanager.cs (ImplementsInterface): interface might be null;
21710         Deal with this problem;
21711
21712         Also, we do store negative hits on the cache (null values), so use
21713         this instead of calling t.GetInterfaces on the type everytime.
21714
21715 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21716
21717         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21718
21719         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21720         split functionality out into different classes.
21721
21722         (New::FormArrayType): Move into NewBuiltinArray.
21723
21724         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21725         quite useless.
21726
21727         (NewBuiltinArray): New class to handle creation of built-in arrays.
21728
21729         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21730         account creation of one-dimensional arrays.
21731
21732         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21733
21734         (NewUserdefinedArray::DoResolve): Implement.
21735
21736         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21737
21738         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21739         we maintain inside the TypeManager. This is necessary to perform lookups on the
21740         module builder.
21741
21742         (LookupType): Update to perform GetType on the module builders too.     
21743
21744         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21745
21746         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21747
21748 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21749
21750         * expression.cs (New::DoResolve): Implement guts of array creation.
21751
21752         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21753
21754 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21755
21756         * expression.cs: Fix bug I introduced lsat night that broke
21757         Delegates. 
21758
21759         (Expression.Resolve): Report a 246 error (can not resolve name)
21760         if we find a SimpleName in the stream.
21761
21762         (Expression.ResolveLValue): Ditto.
21763
21764         (Expression.ResolveWithSimpleName): This function is a variant of
21765         ResolveName, this one allows SimpleNames to be returned without a
21766         warning.  The only consumer of SimpleNames is MemberAccess
21767
21768 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21769
21770         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21771         might arrive here.  I have my doubts that this is correct.
21772
21773         * statement.cs (Lock): Implement lock statement.
21774
21775         * cs-parser.jay: Small fixes to support `lock' and `using'
21776
21777         * cs-tokenizer.cs: Remove extra space
21778
21779         * driver.cs: New flag --checked, allows to turn on integer math
21780         checking. 
21781
21782         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21783         Threading.Monitor.Exit 
21784
21785 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21786
21787         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21788         Expression Class to be IndexerAccess.
21789
21790         Notice that Indexer::DoResolve sets the eclass to Value.
21791
21792 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * class.cs (TypeContainer::Emit): Emit code for indexers.
21795
21796         * assign.cs (IAssignMethod): New interface implemented by Indexers
21797         and Properties for handling assignment.
21798
21799         (Assign::Emit): Simplify and reuse code. 
21800
21801         * expression.cs (IndexerAccess, PropertyExpr): Implement
21802         IAssignMethod, clean up old code. 
21803
21804 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21805
21806         * typemanager.cs (ImplementsInterface): New method to determine if a type
21807         implements a given interface. Provides a nice cache too.
21808
21809         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21810         method.
21811
21812         (ConvertReferenceExplicit): Ditto.
21813
21814         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21815         various methods, with correct names etc.
21816
21817         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21818         Operator.UnaryNegation.
21819
21820         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21821         we have a unary plus or minus operator.
21822
21823         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21824         UnaryMinus.
21825
21826         * everywhere : update accordingly.
21827
21828         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21829         respectively.
21830
21831         * class.cs (Method::Define): For the case where we are implementing a method
21832         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21833         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21834
21835 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21836
21837         * interface.cs (FindMembers): Implement to work around S.R.E
21838         lameness.
21839
21840         * typemanager.cs (IsInterfaceType): Implement.
21841
21842         (FindMembers): Update to handle interface types too.
21843
21844         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21845         use IsAssignableFrom as that is not correct - it doesn't work.
21846
21847         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21848         and accordingly override EmitStatement.
21849
21850         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21851         using the correct logic :-)
21852
21853 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21854
21855         * ../errors/cs-11.cs : Add to demonstrate error -11 
21856
21857 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21858
21859         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21860         then pass this as a hint to ResolveLValue.
21861
21862         * expression.cs (FieldExpr): Add Location information
21863
21864         (FieldExpr::LValueResolve): Report assignment to readonly
21865         variable. 
21866
21867         (Expression::ExprClassFromMemberInfo): Pass location information.
21868
21869         (Expression::ResolveLValue): Add new method that resolves an
21870         LValue. 
21871
21872         (Expression::DoResolveLValue): Default invocation calls
21873         DoResolve. 
21874
21875         (Indexers): New class used to keep track of indexers in a given
21876         Type. 
21877
21878         (IStackStore): Renamed from LValue, as it did not really describe
21879         what this did.  Also ResolveLValue is gone from this interface and
21880         now is part of Expression.
21881
21882         (ElementAccess): Depending on the element access type
21883
21884         * typemanager.cs: Add `indexer_name_type' as a Core type
21885         (System.Runtime.CompilerServices.IndexerNameAttribute)
21886
21887         * statement.cs (Goto): Take a location.
21888
21889 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21890
21891         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21892         if two delegates are compatible.
21893
21894         (NewDelegate::DoResolve): Update to take care of the case when
21895         we instantiate a delegate from another delegate.
21896
21897         * typemanager.cs (FindMembers): Don't even try to look up members
21898         of Delegate types for now.
21899
21900 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21901
21902         * delegate.cs (NewDelegate): New class to take care of delegate
21903         instantiation.
21904
21905         * expression.cs (New): Split the delegate related code out into 
21906         the NewDelegate class.
21907
21908         * delegate.cs (DelegateInvocation): New class to handle delegate 
21909         invocation.
21910
21911         * expression.cs (Invocation): Split out delegate related code into
21912         the DelegateInvocation class.
21913
21914 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21915
21916         * expression.cs (New::DoResolve): Implement delegate creation fully
21917         and according to the spec.
21918
21919         (New::DoEmit): Update to handle delegates differently.
21920
21921         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21922         because of which we were printing out arguments in reverse order !
21923
21924         * delegate.cs (VerifyMethod): Implement to check if the given method
21925         matches the delegate.
21926
21927         (FullDelegateDesc): Implement.
21928
21929         (VerifyApplicability): Implement.
21930
21931         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21932         delegate invocations too.
21933
21934         (Invocation::Emit): Ditto.
21935
21936         * ../errors/cs1593.cs : Added.
21937
21938         * ../errors/cs1594.cs : Added.
21939
21940         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21941
21942 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21943
21944         * typemanager.cs (intptr_type): Core type for System.IntPtr
21945
21946         (InitCoreTypes): Update for the same.
21947
21948         (iasyncresult_type, asynccallback_type): Ditto.
21949
21950         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21951         correct.
21952
21953         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21954         too.
21955
21956         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21957         the builders for the 4 members of a delegate type :-)
21958
21959         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21960         type.
21961
21962         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21963
21964         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21965
21966 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21967
21968         * statement.cs (Break::Emit): Implement.   
21969         (Continue::Emit): Implement.
21970
21971         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21972         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21973         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21974         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21975         end loop
21976
21977         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21978         properties that track the label for the current loop (begin of the
21979         loop and end of the loop).
21980
21981 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21982
21983         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21984         use of emitting anything at all.
21985
21986         * class.cs, rootcontext.cs : Get rid of calls to the same.
21987
21988         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21989
21990         (Populate): Define the constructor correctly and set the implementation
21991         attributes.
21992
21993         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21994         have been defined.
21995
21996         (AddDelegateType): Implement.
21997
21998         (IsDelegateType): Implement helper method.
21999
22000         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22001
22002         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22003         and accordingly handle it.
22004
22005         * delegate.cs (Populate): Take TypeContainer argument.
22006         Implement bits to define the Invoke method. However, I still haven't figured out
22007         how to take care of the native int bit :-(
22008
22009         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22010         Qualify the name of the delegate, not its return type !
22011
22012         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22013         conversion.
22014
22015         (StandardConversionExists): Checking for array types turns out to be recursive.
22016
22017         (ConvertReferenceExplicit): Implement array conversion.
22018
22019         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22020
22021 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22022
22023         * cs-parser.jay (delegate_declaration): Store the fully qualified
22024         name as it is a type declaration.
22025
22026         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22027         readonly.
22028
22029         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22030         as TypeContainer::DefineType.
22031
22032         (Populate): Method in which all the definition of the various methods (Invoke)
22033         etc is done.
22034
22035         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22036         see.
22037
22038         (CloseDelegate): Finally creates the delegate.
22039
22040         * class.cs (TypeContainer::DefineType): Update to define delegates.
22041         (Populate, Emit and CloseType): Do the same thing here too.
22042
22043         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22044         delegates in all these operations.
22045
22046 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22047
22048         * expression.cs: LocalTemporary: a new expression used to
22049         reference a temporary that has been created.
22050
22051         * assign.cs: Handle PropertyAccess back here, so that we can
22052         provide the proper semantic access to properties.
22053
22054         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22055         a few more explicit conversions. 
22056
22057         * modifiers.cs: `NEW' modifier maps to HideBySig.
22058
22059         * expression.cs (PropertyExpr): Make this into an
22060         ExpressionStatement, and support the EmitStatement code path. 
22061
22062         Perform get/set error checking, clean up the interface.
22063
22064         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22065         them into toplevel access objects.
22066
22067 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22068
22069         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22070         SRE.
22071
22072         * typemanager.cs: Keep track here of our PropertyBuilders again to
22073         work around lameness in SRE.
22074
22075 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22076
22077         * expression.cs (LValue::LValueResolve): New method in the
22078         interface, used to perform a second resolution pass for LValues. 
22079
22080         (This::DoResolve): Catch the use of this in static methods.
22081
22082         (This::LValueResolve): Implement.
22083
22084         (This::Store): Remove warning, assigning to `this' in structures
22085         is 
22086
22087         (Invocation::Emit): Deal with invocation of
22088         methods on value types.  We need to pass the address to structure
22089         methods rather than the object itself.  (The equivalent code to
22090         emit "this" for structures leaves the entire structure on the
22091         stack instead of a pointer to it). 
22092
22093         (ParameterReference::DoResolve): Compute the real index for the
22094         argument based on whether the method takes or not a `this' pointer
22095         (ie, the method is static).
22096
22097         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22098         value types returned from functions when we need to invoke a
22099         method on the sturcture.
22100
22101
22102 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22103
22104         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22105         defining the type in the Modulebuilder or Typebuilder. This is to take
22106         care of nested types which need to be defined on the TypeBuilder using
22107         DefineNestedMethod.
22108
22109         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22110         methods in RootContext, only ported to be part of TypeContainer.
22111
22112         (TypeContainer::GetInterfaceOrClass): Ditto.
22113
22114         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22115
22116         * interface.cs (Interface::DefineInterface): New method. Does exactly
22117         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22118         too.
22119
22120         (Interface::GetInterfaces): Move from RootContext here and port.
22121
22122         (Interface::GetInterfaceByName): Same here.
22123
22124         * rootcontext.cs (ResolveTree): Re-write.
22125
22126         (PopulateTypes): Re-write.
22127
22128         * class.cs (TypeContainer::Populate): Populate nested types too.
22129         (TypeContainer::Emit): Emit nested members too.
22130
22131         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22132         instead just use the name argument passed in as it is already fully
22133         qualified.
22134
22135         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22136         to TypeContainer mapping to see if a type is user-defined.
22137
22138         * class.cs (TypeContainer::CloseType): Implement. 
22139
22140         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22141         the default constructor.
22142
22143         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22144         twice.
22145
22146         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22147
22148         * interface.cs (CloseType): Create the type here.
22149
22150         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22151         the hierarchy.
22152
22153         Remove all the methods which are now in TypeContainer.
22154
22155 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22156
22157         * delegate.cs (Define): Re-write bits to define the delegate
22158         correctly.
22159
22160 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22161
22162         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22163
22164         * expression.cs (ImplicitReferenceConversion): handle null as well
22165         as a source to convert to any reference type.
22166
22167         * statement.cs (Return): Perform any implicit conversions to
22168         expected return type.  
22169
22170         Validate use of return statement.  
22171
22172         * codegen.cs (EmitContext): Pass the expected return type here.
22173
22174         * class.cs (Method, Constructor, Property): Pass expected return
22175         type to EmitContext.
22176
22177 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22178
22179         * expression.cs: Make DoResolve take an EmitContext instead of a
22180         TypeContainer.
22181
22182         Replaced `l' and `location' for `loc', for consistency.
22183
22184         (Error, Warning): Remove unneeded Tc argument.
22185
22186         * assign.cs, literal.cs, constant.cs: Update to new calling
22187         convention. 
22188
22189         * codegen.cs: EmitContext now contains a flag indicating whether
22190         code is being generated in a static method or not.
22191
22192         * cs-parser.jay: DecomposeQI, new function that replaces the old
22193         QualifiedIdentifier.  Now we always decompose the assembled
22194         strings from qualified_identifier productions into a group of
22195         memberaccesses.
22196
22197 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22198
22199         * rootcontext.cs: Deal with field-less struct types correctly now
22200         by passing the size option to Define Type.
22201
22202         * class.cs: Removed hack that created one static field. 
22203
22204 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22205
22206         * statement.cs: Moved most of the code generation here. 
22207
22208 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22209
22210         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22211         seem very right.
22212
22213         (ElementAccess): Remove useless bits for now - keep checks as the spec
22214         says.
22215
22216 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22217
22218         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22219         and start performing checks according to the spec.
22220
22221 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22222
22223         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22224         rank_specifiers instead.
22225
22226         (rank_specifiers): Change the order in which the rank specifiers are stored
22227
22228         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22229
22230         * expression.cs (ElementAccess): Implement the LValue interface too.
22231
22232 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22233
22234         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22235         except that user defined conversions are not included.
22236
22237         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22238         perform the conversion of the return type, if necessary.
22239
22240         (New::DoResolve): Check whether we are creating an array or an object
22241         and accordingly do the needful.
22242
22243         (New::Emit): Same here.
22244
22245         (New::DoResolve): Implement guts of array creation.
22246
22247         (New::FormLookupType): Helper function.
22248
22249 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22250
22251         * codegen.cs: Removed most of the code generation here, and move the
22252         corresponding code generation bits to the statement classes. 
22253
22254         Added support for try/catch/finalize and throw.
22255
22256         * cs-parser.jay: Added support for try/catch/finalize.
22257
22258         * class.cs: Catch static methods having the flags override,
22259         virtual or abstract.
22260
22261         * expression.cs (UserCast): This user cast was not really doing
22262         what it was supposed to do.  Which is to be born in fully resolved
22263         state.  Parts of the resolution were being performed at Emit time! 
22264
22265         Fixed this code.
22266
22267 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22268
22269         * expression.cs: Implicity convert the result from UserCast.
22270
22271 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22272
22273         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22274         prevented it from working correctly. 
22275
22276         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22277         merely ConvertImplicit.
22278
22279 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22280
22281         * typemanager.cs: Make the LookupTypeContainer function static,
22282         and not per-instance.  
22283
22284         * class.cs: Make static FindMembers (the one that takes a Type
22285         argument). 
22286
22287         * codegen.cs: Add EmitForeach here.
22288
22289         * cs-parser.jay: Make foreach a toplevel object instead of the
22290         inline expansion, as we need to perform semantic analysis on it. 
22291
22292 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22293
22294         * expression.cs (Expression::ImplicitUserConversion): Rename to
22295         UserDefinedConversion.
22296
22297         (Expression::UserDefinedConversion): Take an extra argument specifying 
22298         whether we look for explicit user conversions too.
22299
22300         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22301
22302         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22303
22304         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22305         with the appropriate arguments.
22306
22307         * cs-parser.jay (cast_expression): Record location too.
22308
22309         * expression.cs (Cast): Record location info.
22310
22311         (Expression::ConvertExplicit): Take location argument.
22312
22313         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22314         to determine if we are doing explicit conversions.
22315
22316         (UserCast::Emit): Update accordingly.
22317
22318         (Expression::ConvertExplicit): Report an error if everything fails.
22319
22320         * ../errors/cs0030.cs : Add.
22321
22322 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22323
22324         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22325         virtual and newslot bits. 
22326
22327         * class.cs (TypeContainer::RegisterRequiredImplementations):
22328         Record methods we need.
22329
22330         (TypeContainer::MakeKey): Helper function to make keys for
22331         MethodBases, since the Methodbase key is useless.
22332
22333         (TypeContainer::Populate): Call RegisterRequiredImplementations
22334         before defining the methods.   
22335
22336         Create a mapping for method_builders_to_methods ahead of time
22337         instead of inside a tight loop.
22338
22339         (::RequireMethods):  Accept an object as the data to set into the
22340         hashtable so we can report interface vs abstract method mismatch.
22341
22342 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22343
22344         * report.cs: Make all of it static.
22345
22346         * rootcontext.cs: Drop object_type and value_type computations, as
22347         we have those in the TypeManager anyways.
22348
22349         Drop report instance variable too, now it is a global.
22350
22351         * driver.cs: Use try/catch on command line handling.
22352
22353         Add --probe option to debug the error reporting system with a test
22354         suite. 
22355
22356         * report.cs: Add support for exiting program when a probe
22357         condition is reached.
22358
22359 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22360
22361         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22362         we do a forcible conversion regardless of type, to check if 
22363         ForceConversion returns a null.
22364
22365         (Binary::error19): Use location to report error.
22366
22367         (Unary::error23): Use location here too.
22368
22369         * ../errors/cs0019.cs : Check in.
22370
22371         * ../errors/cs0023.cs : Check in.
22372
22373         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22374         case of a non-null MethodInfo object with a length of 0 !
22375
22376         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22377         an applicable member - according to the spec :-)
22378         Also fix logic to find members in base types.
22379
22380         (Unary::ResolveOperator): Same here.
22381
22382         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22383         as I was getting thoroughly confused between this and error19 :-)
22384
22385         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22386         (::FindMostEncompassedType): Implement.
22387         (::FindMostEncompassingType): Implement.
22388         (::StandardConversionExists): Implement.
22389
22390         (UserImplicitCast): Re-vamp. We now need info about most specific
22391         source and target types so that we can do the necessary conversions.
22392
22393         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22394         mathematical union with no duplicates.
22395
22396 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22397
22398         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22399         in order from base classes to child classes, so that we can in
22400         child classes look up in our parent for method names and
22401         attributes (required for handling abstract, virtual, new, override
22402         constructs: we need to instrospect our base class, and if we dont
22403         populate the classes in order, the introspection might be
22404         incorrect.  For example, a method could query its parent before
22405         the parent has any methods and would determine that the parent has
22406         no abstract methods (while it could have had them)).
22407
22408         (RootContext::CreateType): Record the order in which we define the
22409         classes.
22410
22411 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22412
22413         * class.cs (TypeContainer::Populate): Also method definitions can
22414         fail now, keep track of this.
22415
22416         (TypeContainer::FindMembers): Implement support for
22417         DeclaredOnly/noDeclaredOnly flag.
22418
22419         (Constructor::Emit) Return the ConstructorBuilder.
22420
22421         (Method::Emit) Return the MethodBuilder. 
22422         Check for abstract or virtual methods to be public.
22423
22424         * rootcontext.cs (RootContext::CreateType): Register all the
22425         abstract methods required for the class to be complete and the
22426         interface methods that must be implemented. 
22427
22428         * cs-parser.jay: Report error 501 (method requires body if it is
22429         not marked abstract or extern).
22430
22431         * expression.cs (TypeOf::Emit): Implement.
22432
22433         * typemanager.cs: runtime_handle_type, new global type.
22434
22435         * class.cs (Property::Emit): Generate code for properties.
22436
22437 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22438
22439         * expression.cs (Unary::ResolveOperator): Find operators on base type
22440         too - we now conform exactly to the spec.
22441
22442         (Binary::ResolveOperator): Same here.
22443
22444         * class.cs (Operator::Define): Fix minor quirk in the tests.
22445
22446         * ../errors/cs0215.cs : Added.
22447
22448         * ../errors/cs0556.cs : Added.
22449
22450         * ../errors/cs0555.cs : Added.
22451
22452 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22453
22454         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22455         single integer which is really efficient
22456
22457 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22458
22459         *  expression.cs (Expression::ImplicitUserConversion): Use location
22460         even in the case when we are examining True operators.
22461  
22462         * class.cs (Operator::Define): Perform extensive checks to conform
22463         with the rules for operator overloading in the spec.
22464
22465         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22466         some of the other conversions mentioned in the spec.
22467
22468         * typemanager.cs (array_type): New static member for the System.Array built-in
22469         type.
22470
22471         (cloneable_interface): For System.ICloneable interface.
22472
22473         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22474         we start resolving the tree and populating types.
22475
22476         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22477  
22478 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22479
22480         * expression.cs (Expression::ExprClassFromMemberInfo,
22481         Expression::Literalize): Create literal expressions from
22482         FieldInfos which are literals.
22483
22484         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22485         type casts, because they were wrong.  The test suite in tests
22486         caught these ones.
22487
22488         (ImplicitNumericConversion): ushort to ulong requires a widening
22489         cast. 
22490
22491         Int32 constant to long requires widening cast as well.
22492
22493         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22494         for integers because the type on the stack is not i4.
22495
22496 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22497
22498         * expression.cs (report118): require location argument. 
22499
22500         * parameter.cs: Do not dereference potential null value.
22501
22502         * class.cs: Catch methods that lack the `new' keyword when
22503         overriding a name.  Report warnings when `new' is used without
22504         anything being there to override.
22505
22506         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22507
22508         * class.cs: Only add constructor to hashtable if it is non-null
22509         (as now constructors can fail on define).
22510
22511         (TypeManager, Class, Struct): Take location arguments.
22512
22513         Catch field instance initialization in structs as errors.
22514
22515         accepting_filter: a new filter for FindMembers that is static so
22516         that we dont create an instance per invocation.
22517
22518         (Constructor::Define): Catch errors where a struct constructor is
22519         parameterless 
22520
22521         * cs-parser.jay: Pass location information for various new
22522         constructs. 
22523
22524         * delegate.cs (Delegate): take a location argument.
22525
22526         * driver.cs: Do not call EmitCode if there were problesm in the
22527         Definition of the types, as many Builders wont be there. 
22528
22529         * decl.cs (Decl::Decl): Require a location argument.
22530
22531         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22532         into integers, and find the most appropiate integer for it.
22533
22534         * literal.cs: Implement ULongLiteral.
22535
22536         * rootcontext.cs: Provide better information about the location of
22537         failure when CreateType fails.
22538
22539 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22542         as well.
22543
22544         * expression.cs (Binary::CheckShiftArguments): Add missing type
22545         computation.
22546         (Binary::ResolveOperator): Add type to the logical and and logical
22547         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22548         before.
22549
22550         (Binary::DoNumericPromotions): In the case where either argument
22551         is ulong (and most signed types combined with ulong cause an
22552         error) perform implicit integer constant conversions as well.
22553
22554 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22555
22556         * expression.cs (UserImplicitCast): Method should always be
22557         non-null. 
22558         (Invocation::BetterConversion): Simplified test for IntLiteral.
22559
22560         (Expression::ImplicitNumericConversion): Split this routine out.
22561         Put the code that performs implicit constant integer conversions
22562         here. 
22563
22564         (Expression::Resolve): Become a wrapper around DoResolve so we can
22565         check eclass and type being set after resolve.
22566
22567         (Invocation::Badness): Remove this dead function
22568
22569         (Binary::ResolveOperator): Do not compute the expensive argumnets
22570         unless we have a union for it.
22571
22572         (Probe::Emit): Is needs to do an isinst and then
22573         compare against null.
22574
22575         (::CanConvert): Added Location argument.  If the Location argument
22576         is null (Location.Null), then we do not report errors.  This is
22577         used by the `probe' mechanism of the Explicit conversion.  We do
22578         not want to generate an error for something that the user
22579         explicitly requested to be casted.  But the pipeline for an
22580         explicit cast first tests for potential implicit casts.
22581
22582         So for now, if the Location is null, it means `Probe only' to
22583         avoid adding another argument.   Might have to revise this
22584         strategy later.
22585
22586         (ClassCast): New class used to type cast objects into arbitrary
22587         classes (used in Explicit Reference Conversions).
22588
22589         Implement `as' as well.
22590
22591         Reverted all the patches from Ravi below: they were broken:
22592
22593                 * The use of `level' as a mechanism to stop recursive
22594                   invocations is wrong.  That was there just to catch the
22595                   bug with a strack trace but not as a way of addressing
22596                   the problem.
22597
22598                   To fix the problem we have to *understand* what is going
22599                   on and the interactions and come up with a plan, not
22600                   just get things going.
22601
22602                 * The use of the type conversion cache that I proposed
22603                   last night had an open topic: How does this work across
22604                   protection domains.  A user defined conversion might not
22605                   be public in the location where we are applying the
22606                   conversion, a different conversion might be selected
22607                   (ie, private A->B (better) but public B->A (worse),
22608                   inside A, A->B applies, but outside it, B->A will
22609                   apply).
22610
22611                 * On top of that (ie, even if the above is solved),
22612                   conversions in a cache need to be abstract.  Ie, `To
22613                   convert from an Int to a Short use an OpcodeCast', not
22614                   `To convert from an Int to a Short use the OpcodeCast on
22615                   the variable 5' (which is what this patch was doing).
22616
22617 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22618
22619         * expression.cs (Invocation::ConversionExists): Re-write to use
22620         the conversion cache
22621
22622         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22623         cache all conversions done, not just user-defined ones.
22624
22625         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22626         to determine if a conversion exists instead of acutually trying to 
22627         perform the conversion. It's faster too.
22628
22629         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22630         and only then attempt the implicit conversion.
22631
22632 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22633
22634         * expression.cs (ConvertImplicit): Use a cache for conversions
22635         already found. Check level of recursion and bail out if necessary.
22636
22637 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22638
22639         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22640         Export standard methods that we expect for string operations.
22641
22642         * statement.cs (Block::UsageWarning): Track usage of variables and
22643         report the errors for not used variables.
22644
22645         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22646         operator. 
22647
22648 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22649
22650         * codegen.cs: remove unnneded code 
22651
22652         * expression.cs: Removed BuiltinTypeAccess class
22653
22654         Fix the order in which implicit conversions are
22655         done.  
22656
22657         The previous fixed dropped support for boxed conversions (adding a
22658         test to the test suite now)
22659
22660         (UserImplicitCast::CanConvert): Remove test for source being null,
22661         that code is broken.  We should not feed a null to begin with, if
22662         we do, then we should track the bug where the problem originates
22663         and not try to cover it up here.
22664
22665         Return a resolved expression of type UserImplicitCast on success
22666         rather than true/false.  Ravi: this is what I was talking about,
22667         the pattern is to use a static method as a "constructor" for
22668         objects. 
22669
22670         Also, do not create arguments until the very last minute,
22671         otherwise we always create the arguments even for lookups that
22672         will never be performed. 
22673
22674         (UserImplicitCast::Resolve): Eliminate, objects of type
22675         UserImplicitCast are born in a fully resolved state. 
22676
22677         * typemanager.cs (InitCoreTypes): Init also value_type
22678         (System.ValueType). 
22679
22680         * expression.cs (Cast::Resolve): First resolve the child expression.
22681
22682         (LValue): Add new method AddressOf to be used by
22683         the `&' operator.  
22684
22685         Change the argument of Store to take an EmitContext instead of an
22686         ILGenerator, because things like FieldExpr need to be able to call
22687         their children expression to generate the instance code. 
22688
22689         (Expression::Error, Expression::Warning): Sugar functions for
22690         reporting errors.
22691
22692         (Expression::MemberLookup): Accept a TypeContainer instead of a
22693         Report as the first argument.
22694
22695         (Expression::ResolvePrimary): Killed.  I still want to improve
22696         this as currently the code is just not right.
22697
22698         (Expression::ResolveMemberAccess): Simplify, but it is still
22699         wrong. 
22700
22701         (Unary::Resolve): Catch errors in AddressOf operators.
22702
22703         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22704         index to a byte for the short-version, or the compiler will choose
22705         the wrong Emit call, which generates the wrong data.
22706
22707         (ParameterReference::Emit, ::Store): same.
22708
22709         (FieldExpr::AddressOf): Implement.
22710
22711         * typemanager.cs: TypeManager: made public variable instead of
22712         property.
22713
22714         * driver.cs: document --fatal.
22715
22716         * report.cs (ErrorMessage, WarningMessage): new names for the old
22717         Error and Warning classes.
22718
22719         * cs-parser.jay (member_access): Turn built-in access to types
22720         into a normal simplename
22721
22722 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22723
22724         * expression.cs (Invocation::BetterConversion): Fix to cope
22725         with q being null, since this was introducing a bug.
22726
22727         * expression.cs (ConvertImplicit): Do built-in conversions first.
22728
22729 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22730
22731         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22732
22733 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22734
22735         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22736         I had introduced long ago (what's new ?).
22737
22738         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22739         the work of all the checking. 
22740         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22741         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22742
22743         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22744         that is the right way. 
22745
22746         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22747         overloading resolution. Use everywhere instead of cutting and pasting code.
22748
22749         (Binary::ResolveOperator): Use MakeUnionSet.
22750
22751         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22752         we have to convert to bool types. Not complete yet.
22753
22754 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22755
22756         * typemanager.cs (TypeManager::CSharpName): support ushort.
22757
22758         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22759         to provide an expression that performsn an implicit constant int
22760         conversion (section 6.1.6).
22761         (Expression::ConvertImplicitRequired): Reworked to include
22762         implicit constant expression conversions.
22763
22764         (Expression::ConvertNumericExplicit): Finished.
22765
22766         (Invocation::Emit): If InstanceExpression is null, then it means
22767         that we perform a call on this.
22768
22769 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22770
22771         * expression.cs (Unary::Emit): Remove some dead code.
22772         (Probe): Implement Resolve and Emit for `is'.
22773         (Expression::ConvertImplicitRequired): Attempt to do constant
22774         expression conversions here.  Maybe should be moved to
22775         ConvertImplicit, but I am not sure.
22776         (Expression::ImplicitLongConstantConversionPossible,
22777         Expression::ImplicitIntConstantConversionPossible): New functions
22778         that tell whether is it possible to apply an implicit constant
22779         expression conversion.
22780
22781         (ConvertNumericExplicit): Started work on explicit numeric
22782         conversions.
22783
22784         * cs-parser.jay: Update operator constants.
22785
22786         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22787         (Parameters::GetSignature): Hook up VerifyArgs here.
22788         (Parameters::VerifyArgs): Verifies that no two arguments have the
22789         same name. 
22790
22791         * class.cs (Operator): Update the operator names to reflect the
22792         ones that the spec expects (as we are just stringizing the
22793         operator names).
22794
22795         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22796         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22797         previous usage did only work for our methods.
22798         (Expression::ConvertImplicit): Handle decimal implicit numeric
22799         conversions as well.
22800         (Expression::InternalTypeConstructor): Used to invoke constructors
22801         on internal types for default promotions.
22802
22803         (Unary::Emit): Implement special handling for the pre/post
22804         increment/decrement for overloaded operators, as they need to have
22805         the same semantics as the other operators.
22806
22807         (Binary::ResolveOperator): ditto.
22808         (Invocation::ConversionExists): ditto.
22809         (UserImplicitCast::Resolve): ditto.
22810
22811 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22812
22813         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22814         operator, return after emitting body. Regression tests pass again !
22815
22816         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22817         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22818         (Invocation::OverloadResolve): Ditto.
22819         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22820
22821         * everywhere : update calls to the above methods accordingly.
22822
22823 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22824
22825         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22826
22827         * expression.cs (ExpressionStatement): New base class used for
22828         expressions that can appear in statements, so that we can provide
22829         an alternate path to generate expression that do not leave a value
22830         on the stack.
22831
22832         (Expression::Emit, and all the derivatives): We no longer return
22833         whether a value is left on the stack or not.  Every expression
22834         after being emitted leaves a single value on the stack.
22835
22836         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22837         facilties of ExpressionStatement if possible.
22838
22839         * cs-parser.jay: Update statement_expression.
22840
22841 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22842
22843         * driver.cs: Change the wording of message
22844
22845 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22846
22847         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22848         the type of the expression to the return type of the method if
22849         we have an overloaded operator match ! The regression tests pass again !
22850         (Unary::ResolveOperator): Ditto.
22851
22852         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22853         to find "op_Implicit", not "implicit" ;-)
22854         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22855         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22856
22857         * everywhere : Correct calls to the above accordingly.
22858
22859         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22860         (ConvertImplicit): Do user-defined conversion if it exists.
22861
22862 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22863
22864         * assign.cs: track location.
22865         (Resolve): Use implicit conversions on assignment.
22866
22867         * literal.cs: Oops.  Not good, Emit of short access values should
22868         pass (Bytes) or the wrong argument will be selected.
22869
22870         * expression.cs (Unary::Emit): Emit code for -expr.
22871
22872         (Unary::ResolveOperator): Handle `Substract' for non-constants
22873         (substract from zero from the non-constants).
22874         Deal with Doubles as well. 
22875
22876         (Expression::ConvertImplicitRequired): New routine that reports an
22877         error if no implicit conversion exists. 
22878
22879         (Invocation::OverloadResolve): Store the converted implicit
22880         expressions if we make them
22881
22882 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22883
22884         * class.cs (ConstructorInitializer): Take a Location argument.
22885         (ConstructorBaseInitializer): Same here.
22886         (ConstructorThisInitializer): Same here.
22887
22888         * cs-parser.jay : Update all calls accordingly.
22889
22890         * expression.cs (Unary, Binary, New): Take location argument.
22891         Update accordingly everywhere.
22892
22893         * cs-parser.jay : Update all calls to the above to take a location
22894         argument.
22895
22896         * class.cs : Ditto.
22897
22898 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22899
22900         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22901         (Invocation::BetterConversion): Same here
22902         (Invocation::ConversionExists): Ditto.
22903
22904         (Invocation::ConversionExists): Implement.
22905
22906 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22907
22908         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22909         Also take an additional TypeContainer argument.
22910
22911         * All over : Pass in TypeContainer as argument to OverloadResolve.
22912
22913         * typemanager.cs (CSharpName): Update to check for the string type and return
22914         that too.
22915
22916         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22917         a given method.
22918
22919 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22920
22921         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22922         (Invocation::BetterFunction): Implement.
22923         (Invocation::BetterConversion): Implement.
22924         (Invocation::ConversionExists): Skeleton, no implementation yet.
22925
22926         Okay, things work fine !
22927
22928 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22929
22930         * typemanager.cs: declare and load enum_type, delegate_type and
22931         void_type. 
22932
22933         * expression.cs (Expression::Emit): Now emit returns a value that
22934         tells whether a value is left on the stack or not.  This strategy
22935         might be reveted tomorrow with a mechanism that would address
22936         multiple assignments.
22937         (Expression::report118): Utility routine to report mismatches on
22938         the ExprClass.
22939
22940         (Unary::Report23): Report impossible type/operator combination
22941         utility function.
22942
22943         (Unary::IsIncrementableNumber): Whether the type can be
22944         incremented or decremented with add.
22945         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22946         complemented. 
22947         (Unary::ResolveOperator): Implement ++, !, ~,
22948
22949         (Invocation::Emit): Deal with new Emit convetion.
22950
22951         * All Expression derivatives: Updated their Emit method to return
22952         whether they leave values on the stack or not.
22953
22954         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22955         stack for expressions that are statements. 
22956
22957 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22958
22959         * expression.cs (LValue): New interface.  Must be implemented by
22960         LValue objects.
22961         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22962         LValue interface.
22963
22964         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22965         interface for generating code, simplifies the code.
22966
22967 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22968
22969         * expression.cs (everywhere): Comment out return statements in ::Resolve
22970         methods to avoid the warnings.
22971
22972 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22973
22974         * driver.cs (parse): Report error 2001 if we can not open the
22975         source file.
22976
22977         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22978         not resolve it.
22979
22980         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22981         object. 
22982
22983         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22984         otherwise nested blocks end up with the same index.
22985
22986         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22987
22988         * expression.cs:  Instead of having FIXMEs in the Resolve
22989         functions, throw exceptions so it is obvious that we are facing a
22990         bug. 
22991
22992         * cs-parser.jay (invocation_expression): Pass Location information.
22993
22994         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22995         Use a basename for those routines because .NET does not like paths
22996         on them. 
22997
22998         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22999         already defined.
23000
23001 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23002
23003         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23004         are loading the correct data types (throws an exception if not).
23005         (TypeManager::InitCoreTypes): Use CoreLookupType
23006
23007         * expression.cs (Unary::ResolveOperator): return the child
23008         expression for expressions which are just +expr.
23009         (Unary::ResolveOperator): Return negative literals for -LITERAL
23010         expressions (otherwise they are Unary {Literal}).
23011         (Invocation::Badness): Take into account `Implicit constant
23012         expression conversions'.
23013
23014         * literal.cs (LongLiteral): Implement long literal class.
23015         (IntLiteral): export the `Value' of the intliteral. 
23016
23017 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23018
23019         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23020
23021         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23022         instead of 'Operator'
23023
23024         * expression.cs (Binary::ResolveOperator): Update accordingly.
23025         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23026         and 'Minus'
23027
23028         * cs-parser.jay (unary_expression): Update to use the new names.
23029
23030         * gen-treedump.cs (GetUnary): Same here.
23031
23032         * expression.cs (Unary::Resolve): Implement.
23033         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23034         operators are found instead of making noise ;-)
23035         (Unary::ResolveOperator): New method to do precisely the same thing which
23036         Binary::ResolveOperator does for Binary expressions.
23037         (Unary.method, .Arguments): Add.
23038         (Unary::OperName): Implement.   
23039         (Unary::ForceConversion): Copy and Paste !
23040
23041         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23042         a unary operator.
23043
23044         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23045         for the inbuilt operators. Only overloading works for now ;-)
23046
23047 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23048
23049         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23050         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23051
23052         * expression.cs (This::Emit): Implement. 
23053         (This::Resolve): Implement.
23054         (TypeOf:Resolve): Implement.
23055         (Expression::ResolveSimpleName): Add an implicit this to instance
23056         field references. 
23057         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23058         Bind instance variable to Field expressions.
23059         (FieldExpr::Instance): New field used to track the expression that
23060         represents the object instance.
23061         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23062         binding 
23063         (FieldExpr::Emit): Implement.
23064
23065         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23066         the last instruction contains a return opcode to avoid generating
23067         the last `ret' instruction (this generates correct code, and it is
23068         nice to pass the peverify output).
23069
23070         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23071         initializer for static and instance variables.
23072         (Constructor::Emit): Allow initializer to be null in the case of
23073         static constructors.  Only emit initializer for instance
23074         constructors. 
23075
23076         (TypeContainer::FindMembers): Return a null array if there are no
23077         matches.
23078
23079         Also fix the code for the MemberTypes.Method branch, as it was not
23080         scanning that for operators (or tried to access null variables before).
23081
23082         * assign.cs (Assign::Emit): Handle instance and static fields. 
23083
23084         * TODO: Updated.
23085
23086         * driver.cs: Stop compilation if there are parse errors.
23087
23088         * cs-parser.jay (constructor_declaration): Provide default base
23089         initializer for non-static constructors.
23090         (constructor_declarator): Do not provide a default base
23091         initializers if none was specified.
23092         Catch the fact that constructors should not have parameters.
23093
23094         * class.cs: Do not emit parent class initializers for static
23095         constructors, that should be flagged as an error.
23096
23097 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23098
23099         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23100         Move back code into TypeContainer::Populate.
23101
23102 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23103
23104         * class.cs (TypeContainer::AddConstructor): Fix the check to
23105         compare against Name, not Basename. 
23106         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23107
23108         * cs-parser.jay : Update accordingly.
23109
23110         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23111         for methods, don't forget to look into the operators too.
23112         (RegisterMethodBuilder): Helper method to take care of this for
23113         methods, constructors and operators.
23114         (Operator::Define): Completely revamp.
23115         (Operator.OperatorMethod, MethodName): New fields.
23116         (TypeContainer::Populate): Move the registering of builders into
23117         RegisterMethodBuilder.
23118         (Operator::Emit): Re-write.
23119
23120         * expression.cs (Binary::Emit): Comment out code path to emit method
23121         invocation stuff for the case when we have a user defined operator. I am
23122         just not able to get it right !
23123
23124 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23125
23126         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23127         argument. 
23128
23129         (Expression::MemberLookup): Provide a version that allows to
23130         specify the MemberTypes and BindingFlags. 
23131
23132         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23133         so it was not fetching variable information from outer blocks.
23134
23135         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23136         Beforefieldinit as it was buggy.
23137
23138         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23139         that Ravi put here.  
23140
23141         * class.cs (Constructor::Emit): Only emit if block is not null.
23142         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23143         deal with this by semantically definining it as if the user had
23144         done it.
23145
23146         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23147         constructors as we now "emit" them at a higher level.
23148
23149         (TypeContainer::DefineDefaultConstructor): Used to define the
23150         default constructors if none was provided.
23151
23152         (ConstructorInitializer): Add methods Resolve and Emit. 
23153
23154         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23155
23156 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23157
23158         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23159         the default constructor builder with our hashtable for methodbuilders
23160         to methodcores.
23161
23162         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23163         and argument_count is 0 in which case we have a match.
23164         (Binary::ResolveOperator): More null checking and miscellaneous coding
23165         style cleanup.
23166
23167 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23168
23169         * rootcontext.cs (IsNameSpace): Compare against null.
23170
23171         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23172
23173         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23174         and Unary::Operator.
23175
23176         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23177         accordingly.
23178
23179         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23180         we have overloaded operators.
23181         (Binary::ResolveOperator): Implement the part which does the operator overload
23182         resolution.
23183
23184         * class.cs (Operator::Emit): Implement.
23185         (TypeContainer::Emit): Emit the operators we have too.
23186
23187         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23188         the case when we have a user-defined operator.
23189
23190 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23191
23192         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23193
23194 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23195
23196         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23197         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23198         (Constructor::Emit): Implement.
23199         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23200         if we have no work to do. 
23201         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23202         Emit method.
23203
23204         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23205         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23206
23207         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23208         of parent.parent.
23209
23210 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23211
23212         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23213         in the source.
23214         (Tree::RecordNamespace): Method to do what the name says ;-)
23215         (Tree::Namespaces): Property to get at the namespaces hashtable.
23216
23217         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23218         keep track.
23219
23220         * rootcontext.cs (IsNamespace): Fixed it :-)
23221
23222 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * class.cs (TypeContainer::FindMembers): Add support for
23225         constructors. 
23226         (MethodCore): New class that encapsulates both the shared aspects
23227         of a Constructor and a Method.  
23228         (Method, Constructor): Factored pieces into MethodCore.
23229
23230         * driver.cs: Added --fatal which makes errors throw exceptions.
23231         Load System assembly as well as part of the standard library.
23232
23233         * report.cs: Allow throwing exceptions on errors for debugging.
23234
23235         * modifiers.cs: Do not use `parent', instead use the real type
23236         container to evaluate permission settings.
23237
23238         * class.cs: Put Ravi's patch back in.  He is right, and we will
23239         have to cope with the
23240
23241 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23242
23243         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23244         FamORAssem, not FamANDAssem.
23245
23246 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23247
23248         * driver.cs: Added --parse option that only parses its input files
23249         and terminates.
23250
23251         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23252         incorrect.  IsTopLevel is not used to tell whether an object is
23253         root_types or not (that can be achieved by testing this ==
23254         root_types).  But to see if this is a top-level *class* (not
23255         necessarly our "toplevel" container). 
23256
23257 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23258
23259         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23260         parent instead of a direct call to GetType.
23261
23262 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23263
23264         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23265         Modifiers.TypeAttr. This should just be a call to that method.
23266
23267         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23268         object so that we can determine if we are top-level or not.
23269
23270         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23271         TypeContainer too.
23272
23273         * enum.cs (Enum::Define): Ditto.
23274
23275         * modifiers.cs (FieldAttr): Re-write.
23276
23277         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23278         (TypeContainer::HaveStaticConstructor): New property to provide access
23279         to precisely that info.
23280
23281         * modifiers.cs (MethodAttr): Re-write.
23282         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23283
23284         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23285         of top-level types as claimed.
23286
23287 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23288
23289         * expression.cs (MemberLookup): Fruitless attempt to lookup
23290         constructors.  Maybe I need to emit default constructors?  That
23291         might be it (currently .NET emits this for me automatically).
23292         (Invocation::OverloadResolve): Cope with Arguments == null.
23293         (Invocation::EmitArguments): new function, shared by the new
23294         constructor and us.
23295         (Invocation::Emit): Handle static and instance methods.  Emit
23296         proper call instruction for virtual or non-virtual invocations.
23297         (New::Emit): Implement.
23298         (New::Resolve): Implement.
23299         (MemberAccess:Resolve): Implement.
23300         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23301         to track instances.
23302         (FieldExpr::Resolve): Set type.
23303
23304         * support.cs: Handle empty arguments.
23305                 
23306         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23307         SimpleLookup): Auxiliary routines to help parse a qualifier
23308         identifier.  
23309
23310         Update qualifier_identifier rule.
23311
23312         * codegen.cs: Removed debugging messages.
23313
23314         * class.cs: Make this a global thing, this acts just as a "key" to
23315         objects that we might have around.
23316
23317         (Populate): Only initialize method_builders_to_methods once.
23318
23319         * expression.cs (PropertyExpr): Initialize type from the
23320         PropertyType. 
23321
23322         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23323         Resolve pattern.  Attempt to implicitly convert value to boolean.
23324         Emit code.
23325
23326         * expression.cs: Set the type for the int32/int32 argument case.
23327         (Binary::ResolveOperator): Set the return type to boolean for
23328         comparission operators
23329
23330         * typemanager.cs: Remove debugging print code.
23331
23332         (Invocation::Resolve): resolve type.
23333
23334         * class.cs: Allocate a MemberInfo of the correct size, as the code
23335         elsewhere depends on the test to reflect the correct contents.
23336
23337         (Method::) Keep track of parameters, due to System.Reflection holes
23338
23339         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23340         mapping here.
23341
23342         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23343         of the exact size and return that.
23344
23345         (Class::LookupMethodByBuilder): New function that maps
23346         MethodBuilders to its methods.  Required to locate the information
23347         on methods because System.Reflection bit us again.
23348
23349         * support.cs: New file, contains an interface ParameterData and
23350         two implementations: ReflectionParameters and InternalParameters
23351         used to access Parameter information.  We will need to grow this
23352         as required.
23353
23354         * expression.cs (Invocation::GetParameterData): implement a cache
23355         and a wrapper around the ParameterData creation for methods. 
23356         (Invocation::OverloadResolve): Use new code.
23357
23358 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23359
23360         * class.cs (TypeContainer::EmitField): Remove and move into 
23361         (Field::Define): here and modify accordingly.
23362         (Field.FieldBuilder): New member.
23363         (TypeContainer::Populate): Update accordingly.
23364         (TypeContainer::FindMembers): Implement.
23365
23366 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23367
23368         * statement.cs: (VariableInfo::VariableType): New field to be
23369         initialized with the full type once it is resolved. 
23370
23371 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23372
23373         * parameter.cs (GetParameterInfo): Use a type cache to compute
23374         things only once, and to reuse this information
23375
23376         * expression.cs (LocalVariableReference::Emit): Implement.
23377         (OpcodeCast::Emit): fix.
23378
23379         (ParameterReference::Resolve): Implement.
23380         (ParameterReference::Emit): Implement.
23381
23382         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23383         that are expressions need to stay as Expressions.
23384
23385         * typemanager.cs (CSharpName): Returns the C# name of a type if
23386         possible. 
23387
23388         * expression.cs (Expression::ConvertImplicit): New function that
23389         implements implicit type conversions.
23390
23391         (Expression::ImplicitReferenceConversion): Implements implicit
23392         reference conversions.
23393
23394         (EmptyCast): New type for transparent casts.
23395
23396         (OpcodeCast): New type for casts of types that are performed with
23397         a sequence of bytecodes.
23398
23399         (BoxedCast): New type used for casting value types into reference
23400         types.  Emits a box opcode.
23401
23402         (Binary::DoNumericPromotions): Implements numeric promotions of
23403         and computation of the Binary::Type.
23404
23405         (Binary::EmitBranchable): Optimization.
23406
23407         (Binary::Emit): Implement code emission for expressions.
23408
23409         * typemanager.cs (TypeManager): Added two new core types: sbyte
23410         and byte.
23411
23412 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23413
23414         * class.cs (TypeContainer::FindMembers): Method which does exactly
23415         what Type.FindMembers does, only we don't have to use reflection. No
23416         implementation yet.
23417
23418         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23419         typecontainer objects as we need to get at them.
23420         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23421
23422         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23423         typecontainer object.
23424
23425         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23426         of just a Report object.
23427
23428 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23429
23430         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23431         "remove_"
23432         (TypeContainer::Populate): Now define the delegates of the type too.
23433         (TypeContainer.Delegates): Property to access the list of delegates defined
23434         in the type.
23435
23436         * delegates.cs (Delegate::Define): Implement partially.
23437
23438         * modifiers.cs (TypeAttr): Handle more flags.
23439
23440 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23441
23442         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23443         and not <=
23444         (Operator::Define): Re-write logic to get types by using the LookupType method
23445         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23446         (Indexer::Define): Ditto.
23447         (Event::Define): Ditto.
23448         (Property::Define): Ditto.
23449
23450 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23451
23452         * class.cs (TypeContainer::Populate): Now define operators too. 
23453         (TypeContainer.Operators): New property to access the list of operators
23454         in a type.
23455         (Operator.OperatorMethodBuilder): New member to hold the method builder
23456         for the operator we are defining.
23457         (Operator::Define): Implement.
23458
23459 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23460
23461         * class.cs (Event::Define): Make the prefixes of the accessor methods
23462         addOn_ and removeOn_ 
23463
23464         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23465         of the location being passed in too. Ideally, this should go later since all
23466         error reporting should be done through the Report object.
23467
23468         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23469         (Populate): Iterate thru the indexers we have and define them too.
23470         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23471         for the get and set accessors.
23472         (Indexer::Define): Implement.
23473
23474 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23477         my previous implementation, did not work.
23478
23479         * typemanager.cs: Add a couple of missing types (the longs).
23480
23481         * literal.cs: Use TypeManager.bool_type instead of getting it.
23482
23483         * expression.cs (EventExpr): New kind of expressions.
23484         (Expressio::ExprClassFromMemberInfo): finish
23485
23486 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23487
23488         * assign.cs: Emit stores to static fields differently.
23489
23490 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23491
23492         * Merge in changes and adjust code to tackle conflicts. Backed out my
23493         code in Assign::Resolve ;-) 
23494
23495 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23496
23497         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23498         instead Report.Error and also pass in the location.
23499         (CSharpParser::Lexer): New readonly property to return the reference
23500         to the Tokenizer object.
23501         (declare_local_variables): Use Report.Error with location instead of plain 
23502         old error.
23503         (CheckDef): Ditto.
23504
23505         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23506         (Operator.CheckBinaryOperator): Ditto.
23507
23508         * cs-parser.jay (operator_declarator): Update accordingly.
23509
23510         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23511         (CheckBinaryOperator): Same here.
23512
23513         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23514         on the name without any prefixes of namespace names etc. This is because we
23515         already might have something already fully qualified like 
23516         'System.Console.WriteLine'
23517
23518         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23519
23520 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23521
23522         * cs-tokenizer.cs (location): Return a string which also contains
23523         the file name.
23524
23525         * expression.cs (ElementAccess): New class for expressions of the
23526         type 'element access.'
23527         (BaseAccess): New class for expressions of the type 'base access.'
23528         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23529         respectively.
23530
23531         * cs-parser.jay (element_access): Implement action.
23532         (base_access): Implement actions.
23533         (checked_expression, unchecked_expression): Implement.
23534
23535         * cs-parser.jay (local_variable_type): Correct and implement.
23536         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23537
23538         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23539
23540         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23541         name and the specifiers.
23542
23543         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23544
23545         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23546         making them all public ;-)
23547
23548         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23549         class anyways.
23550
23551 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23552
23553         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23554         PropertyExprs.
23555         (FieldExpr, PropertyExprs): New resolved expressions.
23556         (SimpleName::MemberStaticCheck): Perform static checks for access
23557         to non-static fields on static methods. Maybe this should be
23558         generalized for MemberAccesses. 
23559         (SimpleName::ResolveSimpleName): More work on simple name
23560         resolution. 
23561
23562         * cs-parser.jay (primary_expression/qualified_identifier): track
23563         the parameter index.
23564
23565         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23566         (EmitContext::EmitBoolExpression): Chain to expression generation
23567         instead of temporary hack.
23568         (::EmitStatementExpression): Put generic expression code generation.
23569
23570         * assign.cs (Assign::Emit): Implement variable assignments to
23571         local variables, parameters and fields.
23572
23573 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23574
23575         * statement.cs (Block::GetVariableInfo): New method, returns the
23576         VariableInfo for a variable name in a block.
23577         (Block::GetVariableType): Implement in terms of GetVariableInfo
23578
23579         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23580         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23581
23582 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23583
23584         * cs-parser.jay (operator_declaration): Continue on my quest : update
23585         to take attributes argument.
23586         (event_declaration): Ditto.
23587         (enum_declaration): Ditto.
23588         (indexer_declaration): Ditto.
23589
23590         * class.cs (Operator::Operator): Update constructor accordingly.
23591         (Event::Event): Ditto.
23592
23593         * delegate.cs (Delegate::Delegate): Same here.
23594
23595         * enum.cs (Enum::Enum): Same here.
23596
23597 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23598
23599         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23600
23601         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23602
23603         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23604         being passed around as an arraylist.
23605         (Attributes::AddAttribute): Method to add attribute sections.
23606
23607         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23608         (struct_declaration): Update accordingly.
23609         (constant_declaration): Update.
23610         (field_declaration): Update.
23611         (method_header): Update.
23612         (fixed_parameter): Update.
23613         (parameter_array): Ditto.
23614         (property_declaration): Ditto.
23615         (destructor_declaration): Ditto.
23616
23617         * class.cs (Struct::Struct): Update constructors accordingly.
23618         (Class::Class): Ditto.
23619         (Field::Field): Ditto.
23620         (Method::Method): Ditto.
23621         (Property::Property): Ditto.
23622         (TypeContainer::OptAttribute): update property's return type.
23623
23624         * interface.cs (Interface.opt_attributes): New member.
23625         (Interface::Interface): Update to take the extra Attributes argument.
23626
23627         * parameter.cs (Parameter::Parameter): Ditto.
23628
23629         * constant.cs (Constant::Constant): Ditto.
23630
23631         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23632         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23633         the attributes as a parameter.
23634         (InterfaceProperty): Update constructor call.
23635         (InterfaceEvent): Ditto.
23636         (InterfaceMethod): Ditto.
23637         (InterfaceIndexer): Ditto.
23638
23639         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23640         pass the attributes too.
23641         (interface_event_declaration): Ditto.
23642         (interface_property_declaration): Ditto.
23643         (interface_method_declaration): Ditto.
23644         (interface_declaration): Ditto.
23645
23646 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23647
23648         * class.cs (Method::Define): Track the "static Main" definition to
23649         create an entry point. 
23650
23651         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23652         EntryPoint if we find it. 
23653
23654         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23655         (EmitContext::ig): Make this variable public.
23656
23657         * driver.cs: Make the default output file be the first file name
23658         with the .exe extension.  
23659
23660         Detect empty compilations
23661
23662         Handle various kinds of output targets.  Handle --target and
23663         rename -t to --dumper.
23664
23665         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23666         methods inherited from Expression return now an Expression.  This
23667         will is used during the tree rewriting as we resolve them during
23668         semantic analysis.
23669
23670         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23671         the spec.  Missing entirely is the information about
23672         accessability of elements of it.
23673
23674         (Expression::ExprClassFromMemberInfo): New constructor for
23675         Expressions that creates a fully initialized Expression based on
23676         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23677         a Type.
23678
23679         (Invocation::Resolve): Begin implementing resolution of invocations.
23680
23681         * literal.cs (StringLiteral):  Implement Emit.
23682
23683 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23684
23685         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23686         member.
23687
23688 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23689
23690         * cs-parser.jay (attribute_arguments): Implement actions.
23691         (attribute): Fix bug in production. Implement action.
23692         (attribute_list): Implement.
23693         (attribute_target): Implement.
23694         (attribute_target_specifier, opt_target_specifier): Implement
23695         (CheckAttributeTarget): New method to check if the attribute target
23696         is valid.
23697         (attribute_section): Implement.
23698         (opt_attributes): Implement.
23699
23700         * attribute.cs : New file to handle attributes.
23701         (Attribute): Class to hold attribute info.
23702
23703         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23704         (attribute_section): Modify production to use 2 different rules to 
23705         achieve the same thing. 1 s/r conflict down !
23706         Clean out commented, useless, non-reducing dimension_separator rules.
23707
23708         * class.cs (TypeContainer.attributes): New member to hold list
23709         of attributes for a type.
23710         (Struct::Struct): Modify to take one more argument, the attribute list.
23711         (Class::Class): Ditto.
23712         (Field::Field): Ditto.
23713         (Method::Method): Ditto.
23714         (Property::Property): Ditto.
23715
23716         * cs-parser.jay (struct_declaration): Update constructor call to
23717         pass in the attributes too.
23718         (class_declaration): Ditto.
23719         (constant_declaration): Ditto.
23720         (field_declaration): Ditto.
23721         (method_header): Ditto.
23722         (fixed_parameter): Ditto.
23723         (parameter_array): Ditto.
23724         (property_declaration): Ditto.
23725
23726         * constant.cs (Constant::Constant): Update constructor similarly.
23727         Use System.Collections.
23728
23729         * parameter.cs (Parameter::Parameter): Update as above.
23730
23731 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23732
23733         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23734         (TypeContainer.delegates): New member to hold list of delegates.
23735
23736         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23737         this time as I seem to be on crack ;-)
23738
23739 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23740
23741         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23742         tell whether an identifier represents a namespace.
23743
23744         * expression.cs (NamespaceExpr): A namespace expression, used only
23745         temporarly during expression resolution.
23746         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23747         utility functions to resolve names on expressions.
23748
23749 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23750
23751         * codegen.cs: Add hook for StatementExpressions. 
23752
23753         * class.cs: Fix inverted test for static flag in methods.
23754
23755 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23756
23757         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23758         to make it coincide with MS' number.
23759         (Operator::CheckBinaryOperator): Ditto.
23760
23761         * ../errors/errors.txt : Remove error numbers added earlier.
23762
23763         * ../errors/cs1019.cs : Test case for error # 1019
23764
23765         * ../errros/cs1020.cs : Test case for error # 1020
23766
23767         * cs-parser.jay : Clean out commented cruft.
23768         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23769         used anywhere - non-reducing rule.
23770         (namespace_declarations): Non-reducing rule - comment out.
23771
23772         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23773         with TypeContainer::AddEnum.
23774
23775         * delegate.cs : New file for delegate handling classes.
23776         (Delegate): Class for declaring delegates.
23777
23778         * makefile : Update.
23779
23780         * cs-parser.jay (delegate_declaration): Implement.
23781
23782 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23783
23784         * class.cs (Event::Define): Implement.
23785         (Event.EventBuilder): New member.
23786
23787         * class.cs (TypeContainer::Populate): Update to define all enums and events
23788         we have.
23789         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23790         readonly fields for all these cases ?
23791
23792 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23793
23794         * class.cs (Property): Revamp to use the convention of making fields readonly.
23795         Accordingly modify code elsewhere.
23796
23797         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23798         the Define method of the Property class.
23799
23800         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23801         trivial bug.
23802         (TypeContainer::Populate): Update to define all the properties we have. Also
23803         define all enumerations.
23804
23805         * enum.cs (Define): Implement.
23806
23807 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23808
23809         * cs-parser.jay (overloadable_operator): The semantic value is an
23810         enum of the Operator class.
23811         (operator_declarator): Implement actions.
23812         (operator_declaration): Implement.
23813
23814         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23815         validity of definitions.
23816         (Operator::CheckBinaryOperator): Static method to check for binary operators
23817         (TypeContainer::AddOperator): New method to add an operator to a type.
23818
23819         * cs-parser.jay (indexer_declaration): Added line to actually call the
23820         AddIndexer method so it gets added ;-)
23821
23822         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23823         already taken care of by the MS compiler ?  
23824
23825 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23826
23827         * class.cs (Operator): New class for operator declarations.
23828         (Operator::OpType): Enum for the various operators.
23829
23830 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23831
23832         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23833         ostensibly handle this in semantic analysis.
23834
23835         * cs-parser.jay (general_catch_clause): Comment out
23836         (specific_catch_clauses, specific_catch_clause): Ditto.
23837         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23838         (catch_args, opt_catch_args): New productions.
23839         (catch_clause): Rewrite to use the new productions above
23840         (catch_clauses): Modify accordingly.
23841         (opt_catch_clauses): New production to use in try_statement
23842         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23843         and re-write the code in the actions to extract the specific and
23844         general catch clauses by being a little smart ;-)
23845
23846         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23847         Hooray, try and catch statements parse fine !
23848
23849 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23850
23851         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23852         string from the hashtable of variables.
23853
23854         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23855         I end up making that mistake ;-)
23856         (catch_clauses): Fixed gross error which made Key and Value of the 
23857         DictionaryEntry the same : $1 !!
23858
23859 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23860
23861         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23862
23863         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23864         when the add and remove accessors are specified. 
23865
23866 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23867
23868         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23869         information about indexer_declarator.
23870         (indexer_declarator): Implement actions.
23871         (parsing_indexer): New local boolean used to keep track of whether
23872         we are parsing indexers or properties. This is necessary because 
23873         implicit_parameters come into picture even for the get accessor in the 
23874         case of an indexer.
23875         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23876
23877         * class.cs (Indexer): New class for indexer declarations.
23878         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23879         (TypeContainer::indexers): New member to hold list of indexers for the
23880         type.
23881
23882 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23883
23884         * cs-parser.jay (add_accessor_declaration): Implement action.
23885         (remove_accessor_declaration): Implement action.
23886         (event_accessors_declaration): Implement
23887         (variable_declarators): swap statements for first rule - trivial.
23888
23889         * class.cs (Event): New class to hold information about event
23890         declarations.
23891         (TypeContainer::AddEvent): New method to add an event to a type
23892         (TypeContainer::events): New member to hold list of events.
23893
23894         * cs-parser.jay (event_declaration): Implement actions.
23895
23896 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23897
23898         * cs-parser.jay (dim_separators): Implement. Make it a string
23899         concatenating all the commas together, just as they appear.
23900         (opt_dim_separators): Modify accordingly
23901         (rank_specifiers): Update accordingly. Basically do the same
23902         thing - instead, collect the brackets here.
23903         (opt_rank_sepcifiers): Modify accordingly.
23904         (array_type): Modify to actually return the complete type string
23905         instead of ignoring the rank_specifiers.
23906         (expression_list): Implement to collect the expressions
23907         (variable_initializer): Implement. We make it a list of expressions
23908         essentially so that we can handle the array_initializer case neatly too.
23909         (variable_initializer_list): Implement.
23910         (array_initializer): Make it a list of variable_initializers
23911         (opt_array_initializer): Modify accordingly.
23912
23913         * expression.cs (New::NType): Add enumeration to help us
23914         keep track of whether we have an object/delegate creation
23915         or an array creation.
23916         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23917         members to hold data about array creation.
23918         (New:New): Modify to update NewType
23919         (New:New): New Overloaded contructor for the array creation
23920         case.
23921
23922         * cs-parser.jay (array_creation_expression): Implement to call
23923         the overloaded New constructor.
23924
23925 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23926
23927         * class.cs (TypeContainer::Constructors): Return member
23928         constructors instead of returning null.
23929
23930 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23931
23932         * typemanager.cs (InitCoreTypes): Initialize the various core
23933         types after we have populated the type manager with the user
23934         defined types (this distinction will be important later while
23935         compiling corlib.dll)
23936
23937         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23938         on Expression Classification.  Now all expressions have a method
23939         `Resolve' and a method `Emit'.
23940
23941         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23942         generation from working.     Also add some temporary debugging
23943         code. 
23944
23945 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23946
23947         * codegen.cs: Lots of code generation pieces.  This is only the
23948         beginning, will continue tomorrow with more touches of polish.  We
23949         handle the fundamentals of if, while, do, for, return.  Others are
23950         trickier and I need to start working on invocations soon.
23951
23952         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23953         s.InitStatement. 
23954
23955         * codegen.cs (EmitContext): New struct, used during code
23956         emission to keep a context.   Most of the code generation will be
23957         here. 
23958
23959         * cs-parser.jay: Add embedded blocks to the list of statements of
23960         this block.  So code generation proceeds in a top down fashion.
23961
23962 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23963
23964         * statement.cs: Add support for multiple child blocks.
23965
23966 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23967
23968         * codegen.cs (EmitCode): New function, will emit the code for a
23969         Block of code given a TypeContainer and its ILGenerator. 
23970
23971         * statement.cs (Block): Standard public readonly optimization.
23972         (Block::Block constructors): Link children. 
23973         (Block::Child): Child Linker.
23974         (Block::EmitVariables): Emits IL variable declarations.
23975
23976         * class.cs: Drop support for MethodGroups here, delay until
23977         Semantic Analysis.
23978         (Method::): Applied the same simplification that I did before, and
23979         move from Properties to public readonly fields.
23980         (Method::ParameterTypes): Returns the parameter types for the
23981         function, and implements a cache that will be useful later when I
23982         do error checking and the semantic analysis on the methods is
23983         performed.
23984         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23985         and made a method, optional argument tells whether this is a class
23986         or a structure to apply the `has-this' bit.
23987         (Method::GetCallingConvention): Implement, returns the calling
23988         convention. 
23989         (Method::Define): Defines the type, a second pass is performed
23990         later to populate the methods.
23991
23992         (Constructor::ParameterTypes): implement a cache similar to the
23993         one on Method::ParameterTypes, useful later when we do semantic
23994         analysis. 
23995
23996         (TypeContainer::EmitMethod):  New method.  Emits methods.
23997
23998         * expression.cs: Removed MethodGroup class from here.
23999
24000         * parameter.cs (Parameters::GetCallingConvention): new method.
24001
24002 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24003
24004         * class.cs (TypeContainer::Populate): Drop RootContext from the
24005         argument. 
24006
24007         (Constructor::CallingConvention): Returns the calling convention.
24008         (Constructor::ParameterTypes): Returns the constructor parameter
24009         types. 
24010
24011         (TypeContainer::AddConstructor): Keep track of default constructor
24012         and the default static constructor.
24013
24014         (Constructor::) Another class that starts using `public readonly'
24015         instead of properties. 
24016
24017         (Constructor::IsDefault): Whether this is a default constructor. 
24018
24019         (Field::) use readonly public fields instead of properties also.
24020
24021         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24022         track of static constructors;  If none is used, turn on
24023         BeforeFieldInit in the TypeAttributes. 
24024
24025         * cs-parser.jay (opt_argument_list): now the return can be null
24026         for the cases where there are no arguments. 
24027
24028         (constructor_declarator): If there is no implicit `base' or
24029         `this', then invoke the default parent constructor. 
24030
24031         * modifiers.cs (MethodAttr): New static function maps a set of
24032         modifiers flags into a MethodAttributes enum
24033         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24034         MethodAttr, TypeAttr to represent the various mappings where the
24035         modifiers are used.
24036         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24037
24038 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24039
24040         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24041         method arguments.
24042
24043         * interface.cs (PopulateIndexer): Implemented the code generator
24044         for interface indexers.
24045
24046 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24047
24048         * interface.cs (InterfaceMemberBase): Now we track the new status
24049         here.  
24050
24051         (PopulateProperty): Implement property population.  Woohoo!  Got
24052         Methods and Properties going today. 
24053
24054         Removed all the properties for interfaces, and replaced them with
24055         `public readonly' fields. 
24056
24057 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24058
24059         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24060         initialize their hashtables/arraylists only when they are needed
24061         instead of doing this always.
24062
24063         * parameter.cs: Handle refs and out parameters.
24064
24065         * cs-parser.jay: Use an ArrayList to construct the arguments
24066         instead of the ParameterCollection, and then cast that to a
24067         Parameter[] array.
24068
24069         * parameter.cs: Drop the use of ParameterCollection and use
24070         instead arrays of Parameters.
24071
24072         (GetParameterInfo): Use the Type, not the Name when resolving
24073         types. 
24074
24075 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24076
24077         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24078         and instead use public readonly fields.
24079
24080         * class.cs: Put back walking code for type containers.
24081
24082 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24083
24084         * class.cs (MakeConstant): Code to define constants.
24085
24086         * rootcontext.cs (LookupType): New function.  Used to locate types 
24087
24088
24089 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24090
24091         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24092         this System.Reflection code is.  Kudos to Microsoft
24093
24094         * typemanager.cs: Implement a type cache and avoid loading all
24095         types at boot time.  Wrap in LookupType the internals.  This made
24096         the compiler so much faster.  Wow.  I rule!
24097
24098         * driver.cs: Make sure we always load mscorlib first (for
24099         debugging purposes, nothing really important).
24100
24101         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24102         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24103
24104         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24105         on namespaces that have been imported using the `using' keyword.
24106
24107         * class.cs (TypeContainer::TypeAttr): Virtualize.
24108         (Class::TypeAttr): Return attributes suitable for this bad boy.
24109         (Struct::TypeAttr): ditto.
24110         Handle nested classes.
24111         (TypeContainer::) Remove all the type visiting code, it is now
24112         replaced with the rootcontext.cs code
24113
24114         * rootcontext.cs (GetClassBases): Added support for structs. 
24115
24116 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24117
24118         * interface.cs, statement.cs, class.cs, parameter.cs,
24119         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24120         Drop use of TypeRefs, and use strings instead.
24121
24122 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24123
24124         * rootcontext.cs: 
24125
24126         * class.cs (Struct::Struct): set the SEALED flags after
24127         checking the modifiers.
24128         (TypeContainer::TypeAttr): new property, returns the
24129         TypeAttributes for a class.  
24130
24131         * cs-parser.jay (type_list): Oops, list production was creating a
24132         new list of base types.
24133
24134         * rootcontext.cs (StdLib): New property.
24135         (GetInterfaceTypeByName): returns an interface by type name, and
24136         encapsulates error handling here.
24137         (GetInterfaces): simplified.
24138         (ResolveTree): Encapsulated all the tree resolution here.
24139         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24140         types. 
24141
24142         * driver.cs: Add support for --nostdlib, to avoid loading the
24143         default assemblies.
24144         (Main): Do not put tree resolution here. 
24145
24146         * rootcontext.cs: Beginning of the class resolution.
24147
24148 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24149
24150         * rootcontext.cs: Provide better error reporting. 
24151
24152         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24153
24154         * rootcontext.cs (CreateInterface): Handle the case where there
24155         are no parent interfaces.
24156
24157         (CloseTypes): Routine to flush types at the end.
24158         (CreateInterface): Track types.
24159         (GetInterfaces): Returns an array of Types from the list of
24160         defined interfaces.
24161
24162         * typemanager.c (AddUserType): Mechanism to track user types (puts
24163         the type on the global type hash, and allows us to close it at the
24164         end). 
24165
24166 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24167
24168         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24169         RecordInterface instead.
24170
24171         * cs-parser.jay: Updated to reflect changes above.
24172
24173         * decl.cs (Definition): Keep track of the TypeBuilder type that
24174         represents this type here.  Not sure we will use it in the long
24175         run, but wont hurt for now.
24176
24177         * driver.cs: Smaller changes to accomodate the new code.
24178
24179         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24180         when done. 
24181
24182         * rootcontext.cs (CreateInterface):  New method, used to create
24183         the System.TypeBuilder type for interfaces.
24184         (ResolveInterfaces): new entry point to resolve the interface
24185         hierarchy. 
24186         (CodeGen): Property, used to keep track of the code generator.
24187
24188 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24189
24190         * cs-parser.jay: Add a second production for delegate_declaration
24191         with `VOID'.
24192
24193         (enum_body): Put an opt_comma here instead of putting it on
24194         enum_body or enum_member_declarations so we can handle trailing
24195         commas on enumeration members.  Gets rid of a shift/reduce.
24196
24197         (type_list): Need a COMMA in the middle.
24198
24199         (indexer_declaration): Tell tokenizer to recognize get/set
24200
24201         * Remove old targets.
24202
24203         * Re-add the parser target.
24204
24205 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24206
24207         * cs-parser.jay: Add precendence rules for a number of operators
24208         ot reduce the number of shift/reduce conflicts in the grammar.
24209
24210 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24211
24212         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24213         and put it here.
24214
24215         Get rid of old crufty code.
24216
24217         * rootcontext.cs: Use this to keep track of the parsed
24218         representation and the defined types available to the program. 
24219
24220         * gen-treedump.cs: adjust for new convention.
24221
24222         * type.cs: Split out the type manager, and the assembly builder
24223         from here. 
24224
24225         * typemanager.cs: the type manager will live here now.
24226
24227         * cil-codegen.cs: And the code generator here. 
24228
24229 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24230
24231         * makefile: Fixed up for easy making.
24232
24233 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24234
24235         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24236         the 
24237
24238         (unary_expression): Expand pre_increment_expression and
24239         post_decrement_expression to reduce a shift/reduce.
24240
24241 2001-07-11  Simon Cozens
24242
24243         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24244
24245         Improve allow_keyword_as_indent name.
24246
24247 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24248
24249         * Adjustments for Beta2. 
24250
24251 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24252
24253         * decl.cs: Added `Define' abstract method.
24254         (InTransit): new property, used to catch recursive definitions. 
24255
24256         * interface.cs: Implement `Define'. 
24257
24258         * modifiers.cs: Map Modifiers.constants to
24259         System.Reflection.TypeAttribute flags.
24260
24261         * class.cs: Keep track of types and user-defined types.
24262         (BuilderInit): New method for creating an assembly
24263         (ResolveType): New function to launch the resolution process, only
24264         used by interfaces for now.
24265
24266         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24267         that are inserted into the name space. 
24268
24269 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24270
24271         * ARGH.  I have screwed up my tree so many times due to the use of
24272         rsync rather than using CVS.  Going to fix this at once. 
24273
24274         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24275         load types.
24276
24277 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24278
24279         * Experiment successful: Use System.Type rather that our own
24280         version of Type.  
24281
24282 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24283
24284         * cs-parser.jay: Removed nsAliases from here.
24285
24286         Use new namespaces, handle `using XXX;' 
24287
24288         * namespace.cs: Reimplemented namespace handling, use a recursive
24289         definition of the class.  Now we can keep track of using clauses
24290         and catch invalid using clauses.
24291
24292 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * gen-treedump.cs: Adapted for all the renaming.
24295
24296         * expression.cs (Expression): this class now has a Type property
24297         which returns an expression Type.
24298
24299         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24300         `Type', as this has a different meaning now in the base
24301
24302 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24303
24304         * interface.cs, class.cs: Removed from all the sources the
24305         references to signature computation, as we can not do method
24306         signature computation during the parsing time, as we are not
24307         trying to solve at that point distinguishing:
24308
24309         class X {
24310                 void a (Blah x) {}
24311                 void a (NS.Blah x) {}
24312         }
24313
24314         Which depending on the context might be valid or not, as we do not
24315         know if Blah is the same thing as NS.Blah at that point.
24316
24317         * Redid everything so the code uses TypeRefs now instead of
24318         Types.  TypeRefs are just temporary type placeholders, that need
24319         to be resolved.  They initially have a pointer to a string and the
24320         current scope in which they are used.  This is used later by the
24321         compiler to resolve the reference to an actual Type. 
24322
24323         * DeclSpace is no longer a CIR.Type, and neither are
24324         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24325         are all DeclSpaces, but no Types. 
24326
24327         * type.cs (TypeRefManager): This implements the TypeRef manager,
24328         which keeps track of all the types that need to be resolved after
24329         the parsing has finished. 
24330
24331 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24332
24333         * ARGH.  We are going to have to store `foreach' as a class rather
24334         than resolving it, as we need to verify error 1579 after name
24335         resolution.   *OR* we could keep a flag that says `This request to
24336         IEnumerator comes from a foreach statement' which we can then use
24337         to generate the error.
24338
24339 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24340
24341         * class.cs (TypeContainer.AddMethod): we now add methods to the
24342         MethodGroup instead of the method hashtable.  
24343
24344         * expression.cs: Add MethodGroup abstraction, which gets us one
24345         step closer to the specification in the way we handle method
24346         declarations.  
24347
24348         * cs-parser.jay (primary_expression): qualified_identifier now
24349         tried to match up an identifier to a local variable reference or
24350         to a parameter reference.
24351
24352         current_local_parameters is now a parser global variable that
24353         points to the current parameters for the block, used during name
24354         lookup.
24355
24356         (property_declaration): Now creates an implicit `value' argument to
24357         the set accessor.
24358
24359 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24360
24361         * parameter.cs: Do not use `param' arguments as part of the
24362         signature, per the spec.
24363
24364 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24365
24366         * decl.cs: Base class for classes, structs and interfaces.  This
24367         is the "Declaration Space" 
24368
24369         * cs-parser.jay: Use CheckDef for checking declaration errors
24370         instead of having one on each function.
24371
24372         * class.cs: Factor out some code for handling error handling in
24373         accordance to the "Declarations" section in the "Basic Concepts"
24374         chapter in the ECMA C# spec.
24375
24376         * interface.cs: Make all interface member classes derive from
24377         InterfaceMemberBase.
24378
24379 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24380
24381         * Many things: all interfaces are parsed and generated in
24382         gen-treedump.  Support for member variables, constructors,
24383         destructors, properties, constants is there.
24384
24385         Beginning of the IL backend, but very little done, just there for
24386         testing purposes. 
24387
24388 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24389
24390         * cs-parser.jay: Fix labeled statement.
24391
24392         * cs-tokenizer.cs (escape): Escape " and ' always.
24393         ref_line, ref_name: keep track of the line/filename as instructed
24394         by #line by the compiler.
24395         Parse #line.
24396
24397 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24398
24399         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24400         to match the values in System.CodeDOM.
24401
24402         Divid renamed to Divide.
24403
24404         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24405         statements. 
24406         (Statements.set): remove.
24407
24408         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24409         statements. 
24410
24411         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24412         falseStatements always have valid values. 
24413
24414         * cs-parser.jay: Use System.CodeDOM now.
24415