3c33e874e803509e35fde820e31c5a74daeaaed6
[mono.git] / mcs / mcs / ChangeLog
1 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #79987
4         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5         check to a base class.
6         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7         only when assembly has missing attribute.
8         * report.cs: Update.
9
10 2006-11-21  Marek Safar  <marek.safar@gmail.com>
11
12         * cs-tokenizer.cs: Merged with gmcs version.
13
14 2006-11-20  Marek Safar  <marek.safar@gmail.com>
15
16         * cs-tokenizer.cs,
17         * cs-parser.jay: Better error message when partial keyword is misplaced.
18
19 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
20
21         A fix for bug #79810
22         report.cs: CS1058 only applies to 2.0 profile (gmcs).
23         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
24         a RuntimeWrappedException by default.
25
26 2006-11-18  Marek Safar  <marek.safar@gmail.com>
27
28         A fix for bug #79843
29         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
30         implementation.
31         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
32
33 2006-11-18  Marek Safar  <marek.safar@gmail.com>
34
35         * driver.cs, namespace.cs: Uses faster IndexOf version.
36
37 2006-11-17  Marek Safar  <marek.safar@gmail.com>
38
39         A fix for bug #79941
40         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
41         operators.
42         (Operator.Define): Implicit/Explicit operator of same type is duplicate
43         even if internal name is different.
44         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
45         (UserDefinedConversion): Simplified as the operators cannot be internal.
46         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
47         conversions.
48         (MethodLookup): Replaced EmitContext with parentType.
49         * expression.cs: Updated.
50
51 2006-11-09  Raja R Harinath  <rharinath@novell.com>
52
53         * driver.cs (BadAssembly): Handle all the ugliness of
54         DefineDynamicAssembly.
55
56 2006-11-08  Raja R Harinath  <rharinath@novell.com>
57
58         Address parts of #58244 -- most of what's left is in the runtime
59         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
60         CS1509 error checks, and handle them for all assembly loads, not
61         just the first invocation.
62         (LoadModule): Likewise.  Move handling of 'adder_method' ...
63         * codegen.cs (AssemblyClass.AddModule): ... here.
64
65 2006-11-02  Marek Safar  <marek.safar@gmail.com>
66
67         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
68         IEnumerable<T> is ambiguous.
69
70 2006-10-31  Marek Safar  <marek.safar@gmail.com>
71
72         A fix for bug #67689
73         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
74         GetEnumerator is ambiguous.
75
76         * report.cs: Add new warning.
77
78 2006-10-29  Marek Safar  <marek.safar@gmail.com>
79
80         A fix for bug #78602
81         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
82         to protected member can be nested type.
83
84 2006-10-28  Marek Safar  <marek.safar@gmail.com>
85
86         A fix for bug #78965
87         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
88         to protected member must derive from current type.
89
90 2006-10-27  Marek Safar  <marek.safar@gmail.com>
91
92         assign.cs: Reuses error method.
93
94         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
95         instead of type for constants.
96         (Expression.Error_ValueAssignment): Common error method.
97
98         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
99         for any assignment.
100
101 2006-10-27  Marek Safar  <marek.safar@gmail.com>
102
103         A fix for bug #79081
104         * expression.cs (MemberAccess.DoResolve): Check nested type
105         accessibility.
106
107 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
108
109         * doc.cs : nested delegates were not handled. Fixed bug #79754.
110
111 2006-10-26  Marek Safar  <marek.safar@gmail.com>
112
113         A fix for bug #76591
114         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
115
116 2006-10-26  Marek Safar  <marek.safar@gmail.com>
117
118         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
119         type forwarder of the same type multiple times.
120
121 2006-10-26  Raja R Harinath  <rharinath@novell.com>
122
123         Fix #78820
124         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
125         instance as an rvalue, even when we later resolve as an lvalue.
126
127 2006-10-25  Martin Baulig  <martin@ximian.com>
128
129         * anonymous.cs: Fix #79673.
130
131 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
132
133         A fix for bug #79666
134         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
135         ignored when is optimized (= default value) as its value is already set.
136
137 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
138
139         A fix for bug #79724
140         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
141         TypeContainer for type lookup.
142
143 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
144
145         A fix for bug #79231
146         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
147         * expression.cs (OverloadResolve): Always convert type name for
148         an error message.
149         (ResolveNamespaceOrType): Don't confuse a nested type with any 
150         other member.
151
152 2006-10-18  Martin Baulig <martin@ximian.com>
153
154         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
155
156 2006-10-17  Miguel de Icaza  <miguel@novell.com>
157
158         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
159         an int32, but requesting an int64 from the conversion
160
161 2006-10-12  Martin Baulig  <martin@ximian.com>
162
163         * anonymous.cs
164         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
165         
166 2006-10-12  Martin Baulig  <martin@ximian.com>
167
168         * statement.cs
169         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
170
171 2006-10-11  Miguel de Icaza  <miguel@novell.com>
172
173         * convert.cs: Remove broken code: I was doing the "Existance"
174         tests for Implicit conversions.
175
176 2006-10-10  Miguel de Icaza  <miguel@novell.com>
177
178         * convert.cs: Added one missing case in
179         ImplicitStandardConversionExists uint64 to intptr.
180
181         Fixes #59800
182         
183         * typemanager.cs (uintptr_type): another core known type.   
184
185         * ecore.cs (OperatorCast): routine used to do cast operations that
186         depend on op_Explicit.  We could change some of the Decimal
187         conversions to use this.
188
189         This one has a probe mechanism that checks both types for an op_
190         which it coudl be used to eliminate two classes: CastToDecimal
191         and CastFromDecimal.
192
193         * convert.cs: Implement the conversions documented in #59800
194         
195 2006-10-10  Martin Baulig  <martin@ximian.com>
196
197         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
198         before RootScope.ResolveMembers().
199
200         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
201         `CurrentType' if appropriate.
202
203 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
204
205         A fix for bug #78568
206         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
207         when contains binary operators.
208         * cs-parser.jay: Updated.
209
210 2006-10-09  Martin Baulig  <martin@ximian.com>
211
212         * delegate.cs
213         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
214         moved that into Define() and also do the other type parameter
215         checks there.  Fixes #79094.  Added gtest-292.cs.
216
217         * expression.cs
218         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
219         since that doesn't include type parameters; don't use `Ldelema'
220         for type parameters.  Fixes #78980.  Added gtest-293.cs.
221
222 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
223
224         A fix for #77796
225         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
226         conversion is allowed.
227
228 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
229
230         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
231         error reporting when no error occurs.
232
233 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
234
235         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
236         does not exist.
237
238 2006-10-06  Raja R Harinath  <rharinath@novell.com>
239
240         Fix #79584
241         * class.cs (DefineTypeBuilder): Check circular dependencies before
242         setting the parent of the TypeBuilder.
243         (CheckRecursiveDefinition): Don't use 'BaseType', since
244         it may not be valid until after DefineTypeBuilder.  Use
245         'base_type' instead.
246
247 2006-10-04  Martin Baulig  <martin@ximian.com>
248
249         Merged the Anonymous Methods patch.
250
251         * anonymous.cs, iterators.cs: The new anonymous methods code.
252
253         * statement.cs (Variable): New public abstract class.
254         (LocalInfo.Variable): New public property.
255         (LocalInfo.ResolveVariable): New public method.
256         (Block.Flags): Add `IsIterator'.
257         (Block.AddVariable): Improved the CS0136 check.
258         (Block.AnonymousChildren): New public property.
259         (Block.AddAnonymousChild): New public method.
260         (ToplevelBlock): Update to use the new anonymous method framework.
261         (ToplevelBlock.ctor): `container' is now a `Block' and not a
262         `ToplevelBlock'; this is required to correctly implement the
263         CS0136 check.
264         (Fixed, Using): Use `TemporaryVariable' instead of directly
265         creating the `LocalBuilder'.
266
267         * parameter.cs (Parameter.ResolveVariable): New public method.
268         (Parameters.ResolveVariable): Likewise.
269
270         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
271
272         * class.cs (TypeContainer): Replaced the `iterators' list and
273         corresponding methods with a list of `CompilerGeneratedClass'es.
274         (TypeContainer.ResolveMembers): New public method.
275         (Method): `IIteratorContainer' has been replaced by
276         `IAnonymousHost'.
277
278         * expression.cs (VariableReference): New public abstract base
279         class for `LocalVariableReference', `ParameterReference' and
280         `This'.
281
282         * codegen.cs (EmitContext): Removed `capture_context',
283         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
284         (EmitContext.EmitThis): Removed.
285
286         * cs-parser.jay: Replace `iterator_container' with
287         `anonymous_host'.       
288
289 2006-10-04  Martin Baulig  <martin@ximian.com>
290
291         * generic.cs (GenericMethod): Don't make this abstract.
292         (Constraints.Clone): Added dummy implementation.
293
294 2006-10-04  Raja R Harinath  <harinath@gmail.com>
295
296         Fix #79577
297         * namespace.cs (LookForAnyGenericType): Avoid nullref on
298         'declspaces'.  Avoid allocating arrays willy-nilly.
299
300         Fix #79553
301         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
302         cases out of the switch.
303
304 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
305
306         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
307         message when non-generic type is used with the type arguments.
308         * expression.cs: Updated.
309
310 2006-09-28  Raja R Harinath  <rharinath@novell.com>
311
312         Fix #79013
313         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
314         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
315         Change semantics slightly.  Don't insist on having only one
316         temporary EmptyExpression -- just throttle the creation of new ones.
317
318         Fix #79451
319         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
320         non-interfaces too.  If no methods are found, don't try to create
321         a MethodGroupExpr.
322
323 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
324
325         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
326         generic type.
327
328         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
329         us produce better error message.
330
331 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
332
333         * expression.cs (Binary.ResolveOperator): Warn about a side effect
334         of the `|' operator.
335
336         * report.cs: A new warning added.
337
338 2006-09-27  Martin Baulig  <martin@ximian.com>
339
340         * generic.cs (GenericMethod): Don't make this abstract.
341
342 2006-09-27  Martin Baulig  <martin@ximian.com>
343
344         * report.cs
345         (InternalErrorException): Added overloaded ctor taking a params array.
346
347 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
348
349         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
350         Fixed the cases when same error was reported twice.
351
352         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
353         now report symbol information.
354
355 2006-09-25  Martin Baulig  <martin@ximian.com>
356
357         * class.cs: Completely unified with the gmcs version.
358
359 2006-09-25  Martin Baulig  <martin@ximian.com>
360
361         * typemanager.cs (TypeManager.IsNullableType): New public function.
362         (TypeManager.IsNullableTypeOf): Likewise.
363         (TypeManager.IsNullableValueType): Likewise.
364
365         * class.cs (MethodCore): Added the `GenericMethod' argument from
366         gmcs and also unified all classes derived from `MethodCore' with gmcs.
367
368 2006-09-24  Raja R Harinath  <harinath@gmail.com>
369
370         * convert.cs: Unify with gmcs version.
371
372 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
373
374         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
375         verify them as well.
376
377         * report.cs: New warning.
378
379 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
380
381         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
382         for anonymous block with out argument.
383
384 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
385
386         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
387         not used private events only.
388
389 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
390
391         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
392
393         * const.cs (Const.Define): Check for constant type.
394         (Const.IsConstantTypeValid): Looks for valid constant types.
395
396         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
397
398         * ecore.cs (EmptyConstantCast): New common class for all constant based
399         EmptyCast(s).
400
401         * expression.cs (Is.DoResolve): Handle null constant especially.
402         (New.DoResolve): Check for new void().
403         (MemberAccess.DoResolve): Cope with all kind of nulls.
404
405         * literal.cs (NullConstant): Uses EmptyConstantCast.
406         (NullDefault): Based on EmptyConstantCast.
407         (NullLiteral): Uses EmptyConstantCast.
408
409         * statement.cs (Block.ResolveMeta): Check for constant type.
410
411 2006-09-22  Martin Baulig  <martin@ximian.com>
412
413         * delegate.cs, attribute.cs: Merged with the gmcs versions.
414
415 2006-09-22  Raja R Harinath  <rharinath@novell.com>
416
417         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
418         not the null type.
419
420         Fix part of #79451
421         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
422         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
423         code slightly.
424
425 2006-09-22  Martin Baulig  <martin@ximian.com>
426
427         * ecore.cs: Merged with the gmcs version.
428
429         * generic.cs (ConstructedType): New dummy class.
430         (TypeArguments): Don't make this abstract.
431
432         * typemanager.cs
433         (TypeManager.IsGenericTypeDefinition): New method.
434         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
435
436 2006-09-22  Raja R Harinath  <rharinath@novell.com>
437
438         * expression.cs (ComposedCast): Check for arrays of TypedReference
439         before creating the type, not after.
440
441 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
442
443         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
444         after ToType change.
445
446         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
447         when constant must be implicitly convertible.
448
449         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
450
451         * ecore.cs (NullCast): Derives from NullConstant.
452
453         * expression.cs (Is.DoResolve): Removed useless variables.
454         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
455         (New.Constantify): Add enum support.
456         (MemberAccess.DoResolve): Add warning when accessing null constant or
457         variable.
458
459         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
460         property.
461
462         * literal.cs (NullConstant): New abstract class with common
463         functionality for all null specializations.
464         (NullDefault): Represents default(X) when result can be
465         reduced to null.
466         (NullLiteral): Updated.
467
468         * report.cs: Add new warning.
469
470 2006-09-21  Martin Baulig  <martin@ximian.com>
471
472         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
473
474 2006-09-21  Martin Baulig  <martin@ximian.com>
475
476         * generic.cs (GenericConstraints): New dummy class.
477         (Constraints): Likewise.
478         (TypeParameter): Likewise.
479         (TypeParameterName): Likewise.
480         (GenericMethod): Likewise.
481
482         * typemanager.cs (TypeManager.GetGenericArguments): New method.
483
484         * decl.cs: Merged with the gmcs version.
485
486 2006-09-21  Raja R Harinath  <rharinath@novell.com>
487
488         * generic.cs (TypeParameter): Implement IMemberContainer.
489         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
490
491         * rootcontext.cs: Unify with gmcs version.
492
493         * report.cs: Unify with gmcs version.
494         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
495         from gmcs/generics.cs.
496         * generics.cs (TypeParameter): New dummy class.
497
498         * support.cs: Unify with gmcs version.
499
500 2006-09-20  Raja R Harinath  <rharinath@novell.com>
501
502         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
503         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
504
505         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
506         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
507         * mcs.exe.sources: Add generic.cs.
508
509         * codegen.cs: Unify with gmcs version.
510
511         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
512         (EmitContext): Add GenericDeclContainer implementation.
513         * decl.cs (MemberCore, DeclSpace): Likewise.
514         * namespace.cs: Remove #ifdef GMCS_SOURCE.
515
516         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
517         MCS TypeManager has a corresponding dummy method.
518
519 2006-09-19  Martin Baulig  <martin@ximian.com>
520
521         * expression.cs: Completely merged with the gmcs version.
522
523 2006-09-19  Martin Baulig  <martin@ximian.com>
524
525         * expression.cs (Invocation): Merged with the gmcs version.
526         (ArrayAccess.GetStoreOpcode): Likewise.
527
528 2006-09-19  Martin Baulig  <martin@ximian.com>
529
530         * typemanager.cs
531         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
532         (TypeManager.IsGenericMethodDefinition): Likewise.
533
534 2006-09-19  Martin Baulig  <martin@ximian.com>
535
536         * typemanager.cs
537         (TypeManager.IsEqual): Moved the gmcs implementation here.
538         (TypeManager.DropGenericTypeArguments): Likewise.
539         (TypeManager.DropGenericMethodArguments): Likewise.
540         (TypeManager.GetTypeArguments): Moved here from gmcs.
541         (TypeManager.HasGenericArguments): Likewise.
542
543 2006-09-19  Martin Baulig  <martin@ximian.com>
544
545         * expression.cs (Binary): Merged with the gmcs version.
546
547 2006-09-19  Martin Baulig  <martin@ximian.com>
548
549         * expression.cs (Probe, As, Is): Merged with the gmcs version.
550
551 2006-09-19  Martin Baulig  <martin@ximian.com>
552
553         * typemanager.cs: Merged with the gmcs version.
554
555 2006-09-16  Raja R Harinath  <rharinath@novell.com>
556
557         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
558         * driver.cs: Likewise.
559
560 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
561
562         A fix for #79401
563         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
564         only if parent type is class.
565         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
566         update.
567
568 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
569
570         * cs-parser.jay,
571         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
572         keywords are used.
573         * typemanager.cs(CSharpName): Converts NullType to null.
574
575 2006-09-15  Martin Baulig  <martin@ximian.com>
576
577         * typemanager.cs
578         (TypeManager.GetMethodName): Added mcs implementation.
579         (TypeManager.IsEqual): Likewise.
580
581         * ecore.cs
582         (SimpleName.RemoveGenericArity): Added dummy implementation.
583
584         * pending.cs: Merged with the gmcs version.     
585
586 2006-09-15  Martin Baulig  <martin@ximian.com>
587
588         * statement.cs: Merge with the gmcs version.
589
590 2006-09-15  Martin Baulig  <martin@ximian.com>
591
592         * statement.cs (Switch): Merge with the gmcs implementation
593         (without nullables), which is newer.
594
595 2006-09-15  Martin Baulig  <martin@ximian.com>
596
597         * statement.cs (Block.Variables): Make this public.
598         (ToplevelBlock.Parameters): Make this a property.
599         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
600
601 2006-09-15  Martin Baulig  <martin@ximian.com>
602
603         * namespace.cs: Merge with the gmcs version.
604
605 2006-09-15  Martin Baulig  <martin@ximian.com>
606
607         * decl.cs (MemberName): Minor code cleanups.
608
609 2006-09-15  Martin Baulig  <martin@ximian.com>
610
611         * parameter.cs: Merge with the gmcs version.
612
613 2006-09-15  Martin Baulig  <martin@ximian.com>
614
615         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
616         and an error in mcs.
617
618 2006-09-15  Martin Baulig  <martin@ximian.com>
619
620         * flowanalysis.cs: Merged from GMCS; added the generics code into
621         a `GMCS_SOURCE' conditional so we can share this file.
622
623 2006-09-08  Martin Baulig  <martin@ximian.com>
624
625         * typemanager.cs (TypeManager.interlocked_type): New public field.
626         (TypeManager.int_interlocked_compare-exchange): New public field.
627         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
628         enumerator types here and call InitGenericCoreTypes().
629         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
630         after calling InitEnumUnderlyingTypes().
631
632         * rootcontext.cs
633         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
634         `classes_second_stage'. 
635
636 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
637
638         * assign.cs, ecore.cs, expression.cs: Share error message text.
639         * class.cs (FieldMember.Define): Check for varible of static type.
640         * driver.cs (LoadAssembly): Uses error output for errors.
641         * statement.cs: Updated.
642
643 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
644
645         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
646         type instance.
647
648 2006-09-07  Martin Baulig  <martin@ximian.com>
649
650         * driver.cs
651         (MainDriver): Revert r62663 from Marek; see #70506 for details.
652
653 2006-08-29  Miguel de Icaza  <miguel@novell.com>
654
655         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
656         
657 2006-08-17  Miguel de Icaza  <miguel@novell.com>
658
659         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
660         #52019 and #79064, the use of the \uXXXX sequence in source code
661         to represent unicode characters.
662
663 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
664
665         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
666         support.
667         * class.cs, ecore.cs, statement.cs: Merged to one error message.
668
669 2006-08-13  Miguel de Icaza  <miguel@novell.com>
670
671         * assign.cs: Catch attempts to assign to a method groups in += and
672         report as 1656
673
674 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
675
676         A fix for #79056
677         * cs-parser.jay: Don't destroy current array type by typeof of array's.
678
679 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
680
681         * class.cs (Method.Define): Issue a warning when generic method looks like
682         an entry point.
683         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
684         as well.
685
686 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
687  
688         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
689         looking for ctor.
690         * decl.cs (MemberCache.FindMembers): When container is interface we need to
691         search all base interfaces as a member can be ambiguous.
692         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
693         Constructor member type filter. 
694         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
695         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
696         reporting for returned memberinfos.
697         * report.cs: Updated.
698         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
699         version to work on all runtimes.
700         (TypeManager.RealMemberLookup): Removed members filtering.
701
702 2006-08-08  Raja R Harinath  <rharinath@novell.com>
703
704         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
705         (PropertyExpr.EmitAssign): Likewise.
706         * expression.cs (Indirection.EmitAssign): Likewise.
707         (LocalVariableReference.EmitAssign): Likewise.
708         (ParameterReference.EmitAssign): Likewise.
709         (Invocation.EmitArguments): Likewise.
710         (ArrayAccess.EmitAssign): Likewise.
711         (IndexerAccess.EmitAssign): Likewise.
712         (This.EmitAssign): Likewise.
713         (ConditionalLogicalOperator.Emit): Likewise.
714
715         Fix #79026
716         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
717         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
718         leave it in after returning it.
719         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
720
721 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
722
723         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
724         message.
725
726 2006-08-03  Raja R Harinath  <rharinath@novell.com>
727
728         Fix cs0146-3.cs and cs0146-4.cs.
729         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
730         enclosing types don't depend on the current type.
731
732 2006-08-02  Raja R Harinath  <rharinath@novell.com>
733
734         Fix #77963
735         * class.cs (TypeContainer.DoDefineMembers): Use
736         FindBaseMemberWithSameName on Parent, since we're interested in
737         whether we hide inherited members or not.
738         (FindBaseMemberWithSameName): Make slightly more robust.
739
740         Fix the non-generic testcase from #77396
741         * decl.cs (DeclSpace.DeclContainer): Remove override.
742
743         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
744         declspaces for doppelgangers too.
745         (UsingEntry): Implement IResolveContext.
746         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
747         'this' as the resolve context.
748         (LocalAliasEntry): Likewise.
749
750         Implement parts of #77403
751         * roottypes.cs (RootDeclSpace): New.  Used to represent the
752         toplevel declaration space.  Each namespace declaration introduces
753         a "partial" root declaretion space.
754         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
755         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
756         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
757         from 'current_namespace.SlaveDeclSpace'.
758         (namespace_declaration): Likewise.
759         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
760         check.  It can't happen now.
761         * decl.cs (DeclSpace.LookupType): Likewise.
762         * driver.cs (MainDriver): Sanity check.
763
764 2006-08-01  Raja R Harinath  <rharinath@novell.com>
765
766         * decl.cs (DeclSpace.FindNestedType): Remove.
767         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
768         LookupTypeContainer to get the container of the nested type.
769         * class.cs (TypeContainer.FindNestedType): Make non-override.
770
771 2006-07-31  Raja R Harinath  <rharinath@novell.com>
772
773         * decl.cs (DeclSpace.PartialContainer): Move field from ...
774         * class.cs (TypeContainer.PartialContainer): ... here.
775         (TypeContainer.AddBasesForPart): New helper.
776         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
777         instead.
778         * cs-parser.jay (current_class): Convert to DeclSpace.
779         (struct_declaration, interface_declaration, class_declaration):
780         Use AddBasesForPart instead of .Bases directly.
781         * const.cs, iterators.cs: Update to changes.
782
783 2006-07-28  Raja R Harinath  <rharinath@novell.com>
784
785         * class.cs (TypeContainer.AddMemberType): Rename from
786         AddToTypeContainer.
787         (TypeContainer.AddMember): Rename from AddToMemberContainer.
788         (AddTypeContainer): New.  Combine AddClassOrStruct and
789         AddInterface.
790         (AddPartial): Update.  Add 'is_partial' argument.
791         * roottypes.cs: Update to changes.
792         * cs-parser.jay (push_current_class): New helper for handling
793         current_container and current_class.
794         (struct_declaration, interface_declaration, class_declaration):
795         Use it.
796
797 2006-07-26  Raja R Harinath  <rharinath@novell.com>
798
799         * roottypes.cs: Rename from tree.cs.
800
801         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
802         * tree.cs (Tree, ITreeDump): Remove types.
803         * rootcontext.cs (tree, Tree): Remove fields.
804         (root, ToplevelTypes): New.
805         * *.cs: Update to rename.
806
807         * tree.cs (Tree.RecordDecl): Remove.
808         (RootTypes.AddToTypeContainer): Record the toplevel type in its
809         namespace here.
810         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
811
812 2006-07-23  Raja R Harinath  <harinath@gmail.com>
813
814         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
815         DoFlowAnalysis and OmitStructFlowAnalysis here.
816         (ec.With): Rename from WithUnsafe and generalize.
817         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
818         (ec.WithFlowAnalyis): New.
819         * ecore.cs, expression.cs, statement.cs: Update.
820
821 2006-07-22  Raja R Harinath  <harinath@gmail.com>
822
823         * statement.cs (Block.ResolveMeta): Simplify slightly.
824
825         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
826         multiple boolean fields.  Convert InUnsafe, constant_check_state,
827         check_state to flags.
828         (CheckState, ConstantCheckState): Update.
829         (InUnsafe): New read-only property.
830         (FlagsHandle): Rename from CheckStateHandle and convert to handle
831         arbitrary flags.
832         (WithUnsafe): New helper similar to WithCheckState.
833         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
834         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
835
836 2006-07-21  Raja R Harinath  <rharinath@novell.com>
837
838         Make comparisons use the same IL irrespective of whether they're
839         in a 'checked' or 'unchecked' context: one of the issues in #78899
840         * codegen.cs (EmitContext.CheckState): Make read-only property.
841         (EmitContext.ConstantCheckState): Likewise.
842         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
843         helper that implement a save/restore stack for CheckState
844         values.  This is the only way to change check-state.
845         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
846         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
847         (CheckedExpr.EmitBranchable): New forwarding method.
848         (UnCheckedExpr): Likewise.
849         * statement.cs (Block.ResolveMeta): Use WithCheckState.
850         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
851         (Checked.Resolve, checked.DoEmit): Likewise.
852
853 2006-07-20  Miguel de Icaza  <miguel@novell.com>
854
855         * anonymous.cs: Cache the resolved anonymous delegate, and return
856         this so that the ResolveTopBlock is only triggered once, not
857         twice.
858
859         Currently we trigger ResolvetopBlock twice due to a first pass of
860         argument check compatibility, and a second pass that does the
861         actual resolution.   
862         
863 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
864
865         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
866         modifiers.
867         * rootcontext.cs (Reset): Add helper_classes.
868
869 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
870
871         A fix for #78860
872         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
873         correctly.
874
875 2006-07-13  Miguel de Icaza  <miguel@novell.com>
876
877         * statement.cs (Lock): Handle expressions of type
878         TypeManager.null_type specially.  Fixes #78770
879
880 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
881
882         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
883         to an event.
884
885 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
886
887         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
888         for accessors as well.
889         * ecore.cs (EventExpr): Add AccessorTable.
890
891 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
892
893         A fix for #78738
894         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
895         for CS0122 where appropriate.
896         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
897         level attributes.
898         (Filter): Assembly can be null in the case of top level attributes.
899
900 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
901
902         A fix for #78690
903
904         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
905         is done at global level.
906
907 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
908
909         A fix for #77002, Implemented TypeForwarder support.
910
911         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
912         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
913         * typemanager.cs (): Add type_forwarder_attr_type.
914
915 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
916
917         * report.cs: Add CS0469 warning.
918
919 2006-06-21  Martin Baulig  <martin@ximian.com>
920
921         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
922         the `try'-block, so we also report CS0016 etc. there.
923
924 2006-06-21  Martin Baulig  <martin@ximian.com>
925
926         * delegate.cs
927         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
928
929 2006-06-21  Martin Baulig  <martin@ximian.com>
930
931         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
932         also report CS1686 for parameters.
933
934 2006-06-21  Martin Baulig  <martin@ximian.com>
935
936         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
937         instead of an error if the value is not implicitly convertible to
938         the switch types; fixes #77964.
939
940 2006-06-21  Raja R Harinath  <rharinath@novell.com>
941
942         Fix #78673
943         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
944         FieldBuilder is null.
945
946         Fix #78662
947         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
948         'left' and 'right' before error-checking.
949
950 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
951
952         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
953         Fixed bug #78601.
954         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
955         (FieldExpr.DoResolve): likewise.
956         (PropertyExpr.InstanceResolve): likewise.
957         (EventExpr.InstanceResolve): likewise. 
958
959 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
960
961         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
962         attribute applicable tests for attribute argument.
963
964 2006-06-02  Raja R Harinath  <rharinath@novell.com>
965
966         Fix #78079
967         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
968         (Binary.OverloadResolve_PredefinedIntegral): New.
969         (Binary.OverloadResolve_PredefinedFloating): New.
970         (Binary.OverloadResolve_PredefinedString): New.
971         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
972         Follow the standard more closely, and treat numeric promotions in
973         terms of overload resolution.
974         (Binary.CheckShiftArguments): Simplify.
975
976 2006-06-01  Raja R Harinath  <rharinath@novell.com>
977
978         * flowanalysis.cs (MyBitVector): Simplify representation.
979         (MyBitVector.Clone): Avoid allocating BitArray.
980         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
981         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
982         (*): Update.  Change all references to MyBitVector.And and
983         MyBitVector.Or to &= and |=.
984
985 2006-05-29  Raja R Harinath  <rharinath@novell.com>
986
987         Fix cs0231-[34].cs.
988         * cs-parser.jay (formal_parameter_list): Extend the pattern below
989         to param arguments too.
990
991 2006-05-26  Miguel de Icaza  <miguel@novell.com>
992
993         * cs-parser.jay: Catch another parsing form for arglist being
994         followed by other arguments.  Fixes #78313.
995
996 2006-05-24  Raja R Harinath  <rharinath@novell.com>
997
998         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
999         checking of out parameters to ...
1000         (FlowBranchingToplevel.Merge): ... here.
1001         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1002         set, propagate the origin upward, and only complain if there was
1003         no other error.
1004         (FlowBranchingException.AddContinueOrigin): Likewise.
1005         (FlowBranchingException.AddReturnOrigin): Likewise.
1006         (FlowBranchingException.AddGotoOrigin): Likewise.       
1007
1008 2006-05-23  Raja R Harinath  <rharinath@novell.com>
1009
1010         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1011         unreachable, skip it.
1012         (FlowBranchingException.Merge): Always propagate jumps, even if
1013         the finally block renders subsequent code unreachable.
1014
1015 2006-05-18  Raja R Harinath  <rharinath@novell.com>
1016
1017         Fix #77601
1018         * statement.cs (Goto.Resolve): Move responsibility for resolving
1019         'goto' to FlowBranching.AddGotoOrigin.
1020         (Goto.SetResolvedTarget): New.  Callback to set the
1021         LabeledStatement that's the target of the goto.
1022         (Goto.DoEmit): Use Leave instead of Br when crossing an
1023         unwind-protect boundary.
1024         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1025         LookupLabel and adjust to new semantics.
1026         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1027         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1028         Goto.SetResolvedTarget to update target.
1029         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1030         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1031         AddBreakOrigin & co.  Delay propagation until ...
1032         (FlowBranchingException.Merge): ... this.
1033
1034         * statement.cs (Block.Resolve): Always depend on flow-branching to
1035         determine unreachability.  Kill workaround that originally emitted
1036         only one statement after an "unreachable" label (see infloop in
1037         test-515.cs).
1038
1039         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1040         This is still "wrong", but anything better would probably need a
1041         multi-pass algorithm.
1042         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1043         usage vector.  Force current usage vector to be reachable, to
1044         optimistically signify backward jumps.
1045         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1046         detected.
1047         (FlowBranchingLabeled.Merge): New.  If no backward jump was
1048         detected, return the original salted-away usage vector instead,
1049         updated with appropriate changes.  Print unreachable warning if
1050         necessary.
1051         * statement.cs (Block.Resolve): Don't print unreachable warning on
1052         a labeled statement.
1053
1054 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
1055
1056         * driver.cs: Pass filename without path to AssemblyBuilder's 
1057         AddResourceFile. Fixes bug #78407.
1058
1059 2006-05-17  Raja R Harinath  <rharinath@novell.com>
1060
1061         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1062         * flowanalysis.cs (FlowBranchingLabeled): ... here.
1063         (FlowBranching.MergeChild): Overwrite
1064         reachability information from Labeled branchings too.
1065
1066 2006-05-16  Raja R Harinath  <rharinath@novell.com>
1067
1068         * statement.cs (Goto.Resolve): Merge jump origins here ...
1069         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1070
1071         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1072         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
1073         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
1074         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1075         here, ...
1076         * statement.cs (Goto.Resolve): ... not here.
1077         (Goto.Emit): Remove CS1632 check.
1078
1079 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
1080
1081         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1082         error message.
1083
1084 2006-05-11  Raja R Harinath  <rharinath@novell.com>
1085
1086         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1087         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1088         (FlowBranchingException.Label): Likewise.
1089
1090         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
1091         given value.
1092         (MyBitVector.Or): Use it to avoid losing information (Count).
1093         (FlowBranching.MergeOrigins): Likewise.
1094
1095         * flowanalysis.cs (UsageVector.IsDirty): Remove.
1096         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1097         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1098         (UsageVector.ToString): Simplify.
1099         (UsageVector.MergeSiblings): Move here from ...
1100         (FlowBranching.Merge): ... here.
1101         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1102         not a MyBitVector.
1103
1104 2006-05-10  Raja R Harinath  <rharinath@novell.com>
1105
1106         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1107         null bitvector is treated as all-true.
1108
1109         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1110         (MyBitVector): Rationalize invariants.  'vector != null' implies
1111         that we have our own copy of the bitvector.  Otherwise,
1112         'InheritsFrom == null' implies all inherited bits are true.
1113
1114 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
1115
1116         * statement.cs (LocalInfo): Add IsConstant.
1117         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1118         local variable for constants.
1119
1120 2006-05-09  Raja R Harinath  <rharinath@novell.com>
1121
1122         * flowanalysis.cs (MyBitVector.Empty): New.
1123         (MyBitVector): Don't allow InheritedFrom to be null.
1124         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1125         (UsageVector, FlowBranching): Update to changes.
1126
1127         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1128         recursion.  The 'Parent == null' condition isn't sufficient for
1129         anonymous methods.
1130         (FlowBranching.AddBreakOrigin): Likewise.
1131         (FlowBranching.AddContinueOrigin): Likewise.
1132         (FlowBranching.AddReturnOrigin): Likewise.
1133         (FlowBranching.StealFinallyClauses): Likewise.
1134         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1135         (FlowBranching.CheckOutParameters): Likewise.
1136         (FlowBranchingToplevel): Terminate all the above recursions here.
1137         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1138         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1139
1140         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
1141         toplevel block.
1142         (FlowBranchingToplevel): New.  Empty for now.
1143         (FlowBranching.MergeTopBlock): Update.
1144         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1145         branching for the anonymous delegate.
1146         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1147
1148         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1149         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1150         information at the start of the merge.  Reorganize.
1151
1152 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1153
1154         * class.cs (MethodData.Define): Method cannot implement interface accessor.
1155
1156 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1157
1158         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1159         to newly introduced ctor.
1160
1161         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1162         message to one place.
1163         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1164         global namespace.
1165
1166 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
1167
1168         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1169
1170         * ecore.cs (Expression.ResolveAsConstant): Updated.
1171
1172         * statement.cs (ResolveMeta): Updated.
1173
1174 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1175
1176         * cs-parser.jay: __arglist cannot be used in initializer.
1177
1178 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
1179
1180         A fix for #77879
1181         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1182         private types.
1183
1184 2006-05-05  Raja R Harinath  <rharinath@novell.com>
1185
1186         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1187         (LabeledStatement): Add 'name' parameter.
1188         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1189         (Block.AddLabel): Update to changes.
1190         * cs-parser.jay (labeled_statement): Likewise.
1191
1192         * flowanalysis.cs (BranchingType.Labeled): New.
1193         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1194         (FlowBranchingLabeled): New.  Does nothing for now, but will
1195         eventually handle 'goto' flows.
1196         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1197         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1198         that's terminated ...
1199         (Block.Resolve): ... here.
1200
1201         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1202         (UsageVector.MergeFinallyOrigins): Likewise.
1203         (FlowBranching.InTryOrCatch): Likewise.
1204         (FlowBranching.AddFinallyVector): Likewise.
1205         (FlowBranchingException): Update to changes.
1206
1207         Fix #78290
1208         * statement.cs (Return.Resolve): Move error checking to ...
1209         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1210         (FlowBranchingException): Handle return origins like break and
1211         continue origins.
1212         (FlowBranching.UsageVector.CheckOutParameters): Remove.
1213
1214 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1215
1216         A fix for #76122
1217         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1218         filter.
1219
1220 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
1221
1222         A fix for #77543
1223         * class.cs (MethodData.Define): Do public accessor check only when method
1224         implements an interface.
1225
1226 2006-05-04  Raja R Harinath  <rharinath@novell.com>
1227
1228         Remove special handling of 'break'
1229         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1230         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
1231         (UsageVector.Break): Remove.
1232         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1233         reachability.
1234         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1235
1236         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1237         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
1238
1239 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1240
1241         A fix for #75726
1242         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1243         be the interface member.
1244
1245 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
1246
1247         A fix for #60069
1248         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1249         for emitting small (int) values.
1250
1251 2006-05-03  Raja R Harinath  <rharinath@novell.com>
1252
1253         Fix #59427
1254         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1255         control-flow passes through the 'finally' after merging-in all the
1256         control-flows from 'try' and the 'catch' clauses.
1257
1258         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1259         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
1260         always true at the only non-recursive entry point.
1261         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1262         FlowBranchingBreakable.
1263         (FlowBranchingLoop): Remove.
1264         * statement.cs (Return.DoResolve): Update to changes.
1265
1266         Fix #76471, #76665
1267         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1268         (FlowBranching.CreateBranching): Handle it: create a
1269         FlowBranchingContinuable.
1270         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1271         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1272         except that it handles the 'continue' command.
1273         (FlowBranching.UsageVector.MergeOrigins): Rename from
1274         MergeBreakOrigins.
1275         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1276         except that it overrides AddContinueOrigin.
1277         (FlowBranchingException): Override AddContinueOrigin, similar to
1278         AddBreakOrigin.
1279         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1280         Create a new branching around the embedded statement.
1281         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
1282         control flow after the embedded statement.
1283         (Continue.Resolve): Move all error checking to AddContinueOrigin.
1284
1285         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1286         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1287         FlowBranchingBreakable.
1288         (FlowBranchingSwitch): Remove.
1289
1290         Fix test-503.cs
1291         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
1292         error reporting to ...
1293         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1294         Rename from 'AddBreakVector'.  Add new location argument.  Return
1295         a bool indicating whether the 'break' crosses an unwind-protect.
1296         (FlowBranchingException.AddBreakOrigin): Add.
1297         (FlowBranchingException.Merge): Propagate 'break's to surrounding
1298         flowbranching after updating with the effects of the 'finally'
1299         clause.
1300         (FlowBranchingBreakable): New common base class for
1301         FlowBranchingLoop and FlowBranchingSwitch.
1302
1303         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1304         embedded statement.
1305         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1306
1307 2006-05-02  Raja R Harinath  <rharinath@novell.com>
1308
1309         * statement.cs (Do.Resolve): If the loop is infinite, set the
1310         barrier.
1311         (While.Resolve, For.Resolve): Set a barrier after the embedded
1312         statement.  There's no direct control flow that goes from the end
1313         of the embedded statement to the end of the loop.
1314         * flowanalysis.cs (FlowBranching.Infinite): Remove.
1315         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
1316         above ensure that the reachability is correctly computed.
1317
1318         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1319         (UsageVector.MergeBreakOrigins): If the current path is
1320         unreachable, treat it as if all parameters/locals are initialized.
1321         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
1322         infinite loops before merging-in break origins.
1323
1324         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1325         (Reachability.Reachable): Split part into ...
1326         (Reachability.Unreachable): ... this.  Simplify.
1327         (Reachability.IsUnreachable): Use 'Unreachable' instead.
1328
1329         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1330         (Reachability.SetThrowsSometimes): Likewise.
1331         (FlowBranchingBlock.MergeTopBlock): Don't compare against
1332         TriState.Always, use corresponding property.
1333         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1334         (Block.Resolve): Likewise.  Remove some redundant checks.
1335
1336 2006-05-02  Raja R Harinath  <harinath@gmail.com>
1337
1338         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1339         (Reachability.Meet): Don't bother checking AlwaysThrows --
1340         barrier is always set.
1341         (FlowBranchingBlock.Merge): Likewise.
1342
1343 2006-05-01  Raja R Harinath  <harinath@gmail.com>
1344
1345         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1346         checks for unreachable.
1347
1348 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
1349
1350         A fix for #77980
1351         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1352
1353         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1354         whether field is really assigned.
1355
1356 2006-04-30  Raja R Harinath  <harinath@gmail.com>
1357
1358         * flowanalysis.cs (Reachability): Make 4-argument constructor
1359         private.
1360         (Reachability.Meet): Rename from 'And'.  Remove static variant.
1361         (Reachability.Always): Rename from the highly misleading
1362         'Reachability.Never'.
1363         (FlowBranching.Merge): Update to changes.  Mark an impossible
1364         situation with a 'throw'.
1365         (*): Update to changes.
1366
1367 2006-04-29  Raja R Harinath  <harinath@gmail.com>
1368
1369         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1370         Remove 'Undefined'.
1371         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1372         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1373         (*): Update to changes.
1374         * statement.cs: Update to changes.
1375
1376 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
1377
1378         A fix for #78049
1379         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1380
1381 2006-04-28  Raja R Harinath  <harinath@gmail.com>
1382
1383         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1384         dummy UsageVector.
1385
1386         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1387         argument to two arguments: an usage-vector and a bool.  Move call
1388         to FlowBranching.Merge () ...
1389         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1390
1391         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1392         handling of loop and switch reachability to ...
1393         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1394
1395 2006-04-27  Raja R Harinath  <harinath@gmail.com>
1396
1397         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1398         handling to FlowBranchingLoop.InLoop.
1399         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1400
1401 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
1402
1403         A fix for #78115
1404         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1405         anonymous method is allowed from AnonymousContainer here.
1406
1407         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1408
1409 2006-04-24  Raja R Harinath  <rharinath@novell.com>
1410
1411         Fix #78156
1412         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1413
1414 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
1415
1416         A fix for #49011.
1417         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1418         (DoubleConstant.Reduce): Ditto.
1419
1420 2006-04-23  Raja R Harinath  <rharinath@novell.com>
1421
1422         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1423         Remove 'lvalue_right_side' argument.  Move parts to ...
1424         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1425         (LocalVariable.DoResolveLValue): ... these.
1426
1427 2006-04-21  Raja R Harinath  <rharinath@novell.com>
1428
1429         Fix cs1655.cs
1430         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1431         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1432         (LocalVariableReference.DoResolveBase): Use it to implement new
1433         CS1655 check.
1434         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1435         (Argument.Resolve): Simplify.  Move CS1510 check ...
1436         * ecore.cs (Expression.ResolveLValue): ... here.
1437         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1438         (PropertyExpr.DoResolveLValue): Likewise.
1439         (FieldExpr.Report_AssignToReadonly): Likewise.
1440         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
1441         LValueMemberAccess or LValueMemberOutAccess on instance depending
1442         on it.
1443         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1444         DoResolve as appropriate.
1445
1446 2006-04-20  Raja R Harinath  <rharinath@novell.com>
1447
1448         Fix #75800
1449         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1450         implicit conversions on 'out' and 'ref' arguments.
1451
1452         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1453         improve clarity.  Remove dead code.
1454
1455         Fix #66031
1456         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1457         (Catch.Resolve): Resolve VarBlock if it exists.
1458
1459 2006-04-19  Miguel de Icaza  <miguel@novell.com>
1460
1461         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1462         twice, this was some residual code, the enumerator was emitted
1463         properly in the two branche of if later.
1464
1465 2006-04-19  Raja R Harinath  <rharinath@novell.com>
1466
1467         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
1468         cast is never an lvalue.
1469         (Cast.DoResolve, Cast.ResolveRest): Combine.
1470         (Argument.Emit): Simplify slightly.  Move 'Expr is
1471         IMemoryLocation' check ...
1472         (Argument.Resolve): ... here.
1473         (Argument.Error_LValueRequired): Remove.  Inline into only user.
1474
1475         Simplifications.  Fix cs0191-2.cs
1476         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1477         CS1649 and CS1651 to ...
1478         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
1479         the actual selection of the error code and message to a lookup
1480         table.  Add a dummy return value to simplify callsites.
1481         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1482         readonly fields of other instances of the same type.  Move CS0197
1483         warning from ...
1484         * expression.cs (Argument.Resolve): ... here.  Simplify code.
1485         Ensure that ec.InRefOutArgumentResolving is only set during LValue
1486         resolution of an out or ref argument.  The code simplification
1487         above uses this invariant.
1488
1489 2006-04-18  Raja R Harinath  <rharinath@novell.com>
1490
1491         Possibly fix #77752.  Fix cs1690-[4-7].cs.
1492         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1493         CheckMarshallByRefAccess.  Drop parameter.
1494         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
1495         warning.
1496         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1497         InstanceExpression.
1498         * report.cs (AllWarnings): Add CS1690.
1499         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1500         for ref access too.
1501         (LocalVariableReference.DoResolveBase): Update.
1502
1503 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1504
1505         * class.cs (MethodOrOperator): Moved common parts from method class.
1506         detect obsolete attributes.
1507         (Method.Define): Simplified as it reuses code from base.
1508         (Constructor.ValidAttributeTargets): Fixed issue found during
1509         refactoring.
1510         (Destructor.ValidAttributeTargets): Fixed issue found during
1511         refactoring.
1512         (Operator): Finished refactoring set off by #78020. Operator class is now
1513         ordinary method class.
1514
1515         * anonymous.cs: Updated.
1516
1517         * decl.cs (DeclSpace): Add IsGeneric
1518
1519 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1520
1521         * class.cs (Constructor.Emit): Don't emit the attributes twice.
1522
1523 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1524
1525         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1526         detect obsolete attributes.
1527         (Method.CreateEmitContext): Moved to MethodOrOperator.
1528
1529 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
1530
1531         A fix for #78048.
1532         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1533         customized exception to make crash detection easier.
1534         (MethodOrOperator): Started to work on new base class for methods and
1535         operators.
1536         (Method): Derives from MethodOrOperator.
1537         (Constructor.Emit): Emits its own attributes.
1538         (AbstractPropertyEventMethod.Emit): Ditto.
1539         (Operator): Derives from MethodOrOperator, will refactor fully in extra
1540         patch.
1541         (Operator.Emit): It's temporary more tricky than should be.
1542         
1543         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1544
1545         * report.cs (InternalErrorException): Add ctor with inner exception.
1546
1547 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
1548
1549         A fix for #76744.
1550         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1551         only not visible.
1552
1553 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
1554
1555         A fix for #77916.
1556         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1557         array.
1558
1559 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1560
1561         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1562         attribute is present and Guid not.
1563         (Interface.ApplyAttributeBuilder): Ditto.
1564
1565         * attribute.cs: Add error message.
1566
1567 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
1568
1569         A fix for #78020.
1570
1571         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1572         sources (it's composite) so hold them in extra array as they are used in
1573         Emit phase only. It worked in the previous versions by mistake.
1574         (Attribute.Emit): Emit attribute for more owners when exist.
1575
1576         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1577         it has now different behaviour.
1578
1579 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
1580
1581         * constant.cs (Constant.IsDefaultInitializer): New method.
1582
1583         * class.cs: Updated.
1584
1585         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1586         re-initialize default values. It saves KBs almost for every assembly.
1587         Thanks Zoltan for the idea.
1588         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1589         (ArrayCreation.DoResolve): Resolve only once.
1590         (ArrayCreation.Emit): Emit static initializer only when it is faster.
1591         (ArrayCreation.GetAttributableValue): Cope with optimized values.
1592
1593 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
1594
1595         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1596         From #77961.
1597
1598 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1599
1600         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1601         in an embedded statement too.
1602
1603 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1604
1605         Fix #77958
1606         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1607
1608 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1609
1610         A fix for #77966.
1611
1612         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1613         was not specified.
1614
1615         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1616
1617 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1618
1619         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1620         phase.
1621
1622         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1623         LocalTemporary change.
1624
1625         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1626         TypeContainer.
1627         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1628         initializers optimization.
1629         (ClassOrStruct.TypeAttr): Moved from modifiers.
1630         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1631         (FieldBase.ResolveInitializer): Resolves initializer.
1632         (FieldBase.HasDefaultInitializer): New property.
1633
1634         * cs-parser.jay: Removed message.
1635
1636         * expression.cs (CompilerGeneratedThis): New specialization.
1637
1638         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1639
1640 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1641
1642         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1643
1644 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1645
1646         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1647         be now EnumConstants only.
1648
1649 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1650
1651         * attribute.cs, driver.cs: Reset more caches.
1652
1653 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1654
1655         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1656
1657 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1658
1659         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1660         for easier reuse. Updated all overrides.
1661         (IntegralConstant): New base class for all integral constants.
1662         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1663         of the constant range, report custom error.
1664         (UIntConstant.Reduce): Fixed uint conversion.
1665
1666         * ecore.cs, literal.cs: Reduce updates.
1667
1668 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1669
1670         A fix for #75813.
1671
1672         * class.cs (Constructor.Define): Removed extra if for default ctors.
1673         A patch from Atsushi Enomoto.
1674
1675 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1676
1677         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1678         GetAttributableValue.
1679
1680         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1681         when required.
1682
1683         * convert.cs (ImplicitConversionRequired): Error message moved to
1684         DoubleLiteral.
1685
1686         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1687         automatic implicit conversion of an output value.
1688         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1689
1690         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1691         conversion.
1692         (TypeOf.GetAttributableValue): Add extra handling for object type.
1693
1694         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1695         special error message.
1696
1697 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1698
1699         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1700         InternalCall.
1701         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1702         compatible with MS runtime.
1703
1704 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1705
1706         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1707         attribute arguments here.
1708
1709         * class.cs (Indexer.Define): The check was moved to attribute class.
1710
1711 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1712
1713         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1714         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1715         easier.
1716
1717 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1718
1719         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1720         mcs to keep code differences small.
1721         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1722         * typemanager.cs (parameter_default_value_attribute_type): New.
1723         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1724         CS1908 check.
1725
1726 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1727
1728         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1729
1730 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1731
1732         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1733
1734         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1735         the blocks too.
1736
1737 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1738
1739         * doc-bootstrap.cs : fix build.
1740
1741 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1742
1743         * expression.cs (StringConcat.Append): Issue a warning when empty string
1744         is going to append.
1745
1746 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1747
1748         * assign.cs (CompoundAssign.ResolveSource): Removed.
1749
1750         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1751         clean up.
1752
1753         * class.cs (TypeContainer.FindMethods): Removed.
1754         (TypeContainer.CheckMemberUsage): Made static.
1755
1756         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1757
1758         * constant.cs (CheckRange): Removed unused type argument.
1759         (CheckUnsigned): Removed unused type argument.
1760
1761         * cs-parser.jay: Updated after MemberAccess clean up.
1762         Uses Length for empty string test.
1763
1764         * cs-tokenizer.cs: Uses Length for empty string test.
1765         (IsCastToken): Made static.
1766         (is_hex): Made static.
1767         (real_type_suffix): Made static.
1768
1769         * decl.cs (SetupCache): Made static.
1770         (OnGenerateDocComment): Removed unused ds argument.
1771
1772         * delegate.cs (VerifyDelegate): Removed unused argument.
1773
1774         * doc.cs: Uses Length for empty string test.
1775
1776         * driver.cs: Uses Length for empty string test.
1777
1778         * enum.cs (IsValidEnumType): Made static
1779
1780         * expression.cs (EnumLiftUp): Removed unused argument.
1781         (ResolveMethodGroup): Ditto.
1782         (BetterConversion): Ditto.
1783         (GetVarargsTypes): Ditto.
1784         (UpdateIndices): Ditto.
1785         (ValidateInitializers): Ditto.
1786         (MemberAccess.ctor): Ditto.
1787         (GetIndexersForType): Ditto.
1788
1789         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1790
1791         * iterators.cs: Updated after MemberAccess clean up.
1792
1793         * location.cs: Uses Length for empty string test.
1794
1795         * namespace.cs: Uses Length for empty string test.
1796
1797          * report.cs (CheckWarningCode): Made static.
1798
1799         * statement.cs (LabeledStatement): Removed unused argument.
1800
1801         * typemanager.cs (FilterNone): Removed.
1802
1803 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1804
1805         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1806         obsolete.
1807
1808         * class.cs: Updated.
1809
1810 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1811
1812         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1813
1814 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1815
1816         A fix for #77822.
1817
1818         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1819         reporting, it's more tricky than I thought.
1820
1821 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1822
1823         A fix for #77816.
1824
1825         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1826         host container.
1827         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1828         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1829         Add more error reporting; Fixed issue with params.
1830
1831         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1832
1833         * cs-parser.jay: AnonymousMethod requires host container.
1834
1835         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1836
1837 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1838
1839         * class.cs: Change 'TypeContainer ds' constructor argument to
1840         'DeclSpace parent'.  Some classes were missed below due to
1841         different naming convention.
1842
1843         * class.cs (MemberCore.Parent): Delete.  This makes the
1844         ParentContainer changes below enforceable by the compiler.
1845
1846         Treat pointers to enclosing declaration space as 'DeclSpace', not
1847         'TypeContainer'.
1848         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1849         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1850
1851         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1852         of TypeContainer.
1853         (Block.AddThisVariable): Likewise.
1854         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1855         (AbstractPropertyEventMethod.Emit): Likewise.
1856         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1857         (GetMethod.Define, SetMethod.Define): Likewise.
1858         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1859         (DelegateMethod.EmitMethod): Likewise.
1860
1861         Fix regression test-partial-13.cs.
1862         Rationalize use of PartialContainer.  Ensure that the partial
1863         class semantics can be tied to type-correctness, i.e., any
1864         violation will cause a compile error.
1865         * class.cs, const.cs: Access all fields that belong to class
1866         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1867         Resolve()-like functions still use 'Parent'.
1868
1869         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1870         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1871         (PropertyMethod.CheckModifiers): Remove unused argument.
1872         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1873         DeclSpace.
1874
1875 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1876
1877         Make semantics of PartialContainer simpler.
1878         * decl.cs (DeclSpace.IsPartial): Remove.
1879         * class.cs (TypeContainer.IsPartial): Likewise.
1880         (TypeContainer..ctor): Set PartialContainer to point to self.
1881         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1882         (TypeContainer.FindNestedType): Likewise.
1883         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1884
1885 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1886
1887         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1888
1889 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1890
1891         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1892         classes.
1893
1894 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1895
1896         * class.cs (Operator.Define): An error for base conversion was not
1897         reported correctly.
1898
1899 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1900
1901         * iterator.cs : yield break is allowed in try statement which has
1902           catch clauses. Fixed bug #77767.
1903
1904 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1905
1906         A fix for #77593, #77574.
1907
1908         * class.cs (MethodCore.CheckBase): Another if for operator.
1909
1910 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1911
1912         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1913         were not resolved
1914
1915         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1916         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1917         conversion test.
1918         
1919         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1920         not needed.
1921
1922         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1923         Updated after another emitcontext usage was clean up. It should help us to
1924         synchronize with gmcs easier.
1925
1926 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1927
1928         A fix for #77353.
1929
1930         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1931         (Event.Define): ditto
1932         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1933
1934         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1935         Removed redundant code and set NewSlot for Invoke method too.
1936
1937         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1938         (Parameters.MergeGenerated): New method. Use this method when you merge
1939         compiler generated argument with user arguments.
1940
1941 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1942
1943         * attribute.cs (ResolveAsTypeTerminal): Removed.
1944
1945         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1946         specialization for predefined types; 30% speed up.
1947         Finally placed obsolete check to right place.
1948         (Expression.ResolveType): Removed.
1949
1950         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1951         Updated after ResolveType was removed.
1952
1953         * expression.cs (Cast.ctor): Check void cast.
1954         (Binary.ResolveAsTypeTerminal): Is never type.
1955         (Conditional.ResolveAsTypeTerminal): Is never type.
1956
1957         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1958
1959 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1960
1961         Fix #77679.
1962         * expression.cs (ParameterReference.DoResolveBase): Change return
1963         type to bool.
1964         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1965         Update.
1966
1967         Fix #77628.
1968         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1969
1970         Fix #77642.
1971         * typemanager.cs (GetFullNameSignature): Don't nullref on
1972         protected accessors.
1973
1974 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1975
1976         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1977         these two separated members to simplify the code.
1978         (Attribute.Resolve): Refactored to use new fields and methods.
1979         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1980         implemented obsolete attribute checking.
1981         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1982         implemented obsolete checking again. It look line never ending quest ;-)
1983         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1984
1985         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1986
1987         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1988
1989         *class.cs (Property.Define): Add RegisterProperty call.
1990
1991         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1992         argument groups (only 2).
1993
1994         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1995         encoding expression to arguments.
1996         (Expression.ExprClassToResolveFlags): Just turned to property.
1997
1998         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1999         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2000         optimized as well as implemented support for zero-length attributes.
2001
2002         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2003         Add caching of PropertyInfo's.
2004
2005 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2006
2007         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2008         error multiple times.
2009
2010 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
2011
2012         New partial class implementation.
2013         A fix for #77027, #77029, #77403
2014
2015         * attribute.cs (Attributable): Made attributes protected.
2016
2017         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2018         the replacements of ClassPart and PartialContainer.
2019         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2020         (TypeContainer.AddInterface): Ditto.
2021         (TypeContainer.AddPartial): The main method for partial classes. It checks
2022         for errors and merges ModFlags and attributes. At the end class is added to
2023         partial_parts list.
2024         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2025         required here.
2026         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2027         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2028         from the rest of partial classes.
2029         (TypeContainer.GetClassBases): Simplified.
2030         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2031         DefineType.
2032         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2033         (TypeContainer.HasExplicitLayout): Uses Flags now.
2034         (PartialContainer): Removed.
2035         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2036         (StaticClass): Was merged with Class.
2037         (Class.GetClassBases): class and static class bases are verified here.
2038         (Class.TypeAttr): Added static attributes when class is static.
2039         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2040         (MemberBase): In some cases we need to call parent container for partial
2041         class. It should be eliminated but it's not easy now.
2042
2043         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2044
2045         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2046         partial classed to accumulate class comments.
2047         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2048
2049         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2050
2051         * driver.cs (MainDriver): Tree.GetDecl was removed.
2052
2053         * modifiers.cs (Modifiers): Add partial modifier.
2054
2055         * tree.cs (Tree.decl): Removed.
2056         (RootTypes): Started to use this class more often for root types
2057         specializations.
2058
2059 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2060
2061         A fix for #77615
2062
2063         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2064         external interface does not have an attribute.
2065
2066 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
2067
2068         Another prerequisites for new partial classs implementation.
2069         
2070         * attribute.cs (Attribute.Equal): Implemented.
2071         (Attribute.Emit): Changed as attributes can be applied more than twice.
2072         (Attributes.Emit): Check for duplicate attributes here.
2073
2074         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2075         as a parameter, clean-up.
2076
2077 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2078
2079         A fix for #77485
2080
2081         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2082         contains obsolete attribute check which can in some cases look for base
2083         type of current class which is not initialized yet.
2084         (TypeContainer.BaseType): Replacement of ptype.
2085
2086         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2087
2088 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
2089
2090         First of prerequisites for new partial classs implemention.
2091         
2092         * attribute.cs (Attributable): Extended by ResolveContext;
2093         Attributes finally have correct context for resolving in all cases.
2094         (AttachTo): Attribute owner is assigned here.
2095
2096         * codegen.cs (IResolveContext): Introduce new interface to hold
2097         all information needed in resolving phase.
2098         (EmitContext): Implements IResolveContext; more clean-up needed here.
2099         
2100         * decl.cs (MemberCore): Implemented IResolveContext.
2101
2102         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2103         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2104         parameter.cs, statement.cs, tree.cs, typemanager.cs:
2105         Refactored to use new IResolveContext instead of EmitContext; cleanup
2106
2107 2006-02-06  Miguel de Icaza  <miguel@novell.com>
2108
2109         * codegen.cs (EmitScopeInitFromBlock): check here the
2110         capture_context, there is no need to make two calls to the
2111         EmitContext. 
2112
2113         * anonymous.cs: Add some debugging messages that might help me
2114         track other instances of this problem in the future (the
2115         regression of test 467).
2116
2117         * cs-parser.jay: track the variable block, as we need to initalize
2118         any captured variables declared in this block for the "catch"
2119         portion of the "Try" statement.
2120
2121         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2122         scope initialization for captured variables. 
2123
2124         Also, move the emit for the variables after the block location has
2125         been marked.
2126
2127 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
2128
2129         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2130
2131 2006-02-02  Miguel de Icaza  <miguel@novell.com>
2132
2133         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2134         commit yesterday, the initialization for the roots is necessary.
2135         What is not necessary is the scope activation.
2136
2137 2006-02-02  Raja R Harinath  <rharinath@novell.com>
2138
2139         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2140         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2141         CS0206 checks.
2142         (Argument.Resolve): Remove CS0206 checks.
2143
2144 2006-02-01  Miguel de Icaza  <miguel@novell.com>
2145
2146         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2147         scopes for all the roots, the scopes will now be emitted when the
2148         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
2149
2150         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2151         code.  This reduces a lot of existing cruft.
2152         
2153         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2154         that the ScopeInfo is generated as we enter the scope, not at the
2155         time of use, which is what we used to do before.
2156
2157         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2158         every time a Block is about to be emitted if we have a
2159         CaptureContext. 
2160
2161 2006-02-01  Raja R Harinath  <rharinath@novell.com>
2162
2163         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2164         (Reset): Update.
2165         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2166
2167         * typemanager.cs (cons_param_array_attribute): Make private.
2168         (Reset): Set it to null.
2169         (InitCoreHelpers): Don't initialize it.
2170         (ConsParamArrayAttribute): New.  Initialize it as needed.
2171         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2172
2173 2006-01-31  Miguel de Icaza  <miguel@novell.com>
2174
2175         * expression.cs: There might be errors reported during the
2176         selection of applicable methods.  If there are errors, do not
2177         continue execution as it will lead the compiler to crash.
2178
2179 2006-01-30  Miguel de Icaza  <miguel@novell.com>
2180
2181         * expression.cs: Member access is not allowed on anonymous
2182         methods.  Fixes #77402.
2183
2184 2006-01-30  Raja R Harinath  <rharinath@novell.com>
2185
2186         Fix #77401
2187         * cs-parser.jay (VariableDeclaration): Don't set
2188         current_array_type to null.
2189         (field_declaration, event_declaration, declaration_statement):
2190         Set it to null here.
2191
2192 2006-01-28  Raja R Harinath  <harinath@gmail.com>
2193
2194         * typemanager.cs (GenericParameterPosition): New.
2195         * doc.cs: Use it.
2196
2197 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
2198
2199         * doc.cs : To process "include" elements, first we should create
2200           another list than XmlNodeList, because it could result in node
2201           removal, which could result in that the XmlNodeList gives up
2202           yielding next node.
2203
2204           (Also made code identical to gmcs again.)
2205
2206 2006-01-25  Miguel de Icaza  <miguel@novell.com>
2207
2208         * ecore.cs: Introduce an error report that we were not catching
2209         before, if not silent, we must report the error.  Gonzalo ran into
2210         it.
2211
2212 2006-01-23  Miguel de Icaza  <miguel@novell.com>
2213
2214         A fix for bug: #76957
2215         
2216         * iterators.cs (MoveNextMethod.CreateMethodHost): call
2217         ComputeMethodHost before creating the method, this is a new
2218         requirement. 
2219
2220         * anonymous.cs (AnonymousContainer): Now we track all the scopes
2221         that this method references (RegisterScope).  The actual scope
2222         where the method is hosted is computed with the ComputeMethodHost
2223         before we create the method.
2224
2225         Moved the Deepest routine here.
2226
2227         (AnonymousContainer.ComputeMethodHost): New routine used to
2228         compute the proper ScopeInfo that will host the anonymous method.
2229
2230         (ScopeInfo): Deal with multiple roots.  The problem was that we
2231         did not have a unique root where all ScopeInfos could be hanged
2232         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
2233         of roots.  
2234
2235         Remove AdjustMethodScope which is now computed at the end.  Remove
2236         LinkScope which did a partial link, instead link all ScopeInfos
2237         before code generation from the new "LinkScopes" routine. 
2238
2239         Simplify all the Add* routines as they no longer need to maintain
2240         the tree, they just need to record that they are using variables
2241         from a ScopeInfo.
2242
2243         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2244         routines to produce the forest of ScopeInfo trees.
2245
2246         * class.cs (TypeContainer.AppendMethod): This is just like
2247         AddMethod, but ensures that an interface implementation method
2248         (IEnumerable.XXX) is not inserted at the beginning of the queue of
2249         methods, but at the end.
2250
2251         We use this functionality to ensure that the generated MoveNext
2252         method in the iterator class is resolved/emitted before the
2253         enumerator methods created.   
2254
2255         This is required because the MoveNext method computes the right
2256         ScopeInfo for the method.  And the other methods will eventually
2257         need to resolve and fetch information computed from the anonymous
2258         method. 
2259
2260 2006-01-21  Raja R Harinath  <harinath@gmail.com>
2261             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
2262
2263         Fix rest of #76995.
2264         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2265         the 'aliases' hash.
2266         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2267         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2268
2269 2006-01-18  Raja R Harinath  <rharinath@novell.com>
2270
2271         Fix #76656, cs0231-2.cs.
2272         * cs-parser.jay (formal_parameter_list): Make error case catch
2273         more issues.
2274         (parenthesized_expression_0): Add CS1026 check.
2275         (invocation_expression): Remove unused { $$ = lexer.Location }.
2276
2277 2006-01-17  Raja R Harinath  <rharinath@novell.com>
2278
2279         Fix #76824.
2280         * cs-parser.jay (statement_expression): Don't list out the
2281         individual statement-expressions.  Convert syntax error into
2282         CS0201 check.
2283
2284 2006-01-16  Raja R Harinath  <rharinath@novell.com>
2285
2286         Fix #76874.
2287         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2288         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
2289         CheckIntermediateModification.
2290         (FieldExpr.DoResolve): Add new two-argument version that
2291         allows us to resolve the InstanceExpression as an lvalue.
2292         The one-argument variant is now just a wrapper.
2293         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2294         Resolve the lhs as an lvalue if the it has a value type.
2295         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2296         from Assign.DoResolve.
2297         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2298         resolved as an lvalue.
2299         (PropertyExpr.DoResolve): Update.
2300         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2301         has a value type.  Move CS1612 check here from
2302         CheckIntermediateModification.
2303         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2304         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
2305         'right_side' of a ResolveLValue on an 'out' argument.
2306         (EmptyExpression.LValueMemberAccess): New.  Used as the
2307         'right_side' of a propagated ResolveLValue on a value type.
2308         (LocalVariableReference.DoResolveBase): Recognize
2309         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2310         Add CS1654 check.
2311         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2312         EmptyExpression.Null.
2313
2314 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
2315
2316         * typemanager.cs : added IsGenericParameter(). In mcs it always
2317           return false.
2318         * doc.cs : for generic parameters, use GenericParameterPosition,
2319           not FullName.
2320
2321 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
2322
2323         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2324
2325 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2326
2327         This fixes the problem where we used ldfld instead of ldflda to
2328         load the "THIS" pointer on captured parameters, when THIS is a
2329         value type.  See bug #77205.
2330         
2331         * iterators.cs (CapturedThisReference.Emit): Pass false to
2332         EmitThis (we do not need the address).
2333
2334         * codegen.cs (EmitThis): it needs to know whether we need the
2335         address of `this' or not.  This is used by value types.  
2336
2337         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2338         every other call passes false.
2339
2340 2006-01-12  Raja R Harinath  <rharinath@novell.com>
2341
2342         Fix #77221.
2343         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2344         GetOverride.
2345         * expression.cs (Invocation.OverloadResolve): Update.
2346         (Invocation.DoResolve): Avoid double resolution of invocation.
2347
2348 2006-01-11  Raja R Harinath  <rharinath@novell.com>
2349
2350         Fix #77180.
2351         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2352         unary negation of floating point types as 0-expr; negation cannot
2353         overflow in floating point types.
2354
2355         Fix #77204.
2356         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2357         on operands of 'void' type.
2358
2359         Fix #77200.
2360         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2361         and ExclusiveOr for boolean constants too.
2362
2363 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2364
2365         Fix #75636.
2366         * expression.cs (Invocation.OverloadResolve): Replace reflected
2367         override methods with their base virtual methods, rather than
2368         skipping over them.
2369         * typemanager.cs (TypeManager.GetOverride): New.
2370
2371 2006-01-05  Jb Evain  <jbevain@gmail.com>
2372
2373         * class.cs (Property.Define, Indexer.Define): do not tag the
2374         properties as SpecialName | RTSpecialName.
2375
2376 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2377
2378         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2379         doing a low-level comparission of parameter types.  It was lacking
2380         a check for __argslist. 
2381
2382 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2383
2384         * expression.cs (ParameterReference.DoResolveBase): Allow
2385         reference parameters if they are local to this block. 
2386
2387         This allows the ref and out parameters of a delegate to be used in
2388         an anonymous method, for example:
2389
2390         delegate void set (out int x);
2391
2392         set s = delegate (out int x){
2393                 x = 0;
2394         };
2395
2396         This is used by functionality introduced late in the C# language.
2397         
2398         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2399         method that take ref and out parameters. 
2400
2401         Fixes #77119 which was a late change in the spec.
2402
2403 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2404
2405         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2406         parent if its the same scope.  Fixes #77060.
2407
2408 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2409
2410         * driver.cs: Report the case of no source files and no -out:
2411         argument provided.
2412
2413 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2414
2415         Fix #77035.
2416         * expression.cs (ComposedCast.GetSignatureForError): Define.
2417
2418 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2419
2420         Fix #76995
2421
2422         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2423         ListDictionary, to contain the ExternAliasEntry entries (in
2424         addition to the NamespaceEntry.aliases hashtable). This field is
2425         shared between the original entry and its doppelganger (bodyless 
2426         copy of it).
2427         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2428         extern_aliases field.
2429         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2430         lookup in extern_aliases.
2431
2432 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2433
2434         Fix #77006.
2435         * class.cs (TypeContainer.Mark_HasEquals): New.
2436         (TypeContainer.Mark_HasGetHashCode): New.
2437         (ClassPart): Override them.
2438         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2439
2440         Fix #77008.
2441         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2442         'parent' argument to the base constructor.
2443
2444         Remove all mention of TypeContainer from decl.cs.
2445         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2446         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2447         (DeclSpace.DeclSpace): Likewise.
2448         (DeclSpace.DefineMembers): Remove unused argument.
2449         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2450         debugging check -- we don't care if the debug code throws an
2451         InvalidCastException instead of an InternalErrorException.
2452         * class.cs (TypeContainer.DefineMembers): Update to changes.
2453         (TypeContainer.DoDefineMembers): Likewise.
2454         (TypeContainer.GetMethods): Likewise.
2455         (PropertyMember.Define): Likewise.
2456         (MemberBase.Parent): New property that forwards to
2457         MemberCore.Parent, but ensures that we get a TypeContainer.
2458         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2459         (RootContext.PopulateTypes): Likewise.  Remove special case code
2460         for !RootContext.StdLib: DefineMembers is idempotent.
2461
2462 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2463
2464         * convert.cs (ExplicitConversionCore): Check the return value from
2465         ExplicitConversionCore which can return null on failure.  Fixes #76914
2466
2467 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2468
2469         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2470
2471 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2472
2473         * doc.cs : The search for referenced namespace was insufficient to
2474           get global one as it used to do. Fixed bug #76965.
2475
2476 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2477
2478         * doc.cs : check name in cref in the last phase that whether it is
2479           namespace or not.
2480
2481 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2482
2483         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2484           Mono.C5.
2485
2486 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2487
2488         * doc.cs : so it turned out that we cannot skip override check for 
2489           interface members. Fixed bug #76954.
2490
2491 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2492
2493         * cs-tokenizer.cs : fixed bug #75984:
2494           - #warning and #error should not be handled when the source line
2495             is disabled.
2496           - #line is not checked strictly when the source line is disabled.
2497           - #define and #undef is on the other hand checked strictly at any
2498             state.
2499
2500 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2501
2502         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2503           CS1027 report.
2504
2505 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2506
2507         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2508
2509         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2510         event initializers.
2511         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2512         (FieldBase.Initializer): Initializer is now optional.
2513         (EventField.Define): Only event field can have initializer.
2514
2515         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2516
2517         * const.cs (Const): Reuse initializer.
2518
2519         * cs-parser.jay: Updated after FieldBase changes.
2520         Added current_array_type to simplify array initializers.
2521
2522         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2523
2524         * expression.cs, iterators.cs: Updated.
2525
2526         * namespace.cs (NamespaceEntry): Made UsingFound private.
2527
2528 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2529
2530         * parameterCollection.cs: Obsolete, removed.
2531         * parser.cs: Obsolete, removed.
2532
2533 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2534
2535         Fix #76849.
2536         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2537
2538         * enum.cs (Enum.Define): Set obsolete context here.
2539
2540 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2541
2542         * doc.cs :
2543           - FindDocumentedMember() now expects 1) paramList as null
2544             when "we don't have to check the number of parameters" and
2545             2) Type.EmptyTypes when "there is no arguments".
2546           - Introduced FoundMember struct to hold the exact type which was
2547             used to find the documented member (the above change broke
2548             test-xml-044; it might be better just to use DeclaringType than
2549             what MS does, like this change does, but it depends on usage.)
2550
2551 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2552
2553         * doc.cs : documented member might be from DeclaringType for nested
2554           types. Fixed bug #76782.
2555
2556 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2557
2558         * anonymous.cs: Have the param code handle leaving copies on the
2559         stack etc. Allows anonymous params to take part in the assignment
2560         code (++, +=, etc). Fixes bug #76550
2561
2562         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2563         it down to the anon code.
2564
2565         * iterators.cs: Use dummy var here
2566
2567         * codegen.cs: Handle new vars
2568
2569 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2570
2571         Fix #76849.
2572         * class.cs (MethodData.Define): Set proper Obsolete context.
2573
2574         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2575         obsolete context.
2576         (FieldExpr.DoResolve): Ditto.
2577
2578 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2579
2580         Fix #76849.
2581         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2582         parent is not obsolete.
2583
2584 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2585
2586         * doc.cs : (FindDocumentedMember) find parameterless members first
2587           and get CS0419 in the early stage. Fixed first case of bug #76727.
2588
2589 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2590
2591         Fix #76859.
2592         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2593         no error was reported.
2594
2595         *expression.cs (Binary.DoResolve): left can be null.
2596
2597 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2598
2599         Fix #76783.
2600         * class.cs (MethodData.Emit): Parameters should be labeled first.
2601
2602 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2603
2604         Fix #76761.
2605         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2606
2607 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2608
2609         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2610
2611         * class.cs (MethodCore): Parameter clean up.
2612         (IMethodData): Added ParameterInfo.
2613         (MethodData): Parameter clean up.
2614         (Indexer.Define): Parameter clean up.
2615
2616         * anonymous.cs,
2617         * codegen.cs,
2618         * cs-parser.jay,
2619         * decl.cs,
2620         * doc.cs,
2621         * ecore.cs,
2622         * flowanalysis.cs,
2623         * iterators.cs,
2624         * pending.cs,
2625         * statement.cs,
2626         * typemanager.cs: Parameter clean up.
2627
2628         * delegate.cs (Define): Get rid of duplicated code.
2629
2630         * expression.cs (ParameterReference): Removed useless parameters
2631         and simplified.
2632         (Invocation): Ditto.
2633
2634         * parameter.cs (ParamsParameter): New class, params specialization.
2635         (ArglistParameter): Attemp to separate arglist.
2636         (Parameter): Refactored to be reusable and faster.
2637         (Parameter.Modifier): Made understandable.
2638         (Parameters): Changed to be used as a class for `this' assembly
2639         parameters. Refactored to use new specialized classes.
2640
2641         * support.cs (ParameterData): Added Types property.
2642         (InternalParameters): Deleted.
2643
2644 2005-08-20  Martin Baulig  <martin@ximian.com>
2645
2646         Merging this patch from GMCS to fix #75867.
2647
2648         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2649         scope if we don't already have it.
2650
2651 2005-11-17  Martin Baulig  <martin@ximian.com>
2652
2653         * anonymous.cs
2654         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2655         inherit the scope from our parent.  Fixes #76653.
2656
2657 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2658
2659         * doc.cs : the previous patch does not actually fix the bug.
2660           PropertyInfo override check is now implemented and really fixed it.
2661         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2662
2663 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2664
2665         * doc.cs : apply "override filter" also to properties.
2666           Fixed bug #76730.
2667
2668 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2669
2670         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2671           no need to check overrides. For classes, omit those results from 
2672           interfaces since they must exist in the class. Fixed bug #76726.
2673
2674 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2675
2676         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2677           with different parameters. Fixed the second problem in #76685.
2678
2679 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2680
2681         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2682           get expected 'protected' access in CheckValidFamilyAccess()).
2683           Fixed bug #76692.
2684
2685 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2686
2687         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2688           Fixed bug #76705.  CS1569 was incorrectly commented out.
2689
2690 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2691
2692         * doc.cs : use Invocation.IsOverride() to do real override check.
2693         * expression.cs : made Invocation.IsOverride() internal.
2694
2695 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2696
2697         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2698           TypeBuilder.FindMembers() and filter overriden base members out.
2699           Fixed bug #76990.
2700
2701 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2702
2703         * doc.cs : ref/out parameters are represented as '@' (instead of
2704           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2705
2706 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2707
2708         * doc.cs : when there was no '.' in cref to methods in doc comment,
2709           then parameters were missing in the output. Fixed bug #76691.
2710
2711 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2712
2713         * driver.cs : don't output docs when there is an error.
2714           Fixed bug #76693.
2715
2716 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2717
2718         * doc.cs :
2719           Now it should detect indexers. Fixed primary concern in bug #76685.
2720           Fixed CS0419 message to not show the identical member signature in
2721           the message.
2722
2723 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2724
2725         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2726           instead of Type.FindMembers() since it does not handle events.
2727           Fixed bug #71604.
2728
2729 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2730
2731         * codegen.cs: Fixed typo (speficied -> specified).
2732
2733 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2734
2735         Fix #76369.
2736         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2737
2738 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2739
2740         * attribute.cs: Changed error message.
2741
2742         * cs-tokenizer.cs: One more check.
2743
2744 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2745
2746         * statement.cs (Block.Resolve): Ignore empty statement.
2747
2748 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2749
2750         * report.cs: Made error/warning methods more strict to avoid
2751         their misuse.
2752
2753         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2754         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2755         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2756         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2757
2758 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2759
2760         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2761         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2762
2763         * class.cs (TypeContainer.IsComImport): New property.
2764         (Constructor.Define): Create proper ctor for ComImport types.
2765
2766         * expression.cs (New.CheckComImport): Fixed.
2767
2768 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2769
2770         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2771         that a parameter has been captured does not mean that we do not
2772         have to do the rest of the processing.  This fixes the second part
2773         of #76592.  If there was another anonymous method capturing
2774         values in the past, the Scope would never be set for the second
2775         method that captured the same parameter.
2776
2777         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2778         properly manipulate the stack.   Second part of fix for #76592.
2779
2780         * expression.cs (New): Add support for invoking "new" on
2781         interfaces that have been flagged with the ComImport attribute and
2782         the CoClass.  Fixes #76637 
2783
2784         * statement.cs (Try.DoEmit): When a variable is captured, do not
2785         try to emit the vi.LocalBuilder variable as it has been captured.
2786         Create a temporary variable and store the results on the
2787         FieldBuilder.  Fixes #76642
2788
2789 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2790
2791         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2792
2793         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2794
2795         * expression.cs (Binary.DoResolve): Added && optimalization.
2796     
2797         * typemanager.cs (AddUserType): Removed useless argument.
2798
2799 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2800
2801         * statement.cs (Block.variables): Uses ListDictionary.
2802
2803 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fix #75969.
2806         * class.cs (PartialContainer.EmitType): Customized to emit
2807         security attributes.
2808         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2809         for partial classes.
2810
2811 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2812
2813         Fix #76599.
2814         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2815         access has to be fixed.
2816         
2817         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2818
2819 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2820
2821         Fix #76590.
2822         * ecore.cs (NullCast.Reduce): Implemented.
2823
2824         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2825         constant type.
2826         
2827         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2828         properly.
2829         (Foreach.Resolve): Catch null properly.
2830
2831 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2832  
2833         * cs-tokenizer.cs: Warning text fix.
2834
2835         * driver.cs: AllWarningNumbers exposed on public interface.
2836
2837         * report.cs (): Reviewed warning numbers.
2838         (IsValidWarning): Use binary search.
2839
2840 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2841  
2842         * driver.cs: Implemeted resource visibility.
2843         (Resources): New class for code sharing between /res: and
2844         /linkres:
2845  
2846 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2847
2848         Fix #76568.
2849         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2850         folding.
2851         
2852         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2853         contants only.
2854         
2855         * ecore.cs (NullCast): Child is contant only.
2856         
2857         * literal.cs (NullLiteral.Reduce): null can be converted to any
2858         reference type.
2859
2860 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2861
2862         * driver.cs: Use Encoding.Default as default code page instead
2863           of ISO-28591.
2864
2865 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2866
2867         Fix #76085.
2868         * expression.cs (Invocation.Error_InvalidArguments): Handle
2869         __arglist parameters.
2870         (Invocation.VerifyArgumentsCompat): Likewise.
2871         * support.cs (ReflectionParameters.GetSignatureForError): Print
2872         __arglist parameters.
2873         (InternalParamters.GetSignatureForError): Likewise.
2874         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2875
2876 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2877
2878         * attribute.cs (GetPropertyValue): Made public.
2879
2880         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2881         Resolve.
2882         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2883         attribute.
2884         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2885         is not defined.
2886         
2887         * driver.cs: Reflect method name change.
2888         
2889         * statement.cs (Try.Resolve): Warn when try has both general
2890         exception handlers.
2891         
2892         * typemanager.cs: runtime_compatibility_attr_type new predefined
2893         type.
2894
2895 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2896
2897         Fix #76419.
2898         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2899         treat it as an empty parameter list.
2900
2901 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2902
2903         Fix #76271.     
2904         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2905         ResolveAsTypeStep silent.
2906         * statement.cs (Block.AddConstant): Mark block as used.
2907         (Block.ResolveMeta): Avoid piling on error messages
2908         if a constant initializer resolution fails.
2909
2910 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2911
2912         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2913         Remove.
2914         (NamespaceEntry.VerifyAllUsing): New.
2915         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2916         behaviour.  Delegates actual resolution of alias to ...
2917         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2918         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2919         Update.
2920         * driver.cs (Driver.MainDriver): Update.
2921         
2922         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2923         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2924         property.
2925         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2926         Remove.
2927         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2928         RootNamespace.DefineNamespacesForAll.
2929
2930 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2931
2932         * typemanager.cs (assemblies, external_aliases, modules)
2933         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2934         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2935         overhead.  Move resposibility ...
2936         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2937         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2938
2939 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2940
2941         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2942         cached_namespaces.  Improve usage.
2943         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2944         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2945         Move from GlobalRootNamespace and simplify.
2946         (RootNamespace.Global): Make instance variable.
2947         (RootNamespace.RootNamespace): Add "alias name" parameter.
2948         (GlobalRootNamespace): Simplify drastically.
2949         (Namespace.Lookup): Don't use GetNamespace.
2950         * typemanager.cs (GetRootNamespace): Rename from
2951         ComputeNamespaceForAlias.
2952         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2953
2954 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2955
2956         * anonymous.cs (AnonymousContainer): Don't crash when container
2957         doesn't exist.
2958
2959 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2960
2961         * expression.cs (Binary.DoResolve): Warn when comparing same
2962         values.
2963
2964 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2965
2966         Fix #76486.
2967         * expression.cs (Binary.DoResolve): It looks like there are no
2968         convetsion rules in enum context.
2969
2970 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2971
2972         Add support for extern alias qualifiers.
2973         * typemanager.cs: Move some LookupTypeReflection code
2974         to namespace.cs, to have cleaner code. Added some methods
2975         to help us keep track of the extern aliased references.
2976         * driver.cs: Add suport for extern alias assemblies on command
2977         line and check for their warnings/errors. Also keep track of the
2978         extern aliased assemblies.
2979         * namespace.cs: Move the global functionality of Namespace
2980         to GlobalRootNamespace/RootNamespace. Now the global namespace
2981         is GlobalRootNamespace.Globa. Also the code moved from 
2982         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2983         Finally added LocalAliasEntry (AliasEntry before) and
2984         ExternAliasEntry, to handle alias statements.
2985         * cs-parser.jay: Add support in the grammar for extern alias
2986         statement.
2987         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2988         Update callings to Namespace (now in GlobalRootNamespace).
2989
2990 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2991
2992         Fix #76371.
2993         * class.cs (TypeContainer.DefineType): Move updating of
2994         topological sort earlier in the code.
2995         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2996
2997 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2998
2999         Fix #76273.
3000         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3001         
3002         * constant.cs (Constant.TryReduce): Moved from Cast class.
3003         (Reduce): Made little bit more OO and fixed missing conversions.
3004         
3005         * ecore.cs (Reduce): Implemented.
3006         (Binary.EnumLiftUp): New method to upgrade values to enum values.
3007         
3008         * literal.cs (Reduce): Implemented.
3009         
3010         * class.cs: Reverted Miguel's wrong commit.
3011
3012 2005-10-14  Miguel de Icaza  <miguel@novell.com>
3013
3014         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3015
3016 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
3017
3018         * cs-parser.jay, expression.cs : CS0214 was missing error location
3019           for constants. Fixed bug #76404.
3020
3021 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
3022
3023         Fix #76370.
3024         * convert.cs (ExplicitConversionCore): Fixed object->enum
3025         conversion.
3026
3027 2005-10-10  Raja R Harinath  <rharinath@novell.com>
3028
3029         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3030         InstanceExpression.
3031         (PropertyExpr.EmitCall): Likewise.
3032         * expression.cs (Invocation.EmitArguments): Handle case where
3033         arguments == null.
3034         (Invocation.EmitCall): Avoid allocating temporary variable if
3035         there are no arguments.
3036
3037 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3038
3039         Fix #76323.
3040         * convert.cs (ImplicitConversionStandard): Move conversion of
3041         void* to arbitrary pointer types ...
3042         (ExplicitConversionStandard): .. here.
3043         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3044         error to always print typenames.
3045
3046 2005-10-07  Raja R Harinath  <rharinath@novell.com>
3047
3048         * convert.cs (GetConversionOperator): Rename from
3049         GetConversionOperators.  Move operator selection code from ...
3050         (UserDefinedConversion): ... here.
3051
3052 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
3053
3054         * convert.cs (ExplicitConversionCore): Removed duplicate enum
3055         conversion.
3056
3057 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3058
3059         * assign.cs (Assign.DoResolve): Error method changed.
3060
3061         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3062         
3063         * const.cs (ResolveValue): Reset in_transit immediately.
3064         
3065         * constant.cs: Error method changed.
3066         
3067         * convert.cs: Removed useless location parameter.
3068         (ExplicitNumericConversion): Don't do double enum check.
3069         (ExplicitConversionCore): Renamed from ExplicitConversion.
3070         (ExplicitUnsafe): Extracted from ExplicitConversion.
3071         (ExplicitConversion): Uses for error reporting.
3072         
3073         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3074         error messages.
3075         (ResolveBoolean): Uses common error method.
3076         (CastToDecimal): Get rid of ec.
3077         (CastFromDecimal): Optimized.
3078         (ConvCast): Get rid of ec.
3079         
3080         * enum.cs (ResolveValue): Reset in_transit immediately.
3081         (Emit): Return after first error.
3082         
3083         * expression.cs: Convert changes.
3084         
3085         * literal.cs: Error method changed.
3086         
3087         * statement.cs: Error method changed.
3088
3089 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3090
3091         * support.cs (SeekableStreamReader.Position): Don't error out when
3092         the requested position is just beyond the end of the current
3093         buffered data.
3094
3095 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3096
3097         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3098         try to keep in sync with the byte count of the underlying Stream.
3099         However, this limits us to a window size of 2048 characters: i.e.,
3100         the maximum lookahead of our lexer/parser can be 2048 characters.
3101
3102 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3103
3104         Fix #76255.
3105         * driver.cs: Fix compilation files with full root path.
3106
3107 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3108
3109         * report.cs (SymbolRelatedToPreviousError): Format the output so
3110         it does not use an open parenthesis that is never closed. 
3111
3112         * driver.cs: Follow coding guidelines
3113
3114 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3115
3116         Fix #72930.
3117         * const.cs (Const.ResolveValue): Check for assigning non-null
3118         value to reference type.
3119
3120 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3121
3122         * anonymous.cs: Implemented ExprClassName.
3123         
3124         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3125         delegate.
3126         
3127         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3128         check.
3129         
3130         * class.cs (StaticClass.DefineContainerMembers): Report protected
3131         members as error.
3132         
3133         * codegen.cs: if(ed) PRODUCTION.
3134         
3135         * convert.cs (Error_CannotImplicitConversion): Better error
3136         distinction.
3137         
3138         * cs-parser.jay: More error checks.
3139         
3140         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3141         
3142         * driver.cs (CSCParseOption): Enabled wrong option check.
3143         
3144         * ecore.cs (Expression.ExprClassName): Turned to property.
3145         (MemberExpr.CheckIntermediateModification): For checking boxed
3146         value types     modification.
3147         
3148         * statement.cs (Fixed.Resolve): Expression type must be
3149         convertible to fixed type.
3150         (CollectionForeach.GetEnumeratorFilter,TryType):
3151         Small refactoring for easier error checking.
3152
3153 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3154
3155         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3156         attributes.
3157         
3158         * class.cs (GeneratedBaseInitializer): New class for customization
3159         compiler generated initializers.
3160         (MemberBase.DoDefine): Check Obsolete attribute here.
3161         (FieldMember.DoDefine): Ditto.
3162         
3163         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3164         constants.
3165         
3166         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3167         (MemberCore.GetObsoleteAttribute): Removed argument.
3168         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3169         (MemberCore.CheckObsoleteType): New helper.
3170         
3171         * delegate.cs,
3172         * enum.cs,
3173         * statement.cs: Updates after MemberCore changes.
3174         
3175         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3176         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3177         
3178         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3179         obsolete attribute for compiler construct.
3180         (As.DoResolve): Cache result.
3181         
3182         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3183
3184 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3185
3186         Fix #76133.
3187         * expression.cs (This.VerifyFixed): In a value type T, the type of
3188         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3189         value type R, 'this' is treated as a value parameter.
3190
3191 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3192
3193         * statement.cs (Lock): Use the TemporaryVariable class instead of
3194         manually using local variables as those do not work when variables
3195         are captured.
3196
3197         * ecore.cs: Moved the TemporaryVariable class from being a nested
3198         class inside Foreach to be a public class that can be employed in
3199         other places. 
3200
3201 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3202
3203         * cs-parser.jay: interface_accessors replaced by
3204         accessor_declarations.
3205
3206         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3207         location.
3208         
3209         * statement.cs (GotoCase.Resolve): Convert null constant to
3210         null case.
3211         (SwitchLabel.ResolveAndReduce): Ditto.
3212         (SwitchLabel.NullStringCase): Custom null stamp.
3213         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3214         
3215         typemanager.cs (CSharpSignature): Don't skip first argument
3216         for full names.
3217
3218 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3219
3220         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3221
3222         * location.cs (InEmacs): in this mode, do not report column
3223         location as it confuses Emacs.
3224
3225 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3226
3227         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3228         expression.cs, iterators.cs, literal.cs: Store constants and
3229         literals location.
3230         
3231         * class.cs (MemberBase.ShortName): Pass location.
3232         
3233         * cs-parser.jay: Some location fixes.
3234         
3235         * ecore.cs (Expression.Location): Made virtual.
3236
3237 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3238
3239         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3240         if the underlying types are the same, otherwise we need to produce
3241         code that will do the proper cast.
3242
3243         This was exposed by Marek's constant rewrite which produced
3244         invalid code for the call site:
3245
3246         enum X : long { a }
3247         void Method (X v) {}
3248
3249         Method ((X) 5)
3250
3251         This fixes test-49.cs
3252
3253 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3254
3255         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3256           Type/Object should be allowed as well. Fixed bug #75968.
3257
3258 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3259
3260         * expression.cs : (Binary.DoResolve): when one is enum constant and
3261           another is constant 0, then return enum one *as enum type*.
3262           Fixed bug 74846.
3263
3264 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3265
3266         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3267         internal.
3268
3269         Fix #75941.
3270         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3271         flow-branching for LocalVariableReferences in case we were invoked
3272         from a MemberAccess.
3273         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3274         Carved out of ...
3275         (LocalVariableReference.DoResolveBase): ... this.
3276         (MemberAccess.Resolve): Do the check that was disabled during
3277         SimpleNameResolve.
3278
3279 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3280
3281         * class.cs :
3282           (PartialContainer.Create): check abstract/sealed/static strictly
3283           but abstract/sealed can exist only at one side. Fixed bug #75883.
3284
3285 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3286
3287         Fix #75945.
3288         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3289         specified, don't default to UnmanagedType.I4.
3290
3291 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3292
3293         * expression.cs : conditional operator should check possibly
3294           incorrect assign expression. Fixed bug #75946.
3295
3296 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3297
3298         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3299           Reverting the change. gmcs is much complex than mcs on this matter.
3300
3301 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
3302
3303         * cs-tokenizer.cs : To read another token ahead of the actual 
3304           consumption, use new SavedToken and cache token instead of moving
3305           back the stream with SeekableStreamReader (it seemed problematic).
3306         * cs-parser.jay,
3307           driver.cs : Thus use StreamReader directly.
3308         * support.cs : Thus removed SeekableStreamReader.
3309
3310 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3311
3312         Fix #75934.
3313         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3314         (ScopeInfo.EmitScopeType): Use it to construct field names from
3315         names of captured locals.
3316
3317         Fix #75929.
3318         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3319         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3320         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3321         (ExplicitConversion): Remove enum cases already handled by
3322         implicit conversion.  Move implicit conversion check to the beginning.
3323         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3324         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3325         Don't treat System.Enum as a struct.
3326
3327 2005-08-30  Jb Evain  <jbevain@gmail.com>
3328
3329         * attribute.cs: handles as expression in parameters.
3330
3331 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3332
3333         Fix #75802.
3334         * class.cs (TypeContainer.VerifyClsName): Don't use a
3335         PartialContainer when verifying CLS compliance.
3336         (AbstractPropertyEventMethod): Set Parent here, ...
3337         (PropertyMethod): ... not here.
3338
3339 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3340
3341         * attribute.cs : escaped attribute name should not be allowed to be
3342           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3343
3344 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3345
3346         Fix #75927.
3347         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3348         when converting a long constant to unsigned long.
3349         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3350         detect where IsApplicable and VerifyArgumentsCompat disagree.
3351
3352 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3353         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3354
3355         Fix #75848.
3356         * class.cs (TypeContainer.CanElideInitializer): New helper.
3357         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3358         can safely emitting the initializer of a field.
3359
3360 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3361
3362         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3363           allowed inside a switch (without loop). Fixed bug #75433.
3364
3365 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3366
3367         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3368         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3369
3370 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3371
3372         * driver.cs : kinda reverting the default encoding changes (not exact 
3373           revert since I noticed that "codepage:reset" might not work fine).
3374
3375 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3376
3377         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3378           Location. Now getter and setter store location correctly.
3379           (errors/cs0111-12.cs now reports the expected location.)
3380
3381 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3382
3383         * driver.cs : Use default encoding on the environment.
3384           Removed (now that) extra parameter for SeekableStreamReader.
3385         * support.cs : (SeekableStreamReader) third .ctor() argument for
3386           StreamReader is not required (always true). preamble size could
3387           be acquired in simpler and safe way.
3388
3389 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3390
3391         * cs-parser.jay: report CS0642 at warning level 3
3392           and report CS0642 for an if else statement also
3393           fixes bug #74745. Patch by John Luke (and a bit
3394           modified by me).
3395           Removed extra CS0642 warning check for "while",
3396           "for" and "fixed".
3397         * statement.cs: In Block.Resolve(), CS0642 check
3398           is reimplemented to check a sequence of an empty
3399           statement and a block.
3400
3401           Both fix bug #66777.
3402
3403 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3404
3405         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3406         detection until I fix it.
3407         
3408         * cs-tokenizer.cs: Changed error message.
3409         
3410         * cs-parser.jay: Fixed 2 error locations.
3411         
3412         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3413         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3414         properties.
3415         
3416         * enum.cs (GetSignatureForError): Fixed.
3417         
3418         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3419         method detection.
3420         
3421         * class.cs,
3422         * typemanager.cs (RegisterProperty): Removed.
3423         
3424         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3425
3426 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3427
3428         Fix #75874.
3429         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3430         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3431
3432 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3433
3434         * expression.cs : tiny fix is required for not warning positive ulong.
3435           See test-441.cs.
3436
3437 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3438
3439         * expression.cs : add CS0652 check for constant and integral
3440           expression. Fixed bug #53974.
3441
3442 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3443
3444         * expression.cs : in DoNumericPromotions(), check if there is implicit
3445           conversion overload for string (to check CS0034). Fixed bug #52492.
3446
3447 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3448
3449         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3450
3451 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3452
3453         * ecore.cs : report location when it is *not* Null.
3454
3455 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3456
3457         * codegen.cs,
3458           ecore.cs,
3459           flowanalysis.cs,
3460           expression.cs:
3461           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3462           correctly. Fixed bug #75721.
3463
3464 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3465
3466         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3467         loop that performs 'min (pos, char_count)'.
3468
3469         Fix #75862.
3470         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3471         converted value in Operator.OnesComplement.
3472
3473 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3474
3475         * anonymous.cs: If the anon method is pulled into a helper class,
3476         it needs to be `internal' not `private'. Fixes runtime behavior on
3477         msft. bug #75704
3478
3479 2005-08-20  Martin Baulig  <martin@ximian.com>
3480
3481         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3482         scope if we don't already have it.
3483
3484         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3485         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3486         fixes #75867.
3487
3488 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3489
3490         Fix #75803
3491         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3492         is a partial class.
3493
3494 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3495
3496         The big constants rewrite
3497         Fix #75746, #75685 and more
3498         As a side effect saved 1MB for MWF ;-)
3499         
3500         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3501         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3502         enum based for corlib compilation.
3503         
3504         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3505         subtractions.
3506         
3507         * class.cs (FixedField.Define): Use ResolveAsConstant.
3508         
3509         * const.cs (IConstant): Interface constants and enums.
3510         (Const.ResolveValue): New method for constant resolvning.
3511         (ExternalConstant): Constants from imported assemblies.
3512         
3513         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3514         conversion; like enums.
3515         (Constant.ToType): Converts this constant to different type.
3516         (Constant.Increment): Adds 1.
3517         
3518         * convert.cs (ImplicitConversionRequired): Simplified.
3519         
3520         * cs-parser.jay: Create EnumMember directly.
3521         
3522         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3523         
3524         * doc.cs (GenerateEnumDocComment): Removed.
3525         
3526         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3527         (ConvertIntLiteral): Removed.
3528         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3529         
3530         * enum.cs (EnumMember): Implement IConstant.
3531         (Enum.IsValidEnumConstant): Removed.
3532         (Enum.GetNextDefaultValue): Removed.
3533         (Enum.FindMembers): Updated.
3534         (Enum.GenerateDocComment): Iterate enum members.
3535         
3536         * expression.cs (Cast.TryReduce): Handle enums correctly.
3537         (New.Constantify): Made public.
3538         (MemberAccess.DoResolve): Removed contant specific if(s).
3539         
3540         * literal.cs (NullLiteral): Implement new abstract methods.
3541         
3542         * statement.cs (GotoCase.Resolve): Use new constant methods.
3543         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3544         
3545         * typemanager.cs (LookupEnum): Removed.
3546         (IsEnumType): Fixed to work with corlib.
3547         (RegisterConstant): Removed.
3548         (LookupConstant): Removed.
3549         (GetConstant): Changed to work with IConstant.
3550
3551 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3552
3553         * location.cs : Fixed overflown (>255) column number.
3554
3555 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3556
3557         First cut of the qualified-alias-member feature.
3558         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3559         token.
3560         * cs-parser.jay (DOUBLE_COLON): New token.
3561         (namespace_or_type_name): Add rule for recognizing
3562         qualified-alias-members.
3563         (primary_expression): Likewise.
3564         (element_access): Allow QualifiedAliasMember as a possible
3565         type-bearing expression.
3566         (local_variable_type, local_variable_pointer_type): Likewise.
3567         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3568         aliases in the current and enclosing namespace declarations.
3569         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3570         * decl.cs (MemberName.is_double_colon): New.
3571         (MemberName.MemberName): Add new constructor for alias-member.
3572         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3573         * expression.cs (QualifiedAliasMember): New expression type.
3574
3575 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3576
3577         * location.cs : it borked when no argument was specified.
3578
3579 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3580
3581         * location.cs : tiny ToString() format fix.
3582
3583 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3584
3585         * statement.cs : oops, it was missing.
3586
3587 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3588
3589         A set of fixes for precise line/column location.
3590
3591         * location.cs :
3592           "token" field now holds a file/line "delta", a line number offset 
3593           from the segment, and a column number. See also:
3594           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3595           December/009508.html
3596           Removed static IsNull. Use instance IsNull property instead.
3597         * cs-tokenizer.cs :
3598           For some tokens it stores Location. For Identifier it stores
3599           LocatedToken which is a pair of string name and location.
3600           Column numbers are adjusted only at getChar().
3601         * report.cs :
3602           Use Location.ToString() for reporting (it now contains column).
3603         * cs-parser.jay :
3604           Largely modified to use LocatedToken instead of
3605           string (IDENTIFIER), and to acquire Location from some tokens.
3606         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3607           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3608           codegen.cs :
3609           Now MemberName holds Location. DeclSpace.ctor() receives Location
3610           as a parameter. Removed extra parameters to all derived classes.
3611           Replaced Location.IsNull() with instance property.
3612         * assign.cs, expression.cs :
3613           Added .ctor() overload that omits Location.
3614         * attribute.cs :
3615           Added "nameEscaped" flag that indicates the identifier was escaped
3616           in the source file. This fixes bug #57047.
3617
3618 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3619
3620         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3621         New method, looking for lo-case imported cls type.
3622
3623         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3624         here.
3625
3626         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3627
3628         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3629
3630         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3631         all_imported_types.
3632         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3633
3634         Optimized to save 3.5 MB for SWF compilation.
3635
3636 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3637
3638         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3639         (PartialContainer.Create): Moved logic AddToContainer.
3640         (PartialContainer.MarkForDuplicationCheck): Shares name.
3641         
3642         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3643         place.
3644         
3645         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3646         initialization.
3647         (Namespace.GetSignatureForError): New method.
3648         
3649         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3650         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3651
3652 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3653
3654         Fix #75669.
3655         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3656         member lookup rather than qualifier_type, since qualifier_type can
3657         be null.
3658
3659 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3660
3661         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3662         enum member.
3663
3664 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3665
3666         * statement.cs: Copy the local exception into the exception
3667         captured local.  Fixes 75674
3668
3669 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3670
3671         Fix #75658.
3672         * expression.cs (Invocation.OverloadResolve): Don't report error
3673         CS1501 if error CS1502 has been reported.
3674         (New.DoResolve): Delegate CS1501 reporting to
3675         Invocation.OverloadResolve.
3676
3677         Fix #75656.
3678         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3679         invariant-meaning-in-block property in an enclosing block if
3680         necessary.
3681
3682 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3683
3684         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3685         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3686         (Switch.CheckSwitch): Just save 50kb for SWF.
3687
3688 2005-07-27  Martin Baulig  <martin@ximian.com>
3689
3690         * anonymous.cs (CaptureContext.AddField): Added
3691         `AnonymousContainer am' argument; compute its toplevel scope if
3692         it's not already computed.  Fixes #75649.
3693
3694 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3695
3696         Fix #75628.
3697         * class.cs (Constructor.Emit): Reset block to null if the block
3698         resolve fails.
3699
3700 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3701
3702         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3703
3704 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3705
3706         * class.cs (MethodData.Define): Check whether accessor implementing
3707         interface is public.
3708
3709         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3710
3711 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3712
3713         Fix #57245
3714         * namespace.cs (LookupType): Moved same type check to...
3715         
3716         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3717         with the same name.
3718
3719 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3720
3721         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3722         already found a typebuilder.
3723         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3724         MemberNames, not strings.
3725
3726         * const.cs (Error_ExpressionMustBeConst): 
3727         Rename from Error_EpressionMustBeConst.
3728         * const.cs, class.cs, statement.cd: Update.
3729
3730 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3731
3732         Fix #65573
3733
3734         * const.cs (Const.LookupConstantValue): Report missing contant expression
3735         everytime.
3736         (Error_EpressionMustBeConstant): Only one error method.
3737
3738         * class.cs, statement.c: Updated.
3739
3740 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3741
3742         * statement.cs (Block.Flags): Add back HasVarargs.
3743         (Block.flags): Make protected.
3744         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3745
3746         * typemanager.cs (types, typecontainers, user_types): Remove.
3747         (UserTypes, TypeContainers): Likewise.
3748         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3749         (CleanUp, Reset): Update.
3750         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3751         (GetNestedType): Use Type.GetNestedType.
3752         (CoreLookupType): Take two arguments, the namespace and the
3753         basename of the type.  Update to use the Namespace.Lookup
3754         mechanism.
3755         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3756         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3757         string concatenation and substring matches.
3758         * class.cs, enum.cs, delegate.cs: Update to changes.
3759
3760 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3761
3762         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3763         Expression and made virtual.
3764
3765         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3766         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3767
3768         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3769
3770         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3771         error message.
3772
3773         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3774         change.
3775
3776 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3777
3778         Fix #57707
3779         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3780         AssemblyCultureAttribute is not used on executable.
3781
3782         * rootcontext.cs,
3783         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3784
3785 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3786
3787         Fix #60638.
3788         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3789         New.  Reports CS0252/CS0253.
3790         Mostly taken from preliminary patch by Duncak Mak.
3791         (Binary.DoResolveOperator): Store results of operator lookup.
3792         Use them to detect if we need to warn about unintended reference
3793         comparisons.
3794
3795 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3796
3797         Fix #72969.
3798         * namespace.cs (Namespace.Lookup): Add back location parameter.
3799         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3800         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3801
3802         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3803         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3804         (Namespace.LookupType): ... this.
3805         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3806         of namespaces.
3807         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3808         purported to handle pointers.
3809         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3810         CoreLookupType.
3811
3812 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3813
3814         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3815         type as namespace.
3816
3817 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3818
3819         * namespace.cs (Namespace.Lookup): Drop location parameter.
3820         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3821         (NamespaceEntry.Lookup): ... this.
3822         (NamespaceEntry.Error_AmbiguousTypeReference):
3823         Move here from DeclSpace.
3824         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3825         names ...
3826         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3827         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3828         Move to NamespaceEntry.
3829         * delegate.cs, expression.cs: Update to changes.
3830
3831 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3832
3833         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3834         CheckAttributeType and refactored.
3835         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3836         ResolveAsTypeTerminal error handling.
3837         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3838         handling.
3839         (GetSignatureForError): Print errors in same way.
3840
3841         * class.cs,
3842         * codegen.cs: Reflect attribute GetSignatureForError change.
3843
3844         * ecore.cs,
3845         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3846
3847         * namespace.cs (UsingEntry): Refactored to make fields private.
3848
3849         * assign.cs,
3850         statement.cs: Error_UnexpectedKind has extra parameter.
3851
3852 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3853
3854         * ecore.cs (IAlias): Remove.
3855         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3856         that implement the interface.
3857         * namespace.cs (Namespace): Likewise.
3858         (Namespace.declspaces): Renamed from 'defined_names'.
3859         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3860         DeclSpace instead of an IAlias.
3861         * tree.cs (Tree.AddDecl): Update.
3862
3863 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3864
3865         * statement.cs (Block.Flags); Remove HasVarargs.
3866         (Block.HasVarargs): Move to ToplevelBlock.
3867         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3868         (Block.Variables): Make protected.  Initialize variable hashtable
3869         if necessary.
3870         (Block.AddVariable): Update.
3871         (Block.Resolve): Update to changes.
3872         (ToplevelBlock.HasVarargs): New boolean.
3873         (ToplevelBlock.ThisVariable): Move here from Block.
3874         (ToplevelBlock.AddThisVariable): Likewise.
3875         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3876         * expression.cs (This.ResolveBase): Update to changes.
3877         (ArglistAccess.DoResolve): Likewise.
3878
3879 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3880
3881         Fix #75321
3882         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3883
3884         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3885         not used and not used & assigned.
3886         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3887
3888 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3889
3890         Fix #75053
3891         * expression.cs (Is.DoResolve): null is never provided type.
3892
3893 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3894
3895         Fix #52496
3896         * cs-parser.jay: Less strict event error rule to catch more errors.
3897
3898 2005-07-08  Martin Baulig  <martin@ximian.com>
3899
3900         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3901         gettter (allowed) or setter (not allowed).
3902
3903         * class.cs (Accessor): Implement IIteratorContainer.
3904         (Accessor.Yields): New public field.
3905         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3906         per-accessor basis.
3907
3908         * cs-parser.jay
3909         (get_accessor_declaration, set_accessor_declaration): Set the
3910         `yields' flag on the accessor, not the property.
3911         (property_declaration): Do the iterators check on a per-accessor
3912         basis and not for the whole property.
3913
3914 2005-07-08  Martin Baulig  <martin@ximian.com>
3915
3916         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3917         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3918
3919 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3920
3921         Fix #74975
3922         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3923         (ExtractSecurityPermissionSet): Cope with self referencing security
3924         attributes properly.
3925
3926         * driver.cs (SetOutputFile): Made public property OutputFile.
3927
3928 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3929
3930         Fix #75486.
3931         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3932         has_nonstatic_fields.  Make into a FieldBase pointer.
3933         (TypeContainer.AddField): Add CS0282 check.
3934         (TypeContainer.EmitType): Update.
3935
3936 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3937
3938         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3939         compare if they start with __.
3940
3941 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3942
3943         * statement.cs (Switch.SwitchGoverningType): Only look at
3944         UserCasts that don't need implicit standard conversions to one of
3945         the allowed switch types (Fixes test-322.cs).
3946         (LocalInfo.Resolve): Re-enable sanity-test.
3947
3948 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3949
3950         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3951         
3952         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3953         
3954         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3955
3956 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3957
3958         Fix #75472.
3959         * ecore.cs (SimpleName.GetSignatureForError): Add.
3960         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3961         (MemberAccess.GetSignatureForError): Add.
3962
3963 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3964  
3965         The big error and warning messages review.
3966         
3967         * anonymous.cs,
3968         * assign.cs,
3969         * attribute.cs,
3970         * class.cs,
3971         * codegen.cs,
3972         * convert.cs,
3973         * cs-parser.jay,
3974         * cs-tokenizer.cs,
3975         * decl.cs,
3976         * delegate.cs,
3977         * doc.cs,
3978         * driver.cs,
3979         * ecore.cs,
3980         * enum.cs,
3981         * expression.cs,
3982         * flowanalysis.cs,
3983         * iterators.cs,
3984         * literal.cs,
3985         * location.cs,
3986         * modifiers.cs,
3987         * namespace.cs,
3988         * parameter.cs,
3989         * pending.cs,
3990         * report.cs,
3991         * rootcontext.cs,
3992         * statement.cs,
3993         * support.cs,
3994         * tree.cs,
3995         * typemanager.cs: Updated.
3996         
3997         * class.cs: (MethodCore.SetYields): Moved here to share.
3998         (PropertyMethod.Define): Moved iterator setup here.
3999         
4000         * iterators.cs: Add orig_method to have full access to parent
4001         container.
4002
4003 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4004
4005         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4006         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4007         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4008         variable of struct type.
4009         * expression.cs (Unary.ResolveOperator): Update to change.
4010         (Indirection.VerifyFixed): Likewise.
4011         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4012         (ParameterReference.VerifyFixed): Value parameters are fixed.
4013         (This.VerifyFixed): Treat 'this' as a value parameter.
4014         * statement.cs (LocalInfo.IsFixed): Remove.
4015
4016 2005-07-01  Martin Baulig  <martin@ximian.com>
4017
4018         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4019         `ec.EmitThis ()' to get the correct scope.
4020
4021 2005-07-01  Martin Baulig  <martin@ximian.com>
4022
4023         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4024         instance is a ParameterReference; fixes #75299.
4025
4026 2005-07-01  Martin Baulig  <martin@ximian.com>
4027
4028         Reverted Marek's latest patch (r46725):
4029         - it contains structural changes which are neither mentioned in
4030           the ChangeLog nor explained anywhere; for example the additional
4031           argument of EmitContext's and Iterator's .ctor's and the
4032           TypeContainer.DefineMembers() change.
4033         - structural changes like this should go in in seperate patches
4034           and not be hidden in a huge patch which just seems to affect
4035           warnings and errors.
4036           a big and hard to understand patch.
4037         - it breaks iterators and causes regressions, for instance in
4038           test-iter-03.cs.      
4039
4040 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4041
4042         Fix #75412.
4043         * expression.cs (Indexers.map): Remove.
4044         (Indexers.Append): Filter out inaccessible setters and getters.
4045         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4046
4047         Fix #75283.
4048         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4049         Refactored from ...
4050         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4051         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4052         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4053         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4054
4055 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4056
4057         Fix #75322
4058         * class.cs (FieldBase.GetInitializerExpression): One more field
4059         for backup.
4060
4061 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4062
4063         * pending.cs: Do not define a proxy if the base method is virtual,
4064         it will be picked up by the runtime (bug 75270).
4065
4066 2005-06-08  Martin Baulig  <martin@ximian.com>
4067
4068         The big Iterators rewrite :-)
4069
4070         * iterators.cs: Rewrite this to use the anonymous methods framework.
4071
4072         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4073         before the TypeContainers; see 2test-21.cs.
4074
4075         * class.cs
4076         (TypeContainer.DefineType): Don't create a new EmitContext if we
4077         already have one (this only happens if we're an Iterator).
4078         (TypeContainer.Define): Also call Define() on all our iterators.
4079         (Method.CreateEmitContext): Added support for iterators.
4080
4081         * anonymous.cs
4082         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4083         (AnonymousContainer.CreateMethodHost): Moved here from
4084         AnonymousMethod and made abstract.
4085         (AnonymousContainer.CreateScopeType): New abstract method.
4086         (AnonymousContainer.IsIterator): New public property.
4087         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4088         get the ScopeTypeBuilder rather than manually defining it here. 
4089         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4090         iterators here.
4091
4092         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4093         before RootContext.DefineTypes().
4094
4095         * codegen.cs (EmitContext.RemapToProxy): Removed.
4096         (EmitContext.CurrentAnonymousMethod): Changed type from
4097         AnonymousMethod -> AnonymousContainer.
4098         (EmitContext.ResolveTopBlock): Protect from being called twice.
4099         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4100         (EmitContext.EmitThis): Removed the iterators hacks; use the
4101         anonymous methods framework for that.
4102
4103         * statement.cs
4104         (ToplevelBlock.Container): Make this a property, not a field.
4105         (ToplevelBlock.ReParent): New public method; move the
4106         ToplevelBlock into a new container.
4107         (Foreach.TemporaryVariable): Simplify.
4108
4109 2005-06-05  Martin Baulig  <martin@ximian.com>
4110
4111         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4112         (Block.AddTemporaryVariable): New public method; creates a new
4113         `LocalInfo' for a temporary variable.
4114         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4115         variables here.
4116         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4117         non-iterator variables.
4118
4119 2005-06-05  Martin Baulig  <martin@ximian.com>
4120
4121         * statement.cs (Foreach.TemporaryVariable): Create the
4122         LocalBuilder in the Emit phase and not in Resolve since in some
4123         situations, we don't have an ILGenerator during Resolve; see
4124         2test-19.cs for an example.
4125
4126 2005-06-04  Martin Baulig  <martin@ximian.com>
4127
4128         **** Merged r45395 from GCS ****
4129
4130         The big Foreach rewrite - Part II.
4131
4132         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4133         with `PropertyInfo ienumerator_getcurrent'.
4134
4135         * codegen.cs (VariableStorage): Removed.
4136
4137         * statement.cs
4138         (Foreach): Derive from Statement, not ExceptionStatement.
4139         (Foreach.CollectionForeach): New nested class.  Moved all the code
4140         dealing with collection foreach here.
4141         (Foreach.ForeachHelperMethods): Removed.
4142         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4143
4144 2005-05-23  Martin Baulig  <martin@ximian.com>
4145
4146         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4147         don't need to.  Fix #75014.
4148
4149 2005-05-20  Martin Baulig  <martin@ximian.com>
4150
4151         Merged r44808 from GMCS.
4152
4153         * class.cs (TypeContainer.CircularDepException): Removed.
4154         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4155         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4156         (CS0146) and interface (CS0529) dependencies here.
4157
4158 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4159
4160         * expression.cs (Invocation.EmitCall): Fix initialization
4161         'this_call' to reflect current behaviour.  Fix indentation.
4162
4163         * convert.cs (FindMostEncompassedType): Add two trivial special
4164         cases (number_of_types == 0 || number_of_types == 1).
4165         (FindMostEncompasingType): Likewise.
4166
4167 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4168
4169         Some cleanups preparing for the fix of #75283.
4170         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4171         error testing.
4172         (EventExpr.InstanceResolve): Likewise.
4173         (EventExpr.DoResolve): Remove redundant checks.
4174
4175 2005-06-10  Duncan Mak  <duncan@novell.com>
4176
4177         * cs-tokenizer.cs (process_directives): New flag for controlling
4178         the processing of preprocessor directives.
4179         (x_token): After seeing a '#', return Token.NONE instead of going
4180         to handle_preprocessing_directive() when not processing
4181         directives. This avoids unnecessary processing during the token peek in
4182         is_punct().
4183
4184         This fixes #74939.
4185
4186         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4187         the existing error reporting methods instead of Report.Error.
4188
4189         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4190         after Raja's rewrite.
4191
4192 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4193
4194         * class.cs: Small fix.
4195
4196 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4197
4198         Fix #75160.
4199         * class.cs (GetPartialBases): Fix return value check of
4200         part.GetClassBases.
4201
4202 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4203
4204         Ensure that partial classes are registered in their enclosing
4205         namespace.  Initial part of fix of #75160.
4206         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4207         Register declspace with namespace here, not in
4208         DeclSpace.RecordDecl.
4209         * cs-parser.jay: Pass namespace to RecordDecl.
4210         * class.cs (PartialContainer.Create): Likewise.
4211         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4212         called.
4213         * decl.cs (Declspace.RecordDecl): Remove.
4214         * namespace.cs (NamespaceEntry.DefineName): Remove.
4215
4216 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4217
4218         * rootcontext.cs: Reset TargetExt as well.
4219
4220 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4221
4222         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4223         -langversion:ISO-1.
4224
4225 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4226
4227         Fix #75080, cs0119.cs.
4228         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4229         of ...
4230         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4231         allowing ExprClass.Type and ExprClass.Namespace for
4232         ResolveFlags.VariableOrValue.
4233         (Expression.Resolve) [1-argument variant]: Change default resolve
4234         flags based on language version.
4235         (Expression.Error_UnexpectedKind): Use a simple string array
4236         rather than an ArrayList.
4237         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4238         not ExprClass.Type.
4239         (TypeOfVoid.DoResolve): Likewise.
4240         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4241         flags argument -- it always has the same value.
4242
4243 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4244
4245         Fix #75081.
4246         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4247         Use it in the error message.
4248         * assign.cs, expression.cs, statement.cs: Update.
4249
4250 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4251
4252         Fix #75088.
4253         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4254         the "almostMatchedMember" case too.
4255         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4256         that failed the accessibility checks to 'almost_match'.
4257
4258 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4259
4260         * attribute.cs: Use internal MethodBuilder methods to set
4261         ExactSpelling and SetLastError on PInvoke methods, instead
4262         of passing them via charset.  Fixes #75060.
4263
4264 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4265
4266         * parameter.cs (Parameter): Remove TODO comment.
4267         (Parameter.DefineParameter): Remove Location parameter.
4268         (Parameters.LabelParameters): Likewise.
4269         * class.cs (Constructor.Emit): Update to change.
4270         (MethodData.Emit): Likewise.
4271         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4272         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4273
4274 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4275
4276         * parameter.cs,
4277           Removed Parameters.Location and added Parameter.Location instead.
4278           Removed Location parameter from Emit() and GetSignature().
4279         * anonymous.cs,
4280           class.cs,
4281           cs-parser.jay,
4282           delegate.cs,
4283           iterators.cs,
4284           statement.cs :
4285           Modified all related calls.
4286
4287 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4288
4289         Improve user-defined conversion handling.
4290         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4291         applicable operators.
4292         (AddConversionOperators): New.  Helper for GetConversionOperators.
4293         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4294         there is only one most encompassed/encompassing type.
4295         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4296         "applicable operator" handling.
4297         (UserConversion): Move cache here from GetConversionOperators.
4298         Directly cache the chosen operator, rather than the whole
4299         MethodGroup.
4300         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4301         case.  Allow conversion of decimal to sbyte and byte too.
4302         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4303         New static methods.  Used to avoid allocating EmptyExpressions in
4304         convert.cs.
4305
4306 2005-05-24  Duncan Mak  <duncan@novell.com>
4307
4308         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4309         another class, used in Convert.ExplicitNumericConversion.
4310         (CastToDecimal): New class, similar to above, but casts to
4311         System.Decimal, used in Convert.ImplicitNumericConversion and also
4312         in explicit convesion from double/float to decimal.
4313
4314         * convert.cs (ImplicitNumericConversion): Handle implicit
4315         conversions to System.Decimal.
4316         (ExplicitNumericConversion): handle explicit conversions to
4317         System.Decimal.
4318
4319         This fixes #68711.
4320         
4321 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4322
4323         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4324         know the type at this stage, just break through.   Fixes #75008 
4325
4326 2005-05-19  Martin Baulig  <martin@ximian.com>
4327
4328         * delegate.cs
4329         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4330         to disable error reporting.
4331
4332         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4333         here since we don't want to report an error; see the new test-336.cs.
4334
4335 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4336
4337         * statement.cs (ToplevelBlock.GetParameterReference)
4338         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4339         Move here from class Block.
4340         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4341         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4342
4343 2005-05-18  Martin Baulig  <martin@ximian.com>
4344
4345         Fix #74978.
4346
4347         * flowanalysis.cs
4348         (FlowBranching.Reachability): Add non-static public And() and Or()
4349         methods.
4350         (FlowBranchingSwitch): New class; do the `break_origins' thing
4351         like in FlowBranchingLoop.
4352         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4353         reachability, not just locals and parameters.
4354         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4355         switch; MergeBreakOrigins() now takes care of that.
4356
4357 2005-05-18  Martin Baulig  <martin@ximian.com>
4358
4359         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4360         a loop and may leave it, reset the barrier; fixes #74974.
4361
4362 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4363         
4364         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4365         is back.
4366         
4367         * cs-parser.jay: Catch more lexical errors.
4368         
4369         * report.cs: Add one more Error method.
4370         
4371         * rootcontext.cs,
4372         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4373
4374 2005-05-17  Martin Baulig  <martin@ximian.com>
4375
4376         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4377         #70970. 
4378
4379 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4380
4381         Fix test-382.cs.  Emit values of decimal constants.
4382         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4383         Carved out of ...
4384         (TypeContainer.AddField): ... this.
4385         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4386         with initializers to include 'Const's.
4387         (ClassPart.RegisterFieldForInitialization): Forward to
4388         PartialContainer.
4389         * const.cs (Const.Const): Pass initializer to base class.
4390         (Const.Define): In case of decimal constants, register them for
4391         initialization in a static constructor.
4392
4393 2005-05-14  Martin Baulig  <martin@ximian.com>
4394
4395         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4396         do not call ResolveUnreachable() on unreachable statements in
4397         here, see the comment in the source code.
4398
4399 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4400
4401         Fix #74934.
4402         * expression.cs (BinaryResolveOperator): If one of the operands of
4403         an equality comparison is 'null' and the other is a pointer type,
4404         convert the null to a NullPointer.
4405         * convert.cs (ImplicitReferenceConversion): If the expression is a
4406         NullLiteral and the target type is a pointer type, return a
4407         NullPointer instead.
4408         (ImplicitConversionStandard): Likewise.
4409
4410 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4411         
4412         * cs-parser.jay: Set readonly context based on special constructs.
4413         
4414         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4415         readonly variable error handling.
4416         
4417         * rootcontext.cs (EmitCode): Don't verify members when error
4418         occurred.
4419         
4420         * statement.cs (LocalInfo): Add reaodnly context information.
4421         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4422
4423 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4424
4425         * statement.cs (Block.Resolve): Revert change below.  Modify fix
4426         for #74041 to initialize 'resolved' to false only for explicit
4427         blocks.  Fixes #74873.
4428
4429 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4430
4431         Fix #74920.
4432         * typemanager.cs (unmanaged_enclosing_types): New.
4433         (IsUnmanagedType): Avoid infloops by using
4434         'unmanaged_enclosing_types' to talk with recursive invocations.
4435
4436 2005-05-13  Martin Baulig  <martin@ximian.com>
4437
4438         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4439         instance variable, not a local.  Fix #74873.
4440         (Block.ResolveUnreachable): Set it to true here.
4441
4442 2005-05-11  Duncan Mak  <duncan@novell.com>
4443
4444         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4445         continuing to process for 'arg'.
4446         (handle_preprocessing_directive): Check the argument of the #endif
4447         directive and report error CS1025 if there are any trailing
4448         characters.
4449
4450         According to the C# spec, having even whitespace after the #endif
4451         directive is illegal; however, because we call arg.TrimEnd ()
4452         beforehand, we have the same behavior as csc, allowing whitespace
4453         after the directive.
4454
4455         Fixes #74892.
4456
4457 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4458
4459         Fix #74863.
4460         
4461         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4462         (Constructor.GetObsoleteAttribute): Implemented correctly.
4463
4464 2005-05-10  Martin Baulig  <martin@ximian.com>
4465
4466         * support.cs (ReflectionParameters.ParameterModifier): Use
4467         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4468         and `ParameterAttributes.In'.  Fixes #74884.
4469
4470 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4471
4472         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4473         
4474         * expression.cs (Argument.GetParameterModifier): Turned to property.
4475         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4476         
4477         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4478         its C# equivalent.
4479         
4480 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4481
4482         Fix #74852.
4483         * decl.cs (MemberCache.AddMethods): Register override methods,
4484         rather than non-override methods.
4485         * typemanager.cs (RegisterOverride): New.
4486         (IsOverride): Update.
4487
4488 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4489
4490         Fix #73105.
4491         
4492         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4493         recursive declaration.
4494         
4495         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4496         
4497 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4498
4499         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4500         
4501         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4502
4503 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4504
4505         Fix #74797.
4506         * decl.cs (DeclSpace.FamilyAccessible): 
4507         Use TypeManager.IsNestedFamilyAccessible.
4508
4509         Fix reopened #64812.
4510         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4511         internal'.
4512
4513 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4514             Abin Thomas  <projectmonokochi@rediffmail.com>
4515             Anoob V E  <projectmonokochi@rediffmail.com>
4516             Harilal P R  <projectmonokochi@rediffmail.com>
4517
4518         Fix #64812.
4519         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4520         allow access to all static members.
4521
4522 2005-05-04  Martin Baulig  <martin@ximian.com>
4523
4524         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4525
4526 2005-05-04  Martin Baulig  <martin@ximian.com>
4527
4528         Fix #74655.
4529
4530         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4531         section at the end; make things work if `default' is not the last
4532         section.        
4533
4534 2005-05-04  Martin Baulig  <martin@ximian.com>
4535
4536         Fix #70400.
4537
4538         * statement.cs (Switch): Replaced the `got_default' field with a
4539         `default_section' one.
4540         (Switch.CheckSwitch): Set `default_section' here.
4541         (Switch.Resolve): If we're a constant switch and the constant is
4542         not found, use the default section.
4543
4544 2005-05-03  Martin Baulig  <martin@ximian.com>
4545
4546         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4547
4548         * statement.cs (Foreach.ArrayForeach): New nested class.
4549         (Foreach.TemporaryVariable): New nested class.
4550         (Foreach.EmitArrayForeach): Removed; this is now in the new
4551         ArrayForeach class.
4552
4553 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4554
4555         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4556         more conservative.
4557         (VerifyPendingMethods): Revert change below.
4558
4559         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4560         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4561         that used to trigger warning -28.  Remove warning -28.
4562         * expression.cs (Invocation.OverloadResolve): Use
4563         TypeManager.IsOverride to distinguish override methods.
4564
4565         Fix #74773.
4566         * pending.cs (VerifyPendingMethods): If a base type implements the
4567         requested interface, don't bother checking individual methods of
4568         the base type.  As a side-effect, this prevents the creation of
4569         unnecessary proxies.
4570
4571 2005-05-02  Martin Baulig  <martin@ximian.com>
4572
4573         Fix #70182.
4574
4575         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4576         Also `And' the locals if the old vector is null.
4577         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4578         null; in this case we basically reset all the variables.        
4579
4580 2005-05-02  Martin Baulig  <martin@ximian.com>
4581
4582         Fix #74529.
4583
4584         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4585         Added `FlowBranching branching' argument; always `and' the
4586         variables instead of `or'ing them unless we're an infinite loop.
4587
4588         * statement.cs (While.Resolve): Create a new sibling unless we're
4589         infinite.       
4590
4591 2005-05-02  Martin Baulig  <martin@ximian.com>
4592
4593         Fix #70140.
4594
4595         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4596         arguments; use it instead of creating a new TopLevelBlock.
4597         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4598         our ConstructorInitializer.
4599
4600         * statement.cs
4601         (TopLevelBlock.TopLevelBranching): New public property.
4602         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4603         and create our `TopLevelBranching'.
4604
4605         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4606         anonymous method host, use `block.TopLevelBranching' rather than
4607         creating a new branching.
4608
4609 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4610
4611         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4612         a ScopeInfo, if any of the current children is a child of the new
4613         entry, move those children there.
4614
4615 2005-04-30  Martin Baulig  <martin@ximian.com>
4616
4617         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4618         at the beginning of a SwitchSection.  Fix #73335.
4619
4620 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4621
4622         Fix #74378
4623         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4624         
4625         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4626         (FieldExpr.DoResolve): Obsolete members are ignored for field
4627         initializers.
4628         
4629 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4630
4631         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4632         of arrays detection.
4633
4634         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4635         verification.
4636         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4637
4638         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4639         arrays report.
4640
4641 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4642
4643         * cs-parser.jay: Use the prefered version of -unsafe in error
4644         message.
4645
4646 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4647
4648         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4649         circumstances.
4650
4651 2005-04-20  John Luke  <john.luke@gmail.com>
4652
4653         * driver.cs: fix typo in error message, --outout to --output
4654
4655 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4656
4657         * codegen.cs (InRefOutArgumentResolving): New field.
4658         
4659         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4660         fields outside contructor.
4661         
4662         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4663         
4664 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4665
4666         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4667         parameter code was not completed ever, so it was not as up-to-date
4668         as local variables.  Must finish it.
4669
4670         The bug fix was to compare the Toplevel of the block, not the
4671         current block.  Thanks for Ben for pointing this out. 
4672
4673 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4674
4675         * decl.cs (AddMethods): Use the declaring type of the problem
4676         method to determine if we want to squash a warning.
4677
4678 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4679
4680         * attribute.cs: Removed debug output.
4681
4682         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4683         
4684         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4685         Report.Stderr.
4686         
4687 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4688
4689         Fix #74481.
4690         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4691         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4692         all null comparisons against reference types.
4693
4694 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4695
4696         Fix# 74565
4697         * class.cs (TypeContainer.CircularDepException) New nested
4698         exception class.
4699         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4700         (TypeContainer.DefineType): Removed error, reset InTransit before
4701         exit.
4702         (Class.DefineType): Throw exception when is in Transit.
4703         Catch exception and report error.
4704         (Struct.DefineType): Throw exception when is in Transit.
4705         Catch exception and report error.
4706         (Interface.DefineType): Throw exception when is in Transit.
4707         Catch exception and report error.
4708
4709         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4710         handle nested exception handlers.
4711
4712         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4713         a catch.
4714
4715         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4716         InFinally and InCatch storage.
4717
4718         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4719         (Catch.Resolve): Set and Restore ec.InCatch.
4720         (Try.Resolve): Set and Restore ec.InFinally.
4721         (Try.HasCatch): True when try has catch.
4722
4723 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4724
4725         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4726           for the same event member, so exclude such cases from warning 419.
4727           Fixed bug #74633.
4728
4729 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4730
4731         * expression.cs (Binary.ResolveOperator): Apply patch from John
4732         Luke to fix bug 59864: operators &, | and ^ on enumerations
4733         require that the same enum type on both sides.
4734
4735         * driver.cs: Add warnings to old flag usage, this is to assist
4736         people who produce Makefiles and hope that the Makefiles will be
4737         used on Windows.
4738
4739         * class.cs (TypeContainer.EmitType): Moved the definition of the
4740         special $PRIVATE$ field from the resolve phase to the Emit phase.
4741         During resolve we do not know if we are a struct with
4742         HasExplicitLayout, we know this only after the attributes for the
4743         type are emitted.
4744
4745         Set the FieldOffset to zero on the dummy field that we create for
4746         the class.   Fixes 74590.
4747
4748 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4749
4750         Fix #73834.
4751         * ecore.cs (PropertyExpr.resolved): New.
4752         (DoResolve): Use it to handle a case of double resolution here.
4753         Handle a case of identical-name-and-type-name.
4754         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4755         resolution by storing the results of expression resolution back
4756         into the "probes" array.
4757
4758 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4759
4760         Fix cs0208-7.cs and cs0208-8.cs.
4761         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4762         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4763         error reporting to point out the reason a struct is not unmanaged.
4764
4765 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4766
4767         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4768           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4769
4770 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4771
4772         Fix #74528.
4773         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4774         IdenticalNameAndTypeName here.
4775         (EventExpr.InstanceResolve): Likewise.
4776
4777 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4778
4779         C# 2.0 DefaultCharSetAttribute implementation
4780         
4781         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4782         which allows us to set GlobalNamespace for every resolve.
4783         (Attribute.ResolveArguments): Cut from Resolve.
4784         (Attribute.GetCharSetValue): Returns CharSet named argument.
4785         (Attribute.DefinePInvokeMethod): Gets default charset from
4786         module settings.
4787         (GlobalAttribute.ResolveAsTypeStep): Override.
4788         (GlobalAttribute.ResolveArguments): Override.
4789         
4790         * class.cs (TypeAttr): Is protected.
4791         
4792         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4793         (ModuleClass.DefaultCharSetType): New memeber.
4794         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4795         
4796         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4797         charset from module.
4798         
4799         * delegate.cs (TypeAttr): Override.
4800         (Delegate.DefineType): Use this TypeAttr.
4801         
4802         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4803         at very early stage (before types are defined) to resolve model
4804         module attributes. It will probably not work with corlib but it
4805         should be ok.
4806         
4807         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4808         charset from module.
4809         
4810         * typemanager.cs (default_charset_type): New type.
4811
4812 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4813
4814         * decl.cs (MemberCache.AddMethods): Don't warn if
4815         System.Object.Finalize has buggy MethodAttributes.
4816
4817         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4818         removed below.
4819
4820 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4821
4822         * doc.cs : detect ambiguous reference to overloaded members.
4823           Fixed bug #71603. MS 1.1 csc does not detect it.
4824
4825 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4826
4827         * doc.cs : delegates must not be referenced with parameters.
4828           Fixed bug #71605.
4829
4830 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4831
4832         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4833
4834 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4835
4836         * driver.cs (MainDriver): Stop processing if the CLS stage found
4837         errors. 
4838
4839         (CompilerCallableEntryPoint.InvokeCompiler): Always
4840         reset after execution;   Take a TextWriter argument for the
4841         output.
4842
4843         * report.cs: Use the error stream instead of hardcoding stderr. 
4844
4845 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4846
4847         * class.cs: Reduce code paths to test, too small of an
4848         optimization to make it worth the extra testing.  Always perform
4849         it. 
4850
4851 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4852
4853         Fix #74510.
4854         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4855         operators that had errors reported on them.
4856
4857 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4858
4859         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4860         argument types.
4861         (Attribute.Resolve): Add named argument type checking.
4862         
4863         * class.cs (FixedField.Define): Use IsPrimitiveType
4864         
4865         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4866         
4867         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4868         unsafe parameter types.
4869         
4870         * statement.cs (Using.ResolveExpression): Add better error description.
4871         
4872         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4873         
4874 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4875
4876         Fix #74484.
4877         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4878         AttributeUsageAttribute in the emitcontext of the attribute class,
4879         not in the emitcontext of the attributable entity it was attached to.
4880         * cs-parser.jay: Use 'current_class', not 'current_container',
4881         when creating a GlobalAttribute.
4882
4883 2005-04-08  Alp Toker  <alp@atoker.com>
4884
4885         * pending.cs: The fix to #58413 failed to compile methods implementing
4886         interfaces with/without params modifiers and vice versa, even though
4887         params modifiers aren't part of the signature. Make the modifier check
4888         less strict as in csc.
4889
4890 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4891             Anoob V E  <projectmonokochi@rediffmail.com>
4892             Harilal P R  <projectmonokochi@rediffmail.com>
4893
4894         Fix #58413.
4895         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4896         modifiers of pending methods.
4897         (PendingImplementation.PendingImplementation): Initialize it.
4898         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4899         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4900         with ParameterData.  Add check for modifiers.
4901         * class.cs (MethodData.Define): Update to changes.
4902
4903 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4904
4905         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4906
4907 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4908
4909         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4910         property.
4911         
4912         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4913         
4914         * rootcontext.cs,
4915         * typemanager.cs: Registered RequiredAttributeAttribute.
4916         
4917 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4918
4919         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4920         Warning CS0169 is back at level 3.
4921         (IMethodData.SetMemberIsUsed): New method.
4922         
4923         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4924         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4925         
4926         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4927
4928         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4929         contants.
4930         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4931         is used.
4932         
4933         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4934         is used.
4935         
4936         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4937         to avoid the problems with nested types.
4938
4939 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4940             Anoob V.E  <projectmonokochi@rediffmail.com>
4941             Harilal P.R  <projectmonokochi@rediffmail.com>
4942             Raja R Harinath  <rharinath@novell.com>
4943
4944         Fix #73820.
4945         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4946         attribute.
4947         * typemanager (GetConstructor): Make public.
4948
4949 2005-04-05  John Luke  <john.luke@gmail.com>
4950             Raja R Harinath  <rharinath@novell.com>
4951
4952         Fix #62232.
4953         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4954         struct too.  Return false quicker in a few cases.
4955         (VerifyUnManaged): Use it.
4956
4957 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4958
4959         Fix #74041.
4960         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4961         not 'unreachable_seen'.
4962
4963 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4964
4965         * attribute.cs (Attribute.GetValue): Removed unused.
4966         
4967         * codegen.cs (CodeGen.TrimExt): Removed unused.
4968         
4969         * cs-parser.jay (output): Removed unused.
4970         
4971         * cs-tokenizer.cs (hex_digits): Removed unused.
4972         
4973         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4974         
4975         * expression.cs (Indirection.LoadExprValue): Removed unused.
4976         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4977         
4978         * iterators.cs (Iterator.param_types): Removed unused.
4979         
4980         * statement.cs (Goto.block): Removed unused.
4981         (ToplevelBlock.did): Removed unused.
4982         (Switch.ResolveConstantSwitch): Removed unused.
4983
4984 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4985
4986         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4987         resetting thingy.
4988
4989 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4990
4991         Fix #74232 and cs0208-3.cs.
4992         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4993         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4994         unmanaged type.  Don't use FieldBuilders when 't' is a
4995         TypeBuilder.  Use ModFlags and MemberType fields.
4996         * class.cs (MemberBase.member_type): Rename from MemberType.
4997         (MemberBase.MemberType): New property.  Determines member_type on
4998         demand.
4999         (MemberBase.DoDefine): Don't initialize MemberType here.
5000         (FieldMember.Define): Likewise.
5001
5002 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5003
5004         Fix #74241
5005         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5006         Attributes are emitted there.
5007         
5008 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5009
5010         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5011         keyword in 'partial enum' too.
5012         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5013         is not allowed).
5014         Report from Kamil Skalski <nazgul@omega.pl>.
5015
5016         Fix #74309.
5017         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5018         have partial containers too.
5019
5020         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5021         in block' checks to Block.CheckInvariantMeaningInBlock.
5022         * statement.cs (Block.GetKnownVariableInfo): Make private.
5023         (Block.IsVariableUsedInChildBlock): Remove.
5024         (Block.IsVariableUsedInBlock): Likewise.
5025         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5026         conflicting declaration.
5027         (Block.AddVariable): Make error messages less long-winded and more
5028         specific.  Show location of conflicting declaration.
5029         * parameter.cs (Parameters.Location): New readonly property.
5030
5031 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5032
5033         Clean up semantics of invoking ResolveMemberAccess.
5034         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5035         can have an instance, ensure that we pass in a non-TypeExpression
5036         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5037         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5038         argument.  Update to changes and simplify.
5039         (FieldExpr.Emitinstance): Remove CS0120 check.
5040         (PropertyExpr.EmitInstance): Likewise.
5041         * expression.cs (Argument.Resolve): Likewise.
5042         (Invocation.DoResolve): Update to changes in semantics of
5043         InstanceExpression.
5044
5045 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5046
5047         Fix #74241
5048         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5049         customization.
5050         
5051         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5052
5053 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5054
5055         Fix difference in behaviour with commandline invocation.
5056         * driver.cs (Driver.Reset): New.
5057         (CompilerCallableEntryPoint): Call it.
5058
5059         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5060         variable" warnings if the boolean expression failed to resolve.
5061
5062 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5063
5064         * attribute.cs: Fix the union of several permissions when some of them
5065         are unrestricted (so the result isn't an unrestricted permission set).
5066         Fix #74036.
5067
5068 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5069
5070         * ecore.cs (MemberExpr): New class.  Convert from interface
5071         IMemberExpr.
5072         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5073         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5074         error checks.
5075         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5076         (MethodGroupExpr.IsExplicitImpl): Remove.
5077         (Expression.GetFieldFromEvent): Remove.
5078         (SimpleName.MemberStaticCheck): Remove.
5079         (SimpleName.DoSimpleNameResolve): Update to changes.
5080         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5081         (MemberAccess.IdenticalNameAndTypeName): Remove.
5082         (MemberAccess.error176): Move to MemberExpr.
5083         (MemberAccess.DoResolve): Update to changes.
5084         (BaseAccess.DoResolve): Likewise.
5085
5086 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5087
5088         C# 2.0 Conditional attribute class implementation
5089         
5090         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5091         Analyzes class whether it has attribute which has ConditionalAttribute
5092         and its condition is not defined.
5093         
5094         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5095         (Class.IsExcluded): New method. Search for at least one defined
5096         condition in ConditionalAttribute of attribute class.
5097
5098 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5099
5100         * ecore.cs (PropertyExpr): Derive from Expression, not
5101         ExpressionStatement.
5102         (PropertyExpr.EmitStatement): Remove.
5103
5104 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5105
5106         Fix #74060.
5107         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5108         internal field "value__" of an enum be private.  The examples for
5109         "value__" that I found on MSDN all used FieldAttributes.Private.
5110
5111         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5112         Don't mention IL method attribute names.
5113
5114         Fix #47991.  Remove a TODO.
5115         * statement.cs (Block.Toplevel): Make into a field.
5116         (Block.Parameters): Move into ToplevelBlock.
5117         (Block.known_variables): Rename from child_variable_names.
5118         (Block.Block): Remove variants that take Parameters.  Initialize
5119         'Toplevel' with the immediately surrounding toplevel block.
5120         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5121         LocalInfo parameter.
5122         (Block.GetKnownVariableInfo): New.
5123         (Block.IsVariableNameUsedInChildBlock): Update.
5124         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5125         the block, even though it may not be in scope.
5126         (Block.AddVariable): Remove Parameters parameter.  Use
5127         Toplevel.Parameters instead.
5128         (Block.AddConstant): Remove Parameters parameter.
5129         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5130         (Block.IsParamaterReference): Likewise.
5131         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5132         (ToplevelBlock.Parameters): New.  Moved from Block.
5133         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5134         initialize Parameters to a non-null value.
5135         * cs-parser.jay: Update to changes.
5136         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5137         simple names that mean different things in the same block.  Use
5138         Block.IsVariableNameUsedInBlock.
5139
5140 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5141
5142         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5143         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5144         GetTypeHandle.  It is possible for a reflected type to derive from
5145         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5146         System.Array during mscorlib compilation).
5147         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5148         contain a method_hash, don't create one either.  Don't create a
5149         deep copy of the base cache's method_hash.
5150         (MemberCache.SetupCache): Rename back from DeepCopy.
5151         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5152         already initialized.  If we see an override function, add its
5153         underlying base virtual function to the member_hash too.
5154
5155         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5156
5157 2005-03-26  Raja R Harinath  <harinath@acm.org>
5158
5159         Fix #73038.
5160         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5161         fails to resolve, ensure that the LHS is still resolved as an
5162         lvalue.
5163
5164 2005-03-25  Raja R Harinath  <harinath@acm.org>
5165
5166         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5167         ec.ContainerType.
5168         (Enum.current_ec): Remove.
5169         (Enum.LookupEnumValue): Remove EmitContext argument.
5170         Just uses the one created during DefineType.
5171         (Enum.FindMembers): Update.
5172         * expression.cs (MemberAccess.DoResolve): Update.
5173
5174 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5175
5176         * assign.cs (Assign.DoResolve): Check for CS1717 when
5177         source and target are same (uses Equals).
5178
5179         * expression.cs (LocalVariableReference, ParameterReference,
5180         This): Implemented Equals, GetHashCode.
5181
5182         * statement.cs (Block.GetParameterReference): Removed useless
5183         local variable.
5184
5185 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5186
5187         Fix cs0128.cs
5188         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5189         blocks before deciding whether the error is cs0136 or cs0128.
5190
5191         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5192         (using_alias_directive, using_namespace_directive): Pass
5193         MemberName, not an expression to Namespace.UsingAlias and
5194         Namespace.Using.
5195         (MakeName): Use the MemberName of the namespace.
5196         * namespace.cs (Namespace.MemberName): New.
5197         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5198         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5199         Likewise.
5200         * decl.cs (MemberName.Name): Make readonly.
5201         (MemberName.FromDotted): New "constructor".
5202         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5203         (MemberCore.Name): Compute from MemberName on demand.
5204         (MemberCore.SetMemberName): Provide a way to change the
5205         MemberName.
5206         (MemberCore.AddToContainer): Don't take a fullname parameter.
5207         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5208         fully qualified name of the container to the member name.
5209         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5210         only if the type is a member of the root container.
5211         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5212         MemberName.Left rather than searching for an embedded ".".
5213         (PartialContainer.CreatePart): Update to changes in RootContext.
5214         (MemberBase.ShortName): Turn into a property.  Use
5215         MemberCore.SetMemberName.
5216         (MemberBase.ExplicitInterfaceName): Remove.
5217         (MemberBase.UpdateMemberName): Remove.
5218         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5219         (PropertyBase.SetMemberName): New override.
5220         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5221         (Tree.GetDecl): New.
5222         (Tree.AllDecls): Rename from Decls.
5223         * attribute.cs, enum.cs, report.cs: Update to changes.
5224         * driver.cs (MainDriver): Use MemberName.FromDotted on
5225         RootContext.MainClass.
5226
5227 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5228
5229         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5230         checks.
5231
5232         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5233
5234 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5235
5236         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5237         property accessor modifiers.
5238
5239         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5240         fixed buffer attribute (CS1716).
5241         (PropertyMethod.HasCustomAccessModifier): When property accessor
5242         has custom modifier.
5243
5244         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5245         modifiers.
5246         (PropertyExpr.DoResolveLValue): Add CS0272.
5247
5248 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5249
5250         * convert.cs: When converting to a pointer, use the proper Conv.U
5251         or Conv.I depending on the source data type.
5252
5253         * cs-tokenizer.cs: Make the size for large decimal constants,
5254         fixes #72957.
5255
5256 2005-03-17  Martin Baulig  <martin@ximian.com>
5257
5258         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5259         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5260
5261 2005-03-17  Martin Baulig  <martin@ximian.com>
5262
5263         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5264         to bool so we can return an error condition.
5265         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5266         returned an error.
5267
5268 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5269
5270         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5271         attributes.
5272
5273 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5274
5275         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5276         Refactor to avoid traversing the list of assemblies, and to avoid
5277         string concatenation.
5278         * typemanager.cs (guid_attr_type): Remove.
5279         (negative_hits, pointers, references): Remove hashes.
5280         (type_hash): New.
5281         (GetConstructedType): New.  Uses type_hash to handle constructed
5282         types (arrays, references, pointers).
5283         (GetReferenceType, GetPointerType): Use it.
5284         (GetNestedType): New.  Uses type_hash to handle nested types of
5285         reflected types.
5286         (LookupType, LookupTypeDirect): Remove.
5287         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5288         'types' hash and LookupTypeReflection directly.
5289         (params_string, params_object): Use GetConstructedType.
5290         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5291         top-level types.
5292         (Namespace.Lookup): Use cached_types.
5293         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5294         provided by old TypeManager.LookupType.
5295         * rootcontext.cs (MakeFQN): Remove.
5296         * decl.cs (DeclSpace.MakeFQN): Likewise.
5297         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5298         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5299         TypeManager.GetConstructedType.
5300         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5301
5302 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5303
5304         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5305         indexers.
5306
5307         * cs-parser.jay: Reports CS1527 for any namespace element.
5308
5309         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5310         Added CS0407.
5311
5312         * expression.cs (ParameterReference.IsAssigned): Changed error to
5313         CS0269.
5314         (Error_WrongNumArguments): Moved CS0245 detection here.
5315
5316         * statement.cs (Return.Resolve): Add CS1622 report.
5317
5318 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5319
5320         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5321
5322 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5323
5324         * attribute.cs expression.cs: Get rid of some allocations.
5325
5326 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5327
5328         * doc.cs : just eliminate the latest change.
5329
5330 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5331
5332         * doc.cs : commented out the latest change. It breaks xml-030.cs
5333
5334 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5335
5336         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5337           fail. So invoke CreateType() in FindDocumentedType().
5338
5339 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5340
5341         * cs-tokenizer.cs : added IsKeyword().
5342         * doc.cs : Detect keyword incorrectly used as identifier.
5343           Allow identifiers prefixed by @.
5344
5345 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5346
5347         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5348         It caused exception in namespace resolving (again!).
5349         
5350         * class.cs (Class.ctor): Removed exit.
5351         (PropertyMethod.ctor): ditto.
5352         
5353         * codegen.cs (Codegen.Reset): Reset static data.
5354         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5355         
5356         * cs-tokenizer.cs (Cleanup): Removed.
5357         
5358         * driver.cs (GetSystemDir): Rewrote to one line command.
5359         It caused problem with unloaded dynamic modules.
5360         (UnixParseOption): Removed Exit.
5361         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5362         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5363         Now can be mcs used as library.
5364         
5365         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5366         empty location.
5367         
5368         * location.cs (Reset): Reset static data.
5369         
5370         * namespace.cs (Reset): Reset static data.
5371         
5372         * report.cs (Report.Reset): Reset static data.
5373         
5374         * rootcontext.cs (RootContext.Reset): Reset static data.
5375         
5376         * tree.cs (RootTypes.ctor): Use Location.Null
5377         
5378         * typemanager.cs (TypeManager.Reset): Reset static data.
5379         (CoreLookupType): Removed Exit.
5380         (TypeHandle.Reset): Reset static data.
5381         
5382 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5383
5384         Fix #73516.
5385         * typemanager.cs (ComputeNamespaces): Import namespaces from
5386         referenced modules too.
5387
5388 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5389
5390         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5391         than '.'.
5392
5393 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5394
5395         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5396         enclosing DeclSpace.  This ensures that a name-lookup populates
5397         more caches and there are fewer 'TypeExpression's.  Carve out
5398         nested type lookup into ...
5399         (LookupNestedTypeInHierarchy): ... this.
5400
5401 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5402
5403         Clean up a few partial-class semantics.  
5404         Fixes test-357.cs and cs1618-2.cs.
5405         * cs-parser.jay (struct_declaration): Use 'current_class' as
5406         parent of newly-created struct.  Remove call to Register ().
5407         Use 'pop_current_class' to complete handing the current struct.
5408         (interface_declaration): Likewise.
5409         (class_declaration): Likewise.
5410         (enum_declaration): Use 'current_class' as parent of newly created
5411         enum.
5412         (delegate_declaration): Likewise.
5413         (pop_current_class): New function.  This is used to handle closing
5414         up the 'current_class' and 'current_container', and pointing them
5415         to the enclosing class/container.
5416         (CSharpParser): Initialize 'current_class' too.
5417         * decl.cs (MemberCore): Add check for invariant: a partial
5418         container is not a parsed entity, and thus does not enclose any
5419         parsed members.
5420         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5421         (DeclSpace.BaseTypeExpr): Use it.
5422         (DeclSpace.LookupType): Add check for invariant.
5423         * class.cs (TypeContainer): Add check for invariant: a nested
5424         class should have the same NamespaceEntry as its enclosing class.
5425         (TypeContainer.EmitFieldInitializers): Make virtual.
5426         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5427         MemberCore.
5428         (TypeContainer.Register): Remove.
5429         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5430         null.  Use TypeResolveEmitContext for resolving base types and
5431         interfaces.  Move initialization of Parts.TypeBuilder here from
5432         ...
5433         (TypeContainer.DefineNestedTypes): ... here.
5434         (PartialContainer): Take a Namespace not a NamespaceEntry.
5435         (PartialContainer.Create): Don't use Register.  Call the
5436         appropriate Add... function directly.
5437         (ClassPart): Take both the PartialContainer and the enclosing
5438         class as constructor arguments.
5439         (ClassPart.EmitFieldInitializers): Override.
5440         (ClassPart.PartFindNestedTypes): Remove.
5441         (FieldBase.GetInitializerExpression): Resolve the initializer
5442         expression in the emit context of the enclosing class.
5443         * tree.cs (RootTypes): Remove Register ().
5444         
5445 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5446
5447         * cs-parser.jay: Removed CS0134.
5448         
5449         * driver.cs: Removed CS1901.
5450         
5451         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5452         for predefined types.
5453
5454 2005-03-07  Duncan Mak  <duncan@novell.com>
5455
5456         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5457         well. Fixes bug #73454.
5458
5459 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5460
5461         * cs-tokenizer.cs (xtoken): Add CS1035.
5462         
5463         * class.cs (MethodData.Define): Add CS0683.
5464         (FieldMember.ctor): Add CS0681.
5465
5466 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5467
5468         * ecore.cs (SimpleName.DoResolve): Rename from
5469         SimpleName.DoResolveAllowStatic.
5470         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5471         Pass 'intermediate' flag to MemberStaticCheck.
5472         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5473         of "intermediate" lookups via MemberAccess.
5474         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5475         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5476
5477 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix #73394.
5480         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5481         slipped in because of variable names that are identical to a
5482         builtin type's BCL equivalent ('string String;', 'int Int32;').
5483         (PropertyExpr.EmitInstance): Likewise.
5484
5485 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5486
5487         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5488         
5489         * report.cs (warning_ignore_table): Made public.
5490
5491 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5492
5493         Fix #73282.
5494         * class.cs (MethodData.Emit): Pass 'container' to
5495         container.GetObsoleteAttribute instead of 'container.Parent'.
5496
5497 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5498
5499         * cs-parser.jay: Add 1534 error test.
5500
5501         * iterators.cs (Yield.CheckContext): Add error 1629.
5502         (Iterator.ctor): Save unsafe modifier.
5503         (MoveNextMethod.DoEmit): Restore unsafe context.
5504
5505         * namespace.cs (UsingAlias): Better error message.
5506
5507 2005-03-03  Dan Winship  <danw@novell.com>
5508
5509         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5510         the warning message [#73219]
5511
5512 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5513
5514         Fix compile with MCS 1.0.0.0.
5515         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5516         w_restore to not depend on string constant folding.
5517
5518 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5519
5520         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5521         CS0246 check to users who passed 'silent = false'.
5522         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5523         check.
5524         (SimpleName.SimpleNameResolve): Update.
5525         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5526         (MemberAccess.IdenticalNameAndTypeName): Update.
5527         * doc.cs (FindDocumentedTypeNonArray): Update.
5528
5529 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5530
5531         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5532         * parameters.cs (ComputeAndDefineParameters): Remove.
5533         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5534         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5535         Use GetParameterInfo.
5536
5537 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5538
5539         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5540
5541 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5542
5543         Unify DeclSpace.LookupType and DeclSpace.FindType.
5544         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5545         is in charge of defining nested types on demand.
5546         (DeclSpace.LookupType): Use it when the current_type is a
5547         TypeBuilder.  Use LookupTypeDirect for reflected types.
5548         (DeclSpace.FindType): Remove.
5549         (DeclSpace.LookupInterfaceOrClass): Likewise.
5550         (DeclSpace.DefineTypeAndParents): Likewise.
5551         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5552         DeclSpace.LookupType.
5553         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5554         * typemanager.cs (LookupType): Simplify.
5555         (AddUserType): Remove type from negative_hits.
5556         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5557         * class.cs (TypeContainer.FindMembers): Move handling of nested
5558         types ...
5559         (TypeContainer.FindMembers_NestedTypes): ... here.
5560         (TypeContainer.FindNestedType): Implement override.
5561         (ClassPart.FindNestedType): Delegate to PartialContainer.
5562         (ClassPart.PartFindNestedType): Looks up the nested types of the
5563         part alone.
5564
5565 2005-03-02  Martin Baulig  <martin@ximian.com>
5566
5567         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5568         static constructor in static classes.
5569
5570 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5571
5572         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5573         sizeParamIndex is not specified.
5574
5575 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5576
5577         Fix #73117
5578         * report.cs (WarningMessage.IsEnabled): Missing null check.
5579
5580 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5581
5582         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5583         in the fields and not in the properties.
5584
5585 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5586
5587         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5588         fields as well.
5589
5590 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5591
5592         * attribute.cs: Small refactoring (improved robustness).
5593         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5594         (ValidateGuid): Removed.
5595         (Resolve): Removed referenced to above mentioned.
5596         (GetAttributeUsage): Made private and changed to work without
5597         class assistance.
5598         (GetIndexerAttributeValue): Don't crash.
5599         (GetConditionalAttributeValue): Ditto.
5600         (GetClsCompliantAttributeValue): Ditto.
5601         (ExtractSecurityPermissionSet): All attributes exceptions are
5602         error 648.
5603         (GetPropertyValue): New helper.
5604         (GetMethodImplOptions): New method.
5605         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5606         some missing properties.
5607         
5608         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5609         (Method.ApplyAttributeBuilder): Updated.
5610         
5611         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5612         exception.
5613
5614 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5615
5616         Fix #73052.
5617         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5618         non-simple types (array, pointer, reference).
5619
5620 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5621
5622         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5623
5624         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5625         for operators.
5626         (Method.CheckBase): Catch wrong destructor here.
5627         (MethodData.Define): Add errors 550, 668.
5628
5629         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5630
5631         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5632
5633         * pending.cs (VerifyPendingMethods): Add error 551.
5634
5635         * typemanager.cs (CSharpName): Next error report helper.
5636
5637 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5638
5639         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5640         attributes. Removed useless attribute double check.
5641         It saves almost 2MBs for corlib.
5642
5643 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5644
5645         Fix #72924.
5646         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5647         called twice in case of error.
5648
5649 2005-02-23  Chris Toshok  <toshok@ximian.com>
5650
5651         Fix compiler portions of #72827.
5652         * statement.cs (Block.Emit): call Begin/EndScope on the
5653         EmitContext instead of the ILGenerator.
5654
5655         * codegen.cs (EmitContext.BeginScope): new method, call
5656         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5657         we have one.)
5658         (EmitContext.BeginScope): same, but EndScope and CloseScope
5659
5660         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5661         offset and call the superclass's OpenScope(int) with it.
5662         (SymbolWriter.CloseScope): get the current il
5663         offset and call superclass's CloseScope(int) with it.
5664
5665 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5666
5667         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5668         CS1677 for out and ref as well.
5669
5670         * class.cs (Method.Define): Add error CS1599 detection.
5671         
5672         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5673         
5674         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5675         
5676         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5677         
5678         * support.cs.cs (ModifierDesc): New helper method.
5679
5680 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5681             Abin Thomas  <projectmonokochi@rediffmail.com>
5682             Anoob V E  <projectmonokochi@rediffmail.com>
5683             Harilal P R  <projectmonokochi@rediffmail.com>
5684
5685         Fix #57851, #72718.
5686         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5687         MemberLookup (used for error reporting) actually returns a result.
5688         Fix error report number (122, not 112).
5689
5690 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5691             Anoob V E  <projectmonokochi@rediffmail.com>
5692             Harilal P R  <projectmonokochi@rediffmail.com>
5693
5694         Fix #71134.
5695         * pending.cs (PendingImplementation.GetAbstractMethods):
5696         Find NonPublic members too.
5697
5698 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5699
5700         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5701         Fixed error 217.
5702         
5703         * class.cs (MethodCore.CheckMethodAgainstBase):
5704         Add error 239 report.
5705
5706 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5707
5708         Fix #68955.
5709         * expression.cs (Invocation.IsApplicable): Make public.
5710         (Invocation.IsParamsMethodApplicable): Likewise.
5711         * delegate.cs (Delegate.VerifyApplicability): Don't use
5712         Invocation.VerifyArgumentCompat for parameter applicability
5713         testing.  Use Invocation.IsApplicable and
5714         Invocation.IsParamsMethodApplicable.
5715
5716 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5719         
5720         * class.cs (Operator.Define): Add error 217 report.
5721         
5722 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5723
5724         * namespace.cs (UsingEntry.Resolve): Undo change below.
5725
5726 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5727
5728         Fix #72756.
5729         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5730         disable the error message when the extended MemberLookup also
5731         fails.
5732         (Expression.MemberLookupFinal): Update.
5733         (SimpleName.DoSimpleNameResolve): Update.
5734         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5735         Don't use MemberLookupFinal.
5736         (New.DoResolve): Update.
5737         (BaseAccess.CommonResolve): Update.
5738
5739 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5740
5741         Fix #72732.
5742         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5743         occured previously, don't resolve again.
5744
5745 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5746
5747         Fix #69949
5748         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5749         argument. Call ResolveAttributeUsage for unresolved.
5750         when types doesn't match ctor arguments.
5751         
5752         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5753         for nested attribute classes.
5754         (Class.attribute_usage): Removed.
5755         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5756         for attribute class.
5757         
5758         * ecore.cs (IsAttribute): Removed.
5759         
5760         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5761         
5762         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5763         now normal types.
5764         (attribute_types): Removed.
5765         (EmitCode): Global attributes are emited as the latest.
5766
5767 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5768
5769         * class.cs (EmitFieldInitializers): Don't emit field initializer
5770         for default values when optimilization is on.
5771         
5772         * constant.cs (Constant.IsDefaultValue): New property.
5773         
5774         * driver.cs: Add /optimize handling.
5775         
5776         * constant.cs,
5777         * ecore.cs,
5778         * literal.cs: Implement new IsDefaultValue property.
5779         
5780         * rootcontext.cs (Optimize): New field, holds /optimize option.
5781
5782 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5783
5784         Fix crasher in re-opened #72347.
5785         * namespace.cs (Namespace.Lookup): Return null if
5786         DeclSpace.DefineType returns null.
5787
5788         Fix #72678.
5789         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5790
5791 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5792
5793         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5794         now returns null if it cannot resolve to an lvalue.
5795         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5796         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5797         returned null.  Remove check for SimpleName.
5798         (EventExpr.DoResolveLValue): New.
5799         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5800         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5801         error from ...
5802         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5803         avoid CS0131 error.
5804         (Unary.ResolveOperator): Move CS0211 check ...
5805         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5806         CS0131 error.
5807         (Unary.DoResolveLValue): Simplify.
5808         (AddressOf.DoResolveLValue): New.
5809         (ArrayAccess.DoResolveLValue): New.
5810
5811 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5812
5813         * attribute.cs (Attribute.Resolve): Add arguments casting for
5814         when types doesn't match ctor arguments.
5815
5816 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5817
5818         Fix parts of #63202.
5819         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5820         lookup of operator in base type.  Ensure that all checks happen
5821         when the operator resolves to an "op_..." method.
5822
5823 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5824
5825         Fix #71992.
5826         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5827         'ignore_cs0104' parameter.  Pass it to ...
5828         (NamespaceEntry.Lookup): ... this.
5829         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5830         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5831         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5832         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5833         Update.  Request that cs0104 errors be ignored.
5834         (ComposedCast.ResolveAsTypeStep): Update.
5835
5836 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5837
5838         Fix #59209.
5839         * expression.cs (Invocation.BetterFunction): Remove support for
5840         comparing virtual functions and their overrides.
5841         (Invocation.IsOverride): New.
5842         (Invocation.OverloadResolve): Don't consider 'override' functions
5843         during candidate selection.  Store them in a lookaside list.
5844         If the selected method is a 'virtual' function, use the list to
5845         find any overrides that are closer to the LHS type.
5846
5847 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5848
5849         * expression.cs (New.DoResolve): Add complex core type reduction.
5850         (New.Constantify): Converts complex core type syntax like 'new int ()'
5851         to simple constant.
5852         
5853 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5854
5855         * decl.cs (EntryType.EntryType): New constructor to create an
5856         updated copy of a cache entry.
5857         (MemberCache.AddMethods): Use it.
5858         (MemberCache.ClearDeclaredOnly): Remove.
5859         (MemberCache.MemberCache): Update.
5860
5861 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5862
5863         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5864         variable.  This one is represents the actual low-level declaration
5865         of the method, as opposed to the semantic level `IsStatic'.   
5866
5867         An anonymous method which is hosted into a static method might be
5868         actually an instance method.  IsStatic would reflect the
5869         container, while MethodIsStatic represents the actual code
5870         generated.
5871
5872         * expression.cs (ParameterReference): Use the new MethodIsStatic
5873         instead of IsStatic.
5874
5875         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5876         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5877         set on the current EmitContext. 
5878
5879         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5880         resolve our casted expression as an LValue.  This triggers the
5881         proper LValue processing that is later required by Assign.
5882
5883         This fixes 72347.
5884
5885         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5886
5887 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5888
5889         C# 2.0 Fixed buffer implementation
5890
5891         * anonymous.cs: Update after RegisterHelperClass renaming.
5892
5893         * attribute.cs (AttributeTester.fixed_buffer_cache):
5894         Cache of external fixed buffers.
5895         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5896         implementation if field is fixed buffer else null.
5897
5898         * class.cs
5899         (TypeContainer.AddField): Accept FieldMember instead of Field.
5900         (FieldBase.IsFieldClsCompliant): Extracted code from
5901         VerifyClsCompliance descendant customization.
5902         (FixedField): New class handles fixed buffer fields.
5903         (FixedFieldExternal): Keeps information about imported fixed
5904         buffer.
5905         (IFixedField): Make access to internal or external fixed buffer
5906         same.
5907
5908         * cs-parser.jay: Add fixed buffer parsing.
5909
5910         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5911         buffer.
5912
5913         * expression.cs (Indirection): Extended implementation to accept
5914         fixed buffer field.
5915         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5916         (ElementAccess.MakePointerAccess): Get type as parameter.
5917         (DoResolve): Add fixed buffer field expression conversion.
5918         (DoResolveLValue): Ditto.
5919         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5920         (ArrayPtr): Derives from FixedBufferPtr.
5921         (ArrayPtr.Emit): Add extra emit for array elements.
5922
5923         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5924
5925         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5926         for compiler generated types.
5927         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5928
5929         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5930         and consume less memory.
5931         (Fixed.Resolve): Add fixed buffer case.
5932
5933         * typemanager.cs (compiler_generated_attr_ctor,
5934         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5935         (HasElementType): Add our own implementation to work on every
5936         runtime.
5937
5938 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5939
5940         * anonymous.cs (CaptureContext): Track whether `this' has been
5941         referenced.   
5942
5943         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5944         only captured `this' if it was implicitly done (instance
5945         methods/variables were used). 
5946
5947         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5948         `this' must be captured.
5949
5950 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5951  
5952         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5953         is null it means that there has been no need to capture anything,
5954         so we just create a sibling.
5955
5956         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5957
5958         Just a partial fix.  The other half is fairly elusive.
5959         
5960 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5961
5962         Fix #52586, cs0121-4.cs.
5963         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5964         and return a hashtable.
5965         (MemberCache.ClearDeclaredOnly): New.
5966         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5967         the method_hash of a base type too.
5968         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5969         type methods.  Overwrite entries with the same MethodHandle so
5970         that the ReflectedType is correct.  The process leaves in base
5971         virtual functions and their overrides as distinct entries.
5972         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5973         matters since it was boxed in a ArrayList before.
5974         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5975         modifier.
5976         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5977         case of a virtual function and its override (choose the overload
5978         as better).
5979         (Invocation.OverloadResolve): Avoid 'override' members during
5980         'applicable_type' calculation.
5981
5982 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5983
5984         Combine two near-redundant caches.
5985         * typemanager.cs (method_params): Rename from method_internal_params.
5986         (TypeManager.GetParameterData): New.  Replace
5987         Invocation.GetParameterData.
5988         (TypeManager.LookupParametersByBuilder): Remove.
5989         * expression.cs (Invocation.method_parameter_cache): Remove.
5990         (Invocation.GetParameterData): Remove.
5991         Update to changes.
5992         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5993         Update to changes.
5994
5995 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5996
5997         Fix #72015.
5998         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5999         TypeManager.multicast_delegate_type is null, resolve it by looking
6000         up "System.MulticastDelegate".
6001         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6002
6003 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6004             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6005             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6006
6007         Fix cs0164.cs.
6008         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6009         (LabeledStatement.AddReference): New.  Set 'referenced'.
6010         (Goto.Resolve): Use it.
6011
6012 2005-02-05  John Luke  <john.luke@gmail.com>
6013
6014         * driver.cs: remove duplicate -doc line in Usage ()
6015
6016 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6017
6018         * location.cs (Location.AddFile): Fix CS2002 error report.
6019
6020 2005-02-02  Martin Baulig  <martin@ximian.com>
6021
6022         * delegate.cs (Delegate.DefineType): Report an internal error if
6023         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6024         details.        
6025
6026 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6027
6028         Fix a crasher in a variant of #31984.
6029         * const.cs (Constant.CheckBase): New override that defers the
6030         new-or-override check in case the base type hasn't been populated
6031         yet.
6032         (Constant.Define): Ensure the new-or-override check is performed.
6033
6034 2005-02-01  Duncan Mak  <duncan@ximian.com>
6035
6036         * const.cs (LookupConstantValue): Check that `ce' is not null
6037         before calling GetValue ().
6038
6039 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6040
6041         Fix test-334.cs (#69519).
6042         * cs-parser.jay (using_alias_directive): Pass in an expression to
6043         NamespaceEntry.UsingAlias.
6044         (using_namespace_directive): Pass in an expression to
6045         NamespaceEntry.Using.
6046         (namespace_name): Don't flatten to a string.
6047         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6048         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6049         ResolveAsTypeStep.
6050         (NamespaceEntry.UsingEntry): Likewise.
6051         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6052         changes.
6053         (NamespaceEntry.LookupForUsing): Remove.
6054         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6055         names.
6056         (NamespaceEntry.Lookup): Remove support for dotted names.
6057
6058 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6059
6060         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6061         split into two.
6062         (NamespaceEntry.ImplicitParent): Compute on demand.
6063         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6064         parallels the current.
6065         (NamespaceEntry.LookupForUsing): Use it.
6066         (NamespaceEntry.Lookup): If the current namespace-entry is
6067         implicit, don't search aliases and using tables.
6068
6069 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6070
6071         Fix #31984.
6072         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6073         BaseCache here.
6074         (TypeContainer.BaseCache): Compute on demand.
6075         (TypeContainer.FindMembers): Define constants and types if they're
6076         not already created.
6077         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6078         check.
6079         * const.cs (Constant.Define): Make idempotent.
6080
6081 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6082
6083         * pending.cs: Produce better code (no nops produced by using Ldarg
6084         + value).
6085         
6086         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6087         i - 1' it should be arg + 1.
6088
6089         Fixes bug #71819.
6090
6091 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6092
6093         * attribute.cs (Attribute.CheckAttributeType): Make private
6094         non-virtual.
6095         (Attribute.ResolveType): Make virtual.
6096         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6097         handling of RootContext.Tree.Types.
6098
6099 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6100
6101         Update attribute-handling to use the SimpleName/MemberAccess
6102         mechanisms.
6103         * cs-parser.jay (attribute): Pass in an expression to the
6104         constructors of Attribute and GlobalAttribute.
6105         * attribute.cs (Attribute): Take an expression for the name.
6106         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6107         passed in attribute name expression.
6108         (Attribute.CheckAttributeType): Use it.
6109         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6110         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6111         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6112         argument to prevent error messages if the lookup fails.
6113
6114 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6115
6116         * expression.cs (Indirection): Implemented IVariable interface
6117         to support indirection in AddressOf operator.
6118         (PointerArithmetic.Emit): Add optimalization for case where
6119         result can be precomputed.
6120
6121 2005-01-26  Martin Baulig  <martin@ximian.com>
6122
6123         * class.cs (TypeContainer.AttributeTargets): Return the correct
6124         AttributeTargets depending on our `Kind' instead of throwing an
6125         exception; fixes #71632.
6126
6127 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6128
6129         Fix #71257
6130         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6131         constant members.
6132
6133 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6134
6135         Fix #71602.
6136         * expression.cs (MemberAccess.DoResolve): Don't complain with
6137         cs0572 when the LHS of a member access has identical name and type
6138         name.
6139
6140 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6141
6142         Fix #71651, #71675
6143         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6144         CreatePermission.
6145         Create custom PermissionSet only for PermissionSetAttribute.
6146
6147 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6148
6149         Fix #71649
6150         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6151         delegates in static class.
6152
6153 2005-01-24  Martin Baulig  <martin@ximian.com>
6154
6155         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6156         merging an implicit block, just use its reachability.
6157
6158         * statement.cs (Block.Resolve): Make the unreachable code check
6159         work wrt. implicit blocks; see test-337 from #63842.
6160
6161 2005-01-21  Alp Toker  <alp@atoker.com>
6162  
6163         * cs-parser.jay: destructor_declaration's container is PartialContainer
6164         not Class when partial types are used, so use Kind prop instead of
6165         'is'.
6166         
6167 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6168
6169         * cs-parser.jay: Improve error reporting when an interface
6170         declares new types.
6171
6172 2005-01-20  Dick Porter  <dick@ximian.com>
6173
6174         * support.cs: SeekableStreamReader fix from Sandor Dobos
6175         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6176         chars are read.  Fixes bug 70369.
6177
6178 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6179
6180         * cs-parser.jay (catch_clause): Simplify current_block handling
6181         somewhat.
6182
6183 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6184
6185         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6186         code with ImplicitStandardConversion to handle the implicit
6187         conversion of method groups into valid delegate invocations. 
6188
6189         The problem is that in parameter handling we were using this code
6190         path.  Fixes bug #64698
6191
6192 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6193
6194         * cs-parser.jay: Fix several infelicities.
6195         - Avoid assigning to the parser value stack.  Code like 
6196           '$3 = null' is unclean.  Synthesize a value for the code block
6197           instead. 
6198         - Avoid using oob_stack for storing location information.  Use ...
6199         (_mark_): ... this.  New (empty) rule.  Saves the current location
6200         in $$.
6201         (foreach_statement): Avoid using oob_stack for current_block
6202         handling.  Use technique used in for_statement and
6203         using_statement.  Synthesize a value for the code block to store
6204         additional intermediate information.
6205
6206 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6207
6208         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6209         of a different type is only allowed to private fields of a
6210         containing type, not on fields of a base class.
6211
6212         See test-174.cs and error cs0122-9.cs
6213
6214 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6215
6216         Fix test-335.cs (bug #58126).
6217         * cs-parser.jay (argument): Split out non-expression parts of the
6218         rule into 'non_simple_argument'.
6219         (invocation_expression): Support parenthesized invocations with
6220         multiple arguments, and with single non-simple arguments.
6221
6222 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6223
6224         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6225         places.
6226
6227 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6228
6229         Fix cs0038-1.cs, cs1640-6.cs.
6230         * ecore.cs (Expression.Resolve): Remove special-case for
6231         SimpleName in error-handling.
6232         (Expression.almostMatchedMembers): Relax access permission to
6233         protected.
6234         (Expression.MemberLookupFailed): Handle duplicates in
6235         almostMatchedMembers list.
6236         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6237         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6238         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6239         overload if the passed in MemberInfo is a MethodBase.
6240
6241 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6242
6243         Fix #70749
6244         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6245         for non-CAS & merge permission sets properly.
6246
6247 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6248
6249         Improve standard-compliance of simple name and member access 
6250         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6251         * ecore.cs (FullNamedExpression): New abstract base class 
6252         for Namespaces and TypeExpressions.
6253         (ResolveFlags.SimpleName): Remove.
6254         (SimpleName): Remove support for dotted names.
6255         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6256         DeclSpace.FindType and DeclSpace.LookupType.
6257         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6258         (Expression.ExprClassName): Make member function.
6259         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6260         a namespace.  Remove creation of dotted "SimpleName"s.
6261         (MemberAccess.DoResolve): Likewise.
6262         * decl.cs (DeclSpace.Cache): Make private.
6263         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6264         (DeclSpace.FindType): Update.
6265         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6266         FullNamedExpression.
6267         * namespace.cs (Namespace): Derive from FullNamedExpression
6268         so that it can be part of expression resolution.
6269         (Namespace.Lookup): Return an FullNamedExpression.
6270         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6271         namespace.
6272         * rootcontext.cs (NamespaceLookup): Remove.
6273         (LookupType): Move to DeclSpace.
6274         * attribute.cs (CheckAttributeType): Update.
6275         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6276         (FindDocumentedTypeNonArray): Likewise.
6277
6278 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6279
6280         Fix cs0509.cs, cs1632.cs.
6281         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6282         is the same as IsInterface.
6283         (TypeContainer.GetClassBases): Likewise.
6284         * statement.cs (LabeledStatement.ig): New field.
6285         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6286         label.
6287         (LabeledStatement.DoEmit): Check that the label was created with
6288         the same ILGenerator.
6289
6290 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6291
6292         Fix #71058
6293         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6294         accessors to its properties.
6295
6296         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6297         from accessors to property.
6298         
6299 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6300
6301         Fix #70722
6302         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6303         only for overrides.
6304         
6305 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6306
6307         * attribute.cs: Check for null and empty strings.  
6308
6309         I have lost another battle to Paolo.
6310
6311 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6312
6313         Fix #70942
6314         * class.cs (PropertyMethod): Set Parent field in ctors.
6315         (SetMethod.InternalParameters): Add unsafe switch hack.
6316         Override MarkForDuplicationCheck where it is appropriate.
6317
6318         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6319         It says whether container allows members with the same name.
6320         Base default is no.
6321         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6322         Removed is_method parameter.
6323
6324 2005-01-06  Duncan Mak  <duncan@ximian.com>
6325
6326         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6327         because the previous change led to incorrect reporting of CS1032
6328         ("Cannot define/undefine preprocessor symbols after first token in
6329         file"). Instead of using `tokens_seen' as the only flag that
6330         triggers CS1040, introduce `comments_seen'. This new flag is used
6331         to signify having seen comments on the current line, so it is
6332         unset after a newline.
6333
6334 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6335
6336         * doc.cs : When searching for a type, find nested type too.
6337           This fixes bug #71040.
6338
6339 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6340
6341         * doc.cs :
6342           - Warn missing member comment on those classes which also does not
6343             have doc comments. Fixed bug #71041.
6344           - Don't warn missing doc comment on default constructor.
6345             Fixed bug #71042.
6346
6347 2005-01-06  Duncan Mak  <duncan@ximian.com>
6348
6349         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6350         comments, set `tokens_seen' to true. This allows us to detect
6351         misplaced preprocessor directives (i.e. not at the beginning of
6352         the a line, nor after whitespaces). In that case, report error
6353         CS1040. This fixes bug #56460.
6354
6355         * cs-parser.jay (interface_member_declaration): Add checks for
6356         IsExplicitImpl, and report CS0541 error if an interface member is
6357         defined as an explicit interface declaration.
6358
6359 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6360
6361         Fix #70817
6362         * class.cs (PropertyMethod): Set Parent field in ctors.
6363         (SetMethod.InternalParameters): Add unsafe switch hack.
6364         
6365         * decl.cs (MemberCore.Parent): Cannot be readonly.
6366
6367 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6368
6369         * decl.cs (DeclSpace.ResolveType): Remove.
6370         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6371         Merge in code from ...
6372         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6373         * class.cs, enum.cs: Update to changes.
6374
6375 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6376
6377         * anonymous.cs: Ensure that we init the scope of our parent if it
6378         has not been initialized yet.
6379
6380 2004-12-30  Duncan Mak  <duncan@ximian.com>
6381
6382         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6383         if field.FieldBuilder is null. Fixes #70758.
6384
6385         * convert.cs: Fixed some typos and updated some of the comments.
6386         (ImplicitStandardConversionExists):
6387         (TryImplicitIntConversion): If `target_type' is an interface and
6388         the type of `ic' implements this interface, return true or a new
6389         BoxedCast instead of null. This fixes #70468.
6390
6391 2004-12-29  Duncan Mak  <duncan@ximian.com>
6392
6393         * expression.cs (Argument.Emit): Check that Expr is
6394         IMemoryLocation before casting to it, and report CS1510 otherwise.
6395
6396         This fixes #70402.
6397
6398 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6399
6400         * statement.cs (Block.ThisVariable): remove the recursion here, to
6401         make the --profile more sane.
6402
6403 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6404
6405         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6406         assembly, by JB Evain.
6407
6408 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6409
6410         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6411           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6412         "parent" refers to enclosing type/class.  "base" refers to superclass.
6413
6414 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6415
6416         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6417         Ensure that we only have GlobalAttributes.
6418         * attribute.cs (Attribute.Emit): Make non-virtual.
6419         (GlobalAttribute.Emit): Remove.
6420         (Attribute.Resolve): Make virtual.
6421         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6422         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6423         the argument. Don't create one.
6424         (Attribute.GetObsoleteAttribute): Likewise.
6425         (Attribute.GetClsCompliantAttributeValue): Likewise.
6426         * class.cs, decl.cs: Update to changes.
6427
6428 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6429
6430         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6431         
6432         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6433         
6434         * statement.cs (Foreach.Resolve): Add error 186 report.
6435
6436 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6437
6438         * expression.cs (Conditional.DoResolve): Add warning 429.
6439         
6440         * statement.cs (If.Resolve): Add warning 665.
6441
6442 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6443
6444         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6445         except when in the parser, and in GlobalAttribute.
6446         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6447         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6448         RootContext.Tree.Types.NamespaceEntry once work is done.
6449         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6450         and resets RootContext.Tree.Types.NamespaceEntry.
6451
6452 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6453
6454         * cs-parser.jay: Don't create a block for every variable.
6455
6456 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6457
6458         * location.cs: Provide extra information.
6459
6460         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6461         variables from the captured environment, it is the ldarg_0.
6462
6463 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6464
6465         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6466         find a conclusion.
6467         
6468         * class.cs: Changed warning level for 169 to avoid developer
6469         displeasure from warning flooding. It will be changed back when they
6470         fix most of current BCL warnings.
6471         
6472         * RootContext.cs: Pushed default WarningLevel to 3.
6473         
6474         * statement.cs: Removed unused variable.
6475
6476 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6477
6478         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6479         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6480         Add error 502 report.
6481         (StaticClass.DefineType): Add error 441 report.
6482         (Class.AllowedModifiersProp): New virtual property as temporary
6483         extension to AllowedModifiers.
6484         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6485         to share implementation with StaticClass and don't call virtual
6486         methods from ctor.
6487         
6488         * driver.cs (MainDriver): Add error 1558 test.
6489
6490         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6491         report. Moved error 36 test here.
6492
6493         * statement.cs (Throw.Resolve): Add error 724 report.
6494
6495         * typemanager.cs: Add out_attribute_type core type.
6496         
6497 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6498
6499         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6500         3018 report.
6501         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6502
6503         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6504         3017 report.
6505         
6506         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6507
6508         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6509         Add error 3023 report.
6510         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6511
6512         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6513         implementation.
6514
6515 2004-12-12  John Luke  <john.luke@gmail.com>
6516
6517         * driver.cs (AddArgs): take -- into account when
6518         adding arguments, fixes bug 65710 
6519
6520 2004-12-12  Martin Baulig  <martin@ximian.com>
6521
6522         * expression.cs (Unary.TryReduceNegative): Added support for
6523         SByteConstant and ByteConstant.
6524         (Unary.Reduce): Check error values from TryReduceNegative().
6525
6526 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6527
6528         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6529         and report exception as error 182.
6530
6531 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6532
6533         * driver.cs (Main): Fix message when there are warnings.
6534
6535 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6536
6537         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6538
6539 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6540
6541         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6542         Reduced number of warnings.
6543         
6544         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6545
6546 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6547
6548         * driver.cs: Removed message.
6549
6550         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6551
6552 2004-12-08    <vargaz@freemail.hu>
6553
6554         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6555
6556 2004-12-08  Martin Baulig  <martin@ximian.com>
6557
6558         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6559         instead of a CS3002 for properties and indexer.
6560
6561 2004-12-08  Martin Baulig  <martin@ximian.com>
6562
6563         * decl.cs (MemberName.ToString): Make this work again.
6564
6565 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * attribute.cs (Resolve): Add error 591 detection.
6568
6569         * class.cs (FieldMember.Define): Add error 1547 detection.
6570         (Indexer.Define): Add error 620 detection.
6571         (Operator.Define): Add error 590 detection.
6572
6573         * ecore.cs: Missing argument for error 79.
6574
6575         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6576         detection.
6577
6578 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6579
6580         Fix #70106
6581         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6582         only.
6583
6584 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6585
6586         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6587           Some operator comments were suppressed.
6588         * doc.cs : Implicit/explicit operator name in doc comments are like
6589           "op_Explicit(type)~returnType", so added suffix handling.
6590
6591 2004-12-07  Martin Baulig  <martin@ximian.com>
6592
6593         * decl.cs
6594         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6595         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6596         (DeclSpace.ec): New protected field; store the EmitContext here.
6597         (DeclSpace.EmitContext): New public property; moved here from
6598         `TypeContainer'.
6599         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6600         EmitContext.
6601
6602         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6603         (Enum.Emit): Don't create a new EmitContext.
6604
6605         * delegate.cs (Delegate.DefineType): Always create the
6606         EmitContext.
6607
6608         * iterators.cs (Iterators.DefineIterator): Create a new
6609         EmitContext and store it in `ec'.
6610
6611 2004-08-24  Martin Baulig  <martin@ximian.com>
6612
6613         * typemanager.cs
6614         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6615         this for accessibility checks.
6616         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6617         IsNestedFamilyAccessible.
6618         (TypeManager.IsSubclassOf): New method, do what the name actually
6619         says.   
6620
6621 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6622
6623         Fix crash on cs0657-17.cs.
6624         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6625         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6626         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6627         the case where the NamespaceEntry gets overwritten.
6628
6629 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6630
6631         Fixed #69195, #56821
6632         * ecore.cs (ResolveBoolean): Tiny refactoring.
6633
6634         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6635         of right expression resolving when left is false constant and
6636         operator is LogicalAnd OR true constant and operator is LogicalOr.
6637
6638         * statement.cs (ResolveUnreachable): Always reports warning.
6639
6640 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6641
6642         * class.cs: Distinguish between 1721 and 1722 (just a little help
6643         for the programmer).
6644
6645 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6646
6647         * delegate.cs: Only allow this on new versions of the language. 
6648
6649 2004-12-02  Duncan Mak  <duncan@ximian.com>
6650
6651         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6652         Expression class.
6653         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6654         here as a static method. Take an additional bool out parameter
6655         `must_do_cs1540_check' for signaling to InstanceResolve.
6656         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6657         member field from PropertyExpr class and made it an argument of
6658         the method instead.
6659         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6660         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6661         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6662         and `remove_accessor' as well as InstanceResolve: report CS0122
6663         where applicable.
6664
6665         Fixes #70129.
6666
6667 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6668
6669         Fix test-327.cs, test-328.cs, and put in early infrastructure
6670         for eventually fixing #52697.
6671         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6672         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6673         from other methods.
6674         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6675         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6676         (VerifyUsing, error246): Update.
6677         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6678         'NamespaceEntry.LookupNamespaceOrType'.
6679
6680 2004-12-03  Martin Baulig  <martin@ximian.com>
6681
6682         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6683         method as our child, call AnonymousMethod.Compatible() on it.
6684
6685 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6686
6687         Disable XML documentation support in 'basic' profile.
6688         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6689         Redirect XmlElement to System.Object.
6690         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6691         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6692         * mcs.exe.sources: Add doc-bootstrap.cs.
6693         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6694         of doc.cs.
6695
6696 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6697
6698         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6699           comments are allowed.
6700
6701 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6702
6703         * delegate.cs: Add checks for subtypes in paramaters and return values
6704         in VerifyMethod () to add support for Covariance/Contravariance
6705         in delegates.
6706         
6707 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6708
6709         * report.cs: Remove extra closing parenthesis.
6710
6711         * convert.cs (Error_CannotImplicitConversion): If the name of the
6712         types are the same, provide some extra information.
6713
6714         * class.cs (FieldBase): Use an unused bit field from the field to
6715         encode the `has_offset' property from the FieldMember.  This saves
6716         a couple of Ks on bootstrap compilation.
6717
6718         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6719         method as our child, return the AnonymousMethod resolved
6720         expression.
6721
6722         * expression.cs (New.DoResolve): Allow return values from
6723         NewDelegate to also include AnonymousMethods.
6724
6725         Fixes #70150.
6726
6727 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6728
6729         Fix bug #70102
6730         * attribute.cs (Resolve): Improved implementation of params
6731         attribute arguments.
6732
6733         * support.cs (ParameterData): Add HasParams to be faster.
6734
6735 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6736
6737         all things are for /doc support:
6738
6739         * doc.cs: new file that supports XML documentation generation.
6740         * mcs.exe.sources: added doc.cs.
6741         * driver.cs:
6742           Handle /doc command line option.
6743           Report error 2006 instead of 5 for missing file name for /doc.
6744           Generate XML documentation when required, after type resolution.
6745         * cs-tokenizer.cs:
6746           Added support for picking up documentation (/// and /** ... */),
6747           including a new XmlCommentState enumeration.
6748         * cs-parser.jay:
6749           Added lines to fill Documentation element for field, constant,
6750           property, indexer, method, constructor, destructor, operator, event
6751           and class, struct, interface, delegate, enum.
6752           Added lines to warn incorrect comment.
6753         * rootcontext.cs :
6754           Added Documentation field (passed only when /doc was specified).
6755         * decl.cs:
6756           Added DocComment, DocCommentHeader, GenerateDocComment() and
6757           OnGenerateDocComment() and some supporting private members for
6758           /doc feature to MemberCore.
6759         * class.cs:
6760           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6761         * delegate.cs:
6762           Added overriden DocCommentHeader.
6763         * enum.cs:
6764           Added overriden DocCommentHeader and GenerateDocComment().
6765
6766 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6767
6768         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6769         unwrapping the enumeration values, chain to
6770         DoConstantNumericPromotions again, so we can promote things to the
6771         fundamental types (takes care of enums that are bytes, sbytes).
6772
6773         Fixes bug #62054.
6774
6775 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6776
6777         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6778         Fix long-standing bug in type-lookup.  Use FindType instead of
6779         LookupType when ec.ResolvingTypeTree.
6780         (Attribute.ResolveType, Attribute.Resolve)
6781         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6782         Update to changes.
6783         (Attributes.Search): Remove internal version.  Update.
6784         (Attributes.SearchMulti): Update.
6785         (Attributes.GetClsCompliantAttribute): Remove.
6786         (Attributes.GetIndexerNameAttribute): Remove.
6787         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6788         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6789         * class.cs (Indexer.Define): Likewise.
6790
6791 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6792
6793         Fix bug #68790
6794         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6795         MarshallByReference members access.
6796
6797         * expression.cs: Use CheckMarshallByRefAccess;
6798         Better error CS0197 message.
6799
6800         * report.cs: Print whole related error message.
6801
6802 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6803
6804         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6805         the current directory to help debugging.
6806
6807 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6808
6809         * class (GetClassBases): Better error 60 report.
6810         (EventProperty): Disabled warning 67 detection.
6811
6812 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6813
6814         Fix bug #60324
6815         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6816
6817         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6818         precise values.
6819
6820 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6821
6822         Fix bug #49488
6823         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6824
6825         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6826
6827 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * attribute.cs (Attribute.Resolve): Refine error reporting and
6830         report a cs0117 if the identifier does not exist, to distinguish
6831         from 0617 which is a miss-use of the actual identifier.
6832
6833         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6834         between cs0070 and cs0079.
6835
6836         * class.cs (MemberBase.DoDefine): When reporting a wrong
6837         accessibility level, we use MethodCore to compare instead of
6838         Method (this was a regression in some refactoring effort).
6839
6840         So now we correctly report cs0056 again.
6841
6842         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6843         testing the target_type (which was known to be object_type) and
6844         not the source type (which is anonymous_method).
6845
6846         Fixed reporting of error cs1660.
6847
6848         * expression.cs (UserCast.Source): Expose the underlying cast.
6849
6850         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6851         allowed types to find a match to int32 first (most common).
6852
6853         In addition, it ignores any ImplicitUserConversions that did an
6854         internal implicit conversion (as the switch statement allows only
6855         one integral conversion to exist).
6856
6857         * class.cs (PartialContainer.Create): rename `name' to
6858         `member_name' for clarity.  Then replace the string calls with a
6859         call to MemberName.GetPartialName, as now using
6860         MemberName.ToString is an error (this is due to the side effects
6861         it had, that were fixed in the past).
6862
6863         This will restore the error reporting on a number of partial class
6864         errors that were missusing this (and getting an exception as a
6865         results, which is now just a plain textual warning, because
6866         yyparse debug output would crash otherwise).
6867
6868 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6869
6870         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6871
6872 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6873
6874         * rootcontext.cs (LookupType): Make sure to cache lookups that
6875         don't give us a negative result. This saves about 5% of corlib
6876         compilation time.
6877
6878 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6879
6880         * report.cs (AbstractMessage.Print): messages are sent to stderr
6881
6882         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6883         non-interface in the list of interfaces (at this point, either
6884         parent was properly set, or a base class is being listed in the
6885         interfaces section).
6886
6887         This flags error 1722, and resolves the crash from bug 69259.
6888
6889 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6890
6891         * statement.cs (Using.EmitExpressionFinally): make this work right
6892         for valuetypes. Fixes 69926.
6893
6894 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6895
6896         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6897         converted to an enum" here, before we try to change the underlying
6898         type.  This code exists, but it is a different code path than the
6899         one used while encoding constants.
6900
6901         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6902         old bug: when converting from the null literal to a pointer,
6903         return an EmptyCast, not the NullLiteral.
6904
6905         This fixes #69921, the recent null_type changes probably made this
6906         bug more prominent.
6907
6908         (ImplicitReferenceConversionExists): In addition, resynchronized
6909         the code here, so it matches the same code in
6910         ImplicitReferenceConversionExists for the `from any class-type S
6911         to any interface-type T'.
6912         
6913
6914 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6915
6916         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6917
6918 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6919
6920         * cs-parser.jay: Use verbosity accordingly. 
6921
6922 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6923
6924         * expression.cs (Unary.ResolveOperator): Do not report warning;
6925         AddressOf reads from variable.
6926         
6927         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6928
6929 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6930
6931         Fix bug #69462
6932
6933         * attribute.cs (Attributable): Removed CheckTargets.
6934         (Attributes.Emit): Explicit attribute targets are tested here.
6935
6936         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6937         not enabled for interfaces.
6938
6939         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6940         (GetAssemblyName): Ouch next bug there.
6941
6942 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6943
6944         * expression.cs: Error 275 added.
6945         
6946 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6947
6948         Fix bug #69177 (Implemented decimal constant support)
6949
6950         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6951         (BinaryFold): Add DecimalConstant.
6952
6953         * const.cs (Define): Decimal constant 
6954         (is not constant.
6955         (ChangeType): Add decimal type handling.
6956         (LookupConstantValue): Don't set value for decimal type but
6957         emit DecimalConstantAttribute. Needed for constant optimization.
6958
6959         * constant.cs (ToDecimal): New method.
6960         (ConvertToDecimal): New method.
6961         (IntConstant): Implemented ConvertToDecimal.
6962         (DecimalConstant.Emit): Emit optimized version for decimals in
6963         int range.
6964
6965         * expression.cs (ResolveOperator): Changed order of constant
6966         reduction to work correctly with native types which have
6967         overloaded operators.
6968         (ResolveMemberAccess): Extract constant value from attribute
6969         for decimal type.
6970
6971         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6972
6973         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6974         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6975         (ChangeType): Decimal is special.
6976         (TypeToCoreType): Add decimal type.
6977
6978 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6979
6980         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6981         decimal types.
6982
6983 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6984
6985         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6986         test cs1667-5.cs.
6987
6988 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6989
6990         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6991
6992         * pending.cs (PendingImplementation): Grab only interfaces.
6993
6994 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6995
6996         * statement.cs (ForeachHelperMethods): Add location member and
6997         error 202 detection.
6998
6999 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7000
7001         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
7002         automatically handled by executable.make.
7003         (PROGRAM): Make profile-specific.
7004
7005 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7006
7007         * expression.cs (DoResolveBase): Fixed wrong warning for out
7008         variables.
7009
7010 2004-11-18  Martin Baulig  <martin@ximian.com>
7011
7012         Merged latest changes into gmcs.  Please keep this comment in
7013         here, it makes it easier for me to see what changed in MCS since
7014         the last time I merged.
7015
7016 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7017
7018         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7019         (TypeHandle.GetMemberCache): New.
7020         (TypeHandle.TypeHandle): Update.
7021         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7022         (TypeManager.LookupParentInterfacesCache):
7023         Rename from LookupInterfaceCache.  Optimize slightly.
7024         (TypeManager.MemberLookup_FindMembers): Update.
7025         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7026         multi-type variant.
7027         (AddCacheContents): Rename from AddHashtable.
7028         * class.cs (TypeContainer.parent_container): Remove.
7029         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7030         (TypeContainer.DoDefineMembers): Don't initialize it.
7031         Update to name changes.
7032         
7033 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7034
7035         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7036         that factors the code to check access modifiers on override.  
7037
7038         (PropertyBase): Use the code here.
7039
7040         Patch from Lluis S'anchez, fixes bug #69361.
7041
7042 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7043
7044         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7045         routine that is used to report the use of a captured variable
7046         whose address has been taken.
7047
7048         There are two checks: one when variables are being captured and
7049         the other check is when the address of a variable is taken. 
7050         
7051         (because an anonymous methods might be resolved before *or* after
7052         the address has been taken) and 
7053
7054         * expression.cs (Conditional.DoResolve): Remove the special
7055         casing that Martin added to trueExpr and falseExpr being both
7056         NullLiteral.  We get the right behavior now just by introducing
7057         the null_type into the compiler. 
7058
7059         * convert.cs (ExplicitConversion): Change the code to use
7060         null_type instead of testing `expr is NullLiteral'.
7061         (ImplicitConversionStandard): use null_type too.
7062         (ImplicitReferenceConversionExists): use null_type too.
7063         (ImplicitReferenceConversion): use null_type too.
7064
7065         * literal.cs: The type of `NullLiteral' is now null_type instead
7066         of object_type. 
7067         (Resolve): Set the type here.
7068
7069         * typemanager.cs: Introduce null_type.
7070
7071 2004-11-17  Martin Baulig  <martin@ximian.com>
7072
7073         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7074         direction, like FindMembers() does.  Fixes #69546, testcase is in
7075         test-315.cs.    
7076
7077 2004-11-16  Martin Baulig  <martin@ximian.com>
7078
7079         This is based on a patch from Marek Safar, see bug #69082.
7080         Fixes bugs #63705 and #67130.
7081
7082         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7083         method; create a MemberCache for an interface type and cache the
7084         result.
7085
7086         * decl.cs (IMemberContainer.ParentContainer): Removed.
7087         (IMemberContainer.ParentCache): New property.
7088         (MemberCache.SetupCacheForInterface): Removed.
7089         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7090         to create a cache for an interface's "parent".
7091
7092         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7093         interfaces too.
7094
7095 2004-11-16  Martin Baulig  <martin@ximian.com>
7096
7097         Merged back from gmcs; these changes already went into gmcs a
7098         couple of weeks ago.
7099
7100         * typemanager.cs
7101         (TypeManager.AddUserType): Removed the `ifaces' argument.
7102         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7103         `TypeExpr []'.
7104         (TypeManager.AddUserInterface): Removed.
7105         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7106         `TypeExpr []'.
7107         (TypeManager.GetInterfaces): Likewise.
7108         (TypeManager.GetExplicitInterfaces): Likewise.
7109
7110         * ecore.cs (TypeExpr.GetInterfaces): Removed.
7111
7112         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7113         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7114
7115 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7116
7117         * statement.cs: Avoid adding bools to a hashtable.
7118
7119 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7120
7121         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7122         calling an unsafe method from a safe location.
7123
7124 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7125
7126         Fix #69167
7127         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7128
7129 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7130
7131         * namespace.cs (VerifyUsing): use GetPartialName instead of
7132         ToString. 
7133
7134 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7135
7136         * statement.cs (Return.Resolve): Fix regression in typo: if
7137         `in_exc', we have to request a NeedReturnLabel, this was a typo
7138         introduced in the anonymous method check-in.  Fixes #69131.
7139
7140         * Indexers were using the ShortName when defining themselves,
7141         causing a regression in the compiler bootstrap when applying the
7142         patch from 2004-11-02 (first part), now they use their full name
7143         and the bug is gone.
7144
7145 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7146
7147         * driver.cs: Strip the path from the names of embedded resources. Fixes
7148         #68519.
7149
7150 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7151
7152         Fix error message regression: cs0104-2.cs.
7153         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7154         (AliasEntry.Resolve): Update.
7155         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7156         'silent' flag.
7157         (RootContext.LookupType): Update.
7158
7159 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7160
7161         * cs-parser.jay: Add support for handling accessor modifiers
7162         * class: Add support port accessor modifiers and error checking,
7163         define PropertyMethod.Define as virtual (not abstract anymore)
7164         * ecore.cs: Add checking for proeprties access with access modifiers
7165         * iterators.cs: Modify Accessor constructor call based in the modified
7166         constructor
7167 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7168
7169         * expression.cs (StringConcat): Handle being called twice,
7170         as when we have a concat in a field init with more than two
7171         ctors in the class
7172
7173 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7174
7175         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7176         special case explicit implementations, we should always produce
7177         the .property or .event declaration.
7178         
7179         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7180         since it will not return correct data if people use this
7181         unresolved in the presence of using statements (see test-313).
7182
7183         * class.cs (MethodData.Define): If we are an explicit interface
7184         implementation, set the method name to the full name of the
7185         interface plus the name of the method.  
7186
7187         Notice that using the method.MethodName.GetFullName() does not
7188         work, as it will only contain the name as declared on the source
7189         file (it can be a shorthand in the presence of using statements)
7190         and not the fully qualifed type name, for example:
7191
7192         using System;
7193
7194         class D : ICloneable {
7195                 object ICloneable.Clone ()  {
7196                 }
7197         }
7198
7199         Would produce a method called `ICloneable.Clone' instead of
7200         `System.ICloneable.Clone'.
7201
7202         * namespace.cs (Alias.Resolve): Use GetPartialName.
7203         
7204 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7205
7206         * cs-parser.jay: Add error 1055 report.
7207
7208 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7209
7210         * assign.cs (Assign.DoResolve): Only do the transform of
7211         assignment into a New if the types are compatible, if not, fall
7212         through and let the implicit code deal with the errors and with
7213         the necessary conversions. 
7214
7215 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7216
7217         * cs-parser.jay: Add error 1031 report.
7218
7219         * cs-tokenizer.cs: Add location for error 1038.
7220
7221 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7222
7223         * cs-parser.jay: Add error 1016 report.
7224
7225 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7226
7227         * cs-parser.jay: Add errors 1575,1611 report.
7228
7229 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7230
7231         * cs-parser.jay: Add error 1001 report.
7232
7233 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7234
7235         Fix #68850
7236         * attribute.cs (GetMarshal): Add method argument for
7237         caller identification.
7238
7239         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7240         agument for GetMarshal and RuntimeMissingSupport.
7241
7242 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7243
7244         * attribute.cs (ExtractSecurityPermissionSet): Removed
7245         TypeManager.code_access_permission_type.
7246
7247         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7248
7249 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7250
7251         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7252         for obsolete use of a variable here.   Fixes regression on errors
7253         cs0619-25 and cs0619-26.
7254
7255 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7256
7257         Fix #62358, implemented security attribute encoding.
7258
7259         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7260         Tests permitted SecurityAction for assembly or other types.
7261         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7262         data from SecurityPermissionAttribute to PermisionSet class.
7263
7264         * class.cs (ApplyAttributeBuilder): Added special handling
7265         for System.Security.Permissions.SecurityAttribute based types.
7266
7267         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7268         special handling for System.Security.Permissions.SecurityAttribute
7269         based types.
7270
7271         * enum.cs (ApplyAttributeBuilder): Added special handling
7272         for System.Security.Permissions.SecurityAttribute based types.
7273
7274         * parameter.cs (ApplyAttributeBuilder): Added special handling
7275         for System.Security.Permissions.SecurityAttribute based types.
7276
7277         * rootcontext.cs: Next 2 core types.
7278
7279         * typemanager.cs (TypeManager.security_permission_attr_type):
7280         Built in type for the SecurityPermission Attribute.
7281         (code_access_permission_type): Build in type.
7282
7283 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7284
7285         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7286         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7287         all of this information into
7288         EmitContext.EmitCapturedVariableInstance.
7289         
7290         * codegen.cs (EmitCapturedVariableInstance): move here the
7291         funcionality of emitting an ldarg.0 in the presence of a
7292         remapping.   This centralizes the instance emit code.
7293
7294         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7295         then emit a load of this: it means that we have reached the
7296         topmost ScopeInfo: the one that contains the pointer to the
7297         instance of the class hosting the anonymous method.
7298
7299         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7300         captures to the topmost CaptureContext.
7301
7302 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7303
7304         * expression.cs (LocalVariableReference): Move the knowledge about
7305         the iterators into codegen's EmitCapturedVariableInstance.
7306
7307 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7308
7309         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7310         all code paths return a value from an anonymous method (it is the
7311         same as the 161 error, but for anonymous methods).
7312
7313 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7314
7315         The introduction of anonymous methods in the compiler changed
7316         various ways of doing things in the compiler.  The most
7317         significant one is the hard split between the resolution phase
7318         and the emission phases of the compiler.
7319
7320         For instance, routines that referenced local variables no
7321         longer can safely create temporary variables during the
7322         resolution phase: they must do so from the emission phase,
7323         since the variable might have been "captured", hence access to
7324         it can not be done with the local-variable operations from the runtime.
7325         
7326         * statement.cs 
7327
7328         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7329         is a toplevel block.
7330
7331         (ToplevelBlock): A new kind of Block, these are the blocks that
7332         are created by the parser for all toplevel method bodies.  These
7333         include methods, accessors and anonymous methods.
7334
7335         These contain some extra information not found in regular blocks:
7336         A pointer to an optional CaptureContext (for tracking captured
7337         local variables and parameters).  A pointer to the parent
7338         ToplevelBlock.
7339         
7340         (Return.Resolve): Catch missmatches when returning a value from an
7341         anonymous method (error 1662).
7342         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7343         phase.
7344
7345         (Break.Resolve): ditto.
7346
7347         (SwitchLabel): instead of defining the labels during the
7348         resolution phase, we now turned the public ILLabel and ILLabelCode
7349         labels into methods called GetILLabelCode() and GetILLabel() that
7350         only define the label during the Emit phase.
7351
7352         (GotoCase): Track the SwitchLabel instead of the computed label
7353         (its contained therein).  Emit the code by using
7354         SwitchLabel.GetILLabelCode ().
7355
7356         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7357         whether the Local has been captured or not.
7358
7359         (LocalInfo.IsCaptured): New property, used to tell whether the
7360         local has been captured.
7361         
7362         * anonymous.cs: Vastly updated to contain the anonymous method
7363         support.
7364
7365         The main classes here are: CaptureContext which tracks any
7366         captured information for a toplevel block and ScopeInfo used to
7367         track the activation frames for various local variables.   
7368
7369         Each toplevel block has an optional capture context associated
7370         with it.  When a method contains an anonymous method both the
7371         toplevel method and the anonymous method will create a capture
7372         context.   When variables or parameters are captured, they are
7373         recorded on the CaptureContext that owns them, for example:
7374
7375         void Demo () {
7376              int a;
7377              MyDelegate d = delegate {
7378                  a = 1;
7379              }
7380         }
7381
7382         Here `a' will be recorded as captured on the toplevel
7383         CapturedContext, the inner captured context will not have anything
7384         (it will only have data if local variables or parameters from it
7385         are captured in a nested anonymous method.
7386
7387         The ScopeInfo is used to track the activation frames for local
7388         variables, for example:
7389
7390         for (int i = 0; i < 10; i++)
7391                 for (int j = 0; j < 10; j++){
7392                    MyDelegate d = delegate {
7393                         call (i, j);
7394                    }
7395                 }
7396
7397         At runtime this captures a single captured variable `i', but it
7398         captures 10 different versions of the variable `j'.  The variable
7399         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7400         recorded on a child.  
7401
7402         The toplevel ScopeInfo will also track information like the `this'
7403         pointer if instance variables were referenced (this is necessary
7404         as the anonymous method lives inside a nested class in the host
7405         type of the method). 
7406
7407         (AnonymousMethod): Expanded to track the Toplevel, implement
7408         `AnonymousMethod.Compatible' to tell whether an anonymous method
7409         can be converted to a target delegate type. 
7410
7411         The routine now also produces the anonymous method content
7412
7413         (AnonymousDelegate): A helper class that derives from
7414         DelegateCreation, this is used to generate the code necessary to
7415         produce the delegate for the anonymous method that was created. 
7416
7417         * assign.cs: API adjustments for new changes in
7418         Convert.ImplicitStandardConversionExists.
7419
7420         * class.cs: Adjustments to cope with the fact that now toplevel
7421         blocks are of type `ToplevelBlock'. 
7422
7423         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7424         insteda of standard blocks.
7425
7426         Flag errors if params arguments are passed to anonymous methods.
7427
7428         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7429         `CurrentAnonymousMethod' which points to the current Anonymous
7430         Method.  The variable points to the AnonymousMethod class that
7431         holds the code being compiled.  It is set in the new EmitContext
7432         created for the anonymous method.
7433
7434         (EmitContext.Phase): Introduce a variable and an enumeration to
7435         assist in enforcing some rules about when and where we are allowed
7436         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7437         only one that enfonces this right now).
7438
7439         (EmitContext.HaveCaptureInfo): new helper method that returns
7440         whether we have a CapturedContext initialized.
7441
7442         (EmitContext.CaptureVariable): New method used to register that a
7443         LocalInfo must be flagged for capturing. 
7444
7445         (EmitContext.CapturedParameter): New method used to register that a
7446         parameters must be flagged for capturing. 
7447         
7448         (EmitContext.CapturedField): New method used to register that a
7449         field must be flagged for capturing. 
7450
7451         (EmitContext.HaveCapturedVariables,
7452         EmitContext.HaveCapturedFields): Return whether there are captured
7453         variables or fields. 
7454
7455         (EmitContext.EmitMethodHostInstance): This is used to emit the
7456         instance for the anonymous method.  The instance might be null
7457         (static methods), this (for anonymous methods that capture nothing
7458         and happen to live side-by-side with the current method body) or a
7459         more complicated expression if the method has a CaptureContext.
7460
7461         (EmitContext.EmitTopBlock): Routine that drives the emission of
7462         code: it will first resolve the top block, then emit any metadata
7463         and then emit the code.  The split is done so that we can extract
7464         any anonymous methods and flag any captured variables/parameters.
7465         
7466         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7467         during this phase, the ILGenerator should not be used as labels
7468         and local variables declared here might not be accessible to any
7469         code that is part of an anonymous method.  
7470
7471         Exceptions to this include the temporary variables that are
7472         created by some statements internally for holding temporary
7473         variables. 
7474         
7475         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7476         metadata for a cb
7477
7478         (EmitContext.TemporaryReturn): This method is typically called
7479         from the Emit phase, and its the only place where we allow the
7480         ReturnLabel to be defined other than the EmitMeta.  The reason is
7481         that otherwise we would have to duplicate a lot of logic in the
7482         Resolve phases of various methods that today is on the Emit
7483         phase. 
7484
7485         (EmitContext.NeedReturnLabel): This no longer creates the label,
7486         as the ILGenerator is not valid during the resolve phase.
7487
7488         (EmitContext.EmitThis): Extended the knowledge in this class to
7489         work in anonymous methods in addition to iterators. 
7490
7491         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7492         code is necessary on the stack to access the instance to a local
7493         variable (the variable will be accessed as a field).
7494
7495         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7496         EmitContext.EmitAddressOfParameter): Routines to support
7497         parameters (not completed at this point). 
7498         
7499         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7500         will also remove the parameters.
7501
7502         * convert.cs (Convert): Define a `ConstantEC' which points to a
7503         null.  This is just to prefity some code that uses
7504         ImplicitStandardConversion code and do not have an EmitContext
7505         handy.
7506
7507         The idea is to flag explicitly that at that point in time, it is
7508         known that the conversion will not trigger the delegate checking
7509         code in implicit conversions (which requires a valid
7510         EmitContext). 
7511
7512         Everywhere: pass new EmitContext parameter since
7513         ImplicitStandardConversionExists now requires it to check for
7514         anonymous method conversions. 
7515
7516         (Convert.ImplicitStandardConversionExists): If the type of an
7517         expression is the anonymous_method_type, and the type is a
7518         delegate, we invoke the AnonymousMethod.Compatible method to check
7519         whether an implicit conversion is possible. 
7520
7521         (Convert.ImplicitConversionStandard): Only do implicit method
7522         group conversions if the language level is not ISO_1.
7523
7524         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7525         MethodInfo for the Invoke method.  used by Delegate and
7526         AnonymousDelegate.
7527
7528         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7529         method conversions if the target type is a delegate.
7530
7531         Removed extra debugging nops.
7532
7533         (LocalVariableReference): Turn the `local_info' into a public
7534         field. 
7535
7536         Add `prepared' field, the same hack used for FieldExprs to cope
7537         with composed assignments, as Local variables do not necessarily
7538         operate purely on the stack as they used to: they can be captured
7539         fields. 
7540
7541         Add `temp' for a temporary result, like fields.
7542
7543         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7544
7545         It now copes with Local variables that are captured and emits the
7546         proper instance variable to load it from a field in the captured
7547         case. 
7548
7549         (ParameterReference.DoResolveBase): During the resolve phase,
7550         capture parameters if we are in an anonymous method.
7551
7552         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7553         anonymous method, use the EmitContext helper routines to emit the
7554         parameter reference.
7555
7556         * iterators.cs: Set RemapToProxy to true/false during the
7557         EmitDispose class.
7558
7559         * parameters.cs (GetParameterByName): New helper method. 
7560
7561         * typemanager.cs (anonymous_method_type) a new type that
7562         represents an anonyous method.  This is always an internal type,
7563         used as a fencepost to test against the anonymous-methodness of an
7564         expression. 
7565         
7566 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7567
7568         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7569         561 report.
7570         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7571
7572 2004-10-18  Martin Baulig  <martin@ximian.com>
7573
7574         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7575         `Type' directly, but call ResolveType() on it.
7576         (Catch.Resolve): Likewise.
7577         (Foreach.Resolve): Likewise.
7578
7579 2004-10-18  Martin Baulig  <martin@ximian.com>
7580
7581         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7582         `Type' directly, but call ResolveType() on it.
7583         (Probe.DoResolve): Likewise.
7584         (ArrayCreation.LookupType): Likewise.
7585         (TypeOf.DoResolve): Likewise.
7586         (SizeOf.DoResolve): Likewise.
7587
7588 2004-10-18  Martin Baulig  <martin@ximian.com>
7589
7590         * expression.cs (Invocation.BetterFunction): Put back
7591         TypeManager.TypeToCoreType().
7592
7593 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7594
7595         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7596         the ResolveType.
7597
7598 2004-10-18  Martin Baulig  <martin@ximian.com>
7599
7600         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
7601         `Type' directly, but call ResolveType() on it.
7602
7603 2004-10-18  Martin Baulig  <martin@ximian.com>
7604
7605         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7606         `Type' directly, but call ResolveType() on it.
7607         (MemberBase.DoDefine): Likewise.
7608
7609         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7610         `Type' directly, but call ResolveType() on it.
7611         (ComposedCast.DoResolveAsTypeStep): Likewise.
7612
7613         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7614         `Type' directly, but call ResolveType() on it.
7615
7616 2004-10-17  John Luke  <john.luke@gmail.com>
7617
7618         * class.cs (Operator.GetSignatureForError): use CSharpName
7619
7620         * parameter.cs (Parameter.GetSignatureForError): Returns
7621         correct name even if was not defined.
7622
7623 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7624
7625         Fix #65816.
7626         * class.cs (TypeContainer.EmitContext): New property.
7627         (DefineNestedTypes): Create an emitcontext for each part.
7628         (MethodCore.DoDefineParameters): Use container's emitcontext.
7629         Pass type array to InternalParameters.
7630         (MemberBase.DoDefine): Use container's emitcontext.
7631         (FieldMember.Define): Likewise.
7632         (Event.Define): Likewise.
7633         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7634         Pass type array to InternalParameters.
7635         (SetIndexerMethod.GetParameterInfo): Likewise.
7636         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7637         * delegate.cs (Define): Pass emitcontext to
7638         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7639         array to InternalParameters.
7640         * expression.cs (ParameterReference.DoResolveBase): Pass
7641         emitcontext to GetParameterInfo.
7642         (ComposedCast.DoResolveAsTypeStep): Remove check on
7643         ec.ResolvingTypeTree.
7644         * parameter.cs (Parameter.Resolve): Change argument to
7645         EmitContext.  Use ResolveAsTypeTerminal.
7646         (Parameter.GetSignature): Change argument to EmitContext.
7647         (Parameters.ComputeSignature): Likewise.
7648         (Parameters.ComputeParameterTypes): Likewise.
7649         (Parameters.GetParameterInfo): Likewise.
7650         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7651         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7652         * support.cs (InternalParameters..ctor): Remove variant that takes
7653         a DeclSpace.
7654         * typemanager.cs (system_intptr_expr): New.
7655         (InitExpressionTypes): Initialize it.
7656
7657 2004-10-12  Chris Toshok  <toshok@ximian.com>
7658
7659         * cs-parser.jay: fix location for try_statement and catch_clause.
7660
7661 2004-10-11  Martin Baulig  <martin@ximian.com>
7662
7663         * report.cs: Don't make --fatal abort on warnings, we have
7664         -warnaserror for that.
7665
7666 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7667
7668         More DeclSpace.ResolveType avoidance.
7669         * decl.cs (MemberCore.InUnsafe): New property.
7670         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7671         with newly created EmitContext.
7672         (FieldMember.Define): Likewise.
7673         * delegate.cs (Delegate.Define): Likewise.
7674         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7675         only if normal name-lookup fails.
7676         (TypeExpr.DoResolve): Enable error-checking.
7677         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7678         (SizeOf.DoResolve): Likewise.
7679         (ComposedCast.DoResolveAsTypeStep): Likewise.
7680         (StackAlloc.DoResolve): Likewise.
7681         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7682         (Block.Unsafe): New property.
7683         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7684         (Unsafe): Set 'unsafe' flag of contained block.
7685         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7686         (Fixed.Resolve): Likewise.
7687         (Catch.Resolve): Likewise.
7688         (Using.ResolveLocalVariableDecls): Likewise.
7689         (Foreach.Resolve): Likewise.
7690
7691 2004-10-05  John Luke <john.luke@gmail.com>
7692
7693         * cs-parser.jay: add location to error CS0175
7694
7695 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7696
7697         * ecore.cs (Expression.Constantity): Add support for turning null
7698         into a constant.
7699
7700         * const.cs (Const.Define): Allow constants to be reference types
7701         as long as the value is Null.
7702
7703 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7704
7705         * namespace.cs (NamespaceEntry.Using): No matter which warning
7706         level is set, check if this namespace name has already been added.
7707
7708 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7709
7710         * expression.cs: reftype [!=]= null should always use br[true,false].
7711         # 67410
7712
7713 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7714
7715         Fix #67108
7716         * attribute.cs: Enum conversion moved to 
7717         GetAttributeArgumentExpression to be applied to the all
7718         expressions.
7719
7720 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7721
7722         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7723         * class.c (TypeContainer.DefineType): Flag error if
7724         base types aren't accessible due to access permissions.
7725         * decl.cs (DeclSpace.ResolveType): Move logic to
7726         Expression.ResolveAsTypeTerminal.
7727         (DeclSpace.ResolveTypeExpr): Thin layer over
7728         Expression.ResolveAsTypeTerminal.
7729         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7730         Refactor code into NestedAccess.  Use it.
7731         (DeclSpace.NestedAccess): New.
7732         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7733         argument to silence errors.  Check access permissions.
7734         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7735         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7736         (Cast.DoResolve): Likewise.
7737         (New.DoResolve): Likewise.
7738         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7739         (TypeOf.DoResolve): Likewise.
7740
7741         * expression.cs (Invocation.BetterConversion): Return the Type of
7742         the better conversion.  Implement section 14.4.2.3 more faithfully.
7743         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7744         section 14.4.2.2 explicit.
7745         (Invocation.OverloadResolve): Update.
7746         (Invocation): Remove is_base field.
7747         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7748         (Invocation.Emit): Likewise.
7749
7750 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7751
7752         * README: Update to changes.
7753
7754 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7755
7756         * cs-parser.jay: Reverted 642 warning fix.
7757
7758 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7759
7760         Fix bug #66615
7761         * decl.cs (FindMemberWithSameName): Indexer can have more than
7762         1 argument.
7763
7764 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7765
7766         * expression.cs (LocalVariableReference.DoResolveLValue):
7767         Do not report warning 219 for out values.
7768         (EmptyExpression.Null): New member to avoid extra allocations.
7769
7770 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7771
7772         * cs-parser.jay: Fix wrong warning 642 report.
7773
7774         * cs-tokenizer.cs (CheckNextToken): New helper;
7775         Inspect next character if is same as expected.
7776
7777 2004-09-23  Martin Baulig  <martin@ximian.com>
7778
7779         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7780         (Convert.ImplicitReferenceConversionExists): Likewise.
7781
7782 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7783
7784         * class.cs (Operator.Define): Add error 448 and 559 report.
7785
7786 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7787
7788         * class.cs (MemberBase.IsTypePermitted): New protected
7789         method for checking error CS0610.
7790
7791 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7792
7793         * class.cs (TypeContainer.HasExplicitLayout): New property
7794         Returns whether container has StructLayout attribute set Explicit.
7795         (FieldMember): New abstract class for consts and fields.
7796         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7797         (Field): Reuse FieldMember.
7798
7799         * const.cs (Const): Reuse FieldMember.
7800
7801         * rootcontext.cs: EmitConstants call moved to class.
7802
7803 2004-09-22  Martin Baulig  <martin@ximian.com>
7804
7805         Thanks to Peter Sestoft for this bug report.
7806
7807         * expression.cs (Conditional): If both the `trueExpr' and the
7808         `falseExpr' is a NullLiteral, return a NullLiteral.
7809
7810 2004-09-22  Martin Baulig  <martin@ximian.com>
7811
7812         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7813         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7814         for the "get_Current" call.
7815
7816 2004-09-22  Martin Baulig  <martin@ximian.com>
7817
7818         Marek and me just fixed one of our oldest bugs: #28562 :-)
7819
7820         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7821
7822         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7823         we're an EnumConstant, just return that.
7824         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7825         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7826         to get the value which'll actually be written into the attribute.
7827         However, we have to use GetValue() to access the attribute's value
7828         in the compiler.        
7829
7830 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7831
7832         * constant.cs (Constant.IsNegative): New abstract property
7833         IsNegative.
7834
7835         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7836         (StackAlloc.DoResolve): Reused IsNegative.
7837
7838 2004-09-21  Martin Baulig  <martin@ximian.com>
7839
7840         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7841         if we're used in an iterator, we may be called from different
7842         methods.
7843
7844         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7845         we actually have an exception block.
7846
7847 2004-09-20  John Luke <jluke@cfl.rr.com>
7848
7849         * class.cs, cs-parser.jay: Improve the error report for 1520:
7850         report the actual line where the error happens, not where the
7851         class was declared.
7852
7853         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7854         Pass location information that was available elsewhere.
7855
7856 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7857
7858         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7859         runtime to delay sign assemblies.
7860
7861 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7862
7863         * cs-parser.jay: Do not report the stack trace, this is barely
7864         used nowadays.
7865
7866 2004-08-22  John Luke  <john.luke@gmail.com>
7867  
7868         * driver.cs : check that a resource id is not already used
7869         before adding it, report CS1508 if it is, bug #63637
7870
7871 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7872
7873         * ecore.cs: Removed dead code.
7874
7875 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7876
7877         * class.cs: Do not report warning CS0067 on the interfaces.
7878
7879 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7880
7881         * cs-parser.jay: Add error 504 report.
7882
7883 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7884
7885         * rootcontext.cs: WarningLevel is 4 by default now.
7886
7887         * statement.cs (Fixed.Resolve): Do not null
7888         VariableInfo.
7889
7890 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7891
7892         Fixed bug #55780
7893         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7894         deep search when property is not virtual.
7895         (PropertyExpr.ResolveAccessors): Make one call for both
7896         accessors.
7897
7898 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7899
7900         Fixed bug #65766
7901         * statement.cs: Error 152 report constains also location.
7902
7903 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7904
7905         Fixed bug #65766
7906         * const.cs: Explicitly set constant as static.
7907
7908 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7909
7910         Fixed bug #64226
7911         * cs-parser.jay: Add error 1017 report.
7912
7913 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7914
7915         Fixed bug #59980, #64224
7916         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7917
7918         * typemanager.cs (IsSpecialMethod): Simplified
7919
7920 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7921
7922         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7923         condition with better params.
7924
7925 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7926
7927         Fixed bug #65238
7928         * attribute.cs (Resolve): Property has to have both
7929         accessors.
7930
7931 2004-09-14  Martin Baulig  <martin@ximian.com>
7932
7933         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7934
7935 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7936
7937         Fixed bug #61902
7938         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7939         called and is obsolete then this member suppress message
7940         when call is inside next [Obsolete] method or type.
7941
7942         * expression.cs: Use TestObsoleteMethodUsage member.
7943
7944 2004-09-14  Martin Baulig  <martin@ximian.com>
7945
7946         * cs-parser.jay: Sync a bit with the GMCS version.
7947
7948 2004-09-14  Martin Baulig  <martin@ximian.com>
7949
7950         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7951         (CSharpParser.yacc_verbose_flag): New public field.
7952
7953         * genericparser.cs: Removed.
7954
7955 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7956
7957         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7958
7959 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7960
7961         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7962
7963 2004-09-10  Martin Baulig  <martin@ximian.com>
7964
7965         Backported my MemberName changes from GMCS into MCS.
7966
7967         - we are now using a special `MemberName' class instead of using
7968         strings; in GMCS, the `MemberName' also contains the type
7969         arguments.
7970
7971         - changed the grammar rules a bit:
7972           * the old `member_name' is now a `namespace_or_type_name':
7973             The rule is that we use `namespace_or_type_name' everywhere
7974             where we expect either a "member name" (GetEnumerator) or a
7975             "member name" with an explicit interface name
7976             (IEnumerable.GetEnumerator).
7977             In GMCS, the explicit interface name may include type arguments
7978             (IEnumerable<T>.GetEnumerator).
7979           * we use `member_name' instead of just `IDENTIFIER' for
7980             "member names":
7981             The rule is that we use `member_name' wherever a member may
7982             have type parameters in GMCS.       
7983
7984         * decl.cs (MemberName): New public class.
7985         (MemberCore.MemberName): New public readonly field.
7986         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7987         (DeclSpace): Likewise.
7988
7989         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7990         * enum.cs (Enum.ctor): Likewise.
7991
7992         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7993         MemberName.     
7994         (AliasEntry.ctor): Take a MemberName, not an Expression.
7995         (AliasEntry.UsingAlias): Likewise.
7996
7997         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7998         (IMethodData.MemberName): Changed type from string to MemberName.
7999         (MemberBase.ExplicitInterfaceName): Likewise.
8000         (AbstractPropertyEventMethod.SetupName): Make this private.
8001         (AbstractPropertyEventMethod.ctor): Added `string prefix'
8002         argument; compute the member name here.
8003         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8004         on the `member.MemberName' and the `prefix'.
8005
8006         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8007         not `type_name'.
8008         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8009         thus, we get a `MemberName' instead of a `string'.  These
8010         declarations may have type parameters in GMCS.
8011         (interface_method_declaration, delegate_declaration): Likewise.
8012         (class_declaration, interface_declaration): Likewise.
8013         (method_header): Use `namespace_or_type_name' instead of
8014         `member_name'.  We may be an explicit interface implementation.
8015         (property_declaration, event_declaration): Likewise.
8016         (member_name): This is now just an `IDENTIFIER', not a
8017         `namespace_or_type_name'.
8018         (type_name, interface_type): Removed.
8019         (namespace_or_type_name): Return a MemberName, not an Expression.
8020         (primary_expression): Use `member_name' instead of `IDENTIFIER';
8021         call GetTypeExpression() on the MemberName to get an expression.
8022         (IndexerDeclaration.interface_type): Changed type from string to
8023         MemberName.
8024         (MakeName): Operate on MemberName's instead of string's.
8025
8026 2004-09-13  Raja R Harinath  <rharinath@novell.com>
8027
8028         Fix bug #55770.
8029         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8030         (NamespaceEntry.Lookup): Add new argument to flag if we want the
8031         lookup to avoid symbols introduced by 'using'.
8032         * rootcontext.cs (NamespaceLookup): Update.
8033
8034 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8035
8036         * class.cs (TypeContainer.DoDefineMembers): Do not call
8037         DefineDefaultConstructor for static classes.
8038
8039 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8040
8041         * attribute.cs (Attribute.Resolve): Add error 653 report.
8042
8043         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8044         report.
8045         (Method.ApplyAttributeBuilder): Add error 685 report.
8046         (Operator.Define): Add error 564 report.
8047
8048         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8049
8050         * expression.cs (Invocation.DoResolve): Add error
8051         245 and 250 report.
8052
8053         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8054         error 674 report.
8055
8056 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8057
8058         * class.cs (ConstructorInitializer.Resolve):
8059         Wrong error number (515->516).
8060
8061 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8062
8063         * class.cs (Indexer.Define): Add error 631 report.
8064
8065 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8068
8069 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8070
8071         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8072
8073 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8074
8075         * cs-parser.jay: Added error CS0241 report.
8076
8077 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8078
8079         * cs-parser.jay (fixed_statement): Introduce a scope for the
8080         declaration in the 'fixed' statement.
8081
8082 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8083
8084         * cs-parser.jay: Added CS0230 error report.
8085
8086 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8087
8088         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8089
8090 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8091
8092         * expression.cs (Argument.Resolve): Added error CS0192 and
8093         CS0199 report.
8094
8095 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8096
8097         C# 2.0 #pragma warning feature
8098
8099         * cs-tokenizer.cs (PreProcessPragma): New method; 
8100         Handles #pragma directive.
8101
8102         * report.cs (WarningRegions): New class; Support
8103         class for #pragma warning directive. It tests whether
8104         warning is enabled for a given line.
8105
8106 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * const.cs: Add more descriptive error report, tahnks to
8109         Sebastien. 
8110
8111 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8112
8113         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8114
8115 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8116
8117         * expression.cs: Apply patch from Ben: Remove dead code from
8118         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8119         as that code just threw an exception anwyays.
8120
8121         * const.cs: Remove the call to the turnintoconstant, for details
8122         see bug: #63144
8123         
8124         * literal.cs: The type of the null-literal is the null type;  So
8125         we use a placeholder type (literal.cs:System.Null, defined here)
8126         for it.
8127
8128         * expression.cs (Conditional.DoResolve): Remove some old code that
8129         is no longer needed, conversions have been fixed.
8130
8131         (ArrayCreationExpression.DoResolve): Return false if we fail to
8132         resolve the inner expression.
8133
8134 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8135
8136         Fix test-290.cs.
8137         * cs-parser.jay (delegate_declaration): Record a delegate
8138         declaration as a type declaration.
8139         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8140
8141 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8142
8143         * parameter.cs: Do not crash if the type can not be resolved. 
8144
8145         * expression.cs: Report errors with unsafe pointers, fixes #64896
8146
8147 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8148
8149         * expression.cs: Pointer arith always needs to do a conv.i
8150         if the operand is a long. fix 65320
8151
8152 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8153
8154         Fixed cs0619-37.cs, cs0619-38.cs
8155
8156         * enum.cs (GetObsoleteAttribute): Removed.
8157
8158         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8159         on Enum member is double staged. The first is tested member
8160         and then enum.
8161
8162 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8163
8164         Fixed #56986, #63631, #65231
8165
8166         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8167         adds member to name container.
8168         (TypeContainer.AddToTypeContainer): New method, adds type to
8169         name container.
8170         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8171         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8172         AddOperator): Simplified by reusing AddToMemberContainer.
8173         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8174         instead of field.
8175         (Method.CheckForDuplications): Fixed implementation to test all
8176         possibilities.
8177         (MemberBase): Detection whether member is explicit interface
8178         implementation is now in constructor.
8179         (MemberBase.UpdateMemberName): Handles IndexerName.
8180         (Accessor): Changed to keep also location information.
8181         (AbstractPropertyEventMethod): Is derived from MemberCore.
8182         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8183         will be emited or not.
8184         (PropertyBase.AreAccessorsDuplicateImplementation):
8185         Tests whether accessors are not in collision with some method.
8186         (Operator): Is derived from MethodCore to simplify common
8187         operations.
8188
8189         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8190         must be performed.
8191         (DeclSpace.AddToContainer): Adds the member to defined_names
8192         table. It tests for duplications and enclosing name conflicts.
8193
8194         * enum.cs (EnumMember): Clean up to reuse the base structures
8195
8196 2004-09-03  Martin Baulig  <martin@ximian.com>
8197
8198         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8199         into TypeContainer, to make partial classes work again.
8200
8201 2004-09-03  Martin Baulig  <martin@ximian.com>
8202
8203         * rootcontext.cs (RootContext.V2): Removed.
8204
8205 2004-03-23  Martin Baulig  <martin@ximian.com>
8206
8207         * expression.cs (Invocation.OverloadResolve): Added `bool
8208         may_fail' argument and use it instead of the Location.IsNull() hack.
8209
8210 2004-09-03  Martin Baulig  <martin@ximian.com>
8211
8212         Merged latest changes into gmcs.  Please keep this comment in
8213         here, it makes it easier for me to see what changed in MCS since
8214         the last time I merged.
8215
8216 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8217
8218         Fix #61128.
8219         * expression.cs (BetterConversion): Don't allow either conversion 
8220         to be null.  Remove redundant implicit conversion test when 'q ==
8221         null' -- when this function is invoked, we already know that the
8222         implicit conversion exists.
8223         (BetterFunction): Assume that 'best' is non-null.  Remove
8224         redundant reimplementation of IsApplicable when 'best' is null.
8225         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8226         number of arguments.
8227         (IsAncestralType): Extract from OverloadResolve.
8228         (OverloadResolve): Make robust to the MethodGroupExpr being
8229         unsorted.  Implement all the logic of Section 14.5.5.1, and
8230         support overloading of methods from multiple applicable types.
8231         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8232
8233         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8234         (RealError, Warning): Append type of report to related symbol.
8235
8236 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8237
8238         * enum.cs: Fixed CLS-Compliance checks for enum members.
8239         Error tests cs3008-8.cs, cs3014-8.cs
8240
8241 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8242
8243         Fixed bug #62342, #63102
8244         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8245         like ImplementMethod.
8246
8247 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8248
8249         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8250         Fixed bug #65170.
8251
8252 2004-09-02  Martin Baulig  <martin@ximian.com>
8253
8254         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8255         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8256         on the MethodBase.
8257
8258 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8259
8260         C# 2.0 Static classes implemented
8261
8262         * class.cs (TypeContainer): instance_constructors,
8263         initialized_fields, initialized_static_fields,
8264         default_constructor, base_inteface_types are protected to be
8265         accessible from StaticClass.
8266         (TypeContainer.DefineDefaultConstructor): New virtual method
8267         for custom default constructor generating
8268         (StaticClass): New class to handle "Static classes" feature.
8269
8270         * cs-parser.jay: Handle static keyword on class like instance
8271         of StaticClass.
8272
8273         * driver.cs: Added "/langversion" command line switch with two
8274         options (iso-1, default).
8275
8276 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8277
8278         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8279
8280 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8281
8282         * delegate.cs: Style.
8283
8284 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8285
8286         * delegate.cs: Add seperate instance expr field for miguel.
8287
8288 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8289
8290         * PointerArithmetic (Resolve): make sure we are not doing
8291         pointer arith on void*. Also, make sure we are resolved
8292         by not setting eclass until resolve.
8293
8294         All callers: Make sure that PointerArithmetic gets resolved.
8295
8296 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8297
8298         * ArrayCreation (LookupType): If the type does not resolve 
8299         to an array, give an error.
8300
8301 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8302
8303         * statement.cs (Try.Resolve): Fixed bug #64222
8304
8305 2004-08-27  Martin Baulig  <martin@ximian.com>
8306
8307         * class.cs
8308         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8309         crash here.     
8310
8311 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8312
8313         * ecore.cs (Constantify): Get underlying type via
8314         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8315         Windows in special cases.
8316
8317 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8318
8319         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8320         for obtaining also private methods.
8321         (GetRemoveMethod): Used GetRemoveMethod (true)
8322         for obtaining also private methods.
8323
8324 2004-08-24  Martin Baulig  <martin@ximian.com>
8325
8326         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8327         MethodAttributes.HideBySig for operators.
8328
8329 2004-08-23  Martin Baulig  <martin@ximian.com>
8330
8331         Back to the old error reporting system :-)
8332
8333         * report.cs (Message): Removed.
8334         (Report.MessageData, ErrorData, WarningData): Removed.
8335         (Report.Error, Warning): Back to the old system.
8336
8337 2004-08-23  Martin Baulig  <martin@ximian.com>
8338
8339         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8340
8341         * class.cs (TypeContainer.ParentContainer): New public virtual
8342         method; replaces the explicit interface implementation.
8343         (ClassPart.ParentContainer): Override.
8344
8345 2004-08-23  Martin Baulig  <martin@ximian.com>
8346
8347         * statement.cs (Switch): Added support for constant switches; see
8348         #59428 or test-285.cs.
8349
8350 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8351
8352         Fixed bug #62740.
8353         * statement.cs (GetEnumeratorFilter): Removed useless
8354         logic because C# specs is strict. GetEnumerator must be
8355         public.
8356
8357 2004-08-22  Martin Baulig  <martin@ximian.com>
8358
8359         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8360         a switch and may break, reset the barrier.  Fixes #59867.
8361
8362 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8363
8364         CLS-Compliance speed up (~5% for corlib)
8365
8366         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8367         New method. Tests container for CLS-Compliant names
8368
8369         * class.cs (TypeContainer.VerifyClsName): New method.
8370         Checks whether container name is CLS Compliant.
8371         (Constructor): Implements IMethodData.
8372
8373         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8374         low-case table for CLS Compliance test.
8375         (MemberCache.VerifyClsParameterConflict): New method.
8376         Checks method parameters for CS3006 error.
8377
8378         * enum.cs (EnumMember): Is derived from MemberCore.
8379         (Enum.VerifyClsName): Optimized for better performance.
8380
8381 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * report.cs: Renamed Error_T to Error and changed all
8384         references.
8385
8386 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8387
8388         * class.cs (TypeContainer.IndexerArrayList): New inner class
8389         container for indexers.
8390         (TypeContainer.DefaultIndexerName): New constant for default
8391         indexer name. Replaced all "Item" with this constant.
8392         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8393
8394         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8395         DefaultMemberAttribute constructor.
8396
8397 2004-08-05  Martin Baulig  <martin@ximian.com>
8398
8399         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8400         Fix bug #59429.
8401
8402 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8403
8404         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8405         multi platforms problem.
8406
8407         * compiler.csproj: Included shared files.
8408
8409 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8410
8411         Fix bug 60333, 55971 in the more general way
8412         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8413         Added arg_type argument for constant conversion.
8414         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8415
8416 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8417
8418         Fix bug #59760
8419         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8420         OperatorArrayList, MethodCoreArrayList for typecontainer
8421         containers. Changed class member types to these new types.
8422         (MethodArrayList.DefineMembers): Added test for CS0659.
8423
8424 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8425
8426         * cfold.cs: Synchronize the folding with the code in expression.cs
8427         Binary.DoNumericPromotions for uint operands.
8428
8429         * attribute.cs: Revert patch from Raja, it introduced a regression
8430         while building Blam-1.2.1 (hard to isolate a test case).
8431
8432 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8433
8434         Fix for #55382
8435         * class.cs:
8436         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8437         name collision.
8438         (MethodCore.parent_method): New member. The method we're overriding
8439         if this is an override method.
8440         (MethodCore.CheckBase): Moved from Method class and made common.
8441         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8442         private.
8443         (MethodCore.CheckForDuplications): New abstract method. For custom
8444         member duplication search in a container
8445         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8446         method and its return type.
8447         (Event.conflict_symbol): New member. Symbol with same name in the
8448         parent class.
8449
8450         * decl.cs:
8451         (MemberCache.FindMemberWithSameName): New method. The method
8452         is looking for conflict with inherited symbols.
8453
8454 2004-08-04  Martin Baulig  <martin@ximian.com>
8455
8456         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8457
8458         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8459
8460 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8461
8462         * report.cs (Message): New enum for better error, warning reference in
8463         the code.
8464         (MessageData): New inner abstract class. It generally handles printing of
8465         error and warning messages.
8466         Removed unused Error, Warning, Message methods.
8467
8468 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8469
8470         Fix for cs0592-8.cs test
8471         * attribute.cs
8472         (Attributable.ValidAttributeTargets): Made public.
8473         (Attribute.ExplicitTarget): New member for explicit target value.
8474         (Attribute.CheckTargets): Now we translate explicit attribute
8475         target to Target here.
8476
8477 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8478
8479         * ecore.cs (MethodGroupExpr): new IsBase property.
8480
8481         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8482
8483         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8484         rather than an instance expr.
8485
8486         (DelegateCreation.Emit): Use the method group rather than
8487         the instance expression. Also, if you have base.Foo as the
8488         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8489
8490         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8491
8492         (NewDelegate.DoResolve): Only check for the existance of Invoke
8493         if the method is going to be needed. Use MethodGroupExpr.
8494
8495         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8496
8497         * expression.cs: For pointer arith., make sure to use
8498         the size of the type, not the size of the pointer to
8499         the type.
8500
8501 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8502
8503         Fix for #60722
8504         * class.cs (Class): Added error CS0502 test.
8505
8506 2004-08-03  John Luke  <jluke@cfl.rr.com>
8507             Raja R Harinath  <rharinath@novell.com>
8508
8509         Fix for #60997.
8510         * attribute.cs (Attribute.complained_before): New flag.
8511         (Attribute.ResolveType, Attribute.Resolve),
8512         (Attribute.DefinePInvokeMethod): Set it.
8513         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8514         
8515 2004-08-03  Martin Baulig  <martin@ximian.com>
8516
8517         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8518         use a user-defined operator; we still need to do numeric
8519         promotions in case one argument is a builtin type and the other
8520         one has an implicit conversion to that type.  Fixes #62322.
8521
8522 2004-08-02  Martin Baulig  <martin@ximian.com>
8523
8524         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8525         (LocalInfo.IsThis): New public property.
8526         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8527
8528 2004-08-01  Martin Baulig  <martin@ximian.com>
8529
8530         * class.cs (TypeContainer.GetClassBases): Don't set the default
8531         here since we may get called from GetPartialBases().
8532         (TypeContainer.DefineType): If GetClassBases() didn't return a
8533         parent, use the default one.
8534
8535 2004-07-30  Duncan Mak  <duncan@ximian.com>
8536
8537         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8538
8539 2004-07-30  Martin Baulig  <martin@ximian.com>
8540
8541         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8542
8543         * class.cs (SourceMethod): New public class, derive from the
8544         symbol writer's ISourceMethod.
8545         (Method): Use the new symbol writer API.
8546
8547         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8548         as argument and use the new symbol writer.
8549
8550         * location.cs
8551         (SourceFile): Implement the symbol writer's ISourceFile.
8552         (Location.SymbolDocument): Removed.
8553         (Location.SourceFile): New public property.
8554
8555         * symbolwriter.cs: Use the new symbol writer API.
8556
8557 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8558
8559         * Makefile (install-local): Remove.  Functionality moved to
8560         executable.make.
8561
8562 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8563
8564         * Makefile: Install mcs.exe.config file together with mcs.exe.
8565         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8566         correct runtime version.
8567         
8568 2004-07-25  Martin Baulig  <martin@ximian.com>
8569
8570         * class.cs
8571         (TypeContainer.RegisterOrder): Removed, this was unused.
8572         (TypeContainer, interface_order): Removed.
8573         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8574         TypeContainer as argument since we can also be called with a
8575         `PartialContainer' for a partial class/struct/interface.
8576         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8577         of checking whether we're an `Interface' - we could be a
8578         `PartialContainer'.
8579         (PartialContainer.Register): Override; call
8580         AddClass()/AddStruct()/AddInterface() on our parent.
8581
8582         * cs-parser.jay (interface_member_declaration): Add things to the
8583         `current_container', not the `current_class'.
8584
8585         * rootcontext.cs (RegisterOrder): The overloaded version which
8586         takes an `Interface' was unused, removed.
8587
8588         * typemanager.cs (TypeManager.LookupInterface): Return a
8589         `TypeContainer', not an `Interface'.
8590         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8591         contain a `PartialContainer' for an interface, so check it's
8592         `Kind' to figure out what it is.
8593
8594 2004-07-25  Martin Baulig  <martin@ximian.com>
8595
8596         * class.cs (Class.DefaultTypeAttributes): New public constant.
8597         (Struct.DefaultTypeAttributes): Likewise.
8598         (Interface.DefaultTypeAttributes): Likewise.
8599         (PartialContainer.TypeAttr): Override this and add the
8600         DefaultTypeAttributes.
8601
8602 2004-07-25  Martin Baulig  <martin@ximian.com>
8603
8604         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8605         we can just use the `Parent' field instead.
8606
8607 2004-07-25  Martin Baulig  <martin@ximian.com>
8608
8609         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8610
8611 2004-07-25  Martin Baulig  <martin@ximian.com>
8612
8613         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8614         our parts before defining any methods.
8615         (TypeContainer.VerifyImplements): Make this virtual.
8616         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8617         on our PartialContainer.
8618
8619 2004-07-25  Martin Baulig  <martin@ximian.com>
8620
8621         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8622
8623         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8624         argument, we can just use the `Parent' field instead.
8625
8626         * class.cs
8627         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8628         (MemberBase.DoDefine): Likewise.
8629
8630 2004-07-24  Martin Baulig  <martin@ximian.com>
8631
8632         * decl.cs (MemberCore.Parent): New public field.
8633         (DeclSpace.Parent): Moved to MemberCore.
8634
8635         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8636         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8637         parent's .ctor.
8638         (FieldBase, Field, Operator): Likewise.
8639         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8640         (EventField, Event): Likewise.
8641
8642 2004-07-23  Martin Baulig  <martin@ximian.com>
8643
8644         * class.cs (PartialContainer): New public class.
8645         (ClassPart): New public class.
8646         (TypeContainer): Added support for partial classes.
8647         (TypeContainer.GetClassBases): Splitted some of the functionality
8648         out into GetNormalBases() and GetPartialBases().
8649
8650         * cs-tokenizer.cs (Token.PARTIAL): New token.
8651         (Tokenizer.consume_identifier): Added some hacks to recognize
8652         `partial', but only if it's immediately followed by `class',
8653         `struct' or `interface'.
8654
8655         * cs-parser.jay: Added support for partial clases.
8656
8657 2004-07-23  Martin Baulig  <martin@ximian.com>
8658
8659         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8660         a `DeclSpace' and also made it readonly.
8661         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8662         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8663         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8664
8665         * cs-parser.jay: Pass the `current_class', not the
8666         `current_container' (at the moment, this is still the same thing)
8667         to a new Method, Property, Event, Indexer or Constructor.
8668
8669 2004-07-23  Martin Baulig  <martin@ximian.com>
8670
8671         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8672         and removed the `current_interface' one.
8673         (struct_declaration, class_declaration, interface_declaration):
8674         Set `current_class' to the newly created class/struct/interface;
8675         set their `Bases' and call Register() before parsing their body.
8676
8677 2004-07-23  Martin Baulig  <martin@ximian.com>
8678
8679         * class.cs (Kind): New public enum.
8680         (TypeContainer): Made this class abstract.
8681         (TypeContainer.Kind): New public readonly field.
8682         (TypeContainer.CheckDef): New public method; moved here from
8683         cs-parser.jay.
8684         (TypeContainer.Register): New public abstract method.
8685         (TypeContainer.GetPendingImplementations): New public abstract
8686         method.
8687         (TypeContainer.GetClassBases): Removed the `is_class' and
8688         `is_iface' parameters.
8689         (TypeContainer.DefineNestedTypes): Formerly known as
8690         DoDefineType().
8691         (ClassOrStruct): Made this class abstract.
8692
8693         * tree.cs (RootTypes): New public type. 
8694
8695 2004-07-20  Martin Baulig  <martin@ximian.com>
8696
8697         * tree.cs (Tree.RecordNamespace): Removed.
8698         (Tree.Namespaces): Removed.
8699
8700         * rootcontext.cs (RootContext.IsNamespace): Removed.
8701
8702         * cs-parser.jay (namespace_declaration): Just create a new
8703         NamespaceEntry here.
8704
8705 2004-07-20  Martin Baulig  <martin@ximian.com>
8706
8707         * statement.cs (ExceptionStatement): New abstract class.  This is
8708         now used as a base class for everyone who's using `finally'.
8709         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8710         our local variables before using them.
8711
8712         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8713         virtual method.  This is used by Yield.Resolve() to "steal" an
8714         outer block's `finally' clauses.
8715         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8716         argument.
8717
8718         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8719         version which takes an ExceptionStatement.  This version must be
8720         used to create exception branchings.
8721
8722         * iterator.cs
8723         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8724         (Iterator.EmitMoveNext): Added exception support; protect the
8725         block with a `fault' clause, properly handle 'finally' clauses.
8726         (Iterator.EmitDispose): Run all the `finally' clauses here.
8727
8728 2004-07-20  Martin Baulig  <martin@ximian.com>
8729
8730         * iterator.cs: This is the first of a set of changes in the
8731         iterator code.  Match the spec more closely: if we're an
8732         IEnumerable, then GetEnumerator() must be called.  The first time
8733         GetEnumerator() is called, it returns the current instance; all
8734         subsequent invocations (if any) must create a copy.
8735
8736 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8737
8738         * expression.cs: Resolve the constant expression before returning
8739         it. 
8740
8741 2004-07-19  Martin Baulig  <martin@ximian.com>
8742
8743         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8744         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8745         the return type of the new EmitContext.
8746
8747 2004-07-18  Martin Baulig  <martin@ximian.com>
8748
8749         * class.cs (Property.Define): Fix iterators.
8750
8751         * iterators.cs (Iterator.Define): Moved the
8752         `container.AddInterator (this)' call here from the .ctor; only do
8753         it if we resolved successfully.
8754
8755 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8756
8757         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8758         `true' for preprocessing directives that we parse.  The return
8759         value indicates whether we should return to regular tokenizing or
8760         not, not whether it was parsed successfully.
8761
8762         In the past if we were in: #if false ... #line #endif, we would
8763         resume parsing after `#line'.  See bug 61604.
8764
8765         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8766         building: IsEnumType should return true only for enums, not for
8767         enums or System.Enum itself.  This fixes #61593.
8768
8769         Likely what happened is that corlib was wrong: mcs depended on
8770         this bug in some places.  The bug got fixed, we had to add the
8771         hack, which caused bug 61593.
8772
8773         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8774         that was a workaround for the older conditions.
8775
8776 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8777
8778         * assign.cs: IAssignMethod has a new interface, as documented
8779         inline. All assignment code now uses this new api.
8780
8781         * ecore.cs, expression.cs: All classes which implement
8782         IAssignMethod now use the new interface.
8783
8784         * expression.cs (Invocation): add a hack to EmitCall so that
8785         IndexerAccess can be the target of a compound assignment without
8786         evaluating its arguments twice.
8787
8788         * statement.cs: Handle changes in Invocation api.
8789
8790 2004-07-16  Martin Baulig  <martin@ximian.com>
8791
8792         * iterators.cs: Rewrote this.  We're now using one single Proxy
8793         class for both the IEnumerable and the IEnumerator interface and
8794         `Iterator' derives from Class so we can use the high-level API.
8795
8796         * class.cs (TypeContainer.AddIterator): New method.
8797         (TypeContainer.DoDefineType): New protected virtual method, which
8798         is called from DefineType().
8799         (TypeContainer.DoDefineMembers): Call DefineType() and
8800         DefineMembers() on all our iterators.
8801         (TypeContainer.Emit): Call Emit() on all our iterators.
8802         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8803
8804         * codegen.cs (EmitContext.CurrentIterator): New public field.
8805
8806 2004-07-15  Martin Baulig  <martin@ximian.com>
8807
8808         * typemanager.cs
8809         (TypeManager.not_supported_exception_type): New type.   
8810
8811 2004-07-14  Martin Baulig  <martin@ximian.com>
8812
8813         * iterators.cs: Use real error numbers.
8814
8815 2004-07-14  Martin Baulig  <martin@ximian.com>
8816
8817         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8818         requires this to be a System.Collection.IEnumerable and not a
8819         class implementing that interface.
8820         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8821
8822 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8823
8824         * class.cs: Fixed previous fix, it broke some error tests.
8825
8826 2004-07-12  Martin Baulig  <martin@ximian.com>
8827
8828         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8829         Fixes #61293.
8830
8831 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8832
8833         * assign.cs (LocalTemporary): Add new argument: is_address,If
8834         `is_address' is true, then the value that we store is the address
8835         to the real value, and not the value itself.
8836         
8837         * ecore.cs (PropertyExpr): use the new local temporary
8838         stuff to allow us to handle X.Y += z (where X is a struct)
8839
8840 2004-07-08  Martin Baulig  <martin@ximian.com>
8841
8842         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8843         not always return, just like we're doing in Using.Resolve().
8844
8845 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8846
8847         * cs-parser.jay (fixed_statement): flag this as Pinned.
8848
8849 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * typemanager.cs (TypeManager): Removed MakePinned method, this
8852         mechanism is replaced with the .NET 2.x compatible mechanism of
8853         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8854
8855         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8856         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8857         `IsFixed' property which has a different meaning.
8858
8859 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8860
8861         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8862         visible from inside a nested class, not just the names of the
8863         immediately enclosing class.
8864         Fix for bug #60730.
8865
8866 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8867
8868         * expression.cs (BetterConversion): Remove buggy special-case
8869         handling of "implicit constant expression conversions".  At this
8870         point, we already know that the conversion is possible -- we're
8871         only checking to see which is better.
8872
8873 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8874
8875         * cs-parser.jay: Added error CS0210 test.
8876
8877 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8878
8879         * cs-parser.jay: Added error CS0134 test.
8880
8881 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8882
8883         Fix bug #52507
8884         * cs-parser.jay: Added error CS0145 test.
8885
8886 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8887
8888         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8889
8890 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8891         
8892         * expression.cs (StackAlloc.Resolve): The argument may not
8893         be a constant; deal with this case.
8894         
8895 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8896
8897         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8898         GetIndexerAttributeValue.
8899         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8900
8901         * class.cs (Indexer.Define): Added error tests for CS0415,
8902         CS0609.
8903
8904 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8905
8906         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8907         property code.
8908
8909 2004-06-23  Martin Baulig  <martin@ximian.com>
8910
8911         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8912         neither return nor throw, reset the barrier as well.  Fixes #60457.
8913
8914 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8915
8916         * class.cs : EventAttributes is now set to None by default.
8917           This fixes bug #60459.
8918
8919 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8920
8921         Fix bug #60219
8922         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8923         Don't throw exception but return null (it's sufficient now).
8924
8925 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8926
8927         * typemanager.cs (GetArgumentTypes): Faster implementation.
8928
8929 2004-06-18  Martin Baulig  <martin@ximian.com>
8930
8931         * attribute.cs (Attribute.Resolve): Check whether we're an
8932         EmptyCast which a Constant child.  Fixes #60333.
8933
8934 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8935
8936         * statement.cs (EmitCollectionForeach): Account for the fact that
8937         not all valuetypes are in areas which we can take the address of.
8938         For these variables, we store to a temporary variable. Also, make
8939         sure that we dont emit a `callvirt' on a valuetype method.
8940
8941 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8942
8943         * expression.cs (StackAlloc.DoReSolve): Added test for
8944         negative parameter (CS0247).
8945
8946 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8947
8948         Fix bug #59792
8949         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8950
8951 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8952
8953         Fix bug #59781
8954         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8955         ulong.
8956
8957 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8958
8959         Fix bug #58254 & cs1555.cs, cs1556.cs
8960         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8961
8962 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8963
8964         * cs-parser.jay: Added error CS1669 test for indexers.
8965
8966 2004-06-11  Martin Baulig  <martin@ximian.com>
8967
8968         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8969         call this twice: for params and varargs methods.
8970
8971 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8972
8973         * class.cs:
8974         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8975
8976 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8977
8978         * attribute.cs (Attribute.GetValidTargets): Made public.
8979
8980         * class.cs: 
8981         (AbstractPropertyEventMethod): New class for better code sharing.
8982         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8983         CS1667 report.
8984         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8985
8986 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8987
8988         Fix bug #59477.
8989         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8990         that the call to Resolve is part of a MemberAccess.
8991         (Expression.Resolve): Use it for SimpleName resolution.
8992         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8993         Add 'intermediate' boolean argument.
8994         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8995         error message when the SimpleName can be resolved ambiguously
8996         between an expression and a type.
8997         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8998         public.
8999         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9000         call on the left-side.
9001
9002 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9003
9004         * class.cs:
9005         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9006
9007 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9008
9009         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9010
9011 2004-06-11  Martin Baulig  <martin@ximian.com>
9012
9013         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9014         varargs methods if applicable.
9015
9016 2004-06-11  Martin Baulig  <martin@ximian.com>
9017
9018         * expression.cs (Invocation.EmitCall): Don't use
9019         `method.CallingConvention == CallingConventions.VarArgs' since the
9020         method could also have `CallingConventions.HasThis'.
9021
9022 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9023
9024         * class.cs (Event.GetSignatureForError): Implemented.
9025         Fixed crash in error test cs3010.cs
9026
9027 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
9028
9029         * cs-tokenizer.cs: Change the way we track __arglist to be
9030         consistent with the other keywords.
9031
9032 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
9033
9034         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9035         tomorrow.
9036
9037 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
9038
9039         * codegen.cs: Check that all referenced assemblies have a strongname
9040         before strongnaming the compiled assembly. If not report error CS1577.
9041         Fix bug #56563. Patch by Jackson Harper.
9042         * typemanager.cs: Added a method to return all referenced assemblies.
9043         Fix bug #56563. Patch by Jackson Harper.
9044
9045 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9046
9047         * class.cs:
9048         (Method.ApplyAttributeBuilder): Moved and added conditional
9049         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9050
9051         * delegate.cs:
9052         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9053
9054 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
9055
9056         Fixed #59640
9057         * class.cs: (EventField.attribute_targets): Changed default target.
9058
9059 2004-06-08  Martin Baulig  <martin@ximian.com>
9060
9061         * expression.cs (Invocation.EmitCall): Enable varargs methods.
9062
9063 2004-06-08  Martin Baulig  <martin@ximian.com>
9064
9065         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9066
9067 2004-06-07  Martin Baulig  <martin@ximian.com>
9068
9069         Added support for varargs methods.
9070
9071         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9072         keyword.
9073
9074         * cs-parser.jay: Added support for `__arglist'.
9075
9076         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9077
9078         * expression.cs (Argument.AType): Added `ArgList'.
9079         (Invocation): Added support for varargs methods.
9080         (ArglistAccess): New public class.
9081         (Arglist): New public class.
9082
9083         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9084
9085         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
9086         a method's top-level block if the method has varargs.
9087
9088         * support.cs (ReflectionParameters, InternalParameters): Added
9089         support for varargs methods.    
9090
9091 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
9092
9093         * class.cs: Provide location in indexer error report.
9094
9095         * driver.cs: Use standard names.
9096
9097         * namespace.cs: Catch the use of using after a namespace has been
9098         declared also on using aliases.
9099
9100 2004-06-03  Raja R Harinath  <rharinath@novell.com>
9101
9102         Bug #50820.
9103         * typemanager.cs (closure_private_ok, closure_invocation_type)
9104         (closure_qualifier_type, closure_invocation_assembly)
9105         (FilterWithClosure): Move to ...
9106         (Closure): New internal nested class.
9107         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9108         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9109         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9110         (MemberLookup, MemberLookupFailed): Use it.
9111         * expression.cs (New.DoResolve): Treat the lookup for the
9112         constructor as being qualified by the 'new'ed type.
9113         (Indexers.GetIndexersForTypeOrInterface): Update.
9114
9115 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
9116
9117         * attribute.cs
9118         (GetConditionalAttributeValue): New method. Returns
9119         condition of ConditionalAttribute.
9120         (SearchMulti): New method.  Returns all attributes of type 't'.
9121         Use it when attribute is AllowMultiple = true.
9122         (IsConditionalMethodExcluded): New method.
9123
9124         * class.cs
9125         (Method.IsExcluded): Implemented. Returns true if method has conditional
9126         attribute and the conditions is not defined (method is excluded).
9127         (IMethodData): Extended interface for ConditionalAttribute support.
9128         (PropertyMethod.IsExcluded): Implemented.
9129
9130         * decl.cs
9131         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9132
9133         * expression.cs
9134         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9135         on the method.
9136
9137 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9138
9139         * expression.cs (ArrayCreationExpression): Make this just an
9140         `expression'. It can't be a statement, so the code here was
9141         dead.
9142
9143 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9144
9145         Fixed #59072
9146         * typemanager.cs (GetFullNameSignature): New method for
9147         MethodBase types.
9148
9149 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
9150
9151         Fixed #56452
9152         * class.cs (MemberBase.GetSignatureForError): New virtual method.
9153         Use this method when MethodBuilder is null.
9154         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9155         Added test for error CS0626 (MONO reports error for this situation).
9156         (IMethodData.GetSignatureForError): Extended interface.
9157
9158 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9159
9160         * attribute.cs
9161         (AttributeTester.GetObsoleteAttribute): Returns instance of
9162         ObsoleteAttribute when type is obsolete.
9163
9164         * class.cs
9165         (TypeContainer.VerifyObsoleteAttribute): Override.
9166         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9167         (MethodCode.VerifyObsoleteAttribute): Override.
9168         (MemberBase.VerifyObsoleteAttribute): Override.
9169
9170         * decl.cs
9171         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9172         and report proper error.
9173
9174         *delegate.cs
9175         Delegate.VerifyObsoleteAttribute): Override.
9176
9177         * ecore.cs
9178         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9179         and report proper error.
9180         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9181
9182         * enum.cs
9183         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9184         and enum member.
9185
9186         * expression.cs
9187         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9188         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9189         Added test for ObsoleteAttribute.
9190
9191         * statement.cs
9192         (Catch): Derived from Statement.
9193
9194 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
9195  
9196         Fixed bug #59071 & cs0160.cs
9197  
9198         * statement.cs (Try.Resolve): Check here whether order of catch
9199         clauses matches their dependencies.
9200
9201 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
9202
9203         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
9204         caused a regression: #59343.  Referencing nested classes from an
9205         assembly stopped working.
9206
9207 2004-05-31  Martin Baulig  <martin@ximian.com>
9208
9209         MCS is now frozen for beta 2.
9210
9211 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9212
9213         * convert.cs: add a trivial cache for overload operator resolution.
9214
9215 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9216
9217         * decl.cs: If possible, use lookuptypedirect here. We can only do
9218         this if there is no `.' after the namespace. Avoids using
9219         LookupType, which does lots of slow processing.
9220         (FindNestedType) New method, does what it says :-).
9221         * namespace.cs: use LookupTypeDirect.
9222         * rootcontext.cs: use membercache, if possible.
9223         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9224
9225 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9226
9227         * expression.cs:
9228         According to the spec, 
9229
9230         In a member access of the form E.I, if E is a single identifier,
9231         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9232         field, property, localvariable, or parameter with the same type as
9233         the meaning of E as a type-name (§3.8), then both possible
9234         meanings of E are permitted.
9235
9236         We did not check that E as a simple-name had the same type as E as
9237         a type name.
9238
9239         This trivial check gives us 5-7% on bootstrap time.
9240
9241 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9242
9243         * expression.cs (Invocation.OverloadResolve): Avoid the
9244         use of hashtables and boxing here by allocating on demand.
9245
9246 2004-05-30  Martin Baulig  <martin@ximian.com>
9247
9248         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9249         we're doing a silent lookup.  Don't try to lookup nested types in
9250         TypeManager.object_type (thanks to Ben Maurer).
9251
9252 2004-05-30  Martin Baulig  <martin@ximian.com>
9253
9254         Committing a patch from Ben Maurer.
9255
9256         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9257
9258 2004-05-29  Martin Baulig  <martin@ximian.com>
9259
9260         * class.cs (IMethodData.ShouldIgnore): New method.
9261
9262         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9263         `Location' argument, we don't need it anywhere.  Use
9264         `IMethodData.ShouldIgnore ()' instead of
9265         `MethodData.GetMethodFlags ()'.
9266         (TypeManager.AddMethod): Removed.
9267         (TypeManager.AddMethod2): Renamed to AddMethod.
9268
9269 2004-05-29  Martin Baulig  <martin@ximian.com>
9270
9271         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9272
9273         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9274         converting from a class type S to an interface type and we already
9275         have an object on the stack, don't box it again.  Fixes #52578.
9276
9277 2004-05-29  Martin Baulig  <martin@ximian.com>
9278
9279         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9280         Added support for `params' parameters.  Fixes #59267.
9281
9282 2004-05-29  Martin Baulig  <martin@ximian.com>
9283
9284         * literal.cs (NullPointer): Provide a private .ctor which sets
9285         `type' to TypeManager.object_type.  Fixes #59048.
9286
9287 2004-05-29  Martin Baulig  <martin@ximian.com>
9288
9289         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9290         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9291
9292         * ecore.cs (EventExpr.instance_expr): Make the field private.
9293
9294 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9295
9296         Fixed bug #50080 & cs0214-2.cs
9297         * expression.cs (Cast.DoResolve): Check unsafe context here.
9298         
9299         * statement.cs (Resolve.DoResolve): Likewise.
9300
9301 2004-05-26  Martin Baulig  <martin@ximian.com>
9302
9303         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9304
9305         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9306         (RootContext.LookupType): Pass down the `silent' flag.
9307
9308 2004-05-25  Martin Baulig  <martin@ximian.com>
9309
9310         * expression.cs
9311         (MethodGroupExpr.IdenticalTypeName): New public property.
9312         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9313         expression actually refers to a type.
9314
9315 2004-05-25  Martin Baulig  <martin@ximian.com>
9316
9317         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9318         for #56176 and made it actually work.
9319
9320 2004-05-25  Martin Baulig  <martin@ximian.com>
9321
9322         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9323         (FieldExpr, PropertyExpr): Override and implement
9324         CacheTemporaries.  Fixes #52279.
9325
9326 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * location.cs: In the new compiler listing a file twice is a
9329         warning, not an error.
9330
9331 2004-05-24  Martin Baulig  <martin@ximian.com>
9332
9333         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9334         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9335
9336 2004-05-24  Martin Baulig  <martin@ximian.com>
9337
9338         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9339         walking the `using' list.  Fixes #53921.
9340
9341 2004-05-24  Martin Baulig  <martin@ximian.com>
9342
9343         * const.cs (Const.LookupConstantValue): Added support for
9344         EmptyCast's; fixes #55251.
9345
9346 2004-05-24  Martin Baulig  <martin@ximian.com>
9347
9348         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9349         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9350         which does the CS0135 check.  The reason is that we first need to
9351         check whether the variable actually exists.
9352
9353 2004-05-24  Martin Baulig  <martin@ximian.com>
9354
9355         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9356         than RootContext.LookupType() to find the explicit interface
9357         type.  Fixes #58584.
9358
9359 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9360
9361         * Makefile: Simplify.  Use executable.make.
9362         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9363
9364 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9365
9366         * decl.cs:
9367         * enum.cs:
9368         Use the invariant culture when doing String.Compare for CLS case
9369         sensitivity.
9370         
9371 2004-05-23  Martin Baulig  <martin@ximian.com>
9372
9373         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9374         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9375
9376         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9377         
9378 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * class.cs (MemberBase.Define): Reuse MemberType member for 
9381         resolved type. Other methods can use it too.
9382
9383 2004-05-23  Martin Baulig  <martin@ximian.com>
9384
9385         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9386         the variable also exists in the current block (otherwise, we need
9387         to report a CS0103).  Fixes #58670.
9388
9389 2004-05-23  Martin Baulig  <martin@ximian.com>
9390
9391         * flowanalysis.cs (Reachability.Reachable): Compute this
9392         on-the-fly rather than storing it as a field.
9393
9394 2004-05-23  Martin Baulig  <martin@ximian.com>
9395
9396         * flowanalysis.cs (Reachability.And): Manually compute the
9397         resulting `barrier' from the reachability.      
9398        
9399 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9400
9401         Fix bug #57835
9402         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9403         instance of ObsoleteAttribute when symbol is obsolete.
9404
9405         * class.cs
9406         (IMethodData): Extended interface for ObsoleteAttribute support.
9407
9408 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9409
9410         * attribute.cs: Fix bug #55970
9411
9412 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9413
9414         Fix bug #52705
9415         * attribute.cs
9416         (GetObsoleteAttribute): New method. Creates the instance of
9417         ObsoleteAttribute.
9418         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9419         ObsoleteAttribute when member is obsolete.
9420         (AttributeTester.Report_ObsoleteMessage): Common method for
9421         Obsolete error/warning reporting.
9422
9423         * class.cs
9424         (TypeContainer.base_classs_type): New member for storing parent type.
9425
9426         * decl.cs
9427         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9428         for this MemberCore.
9429
9430 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9431
9432         * attribute.cs, const.cs: Fix bug #58590
9433
9434 2004-05-21  Martin Baulig  <martin@ximian.com>
9435
9436         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9437         out parameters if the end of the method is unreachable.  Fixes
9438         #58098. 
9439
9440 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9441
9442         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9443         Hari was right, why extra method.
9444
9445 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9446
9447         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9448
9449 2004-05-20  Martin Baulig  <martin@ximian.com>
9450
9451         Merged this back from gmcs to keep the differences to a minumum.
9452
9453         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9454         instead of a Declspace.
9455         (Attribute.ResolveType): Likewise.
9456         (Attributes.Search): Likewise.
9457         (Attributes.Contains): Likewise.
9458         (Attributes.GetClsCompliantAttribute): Likewise.
9459
9460         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9461         argument.
9462         (MethodData.ApplyAttributes): Take an EmitContext instead of a
9463         DeclSpace.
9464
9465 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9466
9467         Fix bug #58688 (MCS does not report error when the same attribute
9468         is assigned twice)
9469
9470         * attribute.cs (Attribute.Emit): Distinction between null and default.
9471
9472 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9473
9474         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9475         of a top-level attribute without an attribute target.
9476         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9477         Make non-static.
9478         (Attribute.Conditional_GetConditionName), 
9479         (Attribute.Obsolete_GetObsoleteMessage): Update.
9480         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9481         part of ScanForIndexerName.
9482         (Attribute.CanIgnoreInvalidAttribute): New function.
9483         (Attribute.ScanForIndexerName): Move to ...
9484         (Attributes.ScanForIndexerName): ... here.
9485         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9486         (Attributes.Search): New internal variant that can choose not to
9487         complain if types aren't resolved.  The original signature now
9488         complains.
9489         (Attributes.GetClsCompliantAttribute): Use internal variant, with
9490         complaints suppressed.
9491         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9492         only if it not useful.
9493         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9494         top-level for attributes that are shared between the assembly
9495         and a top-level class.
9496         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9497         * class.cs: Update to reflect changes.
9498         (DefineIndexers): Fuse loops.
9499         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9500         a couple more variants of attribute names.
9501
9502 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9503
9504         Fix bug #52585 (Implemented explicit attribute declaration)
9505
9506         * attribute.cs:
9507         (Attributable.ValidAttributeTargets): New abstract method. It gets
9508         list of valid attribute targets for explicit target declaration.
9509         (Attribute.Target): It holds target itself.
9510         (AttributeSection): Removed.
9511         (Attribute.CheckTargets): New method. It checks whether attribute
9512         target is valid for the current element.
9513
9514         * class.cs:
9515         (EventProperty): New class. For events that are declared like
9516         property (with add and remove accessors).
9517         (EventField): New class. For events that are declared like field.
9518         class.cs
9519
9520         * cs-parser.jay: Implemented explicit attribute target declaration.
9521
9522         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9523         Override ValidAttributeTargets.
9524
9525         * parameter.cs:
9526         (ReturnParameter): Class for applying custom attributes on 
9527         the return type.
9528         (ParameterAtribute): New class. Class for applying custom
9529         attributes on the parameter type.
9530
9531 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9534         definitions. 
9535
9536         (Method): Allow UNSAFE here.
9537
9538         * modifiers.cs: Support unsafe reporting.
9539
9540 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9541
9542         * decl.cs: Fix bug #58478.
9543
9544 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9545
9546         * statement.cs: When checking for unreachable code on an EmptyStatement,
9547         set the location. Fixes bug #58488.
9548
9549 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9550
9551         * driver.cs: Add -pkg handling.
9552
9553         From Gonzalo: UseShelLExecute=false
9554
9555 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9556
9557         * attribute.cs:
9558         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9559         for attribute.
9560         (Attribute.IsClsCompliaceRequired): Moved to base for better
9561         accesibility.
9562         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9563         when attribute is AttributeUsageAttribute.
9564         (Attribute.GetValidTargets): Simplified.
9565         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9566         attribute for this type.
9567         (Attribute.ApplyAttributes): Method renamed to Emit and make
9568         non-static.
9569         (GlobalAttributeSection): New class for special handling of global
9570         attributes (assembly, module).
9571         (AttributeSection.Emit): New method.
9572
9573         * class.cs: Implemented Attributable abstract methods.
9574         (MethodCore.LabelParameters): Moved to Parameter class.
9575         (Accessor): Is back simple class.
9576         (PropertyMethod): Implemented Attributable abstract class.
9577         (DelegateMethod): Implemented Attributable abstract class.
9578         (Event): New constructor for disctintion between normal Event
9579         and Event with accessors.
9580
9581         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9582
9583         * codegen.cs, const.cs, decl.cs, delegate.cs:
9584         (CommonAssemblyModulClass): Implemented Attributable abstract class
9585         and simplified.
9586
9587         * enum.cs: Implement IAttributeSupport interface.
9588         (EnumMember): New class for emum members. Implemented Attributable
9589         abstract class
9590
9591         * parameter.cs:
9592         (ParameterBase): Is abstract.
9593         (ReturnParameter): New class for easier [return:] attribute handling.
9594
9595         * typemanager.cs: Removed builder_to_attr.
9596
9597 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9598
9599         Fix bug #57151.
9600         * attribute.cs (Attribute.GetPositionalValue): New function.
9601         * class.cs (TypeContainer.VerifyMembers): New function.
9602         (TypeContainer.Emit): Use it.
9603         (ClassOrStruct): New base class for Class and Struct.
9604         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9605         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9606         class.
9607         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9608         then each non-static field should have a FieldOffset attribute.
9609         Otherwise, none of the fields should have a FieldOffset attribute.
9610         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9611         and FieldOffset attributes.
9612         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9613         (TypeManager.field_offset_attribute_type): New core types.
9614         (TypeManager.InitCoreTypes): Initialize them.
9615
9616 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9617
9618         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9619         Return correct type.
9620         From bug #58270.
9621
9622 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9623
9624         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9625         be implicitly converted to ulong.
9626         
9627         * expression.cs: The logic for allowing operator &, | and ^ worked
9628         was wrong, it worked before because we did not report an error in
9629         an else branch.  Fixes 57895.
9630
9631         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9632         allow volatile fields to be reference types.
9633
9634 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9635
9636         * driver.cs: Add support for /debug-
9637
9638 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9639
9640         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9641         Add a 'complain' parameter to silence errors.
9642         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9643         silently overlooked type-resolutions.
9644         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9645         to reflect changes.
9646         (Attributes.Search): New function.
9647         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9648         (Attributes.GetAttributeFullName): Remove hack.
9649         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9650         Update to reflect changes.
9651         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9652         Use Attributes.Search instead of nested loops.
9653
9654 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9655
9656         * decl.cs:
9657         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9658         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9659         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9660
9661         * report.cs: (Report.Warning): Renamed to Warning_T because of
9662         parameter collision.
9663
9664 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9665
9666         * expression.cs (MemberAccess.ResolveMemberAccess):
9667         Exit with non-zero status after Report.Error.
9668         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9669         Likewise.
9670         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9671
9672 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9673
9674         * support.cs: Don't hang when the file is empty.
9675
9676 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9677
9678         * support.cs: In SeekableStreamReader, compute the preamble size of the
9679           underlying stream. Position changes should take into account that initial
9680           count of bytes.
9681
9682 2004-05-03  Todd Berman  <tberman@sevenl.net>
9683
9684         * driver.cs: remove unused GetSysVersion function.
9685
9686 2004-05-03  Todd Berman  <tberman@sevenl.net>
9687
9688         * driver.cs: Remove the hack from saturday, as well as the hack
9689         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9690         link_paths to get that bit proper.
9691
9692 2004-05-01  Todd Berman  <tberman@sevenl.net>
9693
9694         * driver.cs: Try a LoadFrom before a Load, this checks the current
9695         path. This is currently a bug in mono that is be fixed, however, this
9696         provides a workaround for now. This will be removed when the bug
9697         is fixed.
9698
9699 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9700
9701         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9702         incomplete key pairs (#57941).
9703
9704 2004-05-01  Todd Berman  <tberman@sevenl.net>
9705
9706         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9707         from the GAC
9708
9709 2004-04-30  Jackson Harper  <jackson@ximian.com>
9710
9711         * codegen.cs: Open keys readonly.
9712         
9713 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9714
9715         * typemanager.cs: don't report cyclic struct layout when a struct
9716         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9717         which has 2 Pango.Rectangle fields.
9718
9719 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9720
9721         * expression.cs: Handle IntPtr comparisons with IL code
9722         rather than a method call.
9723
9724 2004-04-29  Martin Baulig  <martin@ximian.com>
9725
9726         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9727         the list of PropertyInfo's in class hierarchy and find the
9728         accessor.  Fixes #56013.
9729
9730 2004-04-29  Martin Baulig  <martin@ximian.com>
9731
9732         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9733
9734 2004-04-29  Martin Baulig  <martin@ximian.com>
9735
9736         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9737
9738         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9739
9740 2004-04-29  Martin Baulig  <martin@ximian.com>
9741
9742         * class.cs (ConstructorInitializer.Resolve): Check whether the
9743         parent .ctor is accessible.  Fixes #52146.
9744
9745 2004-04-29  Martin Baulig  <martin@ximian.com>
9746
9747         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9748
9749         * statement.cs (Using.EmitLocalVariableDecls): Use
9750         TypeManager.idisposable_type, not typeof (IDisposable).
9751         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9752
9753 2004-04-29  Martin Baulig  <martin@ximian.com>
9754
9755         * class.cs (Event.Define): Don't emit the field and don't set
9756         RTSpecialName and SpecialName for events on interfaces.  Fixes
9757         #57703. 
9758
9759 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9760
9761         Refactor Attribute.ApplyAttributes.
9762         * attribute.cs (Attributable): New base class for objects that can
9763         have Attributes applied on them.
9764         (Attribute): Make AttributeUsage fields public.
9765         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9766         (Attribute.IsInternalCall): New property.
9767         (Attribute.UsageAttr): Convert to a public read-only property.
9768         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9769         (Attribute.ResolveType, Attribute.Resolve)
9770         (Attribute.ScanForIndexerName): Update to reflect changes.
9771         (Attribute.CheckAttributeTarget): Re-format.
9772         (Attribute.ApplyAttributes): Refactor, to various
9773         Attributable.ApplyAttributeBuilder methods.
9774         * decl.cs (MemberCore): Make Attributable.
9775         * class.cs (Accessor): Make Attributable.
9776         (MethodData.ApplyAttributes): Use proper attribute types, not
9777         attribute names.
9778         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9779         (TypeContainer.ApplyAttributeBuilder)
9780         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9781         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9782         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9783         (Operator.ApplyAttributeBuilder): New factored-out methods.
9784         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9785         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9786         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9787         * parameter.cs (ParameterBase): New Attributable base class
9788         that can also represent Return types.
9789         (Parameter): Update to the changes.
9790
9791 2004-04-29  Jackson Harper  <jackson@ximian.com>
9792
9793         * driver.cs: Prefer the corlib system version when looking for
9794         assemblies in the GAC. This is still a hack, but its a better hack
9795         now.
9796         
9797 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9798
9799         * decl.cs, enum.cs: Improved error 3005 reporting.
9800   
9801         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9802         (related_symbols): New private member for list of symbols
9803         related to reported error/warning.
9804         
9805         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9806
9807 2004-04-29  Martin Baulig  <martin@ximian.com>
9808
9809         * ecore.cs (Expression.Constantify): If we're an enum and
9810         TypeManager.TypeToCoreType() doesn't give us another type, use
9811         t.UnderlyingSystemType.  Fixes #56178.  
9812
9813 2004-04-29  Martin Baulig  <martin@ximian.com>
9814
9815         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9816         interfaces and for each interface, only add members directly
9817         declared in that interface.  Fixes #53255.
9818
9819 2004-04-28  Martin Baulig  <martin@ximian.com>
9820
9821         * expression.cs (ConditionalLogicalOperator): Use a temporary
9822         variable for `left' to avoid that we evaluate it more than once;
9823         bug #52588.
9824
9825 2004-04-28  Martin Baulig  <martin@ximian.com>
9826
9827         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9828         `void[]' (CS1547).
9829
9830 2004-04-28  Martin Baulig  <martin@ximian.com>
9831
9832         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9833         void (CS1547).
9834
9835         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9836         whether the type is not void (CS1547).
9837
9838 2004-04-28  Martin Baulig  <martin@ximian.com>
9839
9840         * expression.cs (Unary.DoResolveLValue): Override this and report
9841         CS0131 for anything but Operator.Indirection.
9842
9843 2004-04-28  Martin Baulig  <martin@ximian.com>
9844
9845         Committing a patch from Ben Maurer; see bug #50820.
9846
9847         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9848         check for classes.
9849
9850         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9851         classes.        
9852
9853 2004-04-28  Martin Baulig  <martin@ximian.com>
9854
9855         Committing a patch from Ben Maurer; see bug #50820.
9856
9857         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9858         check for classes.
9859
9860         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9861         classes.        
9862
9863 2004-04-28  Martin Baulig  <martin@ximian.com>
9864
9865         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9866         (Block.AddLabel): Call DoLookupLabel() to only search in the
9867         current block.
9868
9869 2004-04-28  Martin Baulig  <martin@ximian.com>
9870
9871         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9872         comparing StringConstants and NullLiterals in Equality and Inequality.
9873
9874 2004-04-28  Jackson Harper  <jackson@ximian.com>
9875
9876         * driver.cs: Attempt to load referenced assemblies from the
9877         GAC. This is the quick and dirty version of this method that
9878         doesnt take into account versions and just takes the first
9879         canidate found. Will be good enough for now as we will not have more
9880         then one version installed into the GAC until I update this method.
9881
9882 2004-04-28  Martin Baulig  <martin@ximian.com>
9883
9884         * typemanager.cs (TypeManager.CheckStructCycles): New public
9885         static method to check for cycles in the struct layout.
9886
9887         * rootcontext.cs (RootContext.PopulateTypes): Call
9888         TypeManager.CheckStructCycles() for each TypeContainer.
9889         [Note: We only need to visit each type once.]
9890
9891 2004-04-28  Martin Baulig  <martin@ximian.com>
9892
9893         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9894
9895         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9896         success and added `out object value'.  Use a `bool resolved' field
9897         to check whether we've already been called rather than
9898         `ConstantValue != null' since this breaks for NullLiterals.
9899
9900 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9901
9902         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9903         setting of this flag, since the 'set' method may be non-public.
9904
9905 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9906
9907         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9908         check on current_vector.Block.
9909
9910 2004-04-27  Martin Baulig  <martin@ximian.com>
9911
9912         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9913         a field initializer.  Fixes #56459.
9914
9915 2004-04-27  Martin Baulig  <martin@ximian.com>
9916
9917         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9918         we're not attempting to use an indexer.  Fixes #52154.
9919
9920 2004-04-27  Martin Baulig  <martin@ximian.com>
9921
9922         * statement.cs (Return): Don't create a return label if we don't
9923         need it; reverts my change from January 20th.  Thanks to Ben
9924         Maurer for this.
9925
9926 2004-04-27  Martin Baulig  <martin@ximian.com>
9927
9928         According to the spec, `goto' can only leave a nested scope, but
9929         never enter it.
9930
9931         * statement.cs (Block.LookupLabel): Only lookup in the current
9932         block, don't recurse into parent or child blocks.
9933         (Block.AddLabel): Check in parent and child blocks, report
9934         CS0140/CS0158 if we find a duplicate.
9935         (Block): Removed this indexer for label lookups.
9936         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9937         this already does the error reporting for us.
9938
9939         * flowanalysis.cs
9940         (FlowBranching.UsageVector.Block): New public variable; may be null.
9941         (FlowBranching.CreateSibling): Added `Block' argument.
9942         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9943         label for the target of a `goto' and check whether we're not
9944         leaving a `finally'.
9945
9946 2004-04-27  Martin Baulig  <martin@ximian.com>
9947
9948         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9949         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9950         just for returns).
9951
9952 2004-04-27  Martin Baulig  <martin@ximian.com>
9953
9954         * statement.cs (Block.AddLabel): Also check for implicit blocks
9955         and added a CS0158 check.
9956
9957 2004-04-27  Martin Baulig  <martin@ximian.com>
9958
9959         * flowanalysis.cs (FlowBranchingLoop): New class.
9960         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9961         UsageVector's instead of an ArrayList.
9962         (FlowBranching.Label): Likewise.
9963         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9964         (FlowBranching.AddBreakVector): New method.
9965
9966 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9967
9968         * attribute.cs: Small regression fix: only convert the type if we
9969         the type is different, fixes System.Drawing build.
9970
9971 2004-04-27  Martin Baulig  <martin@ximian.com>
9972
9973         * attribute.cs (Attribute.Resolve): If we have a constant value
9974         for a named field or property, implicity convert it to the correct
9975         type.
9976
9977 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9978
9979         * statement.cs (Block.Block): Implicit blocks share
9980         'child_variable_names' fields with parent blocks.
9981         (Block.AddChildVariableNames): Remove.
9982         (Block.AddVariable): Mark variable as "used by a child block" in
9983         every surrounding block.
9984         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9985         been used in a child block, complain about violation of "Invariant
9986         meaning in blocks" rule.
9987         * cs-parser.jay (declare_local_variables): Don't use
9988         AddChildVariableNames.
9989         (foreach_statement): Don't create an implicit block: 'foreach'
9990         introduces a scope.
9991
9992 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9993
9994         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9995         converting from 0L to ulong.  Fixes 57522.
9996
9997 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9998
9999         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10000         derived class hides via 'new' keyword field from base class (test-242.cs).
10001         TODO: Handle this in the more general way.
10002         
10003         * class.cs (CheckBase): Ditto.
10004
10005 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10006
10007         * decl.cs (caching_flags): New member for storing cached values
10008         as bit flags.
10009         (MemberCore.Flags): New enum where bit flags for caching_flags
10010         are defined.
10011         (MemberCore.cls_compliance): Moved to caching_flags.
10012         (DeclSpace.Created): Moved to caching_flags.
10013
10014         * class.cs: Use caching_flags instead of DeclSpace.Created
10015         
10016 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10017
10018         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10019         if we are only a derived class, not a nested class.
10020
10021         * typemanager.cs: Same as above, but do this at the MemberLookup
10022         level (used by field and methods, properties are handled in
10023         PropertyExpr).   Allow for the qualified access if we are a nested
10024         method. 
10025
10026 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10027
10028         * class.cs: Refactoring.
10029         (IMethodData): New inteface; Holds links to parent members
10030         to avoid member duplication (reduced memory allocation).
10031         (Method): Implemented IMethodData interface.
10032         (PropertyBase): New inner classes for get/set methods.
10033         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10034         (Event): New inner classes for add/remove methods.
10035         (Event.DelegateMethod): Implemented IMethodData interface.
10036
10037         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10038         EmitContext (related to class.cs refactoring).
10039
10040 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10041
10042         * delegate.cs (Delegate.VerifyApplicability): If the number of
10043         arguments are the same as the number of parameters, first try to
10044         verify applicability ignoring  any 'params' modifier on the last
10045         parameter.
10046         Fixes #56442.
10047
10048 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10049
10050         * class.cs (TypeContainer.AddIndexer): Use
10051         'ExplicitInterfaceName' to determine if interface name was
10052         explicitly specified.  'InterfaceType' is not initialized at this time.
10053         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10054         Indexers array is already in the required order.  Initialize
10055         'IndexerName' only if there are normal indexers.
10056         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10057         (TypeContainer.Emit): Emit DefaultMember attribute only if
10058         IndexerName is initialized.
10059         Fixes #56300.
10060
10061 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10062
10063         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10064         Fixes #57007
10065
10066 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10067
10068         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10069         attributes.
10070         Fix for #56456.
10071
10072         * attribute.cs (Attribute.Resolve): Check for duplicate named
10073         attributes.
10074         Fix for #56463.
10075
10076 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10077
10078         * iterators.cs (MarkYield): track whether we are in an exception,
10079         and generate code accordingly.  Use a temporary value to store the
10080         result for our state.
10081
10082         I had ignored a bit the interaction of try/catch with iterators
10083         since their behavior was not entirely obvious, but now it is
10084         possible to verify that our behavior is the same as MS .NET 2.0
10085
10086         Fixes 54814
10087
10088 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10089
10090         * iterators.cs: Avoid creating temporaries if there is no work to
10091         do. 
10092
10093         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10094         Enumerations, use TypeManager.EnumToUnderlying and call
10095         recursively. 
10096
10097         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10098         bug #57013
10099
10100         (This.Emit): Use EmitContext.EmitThis to emit our
10101         instance variable.
10102
10103         (This.EmitAssign): Ditto.
10104
10105         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10106         codepaths, we will move all the functionality into
10107         Mono.CSharp.This 
10108
10109         (FieldExpr.EmitAssign): Ditto.
10110
10111         This fixes several hidden bugs that I uncovered while doing a code
10112         review of this today.
10113
10114         * codegen.cs (EmitThis): reworked so the semantics are more clear
10115         and also support value types "this" instances.
10116
10117         * iterators.cs: Changed so that for iterators in value types, we
10118         do not pass the value type as a parameter.  
10119
10120         Initialization of the enumerator helpers is now done in the caller
10121         instead of passing the parameters to the constructors and having
10122         the constructor set the fields.
10123
10124         The fields have now `assembly' visibility instead of private.
10125
10126 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10127
10128         * expression.cs (Argument.Resolve): Check if fields passed as ref
10129         or out are contained in a MarshalByRefObject.
10130
10131         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10132         another compiler type.
10133
10134 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10135
10136         * class.cs (Indexer.Define): use the new name checking method.
10137         Also, return false on an error.
10138         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10139         (is_identifier_[start/part]_character): make static.
10140
10141 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * expression.cs (Binary.ResolveOperator): Do no append strings
10144         twice: since we can be invoked more than once (array evaluation)
10145         on the same concatenation, take care of this here.  Based on a fix
10146         from Ben (bug #56454)
10147
10148 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10149
10150         * codegen.cs: Fix another case where CS1548 must be reported (when 
10151         delay-sign isn't specified and no private is available #56564). Fix
10152         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10153         error when MCS is used on the MS runtime and we need to delay-sign 
10154         (which seems unsupported by AssemblyBuilder - see #56621).
10155
10156 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10157
10158         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10159         (TypeManager.ComputeNamespaces): Faster implementation for
10160         Microsoft runtime.
10161
10162         * compiler.csproj: Updated AssemblyName to mcs.
10163
10164 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10165
10166         * rootcontext.cs: Add new types to the boot resolution.
10167
10168         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10169         MulticastDelegate is not allowed.
10170
10171         * typemanager.cs: Add new types to lookup: System.TypedReference
10172         and ArgIterator.
10173
10174         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10175         check for TypedReference or ArgIterator, they are not allowed. 
10176
10177         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10178         makes us properly catch 1510 in some conditions (see bug 56016 for
10179         details). 
10180
10181 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10182
10183         * CryptoConvert.cs: update from corlib version
10184         with endian fixes.
10185
10186 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10187
10188         * class.cs (Indexer.Define): Check indexername declaration
10189
10190 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10191
10192         * attribute.cs (IsClsCompliant): Fixed problem with handling
10193         all three states (compliant, not-compliant, undetected).
10194
10195 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10196
10197         * attribute.cs (Attribute): Location is now public.
10198         (Resolve): Store resolved arguments (pos_values) in attribute class.
10199         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10200         (GetClsCompliantAttributeValue): New method that gets
10201         CLSCompliantAttribute value.
10202         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10203         if exists else null.
10204         (AttributeTester): New class for CLS-Compliant verification routines.
10205
10206         * class.cs (Emit): Add CLS-Compliant verification.
10207         (Method.GetSignatureForError): Implemented.
10208         (Constructor.GetSignatureForError): Implemented
10209         (Constructor.HasCompliantArgs): Returns if constructor has
10210         CLS-Compliant arguments.
10211         (Constructor.Emit): Override.
10212         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10213         is needed to test only parameters.
10214         (FieldBase.GetSignatureForError): Implemented.
10215         (TypeContainer): New member for storing base interfaces.
10216         (TypeContainer.FindMembers): Search in base interfaces too.
10217
10218         * codegen.cs (GetClsComplianceAttribute): New method that gets
10219         assembly or module CLSCompliantAttribute value.
10220         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10221         for assembly.
10222         (ModuleClass.Emit): Add error 3012 test.
10223
10224         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10225
10226         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10227         state for all decl types.
10228         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10229         if CLS-Compliant tests are required.
10230         (IsClsCompliaceRequired): New method. Analyze whether code
10231         must be CLS-Compliant.
10232         (IsExposedFromAssembly): New method. Returns true when MemberCore
10233         is exposed from assembly.
10234         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10235         value or gets cached value.
10236         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10237         is explicitly marked with CLSCompliantAttribute.
10238         (IsIdentifierClsCompliant): New abstract method. This method is
10239         used to testing error 3005.
10240         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10241         for identifier and parameters CLS-Compliant testing.
10242         (VerifyClsCompliance): New method. The main virtual method for
10243         CLS-Compliant verifications.
10244         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10245         null. I don't know why is null (too many public members !).
10246         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10247         and get value of first CLSCompliantAttribute that found.
10248
10249         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10250         (VerifyClsCompliance): Override and add extra tests.
10251
10252         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10253         clscheck- disable CLS-Compliant verification event if assembly is has
10254         CLSCompliantAttribute(true).
10255
10256         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10257         ApllyAttribute is now called in emit section as in the other cases.
10258         Possible future Emit integration.
10259         (IsIdentifierClsCompliant): New override.
10260         (VerifyClsCompliance): New override.
10261         (GetEnumeratorName): Returns full enum name.
10262
10263         * parameter.cs (GetSignatureForError): Implemented.
10264
10265         * report.cs (WarningData): New struct for Warning message information.
10266         (LocationOfPreviousError): New method.
10267         (Warning): New method. Reports warning based on the warning table.
10268         (Error_T): New method. Reports error based on the error table.
10269
10270         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10271         verifications are done here.
10272
10273         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10274
10275         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10276         CLSCompliantAttribute.
10277         (all_imported_types): New member holds all imported types from other
10278         assemblies.
10279         (LoadAllImportedTypes): New method fills static table with exported types
10280         from all referenced assemblies.
10281         (Modules): New property returns all assembly modules.
10282
10283 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10284
10285         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10286         throwing a parser error.
10287
10288         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10289         which removes the hardcoded get_/set_ prefixes for properties, as
10290         IL allows for the properties to be named something else.  
10291
10292         Bug #56013
10293
10294         * expression.cs: Do not override operand before we know if it is
10295         non-null.  Fix 56207
10296
10297 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10298
10299         * typemanager.cs: support for pinned variables.
10300
10301 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10302
10303         * decl.cs, typemanager.cs: Avoid using an arraylist
10304         as a buffer if there is only one result set.
10305
10306 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10307
10308         * expression.cs: Make sure you cant call a static method
10309         with an instance expression, bug #56174.
10310
10311 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10312
10313         * class.cs (IsDuplicateImplementation): Improve error reporting to
10314         flag 663 (method only differs in parameter modifier).
10315
10316         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10317         in preprocessor directives.
10318
10319         * location.cs (LookupFile): Allow for the empty path.
10320
10321         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10322         better approach for some of that patch, but its failing with the
10323         CharSet enumeration.  For now try/catch will do.
10324
10325         * typemanager.cs: Do not crash if a struct does not have fields.
10326         Fixes 56150.
10327
10328 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10329
10330         * expression.cs: cs0213, cant fix a fixed expression.
10331         fixes 50231.
10332
10333 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10334
10335         * cs-parser.jay: detect invalid embeded statements gracefully.
10336         bug #51113.
10337
10338 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10339
10340         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10341         As a regex:
10342         s/
10343         the invocation type may not be a subclass of the tye of the item/
10344         The type of the item must be a subclass of the invocation item.
10345         /g
10346
10347         Fixes bug #50820.
10348
10349 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10350
10351         * attribute.cs: Added methods to get a string and a bool from an
10352         attribute. Required to information from AssemblyKeyFileAttribute,
10353         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10354         * codegen.cs: Modified AssemblyName creation to include support for
10355         strongnames. Catch additional exceptions to report them as CS1548.
10356         * compiler.csproj: Updated include CryptoConvert.cs.
10357         * compiler.csproj.user: Removed file - user specific configuration.
10358         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10359         Mono.Security assembly. The original class is maintained and tested in
10360         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10361         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10362         like CSC 8.0 (C# v2) supports.
10363         * Makefile: Added CryptoConvert.cs to mcs sources.
10364         * rootcontext.cs: Added new options for strongnames.
10365
10366 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10367
10368         * driver.cs: For --expect-error, report error code `2'
10369         if the program compiled with no errors, error code `1' if
10370         it compiled with an error other than the one expected.
10371
10372 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10373
10374         * compiler.csproj: Updated for Visual Studio .NET 2003.
10375         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10376         * compiler.sln: Updated for Visual Studio .NET 2003.
10377
10378 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10379
10380         * expression.cs: Fix bug #47234. We basically need to apply the
10381         rule that we prefer the conversion of null to a reference type
10382         when faced with a conversion to 'object' (csc behaviour).
10383
10384 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10385
10386         * statement.cs: Shorter form for foreach, eliminates
10387         a local variable. r=Martin.
10388
10389 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10390
10391         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10392         checks if we can use brtrue/brfalse to test for 0.
10393         * expression.cs: use the above in the test for using brtrue/brfalse.
10394         cleanup code a bit.
10395
10396 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10397
10398         * expression.cs: Rewrite string concat stuff. Benefits:
10399
10400         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10401         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10402         rather than a concat chain.
10403
10404         * typemanager.cs: Add lookups for more concat overloads.
10405
10406 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10407
10408         * expression.cs: Emit shorter il code for array init.
10409
10410         newarr
10411         dup
10412         // set 1
10413
10414         // set 2
10415
10416         newarr
10417         stloc.x
10418
10419         ldloc.x
10420         // set 1
10421
10422         ldloc.x
10423         // set 2
10424
10425 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10426
10427         * statement.cs: Before, two switch blocks would be merged if the
10428         total size of the blocks (end_item - begin_item + 1) was less than
10429         two times the combined sizes of the blocks.
10430
10431         Now, it will only merge if after the merge at least half of the
10432         slots are filled.
10433
10434         fixes 55885.
10435
10436 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10437
10438         * class.cs : csc build fix for GetMethods(). See bug #52503.
10439
10440 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10441
10442         * expression.cs: Make sure fp comparisons work with NaN.
10443         This fixes bug #54303. Mig approved this patch a long
10444         time ago, but we were not able to test b/c the runtime
10445         had a related bug.
10446
10447 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10450
10451 2004-03-19  Martin Baulig  <martin@ximian.com>
10452
10453         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10454         error here and not in our caller.
10455
10456 2004-03-19  Martin Baulig  <martin@ximian.com>
10457
10458         * interface.cs: Completely killed this file.
10459         (Interface): We're now a TypeContainer and live in class.cs.
10460
10461         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10462         argument; we're now also called for interfaces.
10463         (TypeContainer.DefineMembers): Allow this method being called
10464         multiple times.
10465         (TypeContainer.GetMethods): New public method; formerly known as
10466         Interface.GetMethod().  This is used by PendingImplementation.
10467         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10468         it's now private and non-static.
10469         (Interface): Moved this here; it's now implemented similar to
10470         Class and Struct.
10471         (Method, Property, Event, Indexer): Added `bool is_interface'
10472         argument to their .ctor's.
10473         (MemberBase.IsInterface): New public field.
10474
10475         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10476         instances instead of InterfaceMethod, InterfaceProperty, etc.
10477         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10478         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10479
10480 2004-03-19  Martin Baulig  <martin@ximian.com>
10481
10482         * class.cs (MethodCore.IsDuplicateImplementation): New private
10483         method which does the CS0111 checking.
10484         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10485         Use IsDuplicateImplementation().
10486
10487 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10488
10489         * decl.cs (FindMemberToOverride): New method to find the correct
10490         method or property to override in the base class.
10491         * class.cs
10492             - Make Method/Property use the above method to find the
10493               version in the base class.
10494             - Remove the InheritableMemberSignatureCompare as it is now
10495               dead code.
10496
10497         This patch makes large code bases much faster to compile, as it is
10498         O(n) rather than O(n^2) to do this validation.
10499
10500         Also, it fixes bug 52458 which is that nested classes are not
10501         taken into account when finding the base class member.
10502
10503         Reviewed/Approved by Martin.
10504
10505 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10506
10507         * interface.cs: In all interface classes removed redundant
10508         member initialization.
10509
10510 2004-03-16  Martin Baulig  <martin@ximian.com>
10511
10512         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10513
10514 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10515
10516         * decl.cs (DefineTypeAndParents): New helper method to define a
10517         type's containers before the type itself is defined;  This is a
10518         bug exposed by the recent changes to Windows.Forms when an
10519         implemented interface was defined inside a class that had not been
10520         built yet.   
10521
10522         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10523
10524         (Check): Loop correctly to report errors modifiers
10525         (UNSAFE was not in the loop, since it was the same as TOP).
10526
10527         * interface.cs: Every interface member now takes a ModFlags,
10528         instead of a "is_new" bool, which we set on the base MemberCore. 
10529
10530         Every place where we called "UnsafeOk" in the interface, now we
10531         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10532         the unsafe settings from the member declaration instead of the
10533         container interface. 
10534
10535         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10536
10537         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10538         `set_indexer_name' to the pending bits (one per type).
10539
10540         We fixed a bug today that was picking the wrong method to
10541         override, since for properties the existing InterfaceMethod code
10542         basically ignored the method name.  Now we make sure that the
10543         method name is one of the valid indexer names.
10544
10545 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10546  
10547         * support.cs (SeekableStreamReader): Keep track of stream byte
10548         positions and don't mix them with character offsets to the buffer.
10549
10550         Patch from Gustavo Giráldez
10551
10552 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10553
10554         * interface.cs (InterfaceSetGetBase): Removed double member
10555         initialization, base class does it as well.
10556
10557 2004-03-13  Martin Baulig  <martin@ximian.com>
10558
10559         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10560         when compiling corlib.
10561
10562 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10563
10564         * convert.cs (ExplicitConversion): We were reporting an error on
10565         certain conversions (object_type source to a value type, when the
10566         expression was `null') before we had a chance to pass it through
10567         the user defined conversions.
10568
10569         * driver.cs: Replace / and \ in resource specifications to dots.
10570         Fixes 50752
10571
10572         * class.cs: Add check for duplicate operators.  Fixes 52477
10573
10574 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10575
10576         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10577         that are in the middle of the statements, not only at the end.
10578         Fixes #54987
10579
10580         * class.cs (TypeContainer.AddField): No longer set the
10581         `HaveStaticConstructor' flag, now we call it
10582         `UserDefineStaticConstructor' to diferentiate the slightly
10583         semantic difference.
10584
10585         The situation is that we were not adding BeforeFieldInit (from
10586         Modifiers.TypeAttr) to classes that could have it.
10587         BeforeFieldInit should be set to classes that have no static
10588         constructor. 
10589
10590         See:
10591
10592         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10593
10594         And most importantly Zoltan's comment:
10595
10596         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10597
10598         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10599          before its static fields are used', i.e. initialization does not need
10600          to be triggered by the first access to the type. Setting this flag
10601          helps the JIT to compile better code, since it can run the static
10602          constructor at JIT time, and does not need to generate code to call it
10603          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10604          this flag for lots of classes like String. 
10605          
10606          csc sets this flag if the type does not have an explicit static 
10607          constructor. The reasoning seems to be that if there are only static
10608          initalizers for a type, and no static constructor, then the programmer
10609          does not care when this initialization happens, so beforefieldinit
10610          can be used.
10611          
10612          This bug prevents the AOT compiler from being usable, since it 
10613          generates so many calls to mono_runtime_class_init that the AOT code
10614          is much slower than the JITted code. The JITted code is faster, 
10615          because it does not generate these calls if the vtable is type is
10616          already initialized, which is true in the majority of cases. But the
10617          AOT compiler can't do this."
10618
10619 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * class.cs (MethodData.Emit): Refactor the code so symbolic
10622         information is generated for destructors;  For some reasons we
10623         were taking a code path that did not generate symbolic information
10624         before. 
10625
10626 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10627
10628         * class.cs: Create a Constructor.CheckBase method that
10629         takes care of all validation type code. The method
10630         contains some code that was moved from Define.
10631
10632         It also includes new code that checks for duplicate ctors.
10633         This fixes bug #55148.
10634
10635 2004-03-09  Joshua Tauberer <tauberer@for.net>
10636
10637         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10638         a { ... }-style array creation invokes EmitStaticInitializers
10639         which is not good for reference-type arrays.  String, decimal
10640         and now null constants (NullCast) are not counted toward
10641         static initializers.
10642
10643 2004-03-05  Martin Baulig  <martin@ximian.com>
10644
10645         * location.cs (SourceFile.HasLineDirective): New public field;
10646         specifies whether the file contains or is referenced by a "#line"
10647         directive.
10648         (Location.DefineSymbolDocuments): Ignore source files which
10649         either contain or are referenced by a "#line" directive.        
10650
10651 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10652
10653         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10654         direct access to our parent, so check the method inline there.
10655
10656 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10657
10658         * expression.cs (Invocation.EmitCall): Miguel's last commit
10659         caused a regression. If you had:
10660
10661             T t = null;
10662             t.Foo ();
10663
10664         In Foo the implict this would be null.
10665
10666 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10667
10668         * expression.cs (Invocation.EmitCall): If the method is not
10669         virtual, do not emit a CallVirt to it, use Call.
10670
10671         * typemanager.cs (GetFullNameSignature): Improve the method to
10672         cope with ".ctor" and replace it with the type name.
10673
10674         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10675         as an argument the ConstructorBuilder where it is being defined,
10676         to catch the recursive constructor invocations.
10677
10678 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10679
10680         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10681         routines to check if a type is an enumerable/enumerator allow
10682         classes that implement the IEnumerable or IEnumerator interfaces.
10683
10684         * class.cs (Property, Operator): Implement IIteratorContainer, and
10685         implement SetYields.
10686
10687         (Property.Define): Do the block swapping for get_methods in the
10688         context of iterators.   We need to check if Properties also
10689         include indexers or not.
10690
10691         (Operator): Assign the Block before invoking the
10692         OperatorMethod.Define, so we can trigger the Iterator code
10693         replacement. 
10694
10695         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10696         Property and Operator classes are not created when we parse the
10697         declarator but until we have the block completed, so we use a
10698         singleton SimpleIteratorContainer.Simple to flag whether the
10699         SetYields has been invoked.
10700
10701         We propagate this setting then to the Property or the Operator to
10702         allow the `yield' to function.
10703
10704 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10705
10706         * codegen.cs: Implemented attribute support for modules.
10707         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10708         Assembly/Module functionality.
10709
10710         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10711         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10712         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10713
10714 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10715
10716         * interface.cs (FindMembers): The operation is performed on all base
10717         interfaces and not only on the first. It is required for future CLS Compliance patch.
10718
10719 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10720
10721         * statement.cs, codegen.cs:
10722         This patch deals with patterns such as:
10723
10724         public class List : IEnumerable {
10725
10726                 public MyEnumerator GetEnumerator () {
10727                         return new MyEnumerator(this);
10728                 }
10729
10730                 IEnumerator IEnumerable.GetEnumerator () {
10731                         ...
10732                 }
10733                 
10734                 public struct MyEnumerator : IEnumerator {
10735                         ...
10736                 }
10737         }
10738
10739         Before, there were a few things we did wrong:
10740         1) we would emit callvirt on a struct, which is illegal
10741         2) we emited ldarg when we needed to emit ldarga
10742         3) we would mistakenly call the interface methods on an enumerator
10743         type that derived from IEnumerator and was in another assembly. For example:
10744
10745         public class MyEnumerator : IEnumerator
10746
10747         Would have the interface methods called, even if there were public impls of the
10748         method. In a struct, this lead to invalid IL code.
10749
10750 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10751
10752         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10753           renamed to Emit.
10754
10755         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10756
10757 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * cs-parser.jay: Fix small regression: we were not testing V2
10760         compiler features correctly.
10761
10762         * interface.cs: If the emit context is null, then create one
10763
10764 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10765
10766         * decl.cs (GetSignatureForError): New virtual method to get full name
10767           for error messages.
10768
10769         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10770           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10771
10772         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10773           Duplicated members and code in these classes has been removed.
10774           Better encapsulation in these classes.
10775
10776 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10777
10778         * assign.cs (Assign.DoResolve): When dealing with compound
10779         assignments, there is a new rule in ECMA C# 2.4 (might have been
10780         there before, but it is documented here) that states that in:
10781
10782         a op= b;
10783
10784         If b is of type int, and the `op' is a shift-operator, then the
10785         above is evaluated as:
10786
10787         a = (int) a op b 
10788
10789         * expression.cs (Binary.ResolveOperator): Instead of testing for
10790         int/uint/long/ulong, try to implicitly convert to any of those
10791         types and use that in pointer arithmetic.
10792
10793         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10794         method to print information for from the type, not from the
10795         null-method we were given.
10796
10797 2004-02-01  Duncan Mak  <duncan@ximian.com>
10798
10799         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10800         parsing for cmd, fixes bug #53694.
10801
10802 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10803
10804         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10805         in the member name duplication tests. Property and operator name duplication
10806         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10807
10808 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10809
10810         * interface.cs (PopulateMethod): Fixed crash when interface method
10811         returns not existing type (error test cs0246-3.cs).
10812
10813 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10814
10815         * cs-parser.jay (interface_accessors): Re-write actions to also
10816         store attributes attached to get and set methods. Fix spelling
10817         while at it.
10818
10819         (inteface_property_declaration): Modify accordingly.
10820
10821         (InterfaceAccessorInfo): New helper class to store information to pass
10822         around between rules that use interface_accessors.
10823
10824         * interface.cs (Emit): Apply attributes on the get and set
10825         accessors of properties and indexers too.
10826
10827         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10828         right MethodBuilder when applying attributes to the get and set accessors.
10829
10830 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10831
10832         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10833
10834 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10835
10836         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10837
10838 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10839
10840         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10841         changes that treat `yield' specially when present before `break'
10842         or `return' tokens.
10843
10844         * cs-tokenizer.cs: yield is no longer a keyword.
10845
10846 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10847
10848         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10849         setting for default constructors.
10850         For default constructors are almost every time set wrong Modifier. The
10851         generated IL code has been alright. But inside mcs this values was
10852         wrong and this was reason why several of my CLS Compliance tests
10853         failed.
10854
10855 2004-01-22  Martin Baulig  <martin@ximian.com>
10856
10857         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10858         not a QualifiedIdentifier.  This is what `type_name_expression'
10859         was previously doing.
10860         (type_name_expression): Removed; the code is now in
10861         `namespace_or_type_name'.
10862         (qualified_identifier): Removed, use `namespace_or_type_name'
10863         instead.
10864         (QualifiedIdentifier): Removed this class.      
10865
10866 2004-01-22  Martin Baulig  <martin@ximian.com>
10867
10868         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10869         not a string as alias name.
10870
10871 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10874         #52730 bug, and instead compute correctly the need to use a
10875         temporary variable when requesting an address based on the
10876         static/instace modified of the field and the constructor.
10877  
10878 2004-01-21  Martin Baulig  <martin@ximian.com>
10879
10880         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10881         class and namespace before looking up aliases.  Fixes #52517.
10882
10883 2004-01-21  Martin Baulig  <martin@ximian.com>
10884
10885         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10886         assinged in a 'try'; fixes exception4.cs.
10887
10888 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10889         * class.cs : Implemented parameter-less constructor for TypeContainer
10890
10891         * decl.cs: Attributes are now stored here. New property OptAttributes
10892
10893         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10894
10895         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10896
10897 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10898
10899         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10900           (CSharpSignature): New method for indexer and property signature.
10901
10902 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10903
10904         * pending.cs (IsVirtualFilter): Faster implementation.
10905
10906 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10907
10908         * typemanager.cs: Avoid inclusion of same assembly more than once.
10909
10910 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10911
10912         * cs-parser.jay: Fixed problem where the last assembly attribute
10913           has been applied also to following declaration (class, struct, etc.)
10914           
10915 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10916
10917         * class.cs: Added error CS0538, CS0539 reporting.
10918         Fixed crash on Microsoft runtime when field type is void.
10919
10920         * cs-parser.jay: Added error CS0537 reporting.
10921
10922         * pending.cs: Added error CS0535 reporting.
10923         Improved error report for errors CS0536, CS0534.
10924
10925 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10926
10927         Merge a few bits from the Anonymous Method MCS tree.
10928
10929         * statement.cs (ToplevelBlock): New class for toplevel methods,
10930         will hold anonymous methods, lifted variables.
10931
10932         * cs-parser.jay: Create toplevel blocks for delegates and for
10933         regular blocks of code. 
10934
10935 2004-01-20  Martin Baulig  <martin@ximian.com>
10936
10937         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10938         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10939         and `NeedExplicitReturn'; added `IsLastStatement'.
10940         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10941         have a `ReturnLabel' or we're not unreachable.
10942
10943         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10944         child's reachability; don't just override ours with it.  Fixes
10945         #58058 (lluis's example).
10946         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10947         InFinally(), InLoop(), InSwitch() and
10948         BreakCrossesTryCatchBoundary() methods.
10949
10950         * statement.cs (Return): Do all error checking in Resolve().
10951         Unless we are the last statement in a top-level block, always
10952         create a return label and jump to it.
10953         (Break, Continue): Do all error checking in Resolve(); also make
10954         sure we aren't leaving a `finally'.
10955         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10956         statement in a top-level block.
10957         (Block.Flags): Added `IsDestructor'.
10958         (Block.IsDestructor): New public property.
10959
10960 2004-01-20  Martin Baulig  <martin@ximian.com>
10961
10962         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10963
10964 2004-01-20  Martin Baulig  <martin@ximian.com>
10965
10966         * statement.cs (Statement.ResolveUnreachable): New public method.
10967         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10968         (Block.Resolve): Resolve unreachable statements.
10969
10970 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10971
10972         * expression.cs: We need to fix the case where we do
10973         not have a temp variable here.
10974
10975         * assign.cs: Only expression compound assignments need
10976         temporary variables.
10977
10978 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10979
10980         * flowanalysis.cs: Reduce memory allocation in a few ways:
10981           - A block with no variables should not allocate a bit
10982             vector for itself.
10983           - A method with no out parameters does not need any tracking
10984             for assignment of the parameters, so we need not allocate
10985             any data for it.
10986           - The arrays:
10987                 public readonly Type[] VariableTypes;
10988                 public readonly string[] VariableNames;
10989             Are redundant. The data is already stored in the variable
10990             map, so we need not allocate another array for it.
10991           - We need to add alot of checks for if (params | locals) == null
10992             due to the first two changes.
10993
10994 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10995
10996         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10997         implement IMemoryLocation, we store a copy on a local variable and
10998         take the address of it.  Patch from Benjamin Jemlich
10999
11000         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11001         to use a special "type_name_expression" rule which reduces the
11002         number of "QualifiedIdentifier" classes created, and instead
11003         directly creates MemberAccess expressions.
11004
11005 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11006
11007         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11008         that fixes #52853.  Null literal assignment to ValueType
11009
11010         * class.cs (MethodData.Emit): Instead of checking the name of the
11011         method to determine if its a destructor, create a new derived
11012         class from Method called Destructor, and test for that.  
11013
11014         * cs-parser.jay: Create a Destructor object instead of a Method.  
11015
11016         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11017
11018         Fixes: 52933
11019
11020 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * expression.cs (Binary.ResolveOperator): Perform an implicit
11023         conversion from MethodGroups to their delegate types on the
11024         Addition operation.
11025
11026         * delegate.cs: Introduce a new class DelegateCreation that is the
11027         base class for `NewDelegate' and `ImplicitDelegateCreation',
11028         factor some code in here.
11029
11030         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11031         conversion from MethodGroups to compatible delegate types. 
11032
11033         * ecore.cs (Expression.Resolve): Do not flag error 654
11034         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11035         we allow conversions from MethodGroups to delegate types now.
11036
11037         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11038         assignments in v2 either.
11039
11040 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11041
11042         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11043         static read-only fields in ctors.
11044
11045         Applied patch from Benjamin Jemlich 
11046
11047         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11048
11049 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11050
11051         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11052         here to return true, as they can be used like this:
11053
11054                 (XXX) int.MEMBER ()
11055
11056         Fixed 49836 and all the other dups
11057
11058 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11059
11060         * driver.cs: Implement /win32res and /win32icon.
11061
11062 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * cs-parser.jay: Add a rule to improve error handling for the
11065         common mistake of placing modifiers after the type.
11066
11067 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11068
11069         * cs-parser.jay (interface_event_declaration): Catch
11070         initialization of events on interfaces, and report cs0068
11071
11072         * cs-parser.jay (interface_event_declaration): Catch
11073         initialization of events. 
11074
11075         * ecore.cs: Better report missing constructors.
11076
11077         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11078         the error reporting done in the wrong place.  Fix.
11079
11080         * expression.cs (Binary.ResolveOperator): Catch the 
11081         operator + (E x, E y) error earlier, and later allow for implicit
11082         conversions in operator +/- (E e, U x) from U to the underlying
11083         type of E.
11084
11085         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11086         52596, if the container class is abstract, the default constructor
11087         is protected otherwise its public (before, we were always public).
11088
11089         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11090         fixed statement.
11091
11092         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11093         Jemlich that fixes bug #52597, MCS was generating invalid code for
11094         idisposable structs.   Thanks to Ben for following up with this
11095         bug as well.
11096
11097 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11098
11099         * driver.cs: Allow assemblies without code to be generated, fixes
11100         52230.
11101
11102 2004-01-07  Nick Drochak <ndrochak@gol.com>
11103
11104         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11105
11106 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * cs-parser.jay: Add rules to improve error reporting if fields or
11109         methods are declared at the namespace level (error 116)
11110
11111         * Add rules to catch event add/remove
11112
11113 2004-01-04  David Sheldon <dave-mono@earth.li>
11114
11115   * expression.cs: Added matching ")" to error message for 
11116   CS0077
11117
11118 2004-01-03 Todd Berman <tberman@gentoo.org>
11119
11120         * ecore.cs, attribute.cs:
11121         Applying fix from #52429.
11122
11123 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11124
11125         * ecore.cs, expression.cs, statement.cs:
11126         Total rewrite of how we handle branching. We
11127         now handle complex boolean expressions with fewer
11128         jumps. As well if (x == 0) no longer emits a ceq.
11129
11130         if (x is Foo) is much faster now, because we generate
11131         better code.
11132
11133         Overall, we get a pretty big improvement on our benchmark
11134         tests. The code we generate is smaller and more readable.
11135
11136         I did a full two-stage bootstrap. The patch was reviewed
11137         by Martin and Miguel.
11138
11139 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11140
11141         * cs-parser.jay: Make primary_expression not take a QI.
11142         we dont need this because the member_access rule covers
11143         us here. So we replace the rule with just IDENTIFIER.
11144
11145         This has two good effects. First, we remove a s/r conflict.
11146         Second, we allocate many fewer QualifiedIdentifier objects.
11147
11148 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11149
11150         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11151         set the correct information via SRE. This prevents
11152         hanging on the MS runtime. Fixes #29374.
11153
11154 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11155
11156         * convert.cs: correctly handle conversions to value types
11157         from Enum and ValueType as unboxing conversions.
11158
11159         Fixes bug #52569. Patch by Benjamin Jemlich.
11160
11161 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11162
11163         * expression.cs (BetterConversion): Prefer int -> uint
11164         over int -> ulong (csc's behaviour). This fixed bug #52046.
11165
11166 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11167
11168         * decl.cs (MemberCache.FindMembers): now returns a
11169         MemberInfo [].
11170
11171         * typemanager.cs: In general, go with with ^^.
11172         (CopyNewMethods): take an IList.
11173         (RealMemberLookup): Only allocate an arraylist
11174         if we copy from two sets of methods.
11175
11176         This change basically does two things:
11177         1) Fewer array lists allocated due to CopyNewMethods.
11178         2) the explicit cast in MemberList costed ALOT.
11179
11180 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11181
11182         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11183         a hashtable to avoid needless string allocations when an identifier is
11184         used more than once (the common case).
11185
11186 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11187
11188         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11189         is broken, it will not return anything. So, we
11190         have to use the information we have in mcs to
11191         do the task.
11192
11193         * typemanager.cs: Add a cache for GetInterfaces,
11194         since this will now be used more often (due to ^^)
11195
11196         (GetExplicitInterfaces) New method that gets the
11197         declared, not effective, interfaces on a type
11198         builder (eg, if you have interface IFoo, interface
11199         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11200         { IBar }.
11201
11202         This patch makes MCS able to bootstrap itself on
11203         Windows again.
11204
11205 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11206
11207         * expression.cs: Remove the Nop's that Miguel put
11208         in by mistake.
11209
11210 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11211
11212         * report.cs, codegen.cs: Give the real stack trace to
11213         the error when an exception is thrown.
11214
11215 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11216
11217         * decl.cs: only allocate hashtables for ifaces if 
11218         it is an iface!
11219
11220 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11221
11222         * expression.cs: fix the error from cs0121-2.cs
11223         (a parent interface has two child interfaces that
11224         have a function with the same name and 0 params
11225         and the function is called through the parent).
11226
11227 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11228
11229         * class.cs, rootcontext.cs, typmanager.cs: do not
11230         leak pointers.
11231
11232 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11233
11234         * codegen.cs: remove stack for the ec flow branching.
11235         It is already a linked list, so no need.
11236
11237 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11238
11239         * Makefile: Allow custom profiler here.
11240
11241 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11242
11243         * typemanager.cs (LookupType):
11244           - Use a static char [], because split takes
11245             a param array for args, so it was allocating
11246             every time.
11247           - Do not store true in a hashtable, it boxes.
11248
11249 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11250
11251         * flowanalysis.cs: bytify common enums.
11252
11253 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11254
11255         * modifiers.cs: Add a new set of flags for the
11256         flags allowed on explicit interface impls.
11257         * cs-parser.jay: catch the use of modifiers in
11258         interfaces correctly.
11259         * class.cs: catch private void IFoo.Blah ().
11260
11261         All related to bug #50572.
11262
11263 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11264
11265         * decl.cs: Rewrite the consistant accessability checking.
11266         Accessability is not linear, it must be implemented in
11267         a tableish way. Fixes #49704.
11268
11269 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11270
11271         * expression.cs: Handle negation in a checked context.
11272         We must use subtraction from zero. Fixes #38674.
11273
11274 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11275
11276         * class.cs: Ignore static void main in DLLs.
11277         * rootcontext.cs: Handle the target type here,
11278         since we are have to access it from class.cs
11279         * driver.cs: account for the above.
11280
11281 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11282
11283         * report.cs: Give line numbers and files if available.
11284
11285 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11286
11287         * driver.cs: Implement /addmodule.
11288
11289         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11290         ModuleBuilders.
11291
11292 2003-12-20  Martin Baulig  <martin@ximian.com>
11293
11294         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11295         (FieldBase.IsAssigned): Removed this field.
11296         (FieldBase.SetAssigned): New public method.
11297         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11298
11299 2003-12-20  Martin Baulig  <martin@ximian.com>
11300
11301         * expression.cs (LocalVariableReference.DoResolve): Don't set
11302         `vi.Used' if we're called from DoResolveLValue().
11303
11304         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11305         returns the usage vector it just merged into the current one -
11306         pass this one to UsageWarning().
11307         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11308         of the `EmitContext', don't call this recursively on our children.
11309
11310 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11311
11312         * driver.cs: Implement /target:module.
11313
11314 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11315
11316         * support.cs (CharArrayHashtable): New helper class.
11317
11318         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11319         char arrays, not strings, so we can avoid creating a string in
11320         consume_identifier if the identifier is a keyword.
11321
11322 2003-12-16  Martin Baulig  <martin@ximian.com>
11323
11324         * statement.cs (LocalInfo.Assigned): Removed this property.
11325         (LocalInfo.Flags): Removed `Assigned'.
11326         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11327         and uses flow analysis.
11328         (Block.UsageWarning): Made this method private.
11329         (Block.Resolve): Call UsageWarning() if appropriate.
11330
11331         * expression.cs (LocalVariableReference.DoResolve): Always set
11332         LocalInfo.Used here.
11333
11334 2003-12-13  Martin Baulig  <martin@ximian.com>
11335
11336         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11337         any value here; we're now using flow analysis to figure out
11338         whether a statement/block returns a value.
11339
11340 2003-12-13  Martin Baulig  <martin@ximian.com>
11341
11342         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11343         working again.
11344         (FlowBranching.MergeFinally): Don't call
11345         `branching.CheckOutParameters()' here, this is called in
11346         MergeTopBlock().
11347         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11348         when adding the `finally' vector.       
11349
11350 2003-12-13  Martin Baulig  <martin@ximian.com>
11351
11352         * flowanalysis.cs
11353         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11354         actually work and also fix #48962.
11355
11356 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11357
11358         * decl.cs: Do not check System.Object for nested types,
11359         since we know it does not have any. Big bang for buck:
11360
11361         BEFORE:
11362            Run 1:   8.35 seconds
11363            Run 2:   8.32 seconds
11364            corlib:  17.99 seconds
11365         AFTER:
11366            Run 1:   8.17 seconds
11367            Run 2:   8.17 seconds
11368            corlib:  17.39 seconds
11369
11370 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11371
11372         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11373         time we are returning 0 members, so we save alot here.
11374
11375 2003-12-11  Martin Baulig  <martin@ximian.com>
11376
11377         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11378         `MergeChild()', also just take the `FlowBranching' as argument;
11379         call Merge() on it and return the result.
11380         (FlowBranching.Merge): We don't need to do anything if we just
11381         have one sibling.
11382
11383 2003-12-11  Martin Baulig  <martin@ximian.com>
11384
11385         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11386         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11387         Maurer for this idea.
11388
11389 2003-12-11  Martin Baulig  <martin@ximian.com>
11390
11391         * flowanalysis.cs (MergeResult): This class is now gone; we now
11392         use the `UsageVector' for this.  The reason for this is that if a
11393         branching just has one sibling, we don't need to "merge" them at
11394         all - that's the next step to do.
11395         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11396         `MergeResult'.
11397
11398 2003-12-11  Martin Baulig  <martin@ximian.com>
11399
11400         Reworked flow analyis and made it more precise and bug-free.  The
11401         most important change is that we're now using a special `Reachability'
11402         class instead of having "magic" meanings of `FlowReturns'.  I'll
11403         do some more cleanups and optimizations and also add some more
11404         documentation this week.
11405
11406         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11407         largely reworked this class.
11408         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11409         the new `Reachability' class instead of having "magic" values here.
11410         (FlowBranching): We're now using an instance of `Reachability'
11411         instead of having separate `Returns', `Breaks' etc. fields.
11412
11413         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11414         based on flow analysis; ignore the return value of block.Emit ().
11415
11416 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11417
11418         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11419         if they are private.
11420
11421 2003-12-09  Martin Baulig  <martin@ximian.com>
11422
11423         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11424         call them directly on the UsageVector.
11425
11426 2003-12-09  Martin Baulig  <martin@ximian.com>
11427
11428         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11429         Changed return type from `FlowReturns' to `Reachability'.
11430
11431 2003-12-09  Martin Baulig  <martin@ximian.com>
11432
11433         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11434         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11435         `Reachable' fields with a single `Reachability' one.
11436
11437 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11438
11439         * class.cs (FindMembers): Remove foreach's.
11440
11441         Bootstrap times:
11442
11443         BEFORE
11444                 Run 1:   8.74 seconds
11445                 Run 2:   8.71 seconds
11446
11447         AFTER
11448                 Run 1:   8.64 seconds
11449                 Run 2:   8.58 seconds
11450
11451
11452 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11453
11454         * cs-parser.jay:
11455         * gen-treedump.cs:
11456         * statement.cs:
11457         This patch does a few things:
11458                 1. EmptyStatement is now a singleton, so it is never reallocated.
11459                 2. All blah is EmptyStatement constructs have been changed to
11460                    blah == EmptyStatement.Value, which is much faster and valid
11461                    now that EmptyStatement is a singleton.
11462                 3. When resolving a block, rather than allocating a new array for
11463                    the non-empty statements, empty statements are replaced with
11464                    EmptyStatement.Value
11465                 4. Some recursive functions have been made non-recursive.
11466         Mainly the performance impact is from (3), however (1) and (2) are needed for
11467         this to work. (4) does not make a big difference in normal situations, however
11468         it makes the profile look saner.
11469
11470         Bootstrap times:
11471
11472         BEFORE
11473         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11474         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11475         Total memory allocated: 56397 KB
11476
11477         AFTER
11478         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11479         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11480         Total memory allocated: 55666 KB
11481
11482 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11483
11484         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11485         than the hashtable in a hashtable version
11486
11487         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11488         we always end up concating a string. This results in a huge perf
11489         loss, because many strings have to be tracked by the GC. In this
11490         patch, we first use a hashtable that works with two keys, so that
11491         the strings do not need to be concat'ed.
11492
11493         Bootstrap times:
11494         BEFORE
11495                 Run 1:   8.74 seconds
11496                 Run 2:   8.71 seconds
11497
11498         AFTER
11499                 Run 1:   8.65 seconds
11500                 Run 2:   8.56 seconds
11501
11502 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11503
11504         * Makefile: Add a new target `do-time' that does a quick and simple
11505         profile, leaving easy to parse output.
11506
11507 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11508
11509         * codegen.cs (Init): Create the dynamic assembly with 
11510         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11511
11512 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11513
11514         * support.cs: Make the PtrHashtable use only one
11515         instance of its comparer.
11516
11517 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11518
11519         * typemanager.cs: Fix lookup of GetNamespaces.
11520
11521 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11522
11523         * expression.cs: Removed redundant line.
11524
11525         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11526         ArrayLists, use for loops with bounds.  
11527
11528         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11529         arraylist.
11530
11531         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11532         arraylists, use for loop with bounds.
11533
11534         The above three changes give us a 0.071 second performance
11535         improvement out of 3.294 seconds down to 3.223.  On my machine
11536         the above changes reduced the memory usage by 1,387 KB during
11537         compiler bootstrap.
11538
11539         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11540         QualifiedIdentifiers.  Before we created a new string through
11541         concatenation, and mostly later on, the result would be
11542         manipulated by DecomposeQI through string manipulation.
11543
11544         This reduced the compiler memory usage for bootstrapping from
11545         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11546         compile times in 0.05 seconds.
11547
11548 2003-11-28  Dick Porter  <dick@ximian.com>
11549
11550         * support.cs: Do string compares with the Invariant culture.
11551
11552         * rootcontext.cs: 
11553         * gen-treedump.cs: 
11554         * expression.cs: 
11555         * driver.cs: 
11556         * decl.cs: 
11557         * codegen.cs: 
11558         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11559         the comparison is done with the Invariant culture.
11560
11561 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11564         GetEnumerator method.
11565
11566         (ProbeCollectionType): Iterate starting at the most specific type
11567         upwards looking for a GetEnumerator
11568
11569         * expression.cs: Shift count can be up to 31 for int/uint and 63
11570         for long/ulong.
11571
11572 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11573
11574         * statement.cs (Block.LookupLabel): Also look for the label on the
11575         children blocks.  Use a hash table to keep track of visited
11576         nodes. 
11577
11578         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11579         we actually did transform the other operand, otherwise fall back
11580         to the common codepath that casts to long.
11581
11582         * cs-tokenizer.cs: Use the same code pattern as the int case.
11583         Maybe I should do the parsing myself, and avoid depending on the
11584         Parse routines to get this done.
11585
11586 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11587
11588         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11589         which fixes bug 51347.  This time test it.
11590
11591         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11592         attributes for example can not tell the difference between these.
11593         The difference was only a syntax feature of the language. 
11594
11595         * attribute.cs: Apply attributes to delegates.
11596
11597         * delegate.cs: Call the apply attributes method.
11598
11599 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11600
11601         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11602         comparing 0 vs Byte.MinValue, not the value
11603
11604         (ImplicitConversionRequired): When reporting a conversion error,
11605         use error 31 to print out the constant error instead of the
11606         simpler 29.
11607
11608         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11609         which fixes bug 51347.
11610
11611 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11612
11613         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11614         which fixes the -warnaserror command line option.
11615
11616 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11617
11618         * cfold.cs (DoNumericPromotions): During constant folding of
11619         additions on UIntConstant, special case intconstants with
11620         IntConstants like we do on the expression binary operator. 
11621
11622 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11623
11624         * convert.cs (ImplicitReferenceConversion): We were missing a case
11625         (System.Enum are not value types or class types, so we need to
11626         classify them separatedly).
11627
11628         * driver.cs: We do not support error 2007.
11629
11630 2003-11-12 Jackson Harper <jackson@ximian.com>
11631
11632         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11633         system directory. Also use the full file name so users can
11634         libraries names mscorlib-o-tron.dll in a non system dir.
11635
11636 2003-11-10  Martin Baulig  <martin@ximian.com>
11637
11638         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11639         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11640         calling `ResolveType()' on them, directly assign their `Type'.
11641
11642 2003-11-08  Martin Baulig  <martin@ximian.com>
11643
11644         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11645         return value and the `out parent' parameter.
11646         (TypeContainer.DefineType): Moved the CS0644 check into
11647         GetClassBases().  Don't pass the interface types to the
11648         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11649         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11650
11651         * ecore.cs (TypeExpr.IsAttribute): New property.
11652         (TypeExpr.GetInterfaces): New method.
11653
11654         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11655         TypeExpr instead of a Type.
11656         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11657         (Interface.DefineType): Don't pass the interface types to the
11658         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11659         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11660
11661         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11662         instead of a `Type[]'.
11663         (TypeManager.RegisterBuilder): Likewise.
11664         (TypeManager.AddUserInterface): Likewise.
11665         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11666         `Type[]' and also return a `TypeExpr[]'.
11667         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11668
11669 2003-11-08  Martin Baulig  <martin@ximian.com>
11670
11671         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11672         Expression.     
11673
11674 2003-11-08  Martin Baulig  <martin@ximian.com>
11675
11676         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11677         TypeManager.ResolveExpressionTypes().
11678
11679         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11680         instead of an Expression.
11681         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11682         (TypeExpression): New public class; formerly known as `TypeExpr'.
11683
11684         * expression.cs (ComposedCast): Derive from TypeExpr.
11685
11686         * typemanager.cs (TypeManager.system_*_expr): These are now
11687         TypExpr's instead of Expression's.
11688         (TypeManager.ResolveExpressionTypes): New public static function;
11689         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11690         of them.        
11691
11692 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11693
11694         * expression.cs (New.DoResolve): Do not dereference value that
11695         might be a null return.
11696
11697         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11698         sure that the constant value has the right type.  Fixes an
11699         unreported bug, similar to 50425.
11700
11701         * const.cs (Const.LookupConstantValue): Call
11702         ImplicitStandardConversionExists before doing a conversion to
11703         avoid havng the TypeManager.ChangeType do conversions.
11704
11705         Reduced the number of casts used
11706
11707         (Const.ChangeType): New routine to enable reuse of the constant
11708         type changing code from statement.
11709
11710         * typemanager.cs (ChangeType): Move common initialization to
11711         static global variables.
11712
11713         Fixes #50425.
11714
11715         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11716         every value type to go through, even if it was void.  Fix that. 
11717
11718         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11719         character of the define, and the is_identifier_part_character for
11720         the rest of the string.
11721
11722 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11723
11724         * expression.cs (UnaryMutator.EmitCode): When I updated
11725         LocalVariableReference.DoResolve, I overdid it, and dropped an
11726         optimization done on local variable references.
11727
11728 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11729
11730         * ecore.cs: Convert the return from Ldlen into an int.
11731
11732 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11733
11734         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11735         the accessibility, this is a special case for toplevel non-public
11736         classes (internal for instance).
11737
11738 2003-10-20  Nick Drochak <ndrochak@gol.com>
11739
11740         * ecore.cs: Fix typo and build.  Needed another right paren.
11741
11742 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11743
11744         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11745         `internal' case regular and protected, but not allowing protected
11746         to be evaluated later.  Bug 49840
11747
11748 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11751         to kb.Nlast, and not the kb.nFirst to isolate the switch
11752         statement.
11753
11754         Extract the underlying type, so enumerations of long/ulong are
11755         treated like long/ulong.
11756
11757 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11758
11759         * expression.cs (New): Overload the meaning of RequestedType to
11760         track the possible creation of the NewDelegate type, since
11761         DoResolve is invoked more than once for new constructors on field
11762         initialization.
11763
11764         See bugs: #48800 and #37014
11765
11766         * cs-parser.jay (declare_local_constants): Take an arraylist
11767         instead of a single constant.
11768
11769         (local_constant_declaration): It should take a
11770         constant_declarators, not a constant_declarator.  Fixes 49487
11771
11772         * convert.cs: Fix error report.
11773
11774 2003-10-13 Jackson Harper <jackson@ximian.com>
11775
11776         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11777         bug #49611
11778
11779 2003-10-09  Martin Baulig  <martin@ximian.com>
11780
11781         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11782         to the .ctor.
11783         (MethodCore.DoDefineParameters): Removed the TypeContainer
11784         argument; use the DeclSpace which was passed to the .ctor instead.
11785         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11786         TypeContainer; we only need a DeclSpace here.
11787
11788 2003-10-09  Martin Baulig  <martin@ximian.com>
11789
11790         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11791         to the .ctor.
11792         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11793         EmitContext's .ctor.    
11794
11795 2003-10-09  Martin Baulig  <martin@ximian.com>
11796
11797         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11798         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11799         AsAccessible(), moved them as well.
11800
11801         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11802
11803 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11804
11805         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11806
11807 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11808
11809         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11810         generation for >=, as spotted by Paolo, bug 48679.  
11811         Patch from David Waite.
11812
11813         * cs-tokenizer.cs: Add handling for #pragma.
11814
11815         * cs-parser.jay: Allow for both yield and yield return in the
11816         syntax.  The anti-cobolization of C# fight will go on!
11817
11818         * class.cs (TypeBuilder.DefineType): Catch error condition here
11819         (Parent.DefineType erroring out and returning null).
11820
11821         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11822         coping with enumerations variables, we were mistakenly processing
11823         them as a regular value type instead of built-in types.  Fixes the
11824         bug #48063
11825
11826         * typemanager.cs (IsBuiltinOrEnum): New method.
11827
11828 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11829
11830         * cs-parser.jay: Upgrade: yield now needs the return clause.
11831
11832 2003-09-19  Martin Baulig  <martin@ximian.com>
11833
11834         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11835         `MemberCache parent' argument.  Normally, an interface doesn't
11836         have a parent type except System.Object, but we use this in gmcs
11837         for generic type parameters.
11838
11839 2003-09-18  Martin Baulig  <martin@ximian.com>
11840
11841         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11842         on `type.IsInterface'; don't check whether the type has a parent
11843         to determine whether it's an interface.
11844
11845 2003-09-15  Martin Baulig  <martin@ximian.com>
11846
11847         * class.cs (TypeContainer.DefineType): Added an error flag to
11848         avoid reporting duplicate CS0146's ("class definition is
11849         circular.").
11850
11851         * driver.cs (Driver.MainDriver): Abort if
11852         RootContext.ResolveTree() reported any errors.
11853
11854 2003-09-07  Martin Baulig  <martin@ximian.com>
11855
11856         * report.cs (Error, Warning): Added overloaded versions which take
11857         a `params object[] args' and call String.Format().
11858
11859 2003-09-07  Martin Baulig  <martin@ximian.com>
11860
11861         * decl.cs (DeclSpace..ctor): Don't call
11862         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11863         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11864         (DeclSpace.RecordDecl): New method.
11865
11866         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11867
11868 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11869
11870         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11871         value attributes to be applied to ParameterBuilders.
11872
11873         * class.cs (MethodCore.LabelParameters): Make static and more
11874         generic so that it can be used from other places - like interface
11875         methods, for instance.
11876
11877         * interface.cs (Interface.Emit): Call LabelParameters before
11878         emitting attributes on the InterfaceMethod.
11879
11880 2003-08-26  Martin Baulig  <martin@ximian.com>
11881
11882         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11883         resolving aliases; fixes #47927.
11884
11885 2003-08-26  Martin Baulig  <martin@ximian.com>
11886
11887         * statement.cs (Using.DoResolve): This is internally emitting a
11888         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11889         do not always return.  Fixes #47681.
11890
11891 2003-08-26  Martin Baulig  <martin@ximian.com>
11892
11893         * decl.cs (MemberCore): Moved WarningNotHiding(),
11894         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11895         into MemberBase.
11896         (AdditionResult): Make this nested in DeclSpace.
11897         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11898         argument; call NamespaceEntry.Define() unless we're nested in a
11899         class or struct.
11900
11901         * namespace.cs (Namespace.DefineName): New public function.  This
11902         is called from DeclSpace's .ctor to add 
11903         (Namespace.Lookup): Include DeclSpaces in the lookup.
11904
11905         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11906
11907         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11908
11909 2003-08-25  Martin Baulig  <martin@ximian.com>
11910
11911         * convert.cs (Convert.ExplicitReferenceConversion): When
11912         converting from an interface type to a class, unbox if the target
11913         type is a struct type.  Fixes #47822.
11914
11915 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11916
11917         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11918         #47854.
11919
11920 2003-08-22  Martin Baulig  <martin@ximian.com>
11921
11922         * class.cs (TypeManager.DefineType): When defining a nested type,
11923         call DefineType() on our parent; fixes #47801.
11924
11925 2003-08-22  Martin Baulig  <martin@ximian.com>
11926
11927         * class.cs (MethodData.Define): While checking if a method is an
11928         interface implementation, improve the test a bit more to fix #47654.
11929
11930 2003-08-22  Martin Baulig  <martin@ximian.com>
11931
11932         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11933         correctly; fixes #47722.
11934
11935 2003-08-22  Martin Baulig  <martin@ximian.com>
11936
11937         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11938         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11939
11940         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11941
11942 2003-08-22  Martin Baulig  <martin@ximian.com>
11943
11944         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11945         can only be assigned in static constructors.  Fixes #47161.
11946
11947 2003-08-22  Martin Baulig  <martin@ximian.com>
11948
11949         Rewrote and improved the flow analysis code.
11950
11951         * flowbranching.cs (FlowBranching): Make this class abstract.
11952         (FlowBranching.CreateBranching): New static function to create a
11953         new flow branching.
11954         (FlowBranchingBlock, FlowBranchingException): New classes.
11955         (FlowBranching.UsageVector.Type): New public readonly field.
11956         (FlowBranching.UsageVector.Breaks): Removed the setter.
11957         (FlowBranching.UsageVector.Returns): Removed the setter.
11958         (FlowBranching.UsageVector): Added Break(), Return(),
11959         NeverReachable() and Throw() methods to modify the reachability.
11960         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11961         done by FlowBranching.Merge().
11962         (FlowBranching.UsageVector.MergeChild): New method; merges the
11963         merge result into the current vector.
11964         (FlowBranching.Merge): New abstract method to merge a branching.
11965
11966 2003-08-12  Martin Baulig  <martin@ximian.com>
11967
11968         * expression.cs (Indirection.CacheTemporaries): Create the
11969         LocalTemporary with the pointer type, not its element type.
11970
11971 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11974         token was a keyword or not.
11975
11976         Add `error' options where an IDENTIFIER was expected;  Provide
11977         CheckToken and CheckIdentifierToken convenience error reporting
11978         functions. 
11979
11980         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11981
11982         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11983         NameSpaceEntry NameSpaceEntry.
11984
11985         (LookupInterfaceOrClass): Avoid creating a full qualified name
11986         from namespace and name: avoid doing lookups when we know the
11987         namespace is non-existant.   Use new Tree.LookupByNamespace which
11988         looks up DeclSpaces based on their namespace, name pair.
11989
11990         * driver.cs: Provide a new `parser verbose' to display the
11991         exception thrown during parsing.  This is turned off by default
11992         now, so the output of a failure from mcs is more graceful.
11993
11994         * namespace.cs: Track all the namespaces defined in a hashtable
11995         for quick lookup.
11996
11997         (IsNamespace): New method
11998
11999 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12002         we know that we need to concatenate (full typename can never be
12003         null). 
12004
12005         * class.cs: ditto.
12006
12007         * statement.cs: Use a bitfield;  Do not initialize to null things
12008         which are done by the constructor by default.
12009
12010         * cs-parser.jay: bug fix, parameter was 4, not 3.
12011
12012         * expression.cs: Just use the property;
12013
12014         * statement.cs: No need for GetVariableInfo method.
12015
12016 2003-08-08  Martin Baulig  <martin@ximian.com>
12017
12018         * flowanalysis.cs (FlowReturns): This is now nested in the
12019         `FlowBranching' class.
12020         (MyBitVector): Moved this here from statement.cs.
12021         (FlowBranching.SiblingType): New enum type.
12022         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12023
12024 2003-08-07  Martin Baulig  <martin@ximian.com>
12025
12026         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12027         `FlowBranching' class and called `BranchingType'.
12028
12029 2003-08-07  Martin Baulig  <martin@ximian.com>
12030
12031         * flowanalysis.cs: Moved all the control flow analysis code into
12032         its own file.
12033
12034 2003-08-07  Martin Baulig  <martin@ximian.com>
12035
12036         * assign.cs (Assign.DoResolve): `target' must either be an
12037         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12038         #37319.
12039
12040 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12041
12042         * expression.cs (BinaryMethod): This kind of expression is created by the
12043         Binary class if it determines that the operator has to be handled
12044         by a method.
12045
12046         (BinaryDelegate): This kind of expression is created if we are
12047         dealing with a + or - operator on delegates.
12048
12049         (Binary): remove method, argumetns, and DelegateOperator: when
12050         dealing with methods, 
12051
12052         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12053
12054         * statement.cs (Block): use bitfields for the three extra booleans
12055         we had in use.   Remove unused topblock parameter.
12056
12057         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12058
12059         * assign.cs: Drop extra unneeded tests.
12060
12061 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12062
12063         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12064
12065         * statement.cs (Foreach): Use VariableStorage instead of
12066         LocalBuilders.   
12067
12068         * codegen.cs (VariableStorage): New class used by clients that
12069         require a variable stored: locals or fields for variables that
12070         need to live across yield.
12071
12072         Maybe provide a convenience api for EmitThis+EmitLoad?
12073
12074         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12075         these bad boys.
12076
12077 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12078
12079         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12080         RemapParameterLValue): New methods that are used to turn a
12081         precomputed FieldInfo into an expression like this:
12082
12083                 instance.FieldInfo
12084
12085         The idea is to use this instead of making LocalVariableReference
12086         have more than one meaning.
12087
12088         * cs-parser.jay: Add error production to BASE.
12089
12090         * ecore.cs: Deal with TypeManager.GetField returning null, which
12091         is now a valid return value.
12092
12093         (FieldExprNoAddress): New expression for Fields whose address can
12094         not be taken.
12095
12096         * expression.cs (LocalVariableReference): During the resolve
12097         phases, create new expressions if we are in a remapping context.
12098         Remove code that dealt with remapping here.
12099
12100         (ParameterReference): same.
12101
12102         (ProxyInstance): New expression, like the `This' expression, but
12103         it is born fully resolved.  We know what we are doing, so remove
12104         the errors that are targeted to user-provided uses of `this'.
12105
12106         * statement.cs (Foreach): our variable is now stored as an
12107         Expression;  During resolution, follow the protocol, dont just
12108         assume it will return this.
12109
12110 2003-08-06  Martin Baulig  <martin@ximian.com>
12111
12112         * support.cs (SeekableStreamReader.cs): New public class.
12113
12114         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12115         SeekableStreamReader instead of the normal StreamReader.
12116
12117 2003-08-04  Martin Baulig  <martin@ximian.com>
12118
12119         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12120         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12121         deambiguate casts and delegate invocations.
12122         (parenthesized_expression): Use the new tokens to ensure this is
12123         not a cast of method invocation.
12124
12125         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12126         when reading a `)' and Deambiguate_CloseParens () was previously
12127         called.
12128
12129         * expression.cs (ParenthesizedExpression): New class.  This is
12130         just used for the CS0075 test.
12131         (Binary.DoResolve): Check for CS0075.   
12132
12133 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12134
12135         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12136         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12137         reference comparison.
12138
12139         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12140         examine the ReturnType for equality - this is necessary in the
12141         cases of implicit and explicit operators whose signature also
12142         includes the return type.
12143
12144 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12145
12146         * namespace.cs: Cache the result of the namespace computation,
12147         instead of computing it every time.
12148
12149 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12150
12151         * decl.cs: Use a global arraylist that we reuse over invocations
12152         to avoid excesive memory consumption.  Reduces memory usage on an
12153         mcs compile by one meg (45 average).
12154
12155         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12156         private, work around that.
12157
12158 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12159
12160         * literal.cs (IntLiteral): Define Zero and One static literals. 
12161
12162         * cs-parser.jay (integer_literal): use static literals to reduce
12163         memory usage for the most used literals (0, 1 and -1).  211kb
12164         reduced in memory usage.
12165
12166         Replace all calls to `new ArrayList' with `new
12167         ArrayList(4)' which is a good average number for most allocations,
12168         and also requires only 16 bytes of memory for its buffer by
12169         default. 
12170
12171         This reduced MCS memory usage in seven megabytes for the RSS after
12172         bootstrapping.
12173
12174 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12175
12176         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12177         handle params methods the correct way by forming only one
12178         applicable set with params and normal methods in them. Earlier we
12179         were looking at params methods only if we found no normal methods
12180         which was not the correct thing to do.
12181
12182         (Invocation.BetterFunction): Take separate arguments indicating
12183         when candidate and the best method are params methods in their
12184         expanded form.
12185
12186         This fixes bugs #43367 and #46199.
12187
12188         * attribute.cs: Documentation updates.
12189
12190         (CheckAttribute): Rename to CheckAttributeTarget.
12191         (GetValidPlaces): Rename to GetValidTargets.
12192
12193         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12194         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12195
12196         Fixes bug #44468.
12197
12198 2003-07-28  Martin Baulig  <martin@ximian.com>
12199
12200         * class.cs (TypeContainer.DefineMembers): Use the base type's full
12201         name when looking up the base class of a nested class.  Fixes #46977.
12202
12203 2003-07-26  Martin Baulig  <martin@ximian.com>
12204
12205         * expression.cs (Indexers.Indexer): New nested struct; contains
12206         getter, setter and the indexer's type.
12207         (Indexers.Properties): This is now an ArrayList of
12208         Indexers.Indexer's.
12209         (IndexerAccess.DoResolveLValue): Correctly set the type if the
12210         indexer doesn't have any getters.
12211
12212         * assign.cs (Assign.DoResolve): Also do the implicit conversions
12213         for embedded property and indexer assignments.
12214
12215 2003-07-26  Martin Baulig  <martin@ximian.com>
12216
12217         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12218         preprocessor directive is not the first non-whitespace character
12219         on a line.
12220
12221 2003-07-26  Martin Baulig  <martin@ximian.com>
12222
12223         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12224         namespace parsing, follow the spec more closely.
12225
12226         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12227         NamespaceEntry.Lookup().
12228
12229 2003-07-25  Martin Baulig  <martin@ximian.com>
12230
12231         * MethodCore.cs (OverridesSomething): New public field; it's set
12232         from TypeContainer.DefineMembers if this method overrides
12233         something (which doesn't need to be a method).  Fix #39462.
12234
12235 2003-07-25  Ravi Pratap  <ravi@ximian.com>
12236
12237         * typemanager.cs (GetMembers): Ensure that the list of members is
12238         reversed. This keeps things in sync.
12239
12240         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12241         find an AttributeUsage attribute.
12242
12243         * expression.cs (Invocation.OverloadResolve): Perform the check
12244         which disallows Invoke to be directly called on a Delegate.
12245
12246         (Error_InvokeOnDelegate): Report error cs1533.
12247
12248 2003-07-25  Martin Baulig  <martin@ximian.com>
12249
12250         * expression.cs (Indexers.GetIndexersForType): Only look in the
12251         interface hierarchy if the requested type is already an
12252         interface.  Fixes #46788 while keeping #46502 fixed.
12253
12254 2003-07-25  Martin Baulig  <martin@ximian.com>
12255
12256         * class.cs (TypeContainer.DefineMembers): Check whether all
12257         readonly fields have been assigned and report warning CS0649 if
12258         not.
12259
12260         * statement.cs (LocalInfo.IsFixed): Always return true if this is
12261         a valuetype.
12262
12263 2003-07-24  Ravi Pratap  <ravi@ximian.com>
12264
12265         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12266         returned from GetMethods to make things consistent with the
12267         assumptions MCS makes about ordering of methods.
12268
12269         This should comprehensively fix bug #45127 and it does :-)
12270
12271         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12272         ordering is actually reverse.
12273
12274         * Clean up some debug messages I left lying around.
12275
12276         * interface.cs (Populate*): Get rid of code which emits attributes
12277         since the stage in which we emit attributes is the 'Emit' stage,
12278         not the define stage.
12279
12280         (Emit): Move attribute emission for interface members here.
12281
12282 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12283
12284         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12285         closely: we eliminate methods in base types when we have an
12286         applicable method in a top-level type.
12287
12288         Please see section 14.5.5.1 for an exact description of what goes
12289         on. 
12290
12291         This fixes bug #45127 and a host of other related to corlib compilation.
12292
12293         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12294         array is the method corresponding to the top-level type (this is
12295         because of the changes made to icall.c) so we change this
12296         accordingly.
12297
12298         (MethodGroupExpr.Name): This too.
12299
12300         * typemanager.cs (GetElementType): New method which does the right
12301         thing when compiling corlib. 
12302
12303         * everywhere: Make use of the above in the relevant places.
12304
12305 2003-07-22  Martin Baulig  <martin@ximian.com>
12306
12307         * cs-parser.jay (invocation_expression): Moved
12308         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12309         `cast_expression', but create a InvocationOrCast which later
12310         resolves to either an Invocation or a Cast.
12311
12312         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12313         method; call this before EmitStatement() to make sure that this
12314         expression can be used as a statement.
12315
12316         * expression.cs (InvocationOrCast): New class; resolves to either
12317         an Invocation or a Cast.
12318
12319         * statement.cs (StatementExpression): Call ResolveStatement() on
12320         the ExpressionStatement before emitting it.
12321
12322 2003-07-21  Martin Baulig  <martin@ximian.com>
12323
12324         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12325         `ref' and `out' attributes match; fixes #46220.
12326         (MemberAccess.ResolveMemberAccess): You can't reference a type
12327         through an expression; fixes #33180.
12328         (Indexers.GetIndexersForType): Don't return the indexers from
12329         interfaces the class implements; fixes #46502.
12330
12331 2003-07-21  Martin Baulig  <martin@ximian.com>
12332
12333         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12334         CS0661 checks; fixes bug #30442.
12335
12336 2003-07-21  Martin Baulig  <martin@ximian.com>
12337
12338         * decl.cs (AdditionResult): Added `Error'.
12339
12340         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12341
12342         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12343         makes cs0031.cs actually work.
12344
12345 2003-07-20  Martin Baulig  <martin@ximian.com>
12346
12347         * namespace.cs: Fixed that bug which caused a crash when compiling
12348         the debugger's GUI.
12349
12350 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12351
12352         * typemanager.cs (LookupTypeReflection): Never expose types which
12353         are NotPublic, NestedPrivate, NestedAssembly, or
12354         NestedFamANDAssem.  We used to return these, and later do a check
12355         that would report a meaningful error, but the problem is that we
12356         would not get the real match, if there was a name override.
12357
12358 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12359
12360         * namespace.cs (Namespace, Name): Do not compute the namespace
12361         name dynamically, compute it in the constructor.  This reduced
12362         memory usage by 1697 KB.
12363
12364         * driver.cs: Use --pause to pause at the end.
12365
12366 2003-07-17  Peter Williams  <peter@newton.cx>
12367
12368         * Makefile: Change the name of the test target so that it doesn't
12369         conflict with the recursive test target.
12370
12371 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12374         AddressOf): Do not use EmitThis, that was wrong, use the actual
12375         this pointer.
12376
12377 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12378
12379         * class.cs (MethodData.Define): While checking if a method is an
12380         interface implementation, improve the test: If we are not public
12381         (use new test here: use the computed MethodAttributes directly,
12382         instead of the parsed modifier flags) check if the `implementing'
12383         method comes from an interface or not.
12384
12385         * pending.cs (VerifyPendingMethods): Slightly better error
12386         message.
12387
12388         * makefile: add test target that does the mcs bootstrap.
12389
12390 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12391
12392         * interface.cs (Define): Do nothing here since there are no
12393         members to populate etc. Move the attribute emission out of here
12394         since this was just totally the wrong place to put it. Attribute
12395         application happens during the 'Emit' phase, not in the 'Define'
12396         phase.
12397
12398         (Emit): Add this method and move the attribute emission here
12399
12400         * rootcontext.cs (EmitCode): Call the Emit method on interface
12401         types too.
12402
12403 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12404
12405         * expression.cs (OverloadResolve): Report error only if Location
12406         is not 'Null' which means that there was a probe going on.
12407
12408 2003-07-14  Martin Baulig  <martin@ximian.com>
12409
12410         * expression.cs (ConditionalLogicalOperator): New public class to
12411         implement user defined conditional logical operators.
12412         This is section 14.11.2 in the spec and bug #40505.
12413
12414 2003-07-14  Martin Baulig  <martin@ximian.com>
12415
12416         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12417
12418 2003-07-14  Martin Baulig  <martin@ximian.com>
12419
12420         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12421
12422         * ecore.cs (IVariable.VerifyFixed): New interface method.
12423
12424         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12425         operator, check whether the variable is actually fixed.  Fixes bug
12426         #36055.  Set a variable definitely assigned when taking its
12427         address as required by the spec.
12428
12429         * statement.cs (LocalInfo.IsFixed): New field.
12430         (LocalInfo.MakePinned): Set `IsFixed' to true.
12431
12432 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12433
12434         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12435         for .ctors, ensure that we only ask for members declared in the
12436         attribute type (BindingFlags.DeclaredOnly).
12437
12438         Fixes bug #43632.
12439
12440         * expression.cs (Error_WrongNumArguments): Report error 1501
12441         correctly the way CSC does.
12442
12443 2003-07-13  Martin Baulig  <martin@ximian.com>
12444
12445         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12446         lookup on the fully qualified name, to make things like "X.X" work
12447         where "X.X" is a fully qualified type name, but we also have a
12448         namespace "X" in the using list.  Fixes #41975.
12449
12450 2003-07-13  Martin Baulig  <martin@ximian.com>
12451
12452         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12453         function. If we're a CompoundAssign, we need to create an embedded
12454         CompoundAssign, not an embedded Assign.
12455         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12456         Fixes #45854.
12457
12458 2003-07-13  Martin Baulig  <martin@ximian.com>
12459
12460         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12461         work to fix bug #46088.
12462
12463 2003-07-13  Ravi Pratap <ravi@ximian.com>
12464
12465         * class.cs (Operator.Emit): Do not emit attributes here - it is
12466         taken care of by the Method class that we delegate too. This takes
12467         care of bug #45876.
12468
12469 2003-07-10  Martin Baulig  <martin@ximian.com>
12470
12471         * expression.cs (TypeOfVoid): New class.
12472         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12473
12474 2003-07-10  Martin Baulig  <martin@ximian.com>
12475
12476         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12477         bug #35957.
12478
12479 2003-07-10  Martin Baulig  <martin@ximian.com>
12480
12481         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12482         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12483
12484         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12485
12486         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12487
12488 2003-07-10  Martin Baulig  <martin@ximian.com>
12489
12490         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12491         of decimal.  Fixes #42850.
12492
12493         NOTE: I also fixed the created byte blob, but this doesn't work on
12494         the MS runtime and csc never produces any byte blobs for decimal
12495         arrays.
12496
12497 2003-07-10  Martin Baulig  <martin@ximian.com>
12498
12499         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12500         structs; fixes #32068.
12501         (Block.AddChildVariableNames): Fixed #44302.
12502
12503 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12504
12505         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12506
12507 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12508
12509         * attribute.cs: And this test is onger needed.
12510
12511 2003-07-08  Martin Baulig  <martin@ximian.com>
12512
12513         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12514         inaccessible types.  Fixes #36313.
12515
12516         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12517
12518         * namespace.cs (NamespaceEntry): Create implicit entries for all
12519         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12520         implicit entries for N1.N2 and N1.
12521
12522 2003-07-08  Martin Baulig  <martin@ximian.com>
12523
12524         Rewrote the handling of namespaces to fix a lot of the issues
12525         wrt. `using' aliases etc.
12526
12527         * namespace.cs (Namespace): Splitted this class into a
12528         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12529
12530         * typemanager.cs (TypeManager.IsNamespace): Removed.
12531         (TypeManager.ComputeNamespaces): Only compute namespaces from
12532         loaded assemblies here, not the namespaces from the assembly we're
12533         currently compiling.
12534
12535 2003-07-08  Martin Baulig  <martin@ximian.com>
12536
12537         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12538
12539 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12540
12541         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12542         already fixed it.  
12543
12544         I thought about the memory savings here, but LookupTypeReflection
12545         is used under already very constrained scenarios.  Compiling
12546         corlib or mcs only exposes one hit, so it would not really reduce
12547         any memory consumption.
12548
12549 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12550
12551         * typemanager.cs: fixes bug #45889 by only adding public types from
12552         other assemblies to the list of known types.
12553
12554 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12555
12556         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12557         on the type we resolved.
12558
12559 2003-07-05  Martin Baulig  <martin@ximian.com>
12560
12561         * pending.cs (PendingImplementation.ParentImplements): Don't
12562         create the proxy if the parent is abstract.
12563
12564         * class.cs (TypeContainer.DefineIndexers): Process explicit
12565         interface implementations first.  Fixes #37714.
12566
12567 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12568
12569         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12570         defined recursively;  but since we modify the input parameters
12571         (left is set to `this' temporarily), we reset this value if the
12572         left_is_explicit is false, which gives the original semantics to
12573         the code.  
12574
12575         * literal.cs (NullPointer): new class used to represent a null
12576         literal in a pointer context.
12577
12578         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12579         type is a pointer, use a NullPointer object instead of a
12580         NullLiteral.   Closes 43687
12581
12582         (ExplicitConversion): Convert pointer values using
12583         the conv opcode to the proper type.
12584
12585         * ecore.cs (New): change ValueTypeVariable property into a method,
12586         that returns whether the valuetype is suitable for being used.
12587
12588         * expression.cs (Binary.DoNumericPromotions): Only return if we
12589         the int constant was a valid uint, and we can return both left and
12590         right as uints.  If not, we continue processing, to trigger the
12591         type conversion.  This fixes 39018.
12592
12593         * statement.cs (Block.EmitMeta): During constant resolution, set
12594         the CurrentBlock property on the emitcontext, so that we resolve
12595         constants propertly.
12596
12597 2003-07-02  Martin Baulig  <martin@ximian.com>
12598
12599         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12600         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12601
12602         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12603         than emitting it here.
12604
12605         * statement.cs: Fixed some more flow analysis bugs.
12606
12607 2003-07-02  Martin Baulig  <martin@ximian.com>
12608
12609         * class.cs (MethodData.Define): When implementing interface
12610         methods, set Final unless we're Virtual.
12611
12612         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12613         check work for interface methods.
12614
12615 2003-07-01  Martin Baulig  <martin@ximian.com>
12616
12617         * ecore.cs (EmitContext.This): Replaced this property with a
12618         GetThis() method which takes a Location argument.  This ensures
12619         that we get the correct error location for a CS0188.
12620
12621 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12624         ImplicitStandardConversion.
12625
12626         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12627
12628 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
12629
12630         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12631         optimization.
12632
12633 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
12634
12635         * class.cs (Constructor.Define): Turn off initlocals for unsafe
12636         constructors.
12637
12638         (MethodData.Define): Turn off initlocals for unsafe methods.
12639
12640 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
12641
12642         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12643         complete;  Fixes #37521.
12644
12645         * delegate.cs: Use Modifiers.TypeAttr to compute the
12646         TypeAttributes, instead of rolling our own.  This makes the flags
12647         correct for the delegates.
12648
12649 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12650
12651         * class.cs (Constructor.Define): Set the private flag for static
12652         constructors as well.
12653
12654         * cs-parser.jay (statement_expression): Set the return value to
12655         null, to avoid a crash when we catch an error.
12656
12657 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12658
12659         * cs-parser.jay: Applied patch from Jackson that adds support for
12660         extern and unsafe modifiers to destructor declarations.
12661
12662         * expression.cs: Report error 21 if the user is trying to index a
12663         System.Array.
12664
12665         * driver.cs: Add an error message, suggested by the bug report.
12666
12667         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12668         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12669
12670 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12671
12672         * namespace.cs: Add some information to reduce FAQs.
12673
12674 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12677         underlying enumeration types.  Fixes #43915.
12678
12679         * expression.cs: Treat ushort/short as legal values to be used in
12680         bitwise operations.
12681
12682 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12683
12684         * delegate.cs: transfer custom attributes for paramenters from
12685         the delegate declaration to Invoke and BeginInvoke.
12686
12687 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12688
12689         * attribute.cs: handle custom marshalers and emit marshal info
12690         for fields, too.
12691
12692 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12693
12694         * makefile.gnu: Added anonymous.cs to the compiler sources.
12695
12696 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12697
12698         * iterators.cs: Change the name of the proxy class to include two
12699         underscores.
12700
12701         * cs-parser.jay: Update grammar to include anonymous methods.
12702
12703         * anonymous.cs: new file.
12704
12705 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12706
12707         * class.cs (Field.Define): Add missing test for pointers and
12708         safety. 
12709
12710 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12711
12712         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12713         we use the stobj opcode.
12714
12715         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12716         since it wasn't the correct fix. 
12717
12718         It still is puzzling that we are required to use stobj for IntPtr
12719         which seems to be a ValueType.
12720
12721 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12724         during regular simple name resolution.   Now, the trick is that
12725         instead of returning for processing the simplename, we do a
12726         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12727         contextual lookup type).   If a match is found, return that, if
12728         not, return for further composition.
12729
12730         This fixes long-standing 30485.
12731
12732         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12733         using the address to initialize an object, do an Stobj instead of
12734         using the regular Stelem.
12735
12736         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12737         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12738         Because if we are a BaseIndexerAccess that value will be true.
12739         Fixes 43643.
12740
12741         * statement.cs (GotoCase.Resolve): Return after reporting an
12742         error, do not attempt to continue. 
12743
12744         * expression.cs (PointerArithmetic.Emit): If our operand is a
12745         long, convert our constants to match the operand before
12746         multiplying.  Convert to I type before adding.   Fixes 43670.
12747
12748 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12749
12750         * enum.cs (ImplicitConversionExists) : Rename to
12751         ImplicitEnumConversionExists to remove ambiguity. 
12752
12753         * ecore.cs (NullCast): New type of cast expression class which
12754         basically is very similar to EmptyCast with the difference being
12755         it still is a constant since it is used only to cast a null to
12756         something else
12757         (eg. (string) null)
12758
12759         * convert.cs (ImplicitReferenceConversion): When casting a null
12760         literal, we return a NullCast.
12761
12762         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12763         should be around anymore.
12764
12765         The renaming (reported was slightly wrong). Corrections:
12766
12767         ConvertImplicitStandard -> ImplicitConversionStandard
12768         ConvertExplicitStandard -> ExplicitConversionStandard
12769
12770         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12771         before passing them in !
12772
12773         * convert.cs (ImplicitConversionStandard): When comparing for
12774         equal expr and target types, ensure that expr is not a
12775         NullLiteral.
12776
12777         In general, we must not be checking (expr_type ==
12778         target_type) in the top level conversion methods
12779         (ImplicitConversion, ExplicitConversion etc). This checking is
12780         done in the methods that they delegate to.
12781
12782 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12783
12784         * convert.cs: Move Error_CannotConvertType,
12785         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12786         ImplicitNumericConversion, ImplicitConversionExists,
12787         ImplicitUserConversionExists, StandardConversionExists,
12788         FindMostEncompassedType, FindMostSpecificSource,
12789         FindMostSpecificTarget, ImplicitUserConversion,
12790         ExplicitUserConversion, GetConversionOperators,
12791         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12792         TryImplicitIntConversion, Error_CannotConvertImplicit,
12793         ConvertImplicitRequired, ConvertNumericExplicit,
12794         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12795         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12796         its own file.
12797
12798         Perform the following renames:
12799
12800         StandardConversionExists -> ImplicitStandardConversionExists
12801         ConvertImplicit -> ImplicitConversion
12802         ConvertImplicitStandard -> ImplicitStandardConversion
12803         TryImplicitIntConversion -> ImplicitIntConversion
12804         ConvertImplicitRequired -> ImplicitConversionRequired
12805         ConvertNumericExplicit -> ExplicitNumericConversion
12806         ConvertReferenceExplicit -> ExplicitReferenceConversion
12807         ConvertExplicit -> ExplicitConversion
12808         ConvertExplicitStandard -> ExplicitStandardConversion
12809
12810 2003-05-19  Martin Baulig  <martin@ximian.com>
12811
12812         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12813         (TypeInfo): Added support for structs having structs as fields.
12814
12815         * ecore.cs (FieldExpr): Implement IVariable.
12816         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12817         VariableInfo for the field.
12818
12819 2003-05-18  Martin Baulig  <martin@ximian.com>
12820
12821         * expression.cs (This.DoResolve): Report a CS0027 if we're
12822         emitting a field initializer.
12823
12824 2003-05-18  Martin Baulig  <martin@ximian.com>
12825
12826         * expression.cs (This.ResolveBase): New public function.
12827         (This.DoResolve): Check for CS0188.
12828
12829         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12830         This.Resolve().
12831
12832         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12833         `instance_expression' to null if we don't have any non-static
12834         methods.
12835
12836 2003-05-18  Martin Baulig  <martin@ximian.com>
12837
12838         Reworked the way how local variables and parameters are handled by
12839         the flow analysis code.
12840
12841         * statement.cs (TypeInfo, VariableMap): New public classes.
12842         (VariableInfo): New public class.  This is now responsible for
12843         checking whether a variable has been assigned.  It is used for
12844         parameters and local variables.
12845         (Block.EmitMeta): Take the InternalParameters as argument; compute
12846         the layout of the flow vectors here.
12847         (Block.LocalMap, Block.ParameterMap): New public properties.
12848         (FlowBranching): The .ctor doesn't get the InternalParameters
12849         anymore since Block.EmitMeta() now computes the layout of the flow
12850         vector.
12851         (MyStructInfo): This class is now known as `StructInfo' and nested
12852         in `TypeInfo'; we don't access this directly anymore.
12853
12854         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12855         property and removed IsAssigned(), IsFieldAssigned(),
12856         SetAssigned() and SetFieldAssigned(); we now call them on the
12857         VariableInfo so we don't need to duplicate this code everywhere.
12858
12859         * expression.cs (ParameterReference): Added `Block block' argument
12860         to the .ctor.
12861         (LocalVariableReference, ParameterReference, This): The new
12862         VariableInfo class is now responsible for all the definite
12863         assignment stuff.
12864
12865         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12866         IsParameterAssigned, SetParameterAssigned): Removed.
12867
12868 2003-05-18  Martin Baulig  <martin@ximian.com>
12869
12870         * typemanager.cs (InitCoreTypes): Try calling
12871         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12872         the 3-args-version.  Corlib now also needs our `void_type'.
12873         (GetMethod): Added overloaded version which takes an optional
12874         `bool report_errors' to allow lookups of optional methods.
12875
12876 2003-05-12  Martin Baulig  <martin@ximian.com>
12877
12878         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12879         only used for locals and not for parameters.
12880
12881 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12882
12883         * support.cs (InternalParameters.ParameterType): Return the
12884         ExternalType of the parameter.
12885
12886         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12887         they were unused.
12888
12889 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12890
12891         * class.cs (MethodData.Define): Do not set the `newslot' on
12892         interface members, if they are also flagged as "override".
12893
12894         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12895         better code for ++i and i++.  This only works for static fields
12896         and local variables.
12897
12898         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12899         want to pull the DeclSpace out of the builder_to_declspace instead
12900         of the TypeBuilder (like in TypeContainer.FindMembers).
12901
12902         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12903         instead of LookupTypeContainer.  Fixes the crash on .NET for
12904         looking up interface members.
12905
12906         * const.cs: Create our own emit context during the Definition
12907         stage, so that constants are evaluated in the proper context, when
12908         a recursive definition happens.
12909
12910 2003-05-11  Martin Baulig  <martin@ximian.com>
12911
12912         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12913         new block for a switch section.
12914         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12915         the adding/lookup in the switch block.  Fixes #39828.
12916
12917 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12918
12919         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12920         functionality: I needed to convert the data after I had performed
12921         the add/sub operation into the operands type size.
12922
12923         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12924         pass the type for the box operation, otherwise the resulting
12925         object would have been of type object.
12926
12927         (BoxedCast): Add constructor to specify the type to box as.
12928
12929 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12930
12931         * iterators.cs: I was reusing the `count' variable inadvertently,
12932         take steps to not allow this to happen.
12933
12934 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12935
12936         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12937         by creating an array at the point where the params starts and
12938         putting all those arguments there, then adjusting the size of the
12939         array.
12940
12941 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12942
12943         * expression.cs (New.AddressOf): Implement interface
12944         IMemoryLocation.  This is used when the `new' operator is used in
12945         the context of an invocation to a method on a value type.
12946
12947         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12948         example. 
12949
12950         * namespace.cs: Also check the using aliases here.
12951
12952         * driver.cs: Move the test for using validity after the types have
12953         been entered, so we do a single pass that also includes the using
12954         aliases. 
12955
12956         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12957         in the regular case.   CreateSiblingForFinally is doing extra
12958         error checking.
12959
12960         * attribute.cs (GetAttributeArgumentExpression): Store the result
12961         on an out value, and use the return value to indicate failure
12962         instead of using null (which is a valid return for Constant.GetValue).
12963
12964         * statement.cs: Perform the analysis flow for the increment
12965         portion after the statement, because this will be the real flow of
12966         execution.  Fixes #42385
12967
12968         * codegen.cs (EmitContext.EmitArgument,
12969         EmitContext.EmitStoreArgument): New helper functions when the
12970         RemapToProxy flag is set.
12971
12972         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12973         function.
12974
12975         Add support for remapping parameters. 
12976
12977         * iterators.cs: Propagate parameter values;  Store parameter
12978         values in the proxy classes.
12979
12980 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12981
12982         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12983         need a proxy reference;  I do not know what I was thinking
12984
12985         * cs-parser.jay (constructor_initializer): catch another error,
12986         and display nice message.
12987
12988         (field_declaration): catch void field declaration
12989         to flag a better error. 
12990
12991         * class.cs (MemberBase.CheckBase): Report an error instead of a
12992         warning if a new protected member is declared in a struct. 
12993         (Field.Define): catch the error of readonly/volatile.
12994
12995         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12996
12997         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12998         volatile variable is taken
12999
13000 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13001
13002         * statement.cs (Fixed.Resolve): Report an error if we are not in
13003         an unsafe context.
13004
13005 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13006
13007         * typemanager.cs: reuse the code that handles type clashes for
13008         delegates and enumerations.
13009
13010         * class.cs (Report28): Always report.
13011
13012         * expression.cs (EncodeAsAttribute): Allow nulls here.
13013
13014 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13015
13016         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13017         the functionality for testing whether an expression is valid for
13018         an attribute here.  Also handle the case of arrays of elements
13019         being stored. 
13020
13021         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13022         encoding a linear array into an array of objects that are suitable
13023         to be passed to an CustomAttributeBuilder.
13024
13025         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13026
13027         * ecore.cs: (FieldExpr): Handle field remapping here.
13028
13029         * iteratators.cs: Pass the instance variable (if the method is an
13030         instance method) to the constructors, so we can access the field
13031         variables on the class.
13032
13033         TODO: Test this with structs.  I think the THIS variable on
13034         structs might have to be a pointer, and not a refenrece
13035
13036 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13037
13038         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13039         local variables to fields in a proxy class.
13040
13041         * iterators.cs (PopulateProxy): Rename our internal fields to
13042         <XXX>.  
13043         Create a <THIS> field if we are an instance method, so we can
13044         reference our parent container variables.
13045         (MapVariable): Called back from the EmitContext code to enter a
13046         new variable to field mapping into the proxy class (we just create
13047         a FieldBuilder).
13048
13049         * expression.cs
13050         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13051         for using the remapped locals to fields.
13052
13053         I placed the code here, because that gives the same semantics to
13054         local variables, and only changes the Emit code.
13055
13056         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13057         statements inside iterators.
13058         (VariableInfo): Add a FieldBuilder for the cases when we are
13059         remapping local variables to fields in a proxy class
13060
13061         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13062         current_block != null.
13063
13064         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13065         not cope with strings, as it has been moved to the
13066         TableSwitchEmit.  Fixed bug in switch generation.
13067
13068         * expression.cs (New.DoResolve): Provide more context for the user
13069         when reporting an error.
13070
13071         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13072         pointers. 
13073
13074         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13075         check the permissions for it.  Note than in a type-resolution
13076         context the check was already present in DeclSpace.ResolveType,
13077         but was missing from the MemberAccess.
13078
13079         (ArrayCreation.CheckIndices): warn if the user has
13080         more nested levels of expressions, but there are no more
13081         dimensions specified.  Avoids crash on bug 41906.
13082
13083 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13084
13085         * statement.cs (Block): replace Implicit bool, for a generic
13086         flags.   
13087         New flag: `Unchecked'.  This is used during the EmitMeta phase
13088         (which is out-of-line with the regular Resolve/Emit process for a
13089         statement, as this is done ahead of time, but still gets a chance
13090         to call constant resolve).
13091
13092         (Block.Flags): new enum for adding a new flag.
13093
13094         (Block.EmitMeta): track the state of unchecked.
13095
13096         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13097         to enable constant resolution to work there as well.
13098
13099 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * typemanager.cs (ienumerable_type): Also look up
13102         System.Collections.IEnumerable. 
13103
13104 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13105
13106         TODO: Test more than one conditional per method.
13107
13108         * class.cs (Indexer.Define): Report the location where the user is
13109         referencing the unsupported feature.
13110
13111         (MethodData): Overload the use of `conditionals' to
13112         minimize the creation of needless ArrayLists.   This saves roughly
13113         212kb on my machine.
13114
13115         (Method): Implement the new IIteratorContainer interface.
13116         (Method.SetYields): Implement the method by setting the ModFlags
13117         to contain METHOD_YIELDS.
13118
13119         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13120         which just got set to null.
13121
13122         * iterators.cs: New file.
13123
13124         (Yield, YieldBreak): New statements.
13125
13126         * statement.cs (Return.Resolve): Flag an error if we are used in
13127         an iterator method.
13128
13129         * codegen.cs (InIterator): New flag set if the code is being
13130         compiled in an iterator method.
13131
13132         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13133         internal modifier, and we just use it to avoid adding extra
13134         fields, as this is seldom used.  
13135
13136         * cs-parser.jay: Add yield_statement (yield and yield break).
13137
13138         * driver.cs: New flag -v2 to turn on version 2 features. 
13139
13140         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13141         hashtable when v2 is enabled.
13142
13143 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13146         there is already a namespace defined with this name.
13147
13148         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13149         people upgraded their corlibs.
13150
13151         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13152         always use fully qualified types, no need to use the compiler
13153         front end.
13154
13155         (TypeManager.IsNamespace): Use binarysearch.
13156
13157         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13158         AddDelegate): I did not quite use the new IsValid API properly: I
13159         have to pass the short-name and the fullname.  I was passing only
13160         the basename instead of the fullname sometimes. 
13161
13162         (TypeContainer.DefineType): call NamespaceClash.
13163
13164         * interface.cs (Interface.DefineType): use NamespaceClash before
13165         defining the type.
13166
13167         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13168         defining the type.
13169
13170         * enum.cs: (Enum.DefineType): use NamespaceClash before
13171         defining the type.
13172
13173         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13174         speed increase.  First, use the negative_hits cache when we get a
13175         negative.  Second, add the type with its full original name
13176         instead of the new . and + encoded name (reflection uses + to
13177         separate type from a nested type).  Use LookupTypeReflection
13178         directly which bypasses the type->name hashtable (that we already
13179         know does not contain the type.
13180
13181         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13182         location/container type. 
13183
13184         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13185
13186 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13187
13188         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13189
13190         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13191         method is being referenced in the method group from a static
13192         context, and report error 120 if so.
13193
13194         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13195         Error118. 
13196
13197         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13198         is created, we create the A namespace).
13199
13200         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13201         Fixes #41591
13202
13203 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13204
13205         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13206         invocation to ModuleBuilder.GetType with the same values will
13207         return a new type instance, so we need to cache its return
13208         values. 
13209
13210         * expression.cs (Binary.ResolveOperator): Only allow the compare
13211         operators on enums if they are of the same type.
13212
13213         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13214         types of ValueType on their own case.  Before we were giving them
13215         the same treatment as objects.
13216
13217         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13218         fullname.  Short name is used to compare against container name.
13219         Fullname is used to check against defined namespace names.
13220
13221         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13222         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13223
13224         (Method.CheckBase): Call parent.
13225         (MemberBase.CheckBase): Check for protected members on sealed
13226         classes.
13227         (PropertyBase.CheckBase): Call parent.
13228         (Field.Define): Call parent.
13229
13230         * report.cs: Negative error codes are now mapped to 8000 - code,
13231         so that the display is render more nicely.
13232
13233         * typemanager.cs: Do not use try/catch, instead report a regular
13234         error. 
13235
13236         (GetPointerType, GetReferenceType): These methods provide
13237         mechanisms to obtain the T* and T& from a T.  We had the code
13238         previously scattered around the code base, and it also used
13239         TypeManager.LookupType that would go through plenty of caches.
13240         This one goes directly to the type source.
13241
13242         In some places we did the Type.GetType followed by
13243         ModuleBuilder.GetType, but not in others, so this unifies the
13244         processing as well.
13245
13246         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13247         statements now that we have namespace information.
13248
13249         * typemanager.cs (IsNamespace): New method, returns whether the
13250         string presented is a namespace or not.
13251
13252         (ComputeNamespaces): New public entry point, computes the list of
13253         available namespaces, using the GetNamespaces API call in Mono, or
13254         the slower version in MS.NET.   
13255
13256         Now before we start the semantic analysis phase, we have a
13257         complete list of namespaces including everything that the user has
13258         provided.
13259
13260         Deleted old code to cache namespaces in .nsc files.
13261
13262 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13263
13264         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13265         class/struct location definition Location for the implicit
13266         constructor location.
13267
13268         (Operator.Define): Use the location of the operator for the
13269         implicit Method definition.
13270
13271         (Constructor.Emit): use the constructor location for the implicit
13272         base initializer constructor.
13273
13274         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13275         and the Expression class now contains two new methods:
13276
13277         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13278         isolate type lookup from the rest of the resolution process.
13279
13280         Since we use Expressions to hold type definitions due to the way
13281         we parse the input we have historically overloaded Resolve to
13282         perform the Type lookups if a special flag is passed.  Now this is
13283         eliminated and two methods take their place. 
13284
13285         The differences in the two methods between xStep and xTerminal is
13286         that xStep is involved in our current lookup system that uses
13287         SimpleNames to compose a name, while xTerminal is used just to
13288         catch the case where the simplename lookup failed.
13289
13290 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13291
13292         * expression.cs (ResolveMemberAccess): Remove redundant code.
13293         TypeExpr expressions are always born fully resolved.
13294
13295         * interface.cs (PopulateMethod): Do not lookup the types twice.
13296         We were doing it once during SemanticAnalysis and once during
13297         PopulateMethod.
13298
13299         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13300         in local variable type definitions, were being returned as a
13301         SimpleName (we decomposed everything into a string), that is
13302         because primary_expression was being used instead of a type in the
13303         grammar (reduce/reduce conflicts).
13304
13305         The part that was wrong is that we converted the expression into a
13306         string (an oversimplification in one hand, compounded with primary
13307         expressions doing string concatenation).
13308
13309         So things like:
13310
13311         A.B.C [] x;
13312
13313         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13314         using clauses from working on this particular context.  And a type
13315         was being matched directly against "A.B.C[]".
13316
13317         We now use the correct approach, and allow for ComposedCast to be
13318         part of the unary expression.  So the "A.B.C []" become a composed
13319         cast of "A.B.C" (as a nested group of MemberAccess with a
13320         SimpleName at the end) plus the rank composition "[]". 
13321
13322         Also fixes 35567
13323
13324 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13325
13326         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13327         for the access level checking.
13328
13329         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13330         `TypeContainer container', because I kept getting confused when I
13331         was debugging this code.
13332
13333         * expression.cs (Indexers): Instead of tracking getters/setters,
13334         we now track them in parallel.  We create one arraylist less, but
13335         most importantly it is possible now for the LValue code to find a
13336         matching get for a set.
13337
13338         (IndexerAccess.DoResolveLValue): Update the code.
13339         GetIndexersForType has been modified already to extract all the
13340         indexers from a type.  The code assumed it did not.
13341
13342         Also make the code set the correct return type for the indexer.
13343         This was fixed a long time ago for properties, but was missing for
13344         indexers.  It used to be void_type.
13345
13346         (Binary.Emit): Test first for doubles instead of
13347         floats, as they are more common.
13348
13349         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13350         when dealing with floats and the <=, >= operators.  This fixes bug
13351         #39314 
13352
13353         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13354         to load the array value by emitting a load on the foreach variable
13355         type.  This was incorrect.  
13356
13357         We now emit the code to load an element using the the array
13358         variable type, and then we emit the conversion operator.
13359
13360         Fixed #40176
13361
13362 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13363
13364         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13365
13366 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13367
13368         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13369         test for protection before we test for signatures. 
13370
13371         (MethodSignature.ToString): implement.
13372
13373         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13374         to the case where we reduced into a LongConstant.
13375
13376         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13377         depend on whether the information is acurrate, because the
13378         Microsoft runtime will always claim that the array type is public,
13379         regardless of the real state.
13380
13381         If the type is a pointer, another problem happens: the type is
13382         reported as non-public in Microsoft.  
13383
13384         In both cases we have to call CheckAccessLevel recursively with
13385         the underlying type as the argument to be tested.
13386
13387 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13388
13389         * assign.cs (Assign.Emit): If we are dealing with a compound
13390         assignment expression, we should use the code path that stores the
13391         intermediate result in a temporary value.  This fixes #40903.
13392
13393         *expression.cs (Indirection.ToString): Provide ToString method for
13394         debugging. 
13395
13396 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13397
13398         * class.cs: Null out fields holding references to Block objects so
13399         they can be garbage collected.
13400
13401         * expression.cs (OverloadResolve): Remove unused local.
13402
13403 2003-04-07  Martin Baulig  <martin@ximian.com>
13404
13405         * codegen.cs (EmitContext.CurrentFile): New public field.
13406         (EmitContext.Mark): Use the CurrentFile to check whether the
13407         location is in the correct file.
13408         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13409
13410 2003-04-07  Martin Baulig  <martin@ximian.com>
13411
13412         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13413
13414         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13415         location.  [FIXME: The location argument which gets passed to this
13416         method is sometimes wrong!]
13417
13418 2003-04-07  Nick Drochak <ndrochak@gol.com>
13419
13420         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13421
13422 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13423
13424         * expression.cs (Indirection.EmitAssign): We were using the
13425         temporary, but returning immediately instead of continuing the
13426         EmitAssing flow.
13427
13428 2003-04-06  Martin Baulig  <martin@ximian.com>
13429
13430         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13431         if it's a nested child, but also deriving from the outer class.
13432         See test 190.cs.
13433
13434         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13435         nested child, but also deriving from the outer class.  See
13436         test-190.cs.
13437         (FilterWithClosure): We may access private members of the outer
13438         class if we're a nested child and deriving from the outer class.
13439         (RealMemberLookup): Only set `closure_private_ok' if the
13440         `original_bf' contained BindingFlags.NonPublic.
13441
13442 2003-04-05  Martin Baulig  <martin@ximian.com>
13443
13444         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13445
13446 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13447
13448         * class.cs (Event.Define): Do not allow abstract events to have
13449         initializers. 
13450
13451 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13452
13453         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13454         block in event declarations.
13455
13456         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13457         value type, get its address.
13458
13459         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13460         leaving a class on the stack instead of a boolean value (int
13461         0/1).  Change the code so we compare against null, and then the
13462         result against zero.
13463
13464         * class.cs (TypeContainer.GetClassBases): We were checking for the
13465         parent class being sealed too late.
13466
13467         * expression.cs (Binary.Emit): For <= and >= when dealing with
13468         floating point values, use cgt.un and clt.un instead of cgt and
13469         clt alone.
13470
13471 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13472
13473         * statement.cs: Apply the same optimization as MS: skip the 
13474         GetEnumerator returning an IEnumerator, and use the one returning a 
13475         CharEnumerator instead. This allows us to avoid the try-finally block 
13476         and the boxing.
13477
13478 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13479
13480         * cs-parser.jay: Attributes cannot be applied to
13481                          namespaces. Fixes #40473
13482
13483 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13484
13485         * class.cs:
13486         (Add*): check if the name is valid using the full name for constants,
13487         fields, properties and events.
13488
13489 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13490
13491         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13492         char constants to be part of the enumeration.
13493
13494         * expression.cs (Conditional.DoResolve): Add support for operator
13495         true. Implements the missing functionality from 14.12
13496
13497         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13498         operator true/false as required by the spec.
13499
13500         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13501         implicit conversion to boolean.
13502
13503         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13504         also one where the type implements `operator true'. 
13505
13506         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13507         get an expression that will invoke operator true based on an
13508         expression.  
13509
13510         (GetConversionOperators): Removed the hack that called op_True
13511         here.  
13512
13513         (Expression.ResolveBoolean): Move this from Statement.
13514
13515 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * ecore.cs (FieldExpr): do not allow initialization of initonly
13518         fields on derived classes
13519
13520 2003-03-13  Martin Baulig  <martin@ximian.com>
13521
13522         * statement.cs (Block.Emit): Call ig.BeginScope() and
13523         ig.EndScope() when compiling with debugging info; call
13524         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13525
13526 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * expression.cs (Indexers): Do not construct immediately, allow
13529         for new members to be appended as we go.  Fixes 38143
13530
13531 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13532
13533         * expression.cs: save/restore context when resolving an unchecked
13534         expression.
13535
13536 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13537
13538         * cfold.cs: Catch division by zero in modulus operator during
13539         constant folding.
13540
13541 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * interface.cs (Interface.DefineMembers): Avoid defining members
13544         twice. 
13545
13546 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13547
13548         * driver.cs: handle the +/- options for -noconfig
13549
13550         * statement.cs (Unckeched.Resolve): Also track the state of
13551         unchecked in the Resolve phase.
13552
13553 2003-02-27  Martin Baulig  <martin@ximian.com>
13554
13555         * ecore.cs (Expression.MemberLookup): Don't create a
13556         MethodGroupExpr for something which is not a method.  Fixes #38291.
13557
13558 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13559
13560         * class.cs (MemberBase.CheckParameters): Also check that the type
13561         is unmanaged if it is a pointer.
13562
13563         * expression.cs (SizeOf.Resolve): Add location information.
13564
13565         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13566         a managed type is declared.
13567
13568         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13569         parameter modifiers as well.  Fixes bug 38606
13570
13571         * class.cs: Very sad.  Am backing out the speed up changes
13572         introduced by the ArrayList -> Array in the TypeContainer, as they
13573         were not actually that much faster, and introduced a bug (no error
13574         reports on duplicated methods).
13575
13576         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13577         source first, this will guarantee that we have a valid expression
13578         before calling in lower levels functions that will require a
13579         resolved object.  Then use this original_source in the
13580         target.ResolveLValue instead of the original source that was
13581         passed to us.
13582
13583         Another change.  Use target.Resolve instead of LValueResolve.
13584         Although we are resolving for LValues, we will let the Assign code
13585         take care of that (it will be called again from Resolve).  This
13586         basically allows code like this:
13587
13588         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13589         class Y { void A (X x) { x [0] += o; }
13590
13591         The problem was that the indexer was trying to resolve for
13592         set_Item (idx, object o) and never finding one.  The real set_Item
13593         was set_Item (idx, X).  By delaying the process we get the right
13594         semantics. 
13595
13596         Fixes bug 36505
13597
13598 2003-02-23  Martin Baulig  <martin@ximian.com>
13599
13600         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13601         while calling DoEmit ().
13602
13603         * codegen.cs (EmitContext.Mark): Don't mark locations in other
13604         source files; if you use the #line directive inside a method, the
13605         compiler stops emitting line numbers for the debugger until it
13606         reaches the end of the method or another #line directive which
13607         restores the original file.
13608
13609 2003-02-23  Martin Baulig  <martin@ximian.com>
13610
13611         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13612
13613 2003-02-23  Martin Baulig  <martin@ximian.com>
13614
13615         * statement.cs (Block.AddChildVariableNames): We need to call this
13616         recursively, not just for our immediate children.
13617
13618 2003-02-23  Martin Baulig  <martin@ximian.com>
13619
13620         * class.cs (Event.Define): Always make the field private, like csc does.
13621
13622         * typemanager.cs (TypeManager.RealMemberLookup): Make events
13623         actually work, fixes bug #37521.
13624
13625 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
13626
13627         * delegate.cs: When creating the various temporary "Parameters"
13628         classes, make sure that we call the ComputeAndDefineParameterTypes
13629         on those new parameters (just like we do with the formal ones), to
13630         allow them to be resolved in the context of the DeclSpace.
13631
13632         This fixes the bug that Dick observed in Bugzilla #38530.
13633
13634 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
13635
13636         * expression.cs (ResolveMemberAccess): When resolving a constant,
13637         do not attempt to pull a constant if the value was not able to
13638         generate a valid constant.
13639
13640         * const.cs (LookupConstantValue): Do not report more errors than required.
13641
13642 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13643
13644         * expression.cs: fixes bug #38328.
13645
13646 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13647
13648         * class.cs: Changed all the various members that can be part of a
13649         class from being an ArrayList to be an Array of the right type.
13650         During the DefineType type_list, interface_list, delegate_list and
13651         enum_list are turned into types, interfaces, delegates and enums
13652         arrays.  
13653
13654         And during the member population, indexer_list, event_list,
13655         constant_list, field_list, instance_constructor_list, method_list,
13656         operator_list and property_list are turned into their real arrays.
13657
13658         Although we could probably perform this operation earlier, for
13659         good error reporting we need to keep the lists and remove the
13660         lists for longer than required.
13661
13662         This optimization was triggered by Paolo profiling the compiler
13663         speed on the output of `gen-sample-program.pl' perl script. 
13664
13665         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13666         not crash in methods like MemberLookupFailed that use this field.  
13667
13668         This problem arises when the compiler fails to resolve a type
13669         during interface type definition for example.
13670
13671 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13674         inherit from System.Object, so we have to stop at null, not only
13675         when reaching System.Object.
13676
13677 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13680         DeclaredOnly because the parent indexer might have had a different
13681         name, but did not loop until the top of the hierarchy was reached.
13682
13683         The problem this one fixes is 35492: when a class implemented an
13684         indexer from an interface, we were getting the interface method
13685         (which was abstract) and we were flagging an error (can not invoke
13686         abstract method).
13687
13688         This also keeps bug 33089 functioning, and test-148 functioning.
13689
13690         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13691         out if a method is special is to see if it is declared in a
13692         property or event, or whether it is one of the predefined operator
13693         names.   This should fix correctly #36804.
13694
13695 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13696
13697         The goal here is to remove the dependency on EmptyCast.Peel ().
13698         Killing it completely.
13699
13700         The problem is that currently in a number of places where
13701         constants are expected, we have to "probe" for an EmptyCast, and
13702         Peel, which is not the correct thing to do, as this will be
13703         repetitive and will likely lead to errors. 
13704
13705         The idea is to remove any EmptyCasts that are used in casts that
13706         can be reduced to constants, so we only have to cope with
13707         constants. 
13708
13709         This bug hunt was triggered by Bug 37363 and the desire to remove
13710         the duplicate pattern where we were "peeling" emptycasts to check
13711         whether they were constants.  Now constants will always be
13712         constants.
13713
13714         * ecore.cs: Use an enumconstant here instead of wrapping with
13715         EmptyCast.  
13716
13717         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13718         throwing me off.  By handling this we can get rid of a few hacks.
13719
13720         * statement.cs (Switch): Removed Peel() code.
13721
13722 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * class.cs: Location information for error 508
13725
13726         * expression.cs (New.DoResolve): Add a guard against double
13727         resolution of an expression.  
13728
13729         The New DoResolve might be called twice when initializing field
13730         expressions (see EmitFieldInitializers, the call to
13731         GetInitializerExpression will perform a resolve on the expression,
13732         and later the assign will trigger another resolution
13733
13734         This leads to bugs (#37014)
13735
13736         * delegate.cs: The signature for EndInvoke should contain any ref
13737         or out parameters as well.  We were not doing this in the past. 
13738
13739         * class.cs (Field.Define): Do not overwrite the type definition
13740         inside the `volatile' group.  Turns out that volatile enumerations
13741         were changing the type here to perform a validity test, which
13742         broke conversions. 
13743
13744 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13745
13746         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13747         and structs, we do not want to load the instance variable
13748
13749         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13750         enum_type has to be handled like an object reference (implicit
13751         conversions exists from this to object), but the regular IsClass
13752         and IsValueType tests will never return true for this one.
13753
13754         Also we use TypeManager.IsValueType instead of type.IsValueType,
13755         just for consistency with the rest of the code (this is only
13756         needed if we ever use the construct exposed by test-180.cs inside
13757         corlib, which we dont today).
13758
13759 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13760
13761         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13762         just InternalCall.
13763
13764 2003-02-09  Martin Baulig  <martin@ximian.com>
13765
13766         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13767         (Namespace.DefineNamespaces): New static public method; this is
13768         called when we're compiling with debugging to add all namespaces
13769         to the symbol file.
13770
13771         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13772         pass it to the Namespace's .ctor.
13773
13774         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13775         and MethodBase arguments; pass the namespace ID to the symwriter;
13776         pass the MethodBase instead of the token to the symwriter.
13777         (SymbolWriter.DefineNamespace): New method to add a namespace to
13778         the symbol file.
13779
13780 2003-02-09  Martin Baulig  <martin@ximian.com>
13781
13782         * symbolwriter.cs: New file.  This is a wrapper around
13783         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13784         methods here in near future.
13785
13786 2003-02-09  Martin Baulig  <martin@ximian.com>
13787
13788         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13789         ILGenerator.MarkSequencePoint() which are actually used by the
13790         symbol writer.
13791
13792 2003-02-09  Martin Baulig  <martin@ximian.com>
13793
13794         * location.cs (SourceFile): New public sealed class.  This
13795         contains the name and an index which is used in the location's token.
13796         (Location): Reserve an appropriate number of bits in the token for
13797         the source file instead of walking over that list, this gives us a
13798         really huge performance improvement when compiling with debugging.
13799
13800         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13801         `SourceFile' argument instead of a string.
13802         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13803         but don't parse/tokenize here, we need to generate the list of all
13804         source files before we do that.
13805         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13806         the files.
13807
13808         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13809         instead of a string.
13810
13811         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13812         of a string.
13813
13814 2003-02-09  Martin Baulig  <martin@ximian.com>
13815
13816         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13817         filename on `#line default'.
13818
13819 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13820
13821         * statement.cs: don't clear the pinned var when the fixed statement
13822         returns from the method (fixes bug#37752).
13823
13824 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13825
13826         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13827         to IsValueType.
13828
13829 2003-02-07  Martin Baulig  <martin@ximian.com>
13830
13831         * driver.cs: Removed the `--debug-args' command line argument.
13832
13833         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13834         automatically by the AsssemblyBuilder.
13835         (CodeGen.InitializeSymbolWriter): We don't need to call any
13836         initialization function on the symbol writer anymore.  This method
13837         doesn't take any arguments.
13838
13839 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13840
13841         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13842         from referenced assemblies as well.
13843
13844 2003-02-02  Martin Baulig  <martin@ximian.com>
13845
13846         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13847
13848 2003-02-02  Martin Baulig  <martin@ximian.com>
13849
13850         * class.cs (Constructor.Emit): Open the symbol writer before
13851         emitting the constructor initializer.
13852         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13853         single-stepping through constructor initializers.
13854
13855 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * class.cs: Handle error 549: do not allow virtual methods in
13858         sealed classes. 
13859
13860 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13861
13862         * decl.cs: Check access levels when resolving types
13863
13864 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13865
13866         * statement.cs: Add parameters and locals set in catch blocks that might 
13867         return to set vector
13868
13869 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13870
13871         * class.cs (Operator): Set the SpecialName flags for operators.
13872
13873         * expression.cs (Invocation.DoResolve): Only block calls to
13874         accessors and operators on SpecialName methods.
13875
13876         (Cast.TryReduce): Handle conversions from char constants.
13877
13878
13879 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13880
13881         * statement.cs: small memory and time optimization in FlowBranching.
13882
13883 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13884
13885         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13886         problem that the last fix but in the other sid (Set).
13887
13888         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13889         access when there is no indexer in the hierarchy.
13890
13891 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13892
13893         * class.cs: Combine some if statements.
13894
13895 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13896
13897         * driver.cs: fixed bug #37187.
13898
13899 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13900
13901         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13902         any indexer, it's needed to build a list with all the indexers in the
13903         hierarchy (AllGetters), else we have problems. Fixes #35653.
13904
13905 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13906
13907         * class.cs (MethodData.Define): It is wrong for an interface
13908         implementation to be static in both cases: explicit and implicit.
13909         We were only handling this in one case.
13910
13911         Improve the if situation there to not have negations.
13912
13913         * class.cs (Field.Define): Turns out that we do not need to check
13914         the unsafe bit on field definition, only on usage.  Remove the test.
13915
13916 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13917
13918         * driver.cs: use assembly.Location instead of Codebase (the latest
13919         patch made mcs fail when using MS assemblies).
13920
13921 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13922
13923         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13924         get the path to *corlib.dll.
13925
13926 2003-01-21  Nick Drochak <ndrochak@gol.com>
13927
13928         * cs-tokenizer.cs:
13929         * pending.cs:
13930         * typemanager.cs: Remove compiler warnings
13931
13932 2003-01-20  Duncan Mak  <duncan@ximian.com>
13933
13934         * AssemblyInfo.cs: Bump the version number to 0.19.
13935
13936 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13937
13938         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13939
13940 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13941
13942         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13943
13944 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * cs-parser.jay: Small fix: we were not comparing the constructor
13947         name correctly.   Thanks to Zoltan for the initial pointer.
13948
13949 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13950
13951         * cs-tokenizer.cs: Set file name when specified with #line
13952
13953 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13954
13955         * cs-parser.jay: Only perform the constructor checks here if we
13956         are named like the class;  This will help provider a better
13957         error.  The constructor path is taken when a type definition is
13958         not found, but most likely the user forgot to add the type, so
13959         report that rather than the constructor error.
13960
13961 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13962
13963         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13964         allocations.
13965
13966 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13967
13968         * cs-parser.jay: Add cleanup call.
13969
13970 2003-01-13  Duncan Mak  <duncan@ximian.com>
13971
13972         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13973         consistent with other methods.
13974
13975 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13976
13977         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13978
13979 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13980
13981         * attribute.cs: only set GuidAttr to true when we have a
13982         GuidAttribute.
13983
13984 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13985
13986         * ecore.cs:
13987         * expression.cs:
13988         * typemanager.cs: fixes to allow mcs compile corlib with the new
13989         Type.IsSubclassOf fix.
13990
13991 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13992
13993         * expression.cs (LocalVariableReference.DoResolve): Classify a
13994         constant as a value, not as a variable.   Also, set the type for
13995         the variable.
13996
13997         * cs-parser.jay (fixed_statement): take a type instead of a
13998         pointer_type, so we can produce a better error message later.
13999
14000         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14001         as an error.  
14002
14003         (For.DoEmit): Make inifinite loops have a
14004         non-conditional branch back.
14005
14006         (Fixed.DoEmit): First populate the pinned variables, then emit the
14007         statement, then clear the variables.  Before I was emitting the
14008         code once for each fixed piece.
14009
14010
14011 2003-01-08  Martin Baulig  <martin@ximian.com>
14012
14013         * statement.cs (FlowBranching.MergeChild): A break in a
14014         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14015
14016 2003-01-08  Martin Baulig  <martin@ximian.com>
14017
14018         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14019         lives in the same number space than `param_map'.  Fixes #36154.
14020
14021 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14022
14023         * cs-parser.jay (constructor_declaration): Set the
14024         Constructor.ModFlags before probing for it.  This makes the
14025         compiler report 514, 515 and 132 (the code was there, but got
14026         broken). 
14027
14028         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14029         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14030         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14031
14032 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14033
14034         * enum.cs: create the enum static fields using the enum type.
14035
14036 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14037
14038         * class.cs: don't try to create the ParamBuilder for the return
14039         type if it's not needed (and handle it breaking for the ms runtime
14040         anyway).
14041
14042 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14043
14044         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14045
14046 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14049         the command.   This showed up while compiling the JANET source
14050         code, which used \r as its only newline separator.
14051
14052 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14053
14054         * class.cs (Method.Define): If we are an operator (because it
14055         reuses our code), then set the SpecialName and HideBySig.  #36128
14056
14057 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14058
14059         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14060         exception, report error 120 `object reference required'.
14061
14062         * driver.cs: Add --pause option, used during to measure the size
14063         of the process as it goes with --timestamp.
14064
14065         * expression.cs (Invocation.DoResolve): Do not allow methods with
14066         SpecialName to be invoked.
14067
14068 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14069
14070         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14071         number before adding it.
14072
14073 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14074
14075         * ecore.cs (StandardImplicitConversion): When in an unsafe
14076         context, we allow conversion between void * to any other pointer
14077         type. This fixes bug #35973.
14078
14079 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14080
14081         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14082         is not thrown when extensionless outputs are used 
14083
14084 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14085
14086         * rootcontext.cs: fixed compilation of corlib.
14087
14088 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14089
14090         * attribute.cs (Attributes.Contains): Add new method.
14091
14092         * class.cs (MethodCore.LabelParameters): if the parameter is an
14093         `out' parameter, check that no attribute `[In]' has been passed.
14094
14095         * enum.cs: Handle the `value__' name in an enumeration.
14096
14097 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14098
14099         * decl.cs: Added special case to allow overrides on "protected
14100         internal" methods
14101
14102 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14103
14104         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14105         since it makes much more sense.
14106
14107         (Attributes.ctor): Don't require a Location parameter.
14108
14109         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14110
14111         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14112         since we already have that information per attribute.
14113
14114         * everywhere : make appropriate changes.
14115
14116         * class.cs (LabelParameters): Write the code which actually
14117         applies attributes to the return type. We can't do this on the MS
14118         .NET runtime so we flag a warning in the case an exception is
14119         thrown.
14120
14121 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * const.cs: Handle implicit null conversions here too.
14124
14125 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14126
14127         * class.cs (MethodCore.LabelParameters): Remove the extra
14128         Type [] parameter since it is completely unnecessary. Instead
14129         pass in the method's attributes so that we can extract
14130         the "return" attribute.
14131
14132 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14133
14134         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14135         of ignoring it and letting the compile continue.
14136
14137         * typemanager.cs (ChangeType): use an extra argument to return an
14138         error condition instead of throwing an exception.
14139
14140 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14141
14142         * expression.cs (Unary.TryReduce): mimic the code for the regular
14143         code path.  Perform an implicit cast in the cases where we can
14144         implicitly convert to one of the integral types, and then reduce
14145         based on that constant.   This fixes bug #35483.
14146
14147 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14148
14149         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14150
14151 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14152
14153         * namespace.cs: fixed bug #35489.
14154
14155 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14156
14157         * class.cs: Remove some dead code.
14158
14159         * cs-parser.jay: Estimate the number of methods needed
14160         (RootContext.MethodCount);
14161
14162         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14163         numbers instead of StringBuilders.
14164
14165         * support.cs (PtrHashtable): Add constructor with initial size;
14166         We can now reduce reallocations of the method table.
14167
14168 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14169
14170         * attribute.cs (ApplyAttributes): Keep track of the emitted
14171         attributes on a per-target basis. This fixes bug #35413.
14172
14173 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14174
14175         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14176         default to the Windows 1252 encoding.
14177
14178         (UnixParseOption): Support version, thanks to Alp for the missing
14179         pointer. 
14180
14181         * AssemblyInfo.cs: Add nice assembly information.
14182
14183         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14184         (bug 35169).
14185
14186         * cs-parser.jay: Allow a trailing comma before the close bracked
14187         in the attribute_section production.
14188
14189         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14190         address of the instance was being taken, I will take this out,
14191         because we take the address of the object immediately here.
14192
14193 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14194
14195         * typemanager.cs (AreMultipleAllowed): Take care of the most
14196         obvious case where attribute type is not in the current assembly -
14197         stupid me ;-)
14198
14199 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14200
14201         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14202         definitions, instead of doing that afterwards.  
14203
14204         Also we use a nice little hack, depending on the constructor, we
14205         know if we are a "composed" name or a simple name.  Hence, we
14206         avoid the IndexOf test, and we avoid 
14207
14208         * codegen.cs: Add code to assist in a bug reporter to track down
14209         the source of a compiler crash. 
14210
14211 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14212
14213         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14214         types have been emitted for a given element and flag an error
14215         if something which does not have AllowMultiple set is used more
14216         than once.
14217
14218         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14219         attribute types and their corresponding AllowMultiple properties
14220
14221         (AreMultipleAllowed): Check the property for a given type.
14222
14223         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14224         property in the case we have a TypeContainer.
14225
14226         (Attributes.AddAttribute): Detect duplicates and just skip on
14227         adding them. This trivial fix catches a pretty gross error in our
14228         attribute emission - global attributes were being emitted twice!
14229
14230         Bugzilla bug #33187 is now fixed.
14231
14232 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14233
14234         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14235         instead of pp_and).
14236
14237         * expression.cs (Binary.ResolveOperator): I can only use the
14238         Concat (string, string, string) and Concat (string, string,
14239         string, string) if the child is actually a concatenation of
14240         strings. 
14241
14242 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14243
14244         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14245         context where we need a 2-character lookahead.
14246
14247         * pending.cs (PendingImplementation): Rework so we can keep track
14248         of interface types all the time, and flag those which were
14249         implemented by parents as optional.
14250
14251 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14252
14253         * expression.cs (Binary.ResolveOperator): Use
14254         String.Concat(string,string,string) or
14255         String.Concat(string,string,string,string) when possible. 
14256
14257         * typemanager: More helper methods.
14258
14259
14260 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14261
14262         * pending.cs: remove the bogus return from GetMissingInterfaces()
14263         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14264
14265 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14266
14267         * namespace.cs: avoid duplicated 'using xxx' being added to
14268         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14269         when we get more than one 'using' statement for the same namespace.
14270         Report a CS0105 warning for it.
14271
14272 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14273
14274         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14275         of calling getChar/putback, uses internal knowledge of it.    
14276
14277         (xtoken): Reorder tokenizer so most common patterns are checked
14278         first.  This reduces the compilation time in another 5% (from 8.11s
14279         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14280
14281         The parsing time is 22% of the compilation in mcs, and from that
14282         64% is spent on the tokenization process.  
14283
14284         I tried using a binary search for keywords, but this is slower
14285         than the hashtable.  Another option would be to do a couple of
14286         things:
14287
14288                 * Not use a StringBuilder, instead use an array of chars,
14289                   with a set value.  Notice that this way we could catch
14290                   the 645 error without having to do it *afterwards*.
14291
14292                 * We could write a hand-parser to avoid the hashtable
14293                   compares altogether.
14294
14295         The identifier consumption process takes 37% of the tokenization
14296         time.  Another 15% is spent on is_number.  56% of the time spent
14297         on is_number is spent on Int64.Parse:
14298
14299                 * We could probably choose based on the string length to
14300                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14301                   computations. 
14302
14303         Another 3% is spend on wrapping `xtoken' in the `token' function.
14304
14305         Handle 0xa0 as whitespace (#34752)
14306
14307 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14308
14309         * typemanager.cs (IsCLRType): New routine to tell whether a type
14310         is one of the builtin types.  
14311
14312         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14313         typecode in more places instead of doing pointer comparissions.
14314         We could leverage some knowledge about the way the typecodes are
14315         laid out.
14316
14317         New code to cache namespaces in assemblies, it is currently not
14318         invoked, to be used soon.
14319
14320         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14321
14322         * expression.cs (Binary.ResolveOperator): specially handle
14323         strings, and do not perform user-defined operator overloading for
14324         built-in types.
14325
14326 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14327
14328         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14329         internalcall as it is a pretty simple operation;  Avoid whenever
14330         possible to call Char.IsLetter.
14331
14332         (consume_identifier): Cut by half the number of
14333         hashtable calls by merging the is_keyword and GetKeyword behavior.
14334
14335         Do not short-circuit, because if we do, we
14336         report errors (ie, #if false && true would produce an invalid
14337         directive error);
14338
14339
14340 2002-11-24  Martin Baulig  <martin@ximian.com>
14341
14342         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14343         check constant ranges and report a CS0221.  Fixes #33186.
14344
14345 2002-11-24  Martin Baulig  <martin@ximian.com>
14346
14347         * cs-parser.jay: Make this work for uninitialized variable
14348         declarations in the `for' initializer.  Fixes #32416.
14349
14350 2002-11-24  Martin Baulig  <martin@ximian.com>
14351
14352         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14353         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14354
14355 2002-11-24  Martin Baulig  <martin@ximian.com>
14356
14357         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14358         argument; if true, we also check for user-defined conversions.
14359         This is only needed if both arguments are of a user-defined type.
14360         Fixes #30443, added test-175.cs.
14361         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14362
14363         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14364
14365 2002-11-24  Martin Baulig  <martin@ximian.com>
14366
14367         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14368         function to get the store opcode.
14369         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14370         only emit the Ldelema if the store opcode is Stobj.  You must run
14371         both test-34 and test-167 to test this.  Fixes #34529.
14372
14373 2002-11-23  Martin Baulig  <martin@ximian.com>
14374
14375         * ecore.cs (Expression.MemberLookup): Added additional
14376         `qualifier_type' argument which is used when we're being called
14377         from MemberAccess.DoResolve() and null if we're called from a
14378         SimpleName lookup.
14379         (Expression.MemberLookupFailed): New method to report errors; this
14380         does the CS1540 check and reports the correct error message.
14381
14382         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14383         argument for the CS1540 check and redone the way how we're dealing
14384         with private members.  See the comment in the source code for details.
14385         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14386         `closure_start_type' to `closure_qualifier_type' and check whether
14387         it's not null.  It was not this filter being broken, it was just
14388         being called with the wrong arguments.
14389
14390         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14391         and pass it the correct `qualifier_type'; this also does the error
14392         handling for us.
14393
14394 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14395
14396         * expression.cs (Invocation.EmitParams): If the we are dealing
14397         with a non-built-in value type, load its address as well.
14398
14399         (ArrayCreation): Use a a pretty constant instead
14400         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14401         static initializers.  
14402
14403         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14404         because they are not really value types, just glorified integers. 
14405
14406         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14407
14408         * ecore.cs: Remove redundant code for enumerations, make them use
14409         the same code path as everything else, fixes the casting issue
14410         with enumerations in Windows.Forms.
14411
14412         * attribute.cs: Do only cast to string if it is a string, the
14413         validation happens later.
14414
14415         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14416         people upgrade their corlibs.
14417
14418         * ecore.cs: Oops, enumerations were not following the entire code path
14419
14420 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14421
14422         * typemanager.cs (FilterWithClosure): Commented out the test for
14423         1540 in typemanager.cs, as it has problems when accessing
14424         protected methods from a parent class (see test-174.cs). 
14425
14426         * attribute.cs (Attribute.ValidateGuid): new method.
14427         (Attribute.Resolve): Use above.
14428
14429 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14430
14431         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14432
14433         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14434         handling for enumerations, as we only needed the TypeContainer
14435         functionality to begin with (this is required for the fix below to
14436         work for enums that reference constants in a container class for
14437         example). 
14438
14439         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14440
14441         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14442         a valid TypeBuilder to perform lookups on.o
14443
14444         * class.cs (InheritableMemberSignatureCompare): Use true in the
14445         call to GetGetMethod and GetSetMethod, because we are comparing
14446         the signature, and we need to get the methods *even* if they are
14447         private. 
14448
14449         (PropertyBase.CheckBase): ditto.
14450
14451         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14452         GotoCase.Resolve): Use Peel on EmpytCasts.
14453
14454         * ecore.cs (EmptyCast): drop child, add Peel method.
14455
14456 2002-11-17  Martin Baulig  <martin@ximian.com>
14457
14458         * ecore.cs (EmptyCast.Child): New public property.
14459
14460         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14461         label resolved to an EmptyCast.  Fixes #34162.
14462         (GotoCase.Resolve): Likewise.
14463         (Block.EmitMeta): Likewise.
14464
14465 2002-11-17  Martin Baulig  <martin@ximian.com>
14466
14467         * expression.cs (Invocation.BetterConversion): Prefer int over
14468         uint; short over ushort; long over ulong for integer literals.
14469         Use ImplicitConversionExists instead of StandardConversionExists
14470         since we also need to check for user-defined implicit conversions.
14471         Fixes #34165.  Added test-173.cs.
14472
14473 2002-11-16  Martin Baulig  <martin@ximian.com>
14474
14475         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14476         with the `true' and `false' literals.  Fixes #33151.
14477
14478 2002-11-16  Martin Baulig  <martin@ximian.com>
14479
14480         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14481         October 22nd; don't do the cs1540 check for static members.
14482
14483         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14484         now using our own filter here and doing the cs1540 check again.
14485
14486 2002-11-16  Martin Baulig  <martin@ximian.com>
14487
14488         * support.cs (InternalParameters): Don't crash if we don't have
14489         any fixed parameters.  Fixes #33532.
14490
14491 2002-11-16  Martin Baulig  <martin@ximian.com>
14492
14493         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14494         when looking up static methods to make this work on Windows.
14495         Fixes #33773.
14496
14497 2002-11-16  Martin Baulig  <martin@ximian.com>
14498
14499         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14500         a setter rather than using PropertyInfo.CanWrite.
14501
14502 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14503
14504         * class.cs: Allow acces to block member by subclasses. Fixes build
14505         breaker.
14506
14507 2002-11-14  Martin Baulig  <martin@ximian.com>
14508
14509         * class.cs (Constructor.Emit): Added the extern/block check.
14510         Fixes bug #33678.
14511
14512 2002-11-14  Martin Baulig  <martin@ximian.com>
14513
14514         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14515         iteration while looking for indexers, this is needed because the
14516         indexer may have a different name in our base classes.  Fixed the
14517         error reporting (no indexers at all, not get accessor, no
14518         overloaded match).  Fixes bug #33089.
14519         (IndexerAccess.DoResolveLValue): Likewise.
14520
14521 2002-11-14  Martin Baulig  <martin@ximian.com>
14522
14523         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14524         indexers.  Fixes the first part of bug #33089.
14525         (MethodSignature.InheritableMemberSignatureCompare): Added support
14526         for properties.
14527
14528 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14529
14530         * attribute.cs (Attribute.Resolve): Catch the
14531         NullReferenceException and report it since it isn't supposed to
14532         happen. 
14533
14534 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14535
14536         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14537         LogicalOr and LogicalAnd that can benefit from recursively
14538         handling EmitBranchable.  The code now should be nice for Paolo.
14539
14540 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14543         the Type lookups, as we perform quite a number of lookups on
14544         non-Types.  This can be removed once we can deterministically tell
14545         whether we have a type or a namespace in advance.
14546
14547         But this might require special hacks from our corlib.
14548
14549         * TODO: updated.
14550
14551         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14552         and double which avoids a conversion from an integer to a double.
14553
14554         * expression.cs: tiny optimization, avoid calling IsConstant,
14555         because it effectively performs the lookup twice.
14556
14557 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14558
14559         But a bogus return here to keep the semantics of the old code
14560         until the Mono runtime is fixed.
14561
14562         * pending.cs (GetMissingInterfaces): New method used to remove all
14563         the interfaces that are already implemented by our parent
14564         classes from the list of pending methods. 
14565
14566         * interface.cs: Add checks for calls after ResolveTypeExpr.
14567
14568 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * class.cs (Class.Emit): Report warning 67: event not used if the
14571         warning level is beyond 3.
14572
14573         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14574         being a NullLiteral.
14575
14576         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14577         specifiers. 
14578
14579         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14580         path that might fail if a type can not be resolved.
14581
14582         * expression.cs (Binary.Emit): Emit unsigned versions of the
14583         operators. 
14584
14585         * driver.cs: use error 5.
14586
14587 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14588
14589         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14590
14591 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * cs-parser.jay (switch_section): A beautiful patch from Martin
14594         Baulig that fixed 33094.
14595
14596 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14597
14598         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14599         Check whether the base is abstract and report an error if so.
14600
14601         * expression.cs (IndexerAccess.DoResolveLValue,
14602         IndexerAccess.DoResolve): ditto. 
14603
14604         (Invocation.DoResolve): ditto.
14605
14606         (Invocation.FullMethodDesc): Improve the report string.
14607
14608         * statement.cs (Block): Eliminate IsVariableDefined as it is
14609         basically just a wrapper for GetVariableInfo.
14610
14611         * ecore.cs (SimpleName): Use new 
14612
14613         * support.cs (ReflectionParamter.ParameterType): We unwrap the
14614         type, as we return the actual parameter ref/unref state on a
14615         different call.
14616
14617 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
14618
14619         * support.cs: Return proper flags REF/OUT fixing the previous
14620         commit.  
14621
14622         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
14623         not used to mean `ref' but `ref or out' in ParameterReference
14624
14625         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14626         full type signature instead of calling TypeManger.CSharpName
14627         ourselves. 
14628
14629         * support.cs (InternalParameters.ParameterDesc): Do not compare
14630         directly to the modflags, because REF/OUT will actually be bitsets
14631         if set. 
14632
14633         * delegate.cs (VerifyMethod): Check also the modifiers.
14634
14635         * cs-tokenizer.cs: Fix bug where floating point values with an
14636         exponent where a sign was missing was ignored.
14637
14638         * driver.cs: Allow multiple assemblies to be specified in a single
14639         /r: argument
14640
14641 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
14644         because identifiers after a parenthesis would end up in this kind
14645         of production, and we needed to desamiguate it for having casts
14646         like:
14647
14648                 (UserDefinedType *) xxx
14649
14650 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14651
14652         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14653         we should set on the Bindingflags.NonPublic, but not turn on
14654         private_ok.  private_ok controls whether a Private member is
14655         returned (this is chekced on the filter routine), while the
14656         BindingFlags.NonPublic just controls whether private/protected
14657         will be allowed.   This fixes the problem part of the problem of
14658         private properties being allowed to be used in derived classes.
14659
14660         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14661         so we can call the children DoResolveLValue method (this will
14662         properly signal errors on lvalue assignments to base properties)
14663
14664         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14665         getter are null, and we have a property info, we know that this
14666         happened because the lookup failed, so we report an error 122 for
14667         protection level violation.
14668
14669         We also silently return if setter and getter are null in the
14670         resolve functions, this condition only happens if we have flagged
14671         the error before.  This is the other half of the problem. 
14672
14673         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14674         not have accessibility information, that is why we were returning
14675         true in the filter function in typemanager.cs.
14676
14677         To properly report 122 (property is inaccessible because of its
14678         protection level) correctly, we report this error in ResolveAccess
14679         by failing if both the setter and the getter are lacking (ie, the
14680         lookup failed). 
14681
14682         DoResolve and DoLResolve have been modified to check for both
14683         setter/getter being null and returning silently, the reason being
14684         that I did not want to put the knowledge about this error in upper
14685         layers, like:
14686
14687         int old = Report.Errors;
14688         x = new PropertyExpr (...);
14689         if (old != Report.Errors)
14690                 return null;
14691         else
14692                 return x;
14693
14694         So the property expr is returned, but it is invalid, so the error
14695         will be flagged during the resolve process. 
14696
14697         * class.cs: Remove InheritablePropertySignatureCompare from the
14698         class, as we no longer depend on the property signature to compute
14699         whether it is possible to implement a method or not.
14700
14701         The reason is that calling PropertyInfo.GetGetMethod will return
14702         null (in .NET, in Mono it works, and we should change this), in
14703         cases where the Get Method does not exist in that particular
14704         class.
14705
14706         So this code:
14707
14708         class X { public virtual int A { get { return 1; } } }
14709         class Y : X { }
14710         class Z : Y { public override int A { get { return 2; } } }
14711
14712         Would fail in Z because the parent (Y) would not have the property
14713         defined.  So we avoid this completely now (because the alternative
14714         fix was ugly and slow), and we now depend exclusively on the
14715         method names.
14716
14717         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14718         reference method, instead of using the property.
14719
14720         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14721         routines are gone now.
14722
14723         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14724         names, they were incorrectly named.
14725
14726         * cs-tokenizer.cs: Return are more gentle token on failure. 
14727
14728         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14729         had an out-of-sync index variable, which caused it to remove from
14730         the list of pending methods the wrong method sometimes.
14731
14732 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14733
14734         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14735         CanWrite, because those refer to this particular instance of the
14736         property, and do not take into account the fact that we can
14737         override single members of a property.
14738
14739         Constructor requires an EmitContext.  The resolution process does
14740         not happen here, but we need to compute the accessors before,
14741         because the resolution does not always happen for properties.
14742
14743         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14744         subclass, before we did not update this flag, but we did update
14745         bindingflags. 
14746
14747         (GetAccessors): Drop this routine, as it did not work in the
14748         presence of partially overwritten set/get methods. 
14749
14750         Notice that this broke the cs1540 detection, but that will require
14751         more thinking. 
14752
14753 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14754
14755         * class.cs:
14756         * codegen.cs:
14757         * driver.cs: issue a warning instead of an error if we don't support
14758         debugging for the platform. Also ignore a couple of errors that may
14759         arise when trying to write the symbols. Undo my previous patch.
14760
14761 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14762
14763         * driver.cs: ignore /debug switch except for Unix platforms.
14764
14765 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14766
14767         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14768
14769 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14770
14771         * driver.cs: Do not make mcs-debug conditional, so we do not break
14772         builds that use it.
14773
14774         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14775         review this patch.  But basically after all the children variables
14776         have been merged, the value of "Breaks" was not being set to
14777         new_breaks for Switch blocks.  I think that it should be set after
14778         it has executed.  Currently I set this to the value of new_breaks,
14779         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14780         conservative, but I do not understand this code very well.
14781
14782         I did not break anything in the build, so that is good ;-)
14783
14784         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14785
14786 2002-10-20  Mark Crichton  <crichton@gimp.org>
14787
14788         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14789
14790 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14791
14792         * cfold.cs: Fixed compile blocker.
14793
14794 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14795
14796         * driver.cs: I was chekcing the key, not the file.
14797
14798 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14799
14800         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14801         message that we were generating - we just need to silently return
14802         a null.
14803
14804 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14805
14806         * class.cs (Event.Define): Change my previous commit, as this
14807         breaks the debugger.  This is a temporary hack, as it seems like
14808         the compiler is generating events incorrectly to begin with.
14809
14810         * expression.cs (Binary.ResolveOperator): Added support for 
14811         "U operator - (E x, E y)"
14812
14813         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14814         y)".
14815
14816         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14817         init-only variables, but this path did not take into account that
14818         there might be also instance readonly variables.  Correct this
14819         problem. 
14820
14821         This fixes bug 32253
14822
14823         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14824         delegates as well.
14825
14826         * driver.cs: Change the extension for modules to `netmodule'
14827
14828         * cs-parser.jay: Improved slightly the location tracking for
14829         the debugger symbols.
14830
14831         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14832         modifiers that were specified instead of the hardcoded value
14833         (FamAndAssem).  This was basically ignoring the static modifier,
14834         and others.  Fixes 32429.
14835
14836         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14837         fixed a bug in the process (32476)
14838
14839         * expression.cs (ArrayAccess.EmitAssign): Patch from
14840         hwang_rob@yahoo.ca that fixes bug 31834.3
14841
14842 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * driver.cs: Make the module extension .netmodule.
14845
14846 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14847
14848         * driver.cs: Report an error if the resource file is not found
14849         instead of crashing.
14850
14851         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14852         false, like Emit does.
14853
14854 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14855
14856         * typemanager.cs: Remove unused private member.  Also reported mcs
14857         bug to report this as a warning like csc.
14858
14859 2002-10-15  Martin Baulig  <martin@gnome.org>
14860
14861         * statement.cs (Statement.Emit): Made this a virtual method; emits
14862         the line number info and calls DoEmit().
14863         (Statement.DoEmit): New protected abstract method, formerly knows
14864         as Statement.Emit().
14865
14866         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14867
14868 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14871         have fixed a remaining problem: not every AddXXXX was adding a
14872         fully qualified name.  
14873
14874         Now everyone registers a fully qualified name in the DeclSpace as
14875         being defined instead of the partial name.  
14876
14877         Downsides: we are slower than we need to be due to the excess
14878         copies and the names being registered this way.  
14879
14880         The reason for this is that we currently depend (on the corlib
14881         bootstrap for instance) that types are fully qualified, because
14882         we dump all the types in the namespace, and we should really have
14883         types inserted into the proper namespace, so we can only store the
14884         basenames in the defined_names array.
14885
14886 2002-10-10  Martin Baulig  <martin@gnome.org>
14887
14888         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14889         from bug #31834, see the bug report for a testcase which is
14890         miscompiled.
14891
14892 2002-10-10  Martin Baulig  <martin@gnome.org>
14893
14894         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14895         flow analysis code for this.
14896
14897         * statement.cs (Do, While, For): Tell the flow analysis code about
14898         infinite loops.
14899         (FlowBranching.UsageVector): Added support for infinite loops.
14900         (Block.Resolve): Moved the dead code elimination here and use flow
14901         analysis to do it.
14902
14903 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * class.cs (Field.Define): Catch cycles on struct type
14906         definitions. 
14907
14908         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14909         fields if the fields are static.  We only need to check instance
14910         fields. 
14911
14912         * expression.cs (As.DoResolve): Test for reference type.
14913
14914         * statement.cs (Using.ResolveExpression): Use
14915         ConvertImplicitRequired, not ConvertImplicit which reports an
14916         error on failture
14917         (Using.ResolveLocalVariableDecls): ditto.
14918
14919         * expression.cs (Binary.ResolveOperator): Report errors in a few
14920         places where we had to.
14921
14922         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14923
14924 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14925
14926         * expression.cs: Use StoreFromPtr instead of extracting the type
14927         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14928
14929         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14930         an enumeration value to a System.Enum, but System.Enum is not a
14931         value type, but an class type, so we need to box.
14932
14933         (Expression.ConvertExplicit): One codepath could return
14934         errors but not flag them.  Fix this.  Fixes #31853
14935
14936         * parameter.cs (Resolve): Do not allow void as a parameter type.
14937
14938 2002-10-06  Martin Baulig  <martin@gnome.org>
14939
14940         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14941         if it's a class type and not a struct.  Fixes #31815.
14942
14943 2002-10-06  Martin Baulig  <martin@gnome.org>
14944
14945         * statement.cs: Reworked the flow analysis code a bit to make it
14946         usable for dead code elimination.
14947
14948 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14949
14950         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14951
14952 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14953
14954         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14955         to fix the test 165, will investigate deeper.
14956
14957 2002-10-04  Martin Baulig  <martin@gnome.org>
14958
14959         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14960         finally blocks actually work.
14961         (Try.Resolve): We don't need to create a sibling for `finally' if
14962         there is no finally block.
14963
14964 2002-10-04  Martin Baulig  <martin@gnome.org>
14965
14966         * class.cs (Constructor.Define): The default accessibility for a
14967         non-default constructor is private, not public.
14968
14969 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14970
14971         * class.cs (Constructor): Make AllowedModifiers public, add
14972         EXTERN.
14973
14974         * cs-parser.jay: Perform the modifiers test here, as the
14975         constructor for the Constructor class usually receives a zero
14976         because of the way we create it (first we create, later we
14977         customize, and we were never checking the modifiers).
14978
14979         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14980         is a version of LookupTypeReflection that includes the type-name
14981         cache.  This can be used as a fast path for functions that know
14982         the fully qualified name and are only calling into *.GetType() to
14983         obtain a composed type.
14984
14985         This is also used by TypeManager.LookupType during its type
14986         composition.
14987
14988         (LookupType): We now also track the real type name, as sometimes
14989         we can get a quey for the real type name from things like
14990         ComposedCast.  This fixes bug 31422.
14991
14992         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14993         complete type fullname, it does not have to go through the type
14994         resolution system to obtain the composed version of the type (for
14995         obtaining arrays or pointers).
14996
14997         (Conditional.Emit): Use the EmitBoolExpression to
14998         generate nicer code, as requested by Paolo.
14999
15000         (ArrayCreation.CheckIndices): Use the patch from
15001         hwang_rob@yahoo.ca to validate the array initializers. 
15002
15003 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15004
15005         * class.cs (ConstructorInitializer.Emit): simplify code by using
15006         Invocation.EmitCall, and at the same time, fix the bugs in calling
15007         parent constructors that took variable arguments. 
15008
15009         * ecore.cs (Expression.ConvertNumericExplicit,
15010         Expression.ImplicitNumericConversion): Remove the code that
15011         manually wrapped decimal (InternalTypeConstructor call is now gone
15012         as well).
15013
15014         * expression.cs (Cast.TryReduce): Also handle decimal types when
15015         trying to perform a constant fold on the type.
15016
15017         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15018
15019         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15020         that only turned off an error report, and did nothing else. 
15021
15022 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15023
15024         * driver.cs: Handle and ignore /fullpaths
15025
15026 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15027
15028         * expression.cs (Binary.ResolveOperator): Catch the case where
15029         DoNumericPromotions returns true, 
15030
15031         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15032
15033 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15034
15035         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15036         report error 70.
15037
15038 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15041         conversion exists, but it is also required that the conversion be
15042         performed.  This manifested in "(Type64Enum) 2".  
15043
15044         * class.cs (TypeManager.AddMethod): The fix is not to change
15045         AddEnum, because that one was using a fully qualified name (every
15046         DeclSpace derivative does), but to change the AddMethod routine
15047         that was using an un-namespaced name.  This now correctly reports
15048         the duplicated name.
15049
15050         Revert patch until I can properly fix it.  The issue
15051         is that we have a shared Type space across all namespaces
15052         currently, which is wrong.
15053
15054         Options include making the Namespace a DeclSpace, and merge
15055         current_namespace/current_container in the parser.
15056
15057 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * cs-parser.jay: Improve error reporting when we get a different
15060         kind of expression in local_variable_type and
15061         local_variable_pointer_type. 
15062
15063         Propagate this to avoid missleading errors being reported.
15064
15065         * ecore.cs (ImplicitReferenceConversion): treat
15066         TypeManager.value_type as a target just like object_type.   As
15067         code like this:
15068
15069         ValueType v = 1;
15070
15071         Is valid, and needs to result in the int 1 being boxed before it
15072         is assigned to the value type v.
15073
15074         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15075         to validate the enumeration name.
15076
15077         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15078         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15079         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15080
15081         * ecore.cs (TryImplicitIntConversion): When doing an
15082         implicit-enumeration-conversion, check if the type is 64-bits and
15083         perform a conversion before passing to EnumConstant.
15084
15085 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15088         report ambiguous type references.  Unlike the MS version, we
15089         report what the ambiguity is.   Innovation at work ;-)
15090
15091         (DeclSpace.FindType): Require a location argument to
15092         display when we display an ambiguous error.
15093
15094         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15095
15096         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15097
15098         * expression.cs (EmitDynamicInitializers): Apply patch from
15099         hwang_rob@yahoo.ca that fixes the order in which we emit our
15100         initializers. 
15101
15102 2002-09-21  Martin Baulig  <martin@gnome.org>
15103
15104         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15105         delegate takes no arguments.
15106
15107 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15110         from integers.
15111
15112         * expression.cs: Extract the underlying type.
15113
15114         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15115
15116         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15117
15118 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15119
15120         * class.cs (TypeContainer.DefineType): We can not use the nice
15121         PackingSize with the size set to 1 DefineType method, because it
15122         will not allow us to define the interfaces that the struct
15123         implements.
15124
15125         This completes the fixing of bug 27287
15126
15127         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15128         means also structs.  This fixes part of the problem. 
15129         (Expresion.ImplicitReferenceConversionExists): ditto.
15130
15131         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15132         error if there were no errors reported during the type lookup
15133         process, to avoid duplicates or redundant errors.  Without this
15134         you would get an ambiguous errors plus a type not found.  We have
15135         beaten the user enough with the first error.  
15136
15137         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15138         reference. 
15139
15140         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15141         during the resolution process, stop the lookup, this avoids
15142         repeated error reports (same error twice).
15143
15144         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15145
15146         * typemanager.cs (LookupType): Redo the type lookup code to match
15147         the needs of System.Reflection.  
15148
15149         The issue is that System.Reflection requires references to nested
15150         types to begin with a "+" sign instead of a dot.  So toplevel
15151         types look like: "NameSpace.TopLevelClass", and nested ones look
15152         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15153         levels. 
15154
15155 2002-09-19  Martin Baulig  <martin@gnome.org>
15156
15157         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15158         says that a method always returns or always throws an exception,
15159         don't report the CS0161.
15160
15161         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15162         set `Returns = new_returns'.
15163
15164 2002-09-19  Martin Baulig  <martin@gnome.org>
15165
15166         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15167         to an enum constant, check for a CS0176.
15168
15169 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15170
15171         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15172         for operators that must be in pairs and report errors.
15173
15174         * ecore.cs (SimpleName.DoResolveType): During the initial type
15175         resolution process, when we define types recursively, we must
15176         check first for types in our current scope before we perform
15177         lookups in the enclosing scopes.
15178
15179         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15180
15181         (Invocation.VerifyArgumentsCompat): Call
15182         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15183         I thought we were supposed to always call this, but there are a
15184         few places in the code where we dont do it.
15185
15186 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15187
15188         * driver.cs: Add support in -linkres and -resource to specify the
15189         name of the identifier.
15190
15191 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * ecore.cs (StandardConversionExists): Sync with the conversion
15194         code: allow anything-* to void* conversions.
15195
15196         (FindMostSpecificSource): Use an Expression argument
15197         instead of a Type, because we might be handed over a Literal which
15198         gets a few more implicit conversions that plain types do not.  So
15199         this information was being lost.
15200
15201         Also, we drop the temporary type-holder expression when not
15202         required.
15203
15204 2002-09-17  Martin Baulig  <martin@gnome.org>
15205
15206         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15207         this is an explicit interface implementation.
15208
15209 2002-09-17  Martin Baulig  <martin@gnome.org>
15210
15211         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15212         different `IndexerName' attributes.
15213
15214         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15215         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15216         virtual CommonResolve().
15217
15218 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15219
15220         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15221         and convert that to the UnderlyingType.
15222
15223         * statement.cs (Foreach.Resolve): Indexers are just like variables
15224         or PropertyAccesses.
15225
15226         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15227         inside quoted strings, we were not doing this before.
15228
15229 2002-09-16  Martin Baulig  <martin@gnome.org>
15230
15231         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15232         resolve it.  This is needed for the definite assignment check of the
15233         instance expression, fixes bug #29846.
15234         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15235
15236 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15237
15238         * parameter.cs: Fix compile error.  Cannot reference static member
15239         from an instance object.  Is this an mcs bug?
15240
15241 2002-09-14  Martin Baulig  <martin@gnome.org>
15242
15243         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15244         multiple times.  Fixes bug #30295, added test-166.cs.
15245
15246 2002-09-14  Martin Baulig  <martin@gnome.org>
15247
15248         * statement.cs (Block.Emit): Don't emit unreachable code.
15249         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15250         `break' statements.
15251         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15252
15253 2002-09-14  Martin Baulig  <martin@gnome.org>
15254
15255         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15256         is set.
15257
15258 2002-09-14  Martin Baulig  <martin@gnome.org>
15259
15260         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15261         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15262         be false on the ms runtime.
15263
15264 2002-09-13  Martin Baulig  <martin@gnome.org>
15265
15266         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15267         the CS0038 error message.
15268
15269 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15270
15271         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15272         constant inside, return it.
15273
15274 2002-09-12  Martin Baulig  <martin@gnome.org>
15275
15276         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15277         implicit conversion can be done between enum types.
15278
15279         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15280         check whether an implicit conversion to the current enum's UnderlyingType
15281         exists and report an error if not.
15282
15283         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15284         without debugging support.
15285
15286         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15287         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15288
15289 2002-09-12  Martin Baulig  <martin@gnome.org>
15290
15291         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15292
15293         * ecore.cs (IMemberExpr.DeclaringType): New property.
15294         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15295         nonstatic member of an outer type (CS0038).
15296
15297 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * driver.cs: Activate the using-error detector at warning level
15300         4 (at least for MS-compatible APIs).
15301
15302         * namespace.cs (VerifyUsing): Small buglett fix.
15303
15304         * pending.cs (PendingImplementation): pass the container pointer. 
15305
15306         * interface.cs (GetMethods): Allow for recursive definition.  Long
15307         term, I would like to move every type to support recursive
15308         definitions, not the current ordering mechanism that we have right
15309         now.
15310
15311         The situation is this: Attributes are handled before interfaces,
15312         so we can apply attributes to interfaces.  But some attributes
15313         implement interfaces, we will now handle the simple cases
15314         (recursive definitions will just get an error).  
15315
15316         * parameter.cs: Only invalidate types at the end if we fail to
15317         lookup all types.  
15318
15319 2002-09-09  Martin Baulig  <martin@gnome.org>
15320
15321         * ecore.cs (PropertyExpr.Emit): Also check for
15322         TypeManager.system_int_array_get_length so this'll also work when
15323         compiling corlib.  Fixes #30003.
15324
15325 2002-09-09  Martin Baulig  <martin@gnome.org>
15326
15327         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15328         and throw an exception if we can't get the type's size.  Fixed #30040,
15329         added test-165.cs.
15330
15331 2002-09-09  Martin Baulig  <martin@gnome.org>
15332
15333         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15334
15335         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15336         context.  Fixes bug #30027.
15337
15338         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15339         virtual functions.  Fixes bug #30043, added test-164.cs.
15340
15341 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15342
15343         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15344
15345 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15346
15347         * driver.cs: Use an object to get the windows codepage since it's not a
15348         static property.
15349
15350 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15351
15352         * statement.cs (For.Emit): for infinite loops (test == null)
15353         return whether there is a break inside, not always "true".
15354
15355         * namespace.cs (UsingEntry): New struct to hold the name of the
15356         using definition, the location where it is defined, and whether it
15357         has been used in a successful type lookup.
15358
15359         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15360         strings.
15361
15362         * decl.cs: ditto.
15363
15364 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15365
15366         * attribute.cs : Fix incorrect code which relied on catching
15367         a NullReferenceException to detect a null being passed in
15368         where an object was expected.
15369
15370 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * statement.cs (Try): flag the catch variable as assigned
15373
15374         * expression.cs (Cast): Simplified by using ResolveType instead of
15375         manually resolving.
15376
15377         * statement.cs (Catch): Fix bug by using ResolveType.
15378
15379 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15380
15381         * expression.cs (BetterConversion): Special case for when we have
15382         a NullLiteral as the argument and we have to choose between string
15383         and object types - we choose string the way csc does.
15384
15385         * attribute.cs (Attribute.Resolve): Catch the
15386         NullReferenceException and report error #182 since the Mono
15387         runtime no more has the bug and having this exception raised means
15388         we tried to select a constructor which takes an object and is
15389         passed a null.
15390
15391 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15392
15393         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15394         message (1502, 1503) when we can't locate a method after overload
15395         resolution. This is much more informative and closes the bug
15396         Miguel reported.
15397
15398         * interface.cs (PopulateMethod): Return if there are no argument
15399         types. Fixes a NullReferenceException bug.
15400
15401         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15402         expressions too. Previously we were checking only in one place for
15403         positional arguments leaving out named arguments.
15404
15405         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15406         type to the enum type is not allowed. Remove code corresponding to
15407         that.
15408
15409         (ConvertNumericExplicit): Allow explicit conversions from
15410         the underlying type to enum type. This precisely follows the spec
15411         and closes a bug filed by Gonzalo.
15412
15413 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15414
15415         * compiler.csproj:
15416         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15417
15418 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15421         it was important that we stored the right value after the
15422         reduction in `converted'.
15423
15424 2002-09-04  Martin Baulig  <martin@gnome.org>
15425
15426         * location.cs (Location.SymbolDocument): Use full pathnames for the
15427         source files.
15428
15429 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15430
15431         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15432         of the expression resolve mechanism, because that will catch the
15433         SimpleName error failures.
15434
15435         (Conditional): If we can not resolve the
15436         expression, return, do not crash.
15437
15438 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15439
15440         * cs-tokenizer.cs:
15441         (location): display token name instead of its number.
15442
15443 2002-08-28  Martin Baulig  <martin@gnome.org>
15444
15445         * expression.cs (Binary.ResolveOperator): Don't silently return
15446         but return an error if an operator cannot be applied between two
15447         enum types.
15448
15449 2002-08-28  Martin Baulig  <martin@gnome.org>
15450
15451         * class.cs (Constructor.Define): Set the permission attributes
15452         correctly instead of making all constructors public.
15453
15454 2002-08-28  Martin Baulig  <martin@gnome.org>
15455
15456         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15457         for private members before reporting a CS0103; if we find anything,
15458         it's a CS0122.
15459
15460 2002-08-28  Martin Baulig  <martin@gnome.org>
15461
15462         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15463         to check whether `closure_start_type == closure_invocation_type',
15464         we also need to check whether `m.DeclaringType == closure_invocation_type'
15465         before bypassing the permission checks.  We might be accessing
15466         protected/private members from the base class.
15467         (TypeManager.RealMemberLookup): Only set private_ok if private
15468         members were requested via BindingFlags.NonPublic.
15469
15470         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15471
15472         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15473         MethodGroupExpr.IsExplicitImpl if appropriate.
15474         (Invocation.DoResolve): Don't report the CS0120 for explicit
15475         interface implementations.
15476
15477 2002-08-27  Martin Baulig  <martin@gnome.org>
15478
15479         * expression.cs (Invocation.DoResolve): If this is a static
15480         method and we don't have an InstanceExpression, we must report
15481         a CS0120.
15482
15483 2002-08-25  Martin Baulig  <martin@gnome.org>
15484
15485         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15486         `==' between a valuetype and an object.
15487
15488 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15489
15490         * ecore.cs (TypeExpr): Provide a ToString method.
15491
15492 2002-08-24  Martin Baulig  <martin@gnome.org>
15493
15494         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15495         now called proggie.dbg and it's a binary file.
15496
15497 2002-08-23  Martin Baulig  <martin@gnome.org>
15498
15499         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15500
15501 2002-08-23  Martin Baulig  <martin@gnome.org>
15502
15503         * struct.cs (MyStructInfo.ctor): Make this work with empty
15504         structs; it's not allowed to use foreach() on null.
15505
15506 2002-08-23  Martin Baulig  <martin@gnome.org>
15507
15508         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15509         writer the full pathname of the generated assembly.
15510
15511 2002-08-23  Martin Baulig  <martin@gnome.org>
15512
15513         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15514         A `finally' block never returns or breaks; improved handling of
15515         unreachable code.
15516
15517 2002-08-23  Martin Baulig  <martin@gnome.org>
15518
15519         * statement.cs (Throw.Resolve): Allow `throw null'.
15520
15521 2002-08-23  Martin Baulig  <martin@gnome.org>
15522
15523         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15524         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15525         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15526         MemberLookup would return a wrong event if this is an explicit
15527         interface implementation and the class has an event with the same
15528         name.
15529
15530 2002-08-23  Martin Baulig  <martin@gnome.org>
15531
15532         * statement.cs (Block.AddChildVariableNames): New public method.
15533         (Block.AddChildVariableName): Likewise.
15534         (Block.IsVariableNameUsedInChildBlock): Likewise.
15535         (Block.AddVariable): Check whether a variable name has already
15536         been used in a child block.
15537
15538         * cs-parser.jay (declare_local_variables): Mark all variable names
15539         from the current block as being used in a child block in the
15540         implicit block.
15541
15542 2002-08-23  Martin Baulig  <martin@gnome.org>
15543
15544         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15545         find the symbol writer.
15546
15547         * driver.cs: csc also allows the arguments to /define being
15548         separated by commas, not only by semicolons.
15549
15550 2002-08-23  Martin Baulig  <martin@gnome.org>
15551
15552         * interface.cs (Interface.GetMembers): Added static check for events.
15553
15554 2002-08-15  Martin Baulig  <martin@gnome.org>
15555
15556         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15557         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15558
15559         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15560         why the MethodData.EmitDestructor() change was necessary.
15561
15562 2002-08-20  Martin Baulig  <martin@gnome.org>
15563
15564         * class.cs (TypeContainer.FindMembers): Added static check for events.
15565
15566         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15567
15568         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15569         use Type.GetEvents(), not Type.FindMembers().
15570
15571 2002-08-20  Martin Baulig  <martin@gnome.org>
15572
15573         * decl.cs (MemberCache): Added a special method cache which will
15574         be used for method-only searched.  This ensures that a method
15575         search will return a MethodInfo with the correct ReflectedType for
15576         inherited methods.      
15577
15578 2002-08-20  Martin Baulig  <martin@gnome.org>
15579
15580         * decl.cs (DeclSpace.FindMembers): Made this public.
15581
15582 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15583
15584         * delegate.cs: fixed build on windows.
15585         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15586
15587 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15588
15589         * ecore.cs (StandardConversionExists): Return a false
15590         if we are trying to convert the void type to anything else
15591         since that is not allowed.
15592
15593         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15594         we flag error 70 in the event an event is trying to be accessed
15595         directly from outside the declaring type.
15596
15597 2002-08-20  Martin Baulig  <martin@gnome.org>
15598
15599         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15600         MemberCache from typemanager.cs to decl.cs.
15601
15602 2002-08-19  Martin Baulig  <martin@gnome.org>
15603
15604         * class.cs (TypeContainer): Implement IMemberContainer.
15605         (TypeContainer.DefineMembers): Create the MemberCache.
15606         (TypeContainer.FindMembers): Do better BindingFlags checking; only
15607         return public members if BindingFlags.Public was given, check
15608         whether members are static.
15609
15610 2002-08-16  Martin Baulig  <martin@gnome.org>
15611
15612         * decl.cs (DeclSpace.Define): Splitted this in Define and
15613         DefineMembers.  DefineMembers is called first and initializes the
15614         MemberCache.
15615
15616         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
15617         DefineMembers() on all our DeclSpaces.
15618
15619         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15620         but call DefineMembers() on all nested interfaces.  We call their
15621         Define() in our new Define() function.
15622
15623         * interface.cs (Interface): Implement IMemberContainer.
15624         (Interface.Define): Moved all code except the attribute stuf to
15625         DefineMembers().
15626         (Interface.DefineMembers): Initialize the member cache.
15627
15628         * typemanager.cs (IMemberFinder): Removed this interface, we don't
15629         need this anymore since we can use MemberCache.FindMembers directly.
15630
15631 2002-08-19  Martin Baulig  <martin@gnome.org>
15632
15633         * typemanager.cs (MemberCache): When creating the cache for an
15634         interface type, add all inherited members.
15635         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15636         to `out bool used_cache' and documented it.
15637         (TypeManager.MemberLookup): If we already used the cache in the first
15638         iteration, we don't need to do the interfaces check.
15639
15640 2002-08-19  Martin Baulig  <martin@gnome.org>
15641
15642         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
15643         here from IMemberFinder and don't implement this interface anymore.
15644         (DeclSpace.MemberCache): Moved here from IMemberFinder.
15645
15646         * typemanager.cs (IMemberFinder): This interface is now only used by
15647         classes which actually support the member cache.
15648         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15649         since we only put DeclSpaces into this Hashtable.
15650         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15651         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15652
15653 2002-08-16  Martin Baulig  <martin@gnome.org>
15654
15655         * typemanager.cs (ICachingMemberFinder): Removed.
15656         (IMemberFinder.MemberCache): New property.
15657         (TypeManager.FindMembers): Merged this with RealFindMembers().
15658         This function will never be called from TypeManager.MemberLookup()
15659         so we can't use the cache here, just the IMemberFinder.
15660         (TypeManager.MemberLookup_FindMembers): Check whether the
15661         IMemberFinder has a MemberCache and call the cache's FindMembers
15662         function.
15663         (MemberCache): Rewrote larger parts of this yet another time and
15664         cleaned it up a bit.
15665
15666 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15667
15668         * driver.cs (LoadArgs): Support quoting.
15669
15670         (Usage): Show the CSC-like command line arguments.
15671
15672         Improved a few error messages.
15673
15674 2002-08-15  Martin Baulig  <martin@gnome.org>
15675
15676         * typemanager.cs (IMemberContainer.Type): New property.
15677         (IMemberContainer.IsInterface): New property.
15678
15679         The following changes are conditional to BROKEN_RUNTIME, which is
15680         defined at the top of the file.
15681
15682         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15683         class'es members, but add all members from TypeHandle.ObjectType
15684         if we're an interface.
15685         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15686         is the current type.
15687         (MemberCache.CacheEntry.Container): Removed this field.
15688         (TypeHandle.GetMembers): Include inherited members.
15689
15690 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15691
15692         * typemanager.cs: fixed compilation and added a comment on a field that
15693         is never used.
15694
15695 2002-08-15  Martin Baulig  <martin@gnome.org>
15696
15697         * class.cs (ConstructorInitializer.Resolve): In the
15698         Expression.MemberLookup call, use the queried_type as
15699         invocation_type.
15700
15701         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15702         declared' attribute, it's always true.
15703         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15704         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15705         temporary wrapper for FindMembers which tells MemberLookup whether
15706         members from the base classes are included in the return value.
15707         This will go away soon.
15708         (TypeManager.MemberLookup): Use this temporary hack here; once the
15709         new MemberCache is completed, we don't need to do the DeclaredOnly
15710         looping here anymore since the MemberCache will take care of this.
15711         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15712         (MemberCache): When creating the MemberCache for a class, get
15713         members from the current class and all its base classes.
15714         (MemberCache.CacheEntry.Container): New field.  This is a
15715         temporary hack until the Mono runtime is fixed to distinguish
15716         between ReflectedType and DeclaringType.  It allows us to use MCS
15717         with both the MS runtime and the unfixed Mono runtime without
15718         problems and without accecting performance.
15719         (MemberCache.SearchMembers): The DeclaredOnly looping from
15720         TypeManager.MemberLookup is now done here.      
15721
15722 2002-08-14  Martin Baulig  <martin@gnome.org>
15723
15724         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15725         Type.GetFields on dynamic types but get the fields from the
15726         corresponding TypeContainer.
15727         (MyStructInfo.GetStructInfo): Added check for enum types.
15728
15729         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15730         (MemberList.SyncRoot): Implemented.
15731         (TypeManager.FilterWithClosure): No need to check permissions if
15732         closure_start_type == closure_invocation_type, don't crash if
15733         closure_invocation_type is null.
15734
15735 2002-08-13  Martin Baulig  <martin@gnome.org>
15736
15737         Rewrote TypeContainer.FindMembers to use a member cache.  This
15738         gives us a speed increase of about 35% for the self-hosting MCS
15739         build and of about 15-20% for the class libs (both on GNU/Linux).
15740
15741         * report.cs (Timer): New class to get enhanced profiling.  This
15742         whole class is "TIMER" conditional since it remarkably slows down
15743         compilation speed.
15744
15745         * class.cs (MemberList): New class.  This is an IList wrapper
15746         which we're now using instead of passing MemberInfo[]'s around to
15747         avoid copying this array unnecessarily.
15748         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15749         (ICachingMemberFinder, IMemberContainer): New interface.
15750         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15751         has already been checked, otherwise use it for the name comparision.
15752         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15753         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15754         if possible.  Returns a MemberList, not a MemberInfo [].
15755         (TypeHandle): New class, implements IMemberContainer.  We create
15756         one instance of this class per type, it contains a MemberCache
15757         which is used to do the member lookups.
15758         (MemberCache): New class.  Each instance of this class contains
15759         all members of a type and a name-based hash table.
15760         (MemberCache.FindMembers): This is our new member lookup
15761         function.  First, it looks up all members of the requested name in
15762         the hash table.  Then, it walks this list and sorts out all
15763         applicable members and returns them.
15764
15765 2002-08-13  Martin Baulig  <martin@gnome.org>
15766
15767         In addition to a nice code cleanup, this gives us a performance
15768         increase of about 1.4% on GNU/Linux - not much, but it's already
15769         half a second for the self-hosting MCS compilation.
15770
15771         * typemanager.cs (IMemberFinder): New interface.  It is used by
15772         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15773         Enum, Delegate or Interface.
15774         (TypeManager.finder_to_member_finder): New PtrHashtable.
15775         (TypeManager.finder_to_container): Removed.
15776         (TypeManager.finder_to_delegate): Removed.
15777         (TypeManager.finder_to_interface): Removed.
15778         (TypeManager.finder_to_enum): Removed.
15779
15780         * interface.cs (Interface): Implement IMemberFinder.
15781
15782         * delegate.cs (Delegate): Implement IMemberFinder.
15783
15784         * enum.cs (Enum): Implement IMemberFinder.
15785
15786         * class.cs (TypeContainer): Implement IMemberFinder.
15787
15788 2002-08-12  Martin Baulig  <martin@gnome.org>
15789
15790         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15791
15792 2002-08-12  Martin Baulig  <martin@gnome.org>
15793
15794         * ecore.cs (ITypeExpression): New interface for expressions which
15795         resolve to a type.
15796         (TypeExpression): Renamed to TypeLookupExpression.
15797         (Expression.DoResolve): If we're doing a types-only lookup, the
15798         expression must implement the ITypeExpression interface and we
15799         call DoResolveType() on it.
15800         (SimpleName): Implement the new ITypeExpression interface.
15801         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15802         hack, the situation that we're only looking up types can't happen
15803         anymore when this method is called.  Moved the type lookup code to
15804         DoResolveType() and call it.
15805         (SimpleName.DoResolveType): This ITypeExpression interface method
15806         is now doing the types-only lookup.
15807         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15808         (ResolveFlags): Added MaskExprClass.
15809
15810         * expression.cs (MemberAccess): Implement the ITypeExpression
15811         interface.
15812         (MemberAccess.DoResolve): Added support for a types-only lookup
15813         when we're called via ITypeExpression.DoResolveType().
15814         (ComposedCast): Implement the ITypeExpression interface.
15815
15816         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15817         Expression.Resolve() with ResolveFlags.Type instead.
15818
15819 2002-08-12  Martin Baulig  <martin@gnome.org>
15820
15821         * interface.cs (Interface.Define): Apply attributes.
15822
15823         * attribute.cs (Attribute.ApplyAttributes): Added support for
15824         interface attributes.
15825
15826 2002-08-11  Martin Baulig  <martin@gnome.org>
15827
15828         * statement.cs (Block.Emit): Only check the "this" variable if we
15829         do not always throw an exception.
15830
15831         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15832         whether the property has a set accessor.
15833
15834 2002-08-11  Martin Baulig  <martin@gnome.org>
15835
15836         Added control flow analysis support for structs.
15837
15838         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15839         with control flow analysis turned off.
15840         (IVariable): New interface.
15841         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15842         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15843         (FieldExpr.DoResolve): Resolve the instance expression with flow
15844         analysis turned off and do the definite assignment check after the
15845         resolving when we know what the expression will resolve to.
15846
15847         * expression.cs (LocalVariableReference, ParameterReference):
15848         Implement the new IVariable interface, only call the flow analysis
15849         code if ec.DoFlowAnalysis is true.
15850         (This): Added constructor which takes a Block argument.  Implement
15851         the new IVariable interface.
15852         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15853         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15854         This does the definite assignment checks for struct members.
15855
15856         * class.cs (Constructor.Emit): If this is a non-static `struct'
15857         constructor which doesn't have any initializer, call
15858         Block.AddThisVariable() to tell the flow analysis code that all
15859         struct elements must be initialized before control returns from
15860         the constructor.
15861
15862         * statement.cs (MyStructInfo): New public class.
15863         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15864         argument to this indexer.  If non-zero, check an individual struct
15865         member, not the whole struct.
15866         (FlowBranching.CheckOutParameters): Check struct members.
15867         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15868         overloaded versions of these methods which take an additional
15869         `int field_idx' argument to check struct members.
15870         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15871         overloaded versions of these methods which take an additional
15872         `string field_name' argument to check struct member.s
15873         (VariableInfo): Implement the IVariable interface.
15874         (VariableInfo.StructInfo): New public property.  Returns the
15875         MyStructInfo instance of the variable if it's a struct or null.
15876         (Block.AddThisVariable): New public method.  This is called from
15877         Constructor.Emit() for non-static `struct' constructor which do
15878         not have any initializer.  It creates a special variable for the
15879         "this" instance variable which will be checked by the flow
15880         analysis code to ensure that all of the struct's fields are
15881         initialized before control returns from the constructor.
15882         (UsageVector): Added support for struct members.  If a
15883         variable/parameter is a struct with N members, we reserve a slot
15884         in the usage vector for each member.  A struct is considered fully
15885         initialized if either the struct itself (slot 0) or all its
15886         members are initialized.
15887
15888 2002-08-08  Martin Baulig  <martin@gnome.org>
15889
15890         * driver.cs (Driver.MainDriver): Only report an error CS5001
15891         if there were no compilation errors.
15892
15893         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15894         `UnsafeContext' property to determine whether the parent is in
15895         unsafe context rather than checking the parent's ModFlags:
15896         classes nested in an unsafe class are unsafe as well.
15897
15898 2002-08-08  Martin Baulig  <martin@gnome.org>
15899
15900         * statement.cs (UsageVector.MergeChildren): Distinguish between
15901         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15902         we return.  Added test17() and test18() to test-154.cs.
15903
15904 2002-08-08  Martin Baulig  <martin@gnome.org>
15905
15906         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15907         Family access, make sure the invoking type isn't a subclass of the
15908         queried type (that'd be a CS1540).
15909
15910         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15911         this method which takes an additional `Type invocation_type'.
15912
15913         * expression.cs (BaseAccess.DoResolve): Use the base type as
15914         invocation and query type.
15915         (MemberAccess.DoResolve): If the lookup failed and we're about to
15916         report a CS0122, try a lookup with the ec.ContainerType - if this
15917         succeeds, we must report a CS1540.
15918
15919 2002-08-08  Martin Baulig  <martin@gnome.org>
15920
15921         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15922         (MethodGroupExpr): Implement the IMemberExpr interface.
15923
15924         * expression (MemberAccess.ResolveMemberAccess): No need to have
15925         any special code for MethodGroupExprs anymore, they're now
15926         IMemberExprs.   
15927
15928 2002-08-08  Martin Baulig  <martin@gnome.org>
15929
15930         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15931         Family, FamANDAssem and FamORAssem permissions.
15932         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15933
15934 2002-08-08  Martin Baulig  <martin@gnome.org>
15935
15936         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15937         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15938         or loop block.
15939
15940 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15941
15942         * driver.cs: implemented /resource option to embed managed resources.
15943
15944 2002-08-07  Martin Baulig  <martin@gnome.org>
15945
15946         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15947         (FieldBase.HasFieldInitializer): New public property.
15948         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15949         returns the field initializer and makes sure it is only resolved once.
15950         (TypeContainer.EmitFieldInitializers): Call
15951         FieldBase.GetInitializerExpression to get the initializer, this ensures
15952         that it isn't resolved multiple times.
15953
15954         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15955         the resolving process (SimpleName/MemberLookup) that we're currently
15956         emitting a field initializer (which must not access any instance members,
15957         this is an error CS0236).
15958
15959         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15960         argument, if the `IsFieldInitializer' flag is set, we must report and
15961         error CS0236 and not an error CS0120.   
15962
15963 2002-08-07  Martin Baulig  <martin@gnome.org>
15964
15965         * ecore.cs (IMemberExpr): New public interface.
15966         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15967         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15968         if the expression is an IMemberExpr.
15969
15970         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15971         to be null, implicitly default to `this' if we're non-static in
15972         this case.  Simplified the code a lot by using the new IMemberExpr
15973         interface.  Also fixed bug #28176 here.
15974
15975 2002-08-06  Martin Baulig  <martin@gnome.org>
15976
15977         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15978         ParameterReferences during semantic analysis so that we can do a
15979         type-only search when resolving Cast, TypeOf and SizeOf.
15980         (block): Pass the `current_local_parameters' to the Block's
15981         constructor.
15982
15983         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15984         argument to the constructor.
15985         (ConstructorInitializer.Resolve): Create a temporary implicit
15986         block with the parameters.
15987
15988         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15989         references here if we aren't doing a type-only search.
15990
15991         * statement.cs (Block): Added constructor which takes a
15992         `Parameters parameters' argument.
15993         (Block.Parameters): New public property.
15994
15995         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15996         to `Parameters' and made it public readonly.
15997
15998 2002-08-06  Martin Baulig  <martin@gnome.org>
15999
16000         * ecore.cs (Expression.Warning): Made this public as well.
16001
16002         * report.cs (Report.Debug): Print the contents of collections.
16003
16004 2002-08-06  Martin Baulig  <martin@gnome.org>
16005
16006         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16007         used to tell Resolve() which kinds of expressions it may return.
16008         (Expression.Resolve): Added overloaded version of this method which
16009         takes a `ResolveFlags flags' argument.  This can be used to tell
16010         Resolve() which kinds of expressions it may return.  Reports a
16011         CS0118 on error.
16012         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16013         ResolveFlags.SimpleName.
16014         (Expression.Error118): Added overloaded version of this method which
16015         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16016         which kinds of expressions are allowed.
16017
16018         * expression.cs (Argument.ResolveMethodGroup): New public method.
16019         Resolves an argument, but allows a MethodGroup to be returned.
16020         This is used when invoking a delegate.
16021
16022         * TODO: Updated a bit.
16023
16024 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16025
16026         Fixed compilation with csc.
16027
16028         * ecore.cs: Expression.Error made public. Is this correct? Should
16029         Warning be made public too?
16030
16031         * expression.cs: use ea.Location instead of ea.loc.
16032         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16033
16034 2002-08-06  Martin Baulig  <martin@gnome.org>
16035
16036         * ecore.cs (Expression.loc): Moved the location here instead of
16037         duplicating it in all derived classes.
16038         (Expression.Location): New public property.
16039         (Expression.Error, Expression.Warning): Made them non-static and
16040         removed the location argument.
16041         (Expression.Warning): Added overloaded version which takes an
16042         `int level' argument.
16043         (Expression.Error118): Make this non-static and removed the
16044         expression and location arguments.
16045         (TypeExpr): Added location argument to the constructor.
16046
16047         * expression.cs (StaticCallExpr): Added location argument to
16048         the constructor.
16049         (Indirection, PointerArithmetic): Likewise.
16050         (CheckedExpr, UnCheckedExpr): Likewise.
16051         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16052         (StringPtr): Likewise.
16053
16054
16055 2002-08-05  Martin Baulig  <martin@gnome.org>
16056
16057         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16058
16059         * assign.cs (Assign.DoResolve): Check whether the source
16060         expression is a value or variable.
16061
16062         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16063         while resolving the corresponding blocks.
16064
16065         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16066         an error, don't silently return null.
16067
16068         * statement.cs (Block.AddVariable): Do the error reporting here
16069         and distinguish between CS0128 and CS0136.
16070         (Block.DoResolve): Report all unused labels (warning CS0164).
16071         (LabeledStatement): Pass the location to the constructor.
16072         (LabeledStatement.HasBeenReferenced): New property.
16073         (LabeledStatement.Resolve): Set it to true here.
16074
16075         * statement.cs (Return.Emit): Return success even after reporting
16076         a type mismatch error (CS0126 or CS0127), this is what csc does and
16077         it avoids confusing the users with any consecutive errors.
16078
16079 2002-08-05  Martin Baulig  <martin@gnome.org>
16080
16081         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16082
16083         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16084
16085         * expression.cs (MemberAccess.DoResolve): Silently return if an
16086         error has already been reported.
16087
16088         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16089         error has already been reported.
16090
16091 2002-08-05  Martin Baulig  <martin@gnome.org>
16092
16093         * statement.cs (UsageVector): Only initialize the `parameters'
16094         vector if we actually have any "out" parameters.
16095
16096 2002-08-05  Martin Baulig  <martin@gnome.org>
16097
16098         * expression.cs (Binary.ResolveOperator): When combining delegates,
16099         they must have the same type.
16100
16101 2002-08-05  Martin Baulig  <martin@gnome.org>
16102
16103         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16104         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16105         work with the ms runtime and we also don't need it: if we're a
16106         PropertyBuilder and not in the `indexer_arguments' hash, then we
16107         are a property and not an indexer.
16108
16109         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16110         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16111         since the latter one doesn't work with the ms runtime.
16112
16113 2002-08-03  Martin Baulig  <martin@gnome.org>
16114
16115         Fixed bugs #27998 and #22735.
16116
16117         * class.cs (Method.IsOperator): New public field.
16118         (Method.CheckBase): Report CS0111 if there's already a method
16119         with the same parameters in the current class.  Report CS0508 when
16120         attempting to change the return type of an inherited method.
16121         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16122         and it's not marked abstract or extern.
16123         (PropertyBase): New abstract base class for Property and Indexer.
16124         (PropertyBase.CheckBase): Moved here from Property and made it work
16125         for indexers.
16126         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16127         the same so we can reuse it there.
16128         (Property, Indexer): Derive from PropertyBase.
16129         (MethodSignature.inheritable_property_signature_filter): New delegate
16130         to find properties and indexers.
16131
16132         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16133         argument and improved error reporting.
16134
16135         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16136         EmptyReadOnlyParameters and made it a property.
16137
16138         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16139         version of this method which takes a `PropertyInfo indexer'.
16140         (TypeManager.RegisterIndexer): New method.
16141
16142         * class.cs: Added myself as author of this file :-)
16143
16144 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16145
16146         * class.cs: fixed compilation on windoze.
16147
16148 2002-08-03  Martin Baulig  <martin@gnome.org>
16149
16150         * interface.cs (Interface.GetInterfaceBases): Check whether all
16151         base interfaces are at least as accessible than the current one.
16152
16153         * class.cs (TypeContainer.GetClassBases): Check whether base types
16154         are at least as accessible than the current type.
16155         (TypeContainer.AsAccessible): Implemented and made non-static.
16156         (MemberBase.CheckParameters): Report errors if the accessibility
16157         checks fail.
16158
16159         * delegate.cs (Delegate.Delegate): The default visibility is
16160         internal for top-level types and private for nested types.
16161         (Delegate.Define): Report errors if the accessibility checks fail.
16162
16163         * enum.cs (Enum.Enum): The default visibility is internal for
16164         top-level types and private for nested types.
16165         (Enum.DefineType): Compute the correct visibility.
16166
16167         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16168         function which takes a `bool is_toplevel' instead of a TypeContainer.
16169
16170         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16171         builtin type.
16172
16173 2002-08-02  Martin Baulig  <martin@gnome.org>
16174
16175         * expression.cs (LocalVariableReferenc): Added constructor which
16176         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16177         (LocalVariableReference.IsReadOnly): New property.
16178         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16179         variable is readonly, use our own readonly flag to do this; you can
16180         use the new constructor to get a writable reference to a read-only
16181         variable.
16182
16183         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16184         reference to the local variable.
16185
16186 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16187
16188         * rootcontext.cs (ResolveCore): Also include System.Exception
16189
16190         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16191         we reach an EmptyStatement.
16192
16193         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16194         is also fine.
16195
16196         * expression.cs (Binary.ResolveOperator): Check error result in
16197         two places.
16198
16199         use brtrue/brfalse directly and avoid compares to null.
16200
16201 2002-08-02  Martin Baulig  <martin@gnome.org>
16202
16203         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16204         Fixes bug #28407, added test-155.cs.
16205
16206 2002-08-01  Martin Baulig  <martin@gnome.org>
16207
16208         * class.cs (Event.EmitDefaultMethod): Make this work with static
16209         events.  Fixes #28311, added verify-3.cs.
16210
16211 2002-08-01  Martin Baulig  <martin@gnome.org>
16212
16213         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16214         `is_disposable' fields.
16215         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16216         `hm.is_disposable' if we're using the collection pattern.
16217         (Foreach.EmitCollectionForeach): Use the correct type for the
16218         enumerator's local variable, only emit the try/finally block if
16219         necessary (fixes #27713).
16220
16221 2002-08-01  Martin Baulig  <martin@gnome.org>
16222
16223         * ecore.cs (Expression.report118): Renamed to Error118 and made
16224         it public static.
16225
16226         * statement.cs (Throw.Resolve): Check whether the expression is of
16227         the correct type (CS0118) and whether the type derives from
16228         System.Exception (CS0155).
16229         (Catch.Resolve): New method.  Do the type lookup here and check
16230         whether it derives from System.Exception (CS0155).
16231         (Catch.CatchType, Catch.IsGeneral): New public properties.
16232
16233         * typemanager.cs (TypeManager.exception_type): Added.
16234
16235 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * driver.cs: Updated About function.
16238
16239 2002-07-31  Martin Baulig  <martin@gnome.org>
16240
16241         Implemented Control Flow Analysis.
16242
16243         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16244         (EmitContext.CurrentBranching): Added.
16245         (EmitContext.StartFlowBranching): Added.
16246         (EmitContext.EndFlowBranching): Added.
16247         (EmitContext.KillFlowBranching): Added.
16248         (EmitContext.IsVariableAssigned): Added.
16249         (EmitContext.SetVariableAssigned): Added.
16250         (EmitContext.IsParameterAssigned): Added.
16251         (EmitContext.SetParameterAssigned): Added.
16252         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16253         Added control flow analysis stuff here.
16254
16255         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16256         resolve the expression as lvalue.
16257         (LocalVariableReference.DoResolve): Check whether the variable has
16258         already been assigned.
16259         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16260         the parameter as assigned here.
16261         (ParameterReference.DoResolve): Check whether the parameter has already
16262         been assigned.
16263         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16264         expression as lvalue.
16265
16266         * statement.cs (FlowBranching): New class for the flow analysis code.
16267         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16268         (LabeledStatement.IsDefined): New public property.
16269         (LabeledStatement.AddUsageVector): New public method to tell flow
16270         analyis that the label may be reached via a forward jump.
16271         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16272         flow analysis.
16273         (VariableInfo.Number): New public field.  This is used by flow analysis
16274         to number all locals of a block.
16275         (Block.CountVariables): New public property.  This is the number of
16276         local variables in this block (including the locals from all parent
16277         blocks).
16278         (Block.EmitMeta): Number all the variables.
16279
16280         * statement.cs: Added flow analysis support to all classes.
16281
16282 2002-07-31  Martin Baulig  <martin@gnome.org>
16283
16284         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16285         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16286         then use this argument.
16287
16288         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16289
16290         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16291         use this to specify /define options.
16292
16293 2002-07-29  Martin Baulig  <martin@gnome.org>
16294
16295         * statement.cs (Fixed): Moved all code that does variable lookups
16296         and resolvings from Emit to Resolve.
16297
16298         * statement.cs (For): Moved all code that does variable lookups
16299         and resolvings from Emit to Resolve.
16300
16301         * statement.cs (Using): Moved all code that does variable lookups
16302         and resolvings from Emit to Resolve.
16303
16304 2002-07-29  Martin Baulig  <martin@gnome.org>
16305
16306         * attribute.cs (Attribute.Resolve): Explicitly catch a
16307         System.NullReferenceException when creating the
16308         CustromAttributeBuilder and report a different warning message.
16309
16310 2002-07-29  Martin Baulig  <martin@gnome.org>
16311
16312         * support.cs (ParameterData.ParameterName): Added method to
16313         get the name of a parameter.
16314
16315         * typemanager.cs (TypeManager.IsValueType): New public method.
16316
16317 2002-07-29  Martin Baulig  <martin@gnome.org>
16318
16319         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16320         is a flag which specifies that it's either ref or out.
16321         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16322         the out parameter to `out Parameter.Modifier mod', also set the
16323         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16324
16325         * support.cs (InternalParameters.ParameterModifier): Distinguish
16326         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16327         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16328
16329         * expression.cs (Argument.GetParameterModifier): Distinguish
16330         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16331         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16332
16333 2002-07-29  Martin Baulig  <martin@gnome.org>
16334
16335         * expression.cs (ParameterReference.ParameterReference): Added
16336         `Location loc' argument to the constructor.
16337
16338         * cs-parser.jay: Pass location to ParameterReference.
16339
16340 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16341
16342         * statement.cs (Try): Initialize the location.
16343
16344         * cs-parser.jay: pass location to Try.
16345
16346         * expression.cs (Unary.Reduce): Change the prototype to return
16347         whether a constant fold could be performed or not.  The result is
16348         returned in an out parameters.  In the case of Indirection and
16349         AddressOf, we want to perform the full tests.
16350
16351 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16352
16353         * statement.cs (Statement.Emit): Flag dead code.
16354
16355 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16356
16357         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16358
16359 2002-07-27  Martin Baulig  <martin@gnome.org>
16360
16361         * class.cs (MethodData.Define): Put back call to
16362         TypeManager.AddMethod(), accidentally commented this out.
16363
16364         * report.cs (Debug): New public method to print debugging information,
16365         this is `[Conditional ("DEBUG")]'.
16366
16367 2002-07-26  Martin Baulig  <martin@gnome.org>
16368
16369         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16370         (switch_statement): Push the current_block to the switch_stack and
16371         pop it again when we're done with the switch.
16372         (switch_section): The new block is a child of the current_block.
16373         Fixes bug #24007, added test-152.cs.
16374
16375 2002-07-27  Martin Baulig  <martin@gnome.org>
16376
16377         * expression.cs (Invocation.EmitArguments): When calling a varargs
16378         function with only its fixed arguments, we need to pass an empty
16379         array.
16380
16381 2002-07-27  Martin Baulig  <martin@gnome.org>
16382
16383         Mono 0.13 has been released.
16384
16385 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16386
16387         * driver.cs: Rename --resource to --linkres, because that is what
16388         we do currently, we dont support --resource yet.
16389
16390         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16391
16392 2002-07-25  Martin Baulig  <martin@gnome.org>
16393
16394         * class.cs (MethodData): New public class.  This is a `method builder'
16395         class for a method or one accessor of a Property/Indexer/Event.
16396         (MethodData.GetMethodFlags): Moved here from MemberBase.
16397         (MethodData.ApplyAttributes): Likewise.
16398         (MethodData.ApplyObsoleteAttribute): Likewise.
16399         (MethodData.ApplyConditionalAttribute): Likewise.
16400         (MethodData.ApplyDllImportAttribute): Likewise.
16401         (MethodData.CheckAbstractAndExternal): Likewise.
16402         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16403         (MethodData.Emit): Formerly known as Method.Emit().
16404         (MemberBase): Moved everything which was specific to a single
16405         accessor/method to MethodData.
16406         (Method): Create a new MethodData and call Define() and Emit() on it.
16407         (Property, Indexer, Event): Create a new MethodData objects for each
16408         accessor and call Define() and Emit() on them.
16409
16410 2002-07-25  Martin Baulig  <martin@gnome.org>
16411
16412         Made MethodCore derive from MemberBase to reuse the code from there.
16413         MemberBase now also checks for attributes.
16414
16415         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16416         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16417         as virtual.
16418         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16419         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16420         (MemberBase.ApplyAttributes): New virtual method; applies the
16421         attributes to a method or accessor.
16422         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16423         (MemberBase.ApplyConditionalAttribute): Likewise.
16424         (MemberBase.ApplyDllImportAttribute): Likewise.
16425         (MemberBase.CheckAbstractAndExternal): Likewise.
16426         (MethodCore.ParameterTypes): This is now a property instead of a
16427         method, it's initialized from DoDefineParameters().
16428         (MethodCore.ParameterInfo): Removed the set accessor.
16429         (MethodCore.DoDefineParameters): New protected virtual method to
16430         initialize ParameterTypes and ParameterInfo.
16431         (Method.GetReturnType): We can now simply return the MemberType.
16432         (Method.GetMethodFlags): Override the MemberBase version and add
16433         the conditional flags.
16434         (Method.CheckBase): Moved some code from Define() here, call
16435         DoDefineParameters() here.
16436         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16437         here to avoid some larger code duplication.
16438         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16439         ensure that abstract and external accessors don't declare a body.
16440
16441         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16442         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16443         lookup in the attribute's parent classes, so we need to abort as soon
16444         as we found the first match.
16445         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16446         the attribute has no arguments.
16447
16448         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16449         of a Method.
16450
16451 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16452
16453         * cs-parser.jay: reverted previous patch.
16454
16455 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16456
16457         * cs-parser.jay: fixed bug #22119.
16458
16459 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16460
16461         * attribute.cs: fixed compilation. The error was:
16462         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16463         be assigned to before control leaves the current method."
16464         [FIXME:  Filed as bug #28186: MCS must report this error.]
16465
16466 2002-07-25  Martin Baulig  <martin@gnome.org>
16467
16468         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16469         method to pull the condition name ouf of a Conditional attribute.
16470         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16471         the obsolete message and error flag out of an Obsolete attribute.
16472
16473         * class.cs (Method.GetMethodFlags): New public method to get the
16474         TypeManager.MethodFlags for this method.
16475         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16476         private methods.
16477         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16478         if we're overriding a virtual function, set the new private variable
16479         `parent_method'; call the new TypeManager.AddMethod().
16480
16481         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16482         the MethodBuilder and the Method in a PtrHashtable.
16483         (TypeManager.builder_to_method): Added for this purpose.
16484         (TypeManager.MethodFlags): Added IsObsoleteError.
16485         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16486         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16487         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16488         the message from the attribute.
16489
16490 2002-07-24  Martin Baulig  <martin@gnome.org>
16491
16492         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16493         preprocessor directives, ensure that the argument to #define/#undef is
16494         exactly one identifier and that it's actually an identifier.
16495
16496         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16497         did not work ....
16498
16499 2002-07-24  Martin Baulig  <martin@gnome.org>
16500
16501         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16502         initialize it to TypeManager.object_type in the constructor.
16503         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16504         of the `hm.get_current' method if we're using the collection pattern.
16505         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16506         for the explicit conversion to make it work when we're using the collection
16507         pattern and the `Current' property has a different return type than `object'.
16508         Fixes #27713.
16509
16510 2002-07-24  Martin Baulig  <martin@gnome.org>
16511
16512         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16513         does not match, but don't report any errors.  This method is called in
16514         order for all methods in a MethodGroupExpr until a matching method is
16515         found, so we don't want to bail out if the first method doesn't match.
16516         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16517         matches, report the 123.  Fixes #28070.
16518
16519 2002-07-24  Martin Baulig  <martin@gnome.org>
16520
16521         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16522         TypeManager.TypeToCoreType() to the top of the method so the
16523         following equality checks will work.  Fixes #28107.
16524
16525 2002-07-24  Martin Baulig  <martin@gnome.org>
16526
16527         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16528         operand is of type uint, and the other operand is of type sbyte,
16529         short or int, the operands are converted to type long." -
16530         Actually do what this comment already told us.  Fixes bug #28106,
16531         added test-150.cs.
16532
16533 2002-07-24  Martin Baulig  <martin@gnome.org>
16534
16535         * class.cs (MethodBase): New abstract class.  This is now a base
16536         class for Property, Indexer and Event to avoid some code duplication
16537         in their Define() and DefineMethods() methods.
16538         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16539         generic methods for Define() and DefineMethods().
16540         (FieldBase): Derive from MemberBase, not MemberCore.
16541         (Property): Derive from MemberBase, not MemberCore.
16542         (Property.DefineMethod): Moved all the code from this method to the
16543         new MethodBase.DefineAccessor(), just call it with appropriate
16544         argumetnts.
16545         (Property.Define): Call the new Property.DoDefine(), this does some
16546         sanity checks and we don't need to duplicate the code everywhere.
16547         (Event): Derive from MemberBase, not MemberCore.
16548         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16549         accessors, this will also make them work with interface events.
16550         (Indexer): Derive from MemberBase, not MemberCore.
16551         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16552         (Indexer.Define): Use the new MethodBase functions.
16553
16554         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16555         argument to the constructor.
16556         (Interface.FindMembers): Added support for interface events.
16557         (Interface.PopluateEvent): Implemented.
16558
16559         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16560
16561 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16564         but this is required to check for a method name being the same as
16565         the containing class.  
16566
16567         Handle this now.
16568
16569 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16570
16571         * interface.cs: initialize variable.
16572
16573 2002-07-23  Martin Baulig  <martin@gnome.org>
16574
16575         Implemented the IndexerName attribute in interfaces.
16576
16577         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16578         name if this is an explicit interface implementation.
16579         (Indexer.InterfaceIndexerName): New public variable.  If we're
16580         implementing an interface indexer, this is the IndexerName in that
16581         interface.  Otherwise, it's the IndexerName.
16582         (Indexer.DefineMethod): If we're implementing interface indexer,
16583         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16584         and Pending.ImplementIndexer methods.
16585         (Indexer.Define): Also define the PropertyBuilder if we're
16586         implementing an interface indexer and this is neither an explicit
16587         interface implementation nor do the IndexerName match the one in
16588         the interface.
16589
16590         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16591         If a method is defined here, then we always need to create a proxy
16592         for it.  This is used when implementing interface indexers.
16593         (Pending.IsInterfaceIndexer): New public method.
16594         (Pending.ImplementIndexer): New public method.
16595         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16596         This is used when implementing interface indexers to define a proxy
16597         if necessary.
16598         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16599         define a proxy if necessary.
16600
16601         * interface.cs (Interface.IndexerName): New public variable.
16602         (Interface.PopulateIndexer): Set the IndexerName.
16603         (Interface.DefineIndexers): New private method.  Populate all the
16604         indexers and make sure their IndexerNames match.
16605
16606         * typemanager.cs (IndexerPropertyName): Added support for interface
16607         indexers.
16608
16609 2002-07-22  Martin Baulig  <martin@gnome.org>
16610
16611         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16612         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16613         ret if HasReturnLabel.
16614         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16615         variables.
16616
16617         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16618         and set the ec.LoopBeginTryCatchLevel.
16619         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16620         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16621         the current ec.TryCatchLevel, the branch goes out of an exception
16622         block.  In this case, we need to use Leave and not Br.
16623
16624 2002-07-22  Martin Baulig  <martin@gnome.org>
16625
16626         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16627         block unless the block does not always return or it is contained in
16628         another try { ... } catch { ... } block.  Fixes bug #26506.
16629         Added verify-1.cs to the test suite.
16630
16631 2002-07-22  Martin Baulig  <martin@gnome.org>
16632
16633         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16634         then we do not always return.  Fixes bug #24985.
16635
16636 2002-07-22  Martin Baulig  <martin@gnome.org>
16637
16638         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16639         lookup on a per-class level; ie. walk up the class hierarchy until we
16640         found at least one applicable method, then choose the best among them.
16641         Fixes bug #24463 and test-29.cs.
16642
16643 2002-07-22  Martin Baulig  <martin@gnome.org>
16644
16645         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16646         return types of the methods.  The return type is not part of the
16647         signature and we must not check it to make the `new' modifier work.
16648         Fixes bug #27999, also added test-147.cs.
16649         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16650
16651         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16652         on the method's return type.
16653
16654 2002-07-21  Martin Baulig  <martin@gnome.org>
16655
16656         * assign.cs: Make this work if the rightmost source is a constant and
16657         we need to do an implicit type conversion.  Also adding a few more tests
16658         to test-38.cs which should have caught this.
16659
16660         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16661         target in the makefile for this.  The makefile.gnu is primarily intended
16662         for end-users who don't want to debug the compiler.
16663
16664 2002-07-21  Martin Baulig  <martin@gnome.org>
16665
16666         * assign.cs: Improved the Assign class so it can now handle embedded
16667         assignments (X = Y = Z = something).  As a side-effect this'll now also
16668         consume less local variables.  test-38.cs now passes with MCS, added
16669         a few new test cases to that test.
16670
16671 2002-07-20  Martin Baulig  <martin@gnome.org>
16672
16673         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16674         instructions.  Fixes bug #27977, also added test-146.cs.
16675
16676 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16677
16678         * cs-tokenizer.cs: fixed getHex ().
16679
16680 2002-07-19  Martin Baulig  <martin@gnome.org>
16681
16682         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16683         not Type.GetType() to lookup the array type.  This is needed when
16684         we're constructing an array of a user-defined type.
16685         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16686         single-dimensional arrays, but also for single-dimensial arrays of
16687         type decimal.
16688
16689 2002-07-19  Martin Baulig  <martin@gnome.org>
16690
16691         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16692         this function is called, it's not allowed to share LocalBuilders
16693         among ILGenerators.
16694
16695 2002-07-19  Martin Baulig  <martin@gnome.org>
16696
16697         * expression.cs (Argument.Resolve): Report an error 118 when trying
16698         to pass a type as argument.
16699
16700 2002-07-18  Martin Baulig  <martin@gnome.org>
16701
16702         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16703         Conv_R_Un for the signed `long' type.
16704
16705 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16706
16707         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16708         `expr' for the temporary result, as that will fail if we do
16709         multiple resolves on the same expression.
16710
16711 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16714         ec.TypeContainer for looking up aliases. 
16715
16716         * class.cs (TypeContainer): Remove LookupAlias from here.
16717
16718         * decl.cs (DeclSpace); Move here.
16719
16720 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16721
16722         * class.cs (FindMembers): Only call filter if the constructor
16723         bulider is not null.
16724
16725         Also handle delegates in `NestedTypes' now.  Now we will perform
16726         type lookups using the standard resolution process.  This also
16727         fixes a bug.
16728
16729         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16730         This uses Expressions (the limited kind that can be parsed by the
16731         tree) instead of strings.
16732
16733         * expression.cs (ComposedCast.ToString): Implement, used to flag
16734         errors since now we have to render expressions.
16735
16736         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16737         FormArrayType. 
16738
16739         * ecore.cs (SimpleName.ToString): ditto.
16740
16741         * cs-parser.jay: Instead of using strings to assemble types, use
16742         Expressions to assemble the type (using SimpleName, ComposedCast,
16743         MemberAccess).  This should fix the type lookups in declarations,
16744         because we were using a different code path for this.
16745
16746         * statement.cs (Block.Resolve): Continue processing statements
16747         even when there is an error.
16748
16749 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * class.cs (Event.Define): Also remove the `remove' method from
16752         the list of pending items.
16753
16754         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16755         generate more compact code. 
16756
16757 2002-07-17  Martin Baulig  <martin@gnome.org>
16758
16759         * const.cs (Const.LookupConstantValue): Add support for constant
16760         `unchecked' and `checked' expressions.
16761         Also adding test case test-140.cs for this.
16762
16763 2002-07-17  Martin Baulig  <martin@gnome.org>
16764
16765         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16766         check whether mi.ReturnType implements the IEnumerator interface; the
16767         `==' and the IsAssignableFrom() will fail in this situation.
16768
16769 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16770
16771         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16772         here too.
16773
16774 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16775
16776         * expression.cs: fixed bug #27811.
16777
16778 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16781         Molaro: when we are a ref, the value already contains a pointer
16782         value, do not take the address of it.
16783
16784 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16785         * removed mb-parser.jay and mb-tokenizer.cs
16786
16787 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16788
16789         * expression.cs: check against the building corlib void type.
16790
16791 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16792
16793         * ecore.cs: fix for valuetype static readonly fields: when 
16794         initializing them, we need their address, not the address of a copy.
16795
16796 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16797
16798         * typemanager.cs: register also enum_type in corlib.
16799
16800 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16801
16802         * class.cs: allow calling this (but not base) initializers in structs.
16803
16804 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16805
16806         * ecore.cs: make sure we compare against the building base types
16807         in GetTypeSize ().
16808
16809 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16810
16811         * typemanager.cs: fix TypeToCoreType() to handle void and object
16812         (corlib gets no more typerefs after this change).
16813
16814 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16815
16816         * expression.cs (ArrayCreation.EmitArrayArguments): use
16817         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16818
16819         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16820         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16821         array indexes, the runtime actually forbids them.
16822
16823         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16824         for array arguments here.
16825
16826         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16827         instead of the default for ValueTypes.
16828
16829         (New.DoEmit): Use IsValueType instead of
16830         IsSubclassOf (value_type)
16831         (New.DoResolve): ditto.
16832         (Invocation.EmitCall): ditto.
16833
16834         * assign.cs (Assign): ditto.
16835
16836         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16837         Statements *are* currently doing part of their resolution during
16838         Emit.  
16839
16840         Expressions do always resolve during resolve, but statements are
16841         only required to propagate resolution to their children.
16842
16843 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16844
16845         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16846
16847         (LoadAssembly): Do not add the dll if it is already specified
16848
16849         (MainDriver): Add the System directory to the link path at the end,
16850         after all the other -L arguments. 
16851
16852         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16853         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16854         ldelem.u1) and using the opposite for sbytes.
16855
16856         This fixes Digger, and we can finally run it.
16857
16858         * driver.cs (UnixParseOption): Move the option parsing here.  
16859         (CSCParseOption): Implement CSC-like parsing of options.
16860
16861         We now support both modes of operation, the old Unix way, and the
16862         new CSC-like way.  This should help those who wanted to make cross
16863         platform makefiles.
16864
16865         The only thing broken is that /r:, /reference: and /lib: are not
16866         implemented, because I want to make those have the same semantics
16867         as the CSC compiler has, and kill once and for all the confussion
16868         around this.   Will be doing this tomorrow.
16869
16870         * statement.cs (Unsafe.Resolve): The state is checked during
16871         resolve, not emit, so we have to set the flags for IsUnsfe here.
16872
16873 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16876         not catch the Error_ObjectRefRequired in SimpleName (as it is
16877         possible to have a class/instance variable name that later gets
16878         deambiguated), we have to check this here.      
16879
16880 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16881
16882         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16883         make static and put into Expression.
16884
16885         (Event.Define): Register the private field of the event with the 
16886         TypeManager so that GetFieldFromEvent can get at it.
16887
16888         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16889         keep track of the private field associated with an event which
16890         has no accessors.
16891
16892         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16893         private field.
16894
16895         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16896
16897 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16898
16899         * expression.cs (Binary.EmitBranchable): this routine emits the
16900         Binary expression in a branchable context.  This basically means:
16901         we need to branch somewhere, not just get the value on the stack.
16902
16903         This works together with Statement.EmitBoolExpression.
16904
16905         * statement.cs (Statement.EmitBoolExpression): Use
16906         EmitBranchable. 
16907
16908 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16909
16910         * statement.cs (For): Reduce the number of jumps in loops.
16911
16912         (For): Implement loop inversion for the For statement.
16913
16914         (Break): We can be breaking out of a Try/Catch controlled section
16915         (foreach might have an implicit try/catch clause), so we need to
16916         use Leave instead of Br.
16917
16918         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16919         now).  If the instace expression supports IMemoryLocation, we use
16920         the AddressOf method from the IMemoryLocation to extract the
16921         address instead of emitting the instance.
16922
16923         This showed up with `This', as we were emitting the instance
16924         always (Emit) instead of the Address of This.  Particularly
16925         interesting when This is a value type, as we dont want the Emit
16926         effect (which was to load the object).
16927
16928 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16929
16930         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16931
16932         * statement.cs (Checked): Set the CheckedState during the resolve
16933         process too, as the ConvCast operations track the checked state on
16934         the resolve process, and not emit.
16935
16936         * cs-parser.jay (namespace_member_declaration): Flag that we have
16937         found a declaration when we do.  This is used to flag error 1529
16938
16939         * driver.cs: Report ok when we display the help only.
16940
16941 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16942
16943         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16944
16945 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16946
16947         * cs-tokenizer.cs (define): We also have to track locally the
16948         defines.  AllDefines is just used for the Conditional Attribute,
16949         but we also need the local defines for the current source code. 
16950
16951 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16952
16953         * statement.cs (While, For, Do): These loops can exit through a
16954         Break statement, use this information to tell whether the
16955         statement is the last piece of code.
16956
16957         (Break): Flag that we break.
16958
16959         * codegen.cs (EmitContexts): New `Breaks' state variable.
16960
16961 2002-07-03  Martin Baulig  <martin@gnome.org>
16962
16963         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16964         modifiers in method declarations in structs.  Otherwise, you won't
16965         be able to override things like Object.Equals().
16966
16967 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16968
16969         * class.cs (Method, Property, Indexer): Do not allow the public
16970         modifier to be used in explicit interface implementations.
16971
16972         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16973         override modifiers in method declarations in structs
16974
16975 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16976
16977         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16978         integer or real overflow, report an error
16979
16980 2002-07-02  Martin Baulig  <martin@gnome.org>
16981
16982         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16983         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16984         to tell the runtime about our newly created System.Object and
16985         System.ValueType types.
16986
16987 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16990         struct instead of Ldarg/Starg.
16991
16992 2002-07-02  Martin Baulig  <martin@gnome.org>
16993
16994         * expression.cs (Indirection.Indirection): Call
16995         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16996
16997 2002-07-02  Martin Baulig  <martin@gnome.org>
16998
16999         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17000         ValueType, call TypeManager.TypeToCoreType() on it.
17001         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17002         the OpCodes.Newarr argument.
17003
17004 2002-07-02  Martin Baulig  <martin@gnome.org>
17005
17006         * expression.cs (Invocation.EmitCall): When compiling corlib,
17007         replace all calls to the system's System.Array type to calls to
17008         the newly created one.
17009
17010         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17011         System.Array methods.
17012         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17013         from the system's System.Array type which must be replaced.
17014
17015 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17016
17017         * typemanager.cs: load unverifiable_code_ctor so we can build
17018         corlib using the correct type. Avoid using GetTypeCode() with
17019         TypeBuilders.
17020         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17021         TypeManager.object_type to allow building corlib.
17022
17023 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17024
17025         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17026
17027 2002-07-01  Martin Baulig  <martin@gnome.org>
17028
17029         * class.cs: Make the last change actually work, we need to check
17030         whether `ifaces != null' to avoid a crash.
17031
17032 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17033
17034         * class.cs: when we build structs without fields that implement
17035         interfaces, we need to add the interfaces separately, since there is
17036         no API to both set the size and add the interfaces at type creation
17037         time.
17038
17039 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17040
17041         * expression.cs: the dimension arguments to the array constructors
17042         need to be converted if they are a long.
17043
17044 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17045
17046         * class.cs: don't emit ldarg.0 if there is no parent constructor
17047         (fixes showstopper for corlib).
17048
17049 2002-06-29  Martin Baulig  <martin@gnome.org>
17050
17051         MCS now compiles corlib on GNU/Linux :-)
17052
17053         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17054         ie. check for MethodImplOptions.InternalCall.
17055
17056         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17057         and TypeManager.attribute_type are null, so we must explicitly check
17058         whether parent is not null to find out whether it's an attribute type.
17059         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17060         and SetBuilder, not only if the property is neither abstract nor external.
17061         This is necessary to set the MethodImplOptions on the accessor methods.
17062         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17063         SetBuilder, see Property.Emit().
17064
17065         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17066         populate "System.Object", "System.ValueType" and "System.Attribute" since
17067         they've already been populated from BootCorlib_PopulateCoreTypes().
17068
17069 2002-06-29  Martin Baulig  <martin@gnome.org>
17070
17071         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17072         is the NullLiteral, we also need to make sure that target_type is not
17073         an enum type.   
17074
17075 2002-06-29  Martin Baulig  <martin@gnome.org>
17076
17077         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17078         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17079         before calling BootstrapCorlib_ResolveDelegate ().
17080
17081 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17082
17083         * statement.cs: fixed build-breaker. All tests passed ok.
17084
17085 2002-06-27  Martin Baulig  <martin@gnome.org>
17086
17087         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17088         for System.Decimal when compiling corlib.
17089
17090 2002-06-27  Martin Baulig  <martin@gnome.org>
17091
17092         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17093         switch blocks which contain nothing but a default clause.
17094
17095 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17096
17097        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17098
17099 2002-06-27  Martin Baulig  <martin@gnome.org>
17100
17101         * ecore.cs (PropertyExpr.PropertyExpr): Call
17102         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17103
17104         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17105         is already a TypeBuilder.
17106
17107 2002-06-27  Martin Baulig  <martin@gnome.org>
17108
17109         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17110         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17111         the "from an array-type to System.Array" case.  This makes it work
17112         when compiling corlib.
17113
17114 2002-06-27  Martin Baulig  <martin@gnome.org>
17115
17116         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17117         non-static PropertyExpr, set its InstanceExpression.  This makes
17118         the `ICollection.Count' property work in System/Array.cs.
17119
17120 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17121
17122         * driver.cs: Made error handling more consistent.  Errors now
17123         tracked by Report class, so many methods which used to return int
17124         now return void.  Main() now prints success/failure and 
17125         errors/warnings message.
17126
17127         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17128         the magic number return values (123 and 124).  Now, if the
17129         expected error occurs, the compiler exits with success (exit value
17130         0).  If the compilation completes without seeing that particular
17131         error, the compiler exits with failure (exit value 1).  The
17132         makefile in mcs/errors has been changed to handle the new behaviour.
17133
17134         * report.cs: Made 'expected error' number a property and renamed
17135         it from 'Probe' to 'ExpectedError'.
17136
17137         * genericparser.cs: Removed error handling support, since it is
17138         now all done by Report class.
17139
17140         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17141         class, so parse() no longer returns an int.
17142
17143         * namespace.cs: Use Report.Error instead of GenericParser.error
17144
17145 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17146
17147         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17148         TypeContainer.AddOperator): At the front of the list put the
17149         explicit implementations, so they get resolved/defined first. 
17150
17151 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17154         interface type is implemented by this TypeContainer.  Used during
17155         explicit interface implementation.
17156
17157         (Property.Define, Indexer.Define, Method.Define): Validate that
17158         the given interface in the explicit implementation is one of the
17159         base classes for the containing type.
17160
17161         Also if we are explicitly implementing an interface, but there is
17162         no match in the pending implementation table, report an error.
17163
17164         (Property.Define): Only define the property if we are
17165         not explicitly implementing a property from an interface.  Use the
17166         correct name also for those properties (the same CSC uses,
17167         although that is really not needed).
17168
17169         (Property.Emit): Do not emit attributes for explicitly implemented
17170         properties, as there is no TypeBuilder.
17171
17172         (Indexer.Emit): ditto.
17173
17174         Hiding then means that we do not really *implement* a pending
17175         implementation, which makes code fail.
17176
17177 2002-06-22  Martin Baulig  <martin@gnome.org>
17178
17179         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17180         the return value of Object.GetType().  [FIXME: we need to do this whenever
17181         we get a type back from the reflection library].
17182
17183 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17184
17185         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17186
17187 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17188
17189         * attribute.cs: Return null if we can not look up the type.
17190
17191         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17192         the interface types found.
17193
17194         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17195         interface types found.
17196
17197         * typemanager.cs (GetInterfaces): Make this routine returns alll
17198         the interfaces and work around the lame differences between
17199         System.Type and System.Reflection.Emit.TypeBuilder in the results
17200         result for GetInterfaces.
17201
17202         (ExpandInterfaces): Given an array of interface types, expand and
17203         eliminate repeated ocurrences of an interface.  This expands in
17204         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17205         be IA, IB, IC.
17206
17207 2002-06-21  Martin Baulig  <martin@gnome.org>
17208
17209         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17210         on System.Enum.
17211
17212 2002-06-21  Martin Baulig  <martin@gnome.org>
17213
17214         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17215         and called with one of the core types, return the corresponding typebuilder for
17216         that type.
17217
17218         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17219         element type.
17220
17221 2002-06-21  Martin Baulig  <martin@gnome.org>
17222
17223         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17224         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17225         (Expression.ConvertReferenceExplicit): Likewise.
17226
17227         * expression.cs (ElementAccess.DoResolve): Likewise.
17228         (ElementAccess.DoResolveLValue): Likewise.
17229
17230 2002-06-10  Martin Baulig  <martin@gnome.org>
17231
17232         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17233         add the "value" parameter to the parameter list.
17234
17235         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17236         to our caller.
17237
17238 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17239
17240         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17241         the argument to an int, uint, long or ulong, per the spec.  Also
17242         catch negative constants in array creation.
17243
17244 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17245
17246         * class.cs: do not allow the same interface to appear twice in
17247         the definition list.
17248
17249 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17250
17251         * ecore.cs: don't use ldlen with System.Array.
17252
17253 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17254
17255         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17256
17257 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17258
17259         * modifiers.cs: produce correct field attributes for protected
17260         internal. Easy fix so miguel can work on ther harder stuff:-)
17261
17262 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * pending.cs: New file.  Move the code from class.cs here.
17265         Support clearning the pending flag for all methods (when not doing
17266         explicit interface implementation).
17267
17268 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17269
17270         * rootcontext.cs: added a couple more types needed to bootstrap.
17271
17272 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17273
17274         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17275         constructor in the type, instead of any constructor in the type
17276         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17277         a bug in the Mono runtime when applying the params attribute). 
17278
17279 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17280         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17281
17282 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17283
17284         * expression.cs (Unary.ResolveOperator): Use TypeManager
17285         to resolve the type.
17286
17287 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17288
17289         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17290         attached.
17291
17292         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17293         with each member too.
17294
17295         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17296         field builders too - this takes care of the enum member case.
17297
17298 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17299
17300         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17301         address-of operator on both value types and pointers.
17302
17303 2002-06-10  Martin Baulig  <martin@gnome.org>
17304
17305         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17306         PropertyBuilder to the `property_builders' list.
17307
17308         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17309         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17310         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17311         find any indexers which are inherited from an interface.
17312
17313 2002-06-09  Martin Baulig  <martin@gnome.org>
17314
17315         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17316         the same type as the constant if necessary.  There's also a test-130.cs
17317         for this.
17318
17319         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17320
17321         * typemanager.cs (TypeManager.ChangeType): Previously known as
17322         Enum.ChangeEnumType().
17323
17324 2002-06-09  Martin Baulig  <martin@gnome.org>
17325
17326         * expression.cs (Cast.TryReduce): Added support for consts.
17327
17328 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17329
17330         * class.cs (Accessor): Hold attributes information so we can pass
17331         it along.
17332
17333         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17334         Modify to pass in attributes attached to the methods.
17335
17336         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17337
17338         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17339         to handle the Accessor kind :-)
17340
17341         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17342
17343 2002-06-08  Martin Baulig  <martin@gnome.org>
17344
17345         * expression.cs (Unary.TryReduceNegative): Added support for
17346         ULongConstants.
17347
17348 2002-06-08  Martin Baulig  <martin@gnome.org>
17349
17350         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17351         name can't be found in the `defined_names' - the caller will do a
17352         MemberLookup in this case and thus find methods in System.Enum
17353         such as Enum.IsDefined().
17354
17355 2002-06-08  Martin Baulig  <martin@gnome.org>
17356
17357         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17358         Convert.ChangeType() which works with TypeBuilder created types.
17359         (Enum.LookupEnumValue, Enum.Define): Use it here.
17360
17361         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17362         `TypeBuilder.BaseType != null' check.
17363         (TypeContainer.FindMembers): Only lookup parent members if we
17364         actually have a parent.
17365         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17366         (ConstructorInitializer.Resolve): Likewise.
17367
17368         * interface.cs (Interface.FindMembers): Added
17369         `TypeBuilder.BaseType != null' check.
17370
17371         * rootcontext.cs (RootContext.ResolveCore): Added
17372         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17373         classes_second_stage.
17374
17375         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17376         debug_type and trace_type when compiling with --nostdlib.       
17377
17378 2002-06-07  Martin Baulig  <martin@gnome.org>
17379
17380         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17381         (AddField): Set it to true when adding a non-static field.
17382         (DefineType): Use `have_nonstatic_fields' to find out whether we
17383         have non-static fields, not `Fields != null'.
17384
17385 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17388         dereferencing a null on the static-field code path)
17389
17390 2002-05-30  Martin Baulig  <martin@gnome.org>
17391
17392         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17393         to take command line arguments.  Use reflection to call the new
17394         custom `Initialize' function on the symbol writer and pass it the
17395         command line arguments.
17396
17397         * driver.cs (--debug-args): New command line argument to pass command
17398         line arguments to the symbol writer.
17399
17400 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17401
17402         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17403         the target type for indexers and properties.  Thanks to Joe for
17404         catching this.
17405
17406 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17407
17408         * typemanager.cs (MethodFlags): returns the method flags
17409         (Obsolete/ShouldIgnore) that control warning emission and whether
17410         the invocation should be made, or ignored. 
17411
17412         * expression.cs (Invocation.Emit): Remove previous hack, we should
17413         not do this on matching a base type, we should do this based on an attribute
17414
17415         Only emit calls to System.Diagnostics.Debug and
17416         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17417         on the command line.
17418
17419         * rootcontext.cs: Global settings for tracing and debugging.
17420
17421         * cs-tokenizer.cs (define): New utility function to track
17422         defines.   Set the global settings for TRACE and DEBUG if found.
17423
17424 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17425
17426         * interface.cs (Populate*): Pass in the TypeContainer as well as
17427         the DeclSpace as parameters so that we can create EmitContexts and
17428         then use that to apply attributes etc.
17429
17430         (PopulateMethod, PopulateEvent, PopulateProperty)
17431         (PopulateIndexer): Apply attributes everywhere.
17432
17433         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17434         etc.
17435
17436         (ApplyAttributes): Update accordingly.
17437
17438         We now apply interface attributes for all members too.
17439
17440 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * class.cs (Indexer.Define); Correctly check if we are explicit
17443         implementation (instead of checking the Name for a ".", we
17444         directly look up if the InterfaceType was specified).
17445
17446         Delay the creation of the PropertyBuilder.
17447
17448         Only create the PropertyBuilder if we are not an explicit
17449         interface implementation.   This means that explicit interface
17450         implementation members do not participate in regular function
17451         lookups, and hence fixes another major ambiguity problem in
17452         overload resolution (that was the visible effect).
17453
17454         (DefineMethod): Return whether we are doing an interface
17455         implementation. 
17456
17457         * typemanager.cs: Temporary hack until we get attributes in
17458         interfaces (Ravi is working on that) and we get IndexerName
17459         support in interfaces.
17460
17461         * interface.cs: Register the indexers as properties.
17462
17463         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17464         warning, I have verified that this is a bug in the .NET runtime
17465         (JavaScript suffers of the same problem).
17466
17467         * typemanager.cs (MemberLookup): When looking up members for
17468         interfaces, the parent of an interface is the implicit
17469         System.Object (so we succeed in searches of Object methods in an
17470         interface method invocation.  Example:  IEnumerable x;  x.ToString
17471         ()) 
17472
17473 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * class.cs (Event): Events should also register if they do
17476         implement the methods that an interface requires.
17477
17478         * typemanager.cs (MemberLookup); use the new GetInterfaces
17479         method. 
17480
17481         (GetInterfaces): The code used to lookup interfaces for a type is
17482         used in more than one place, factor it here. 
17483
17484         * driver.cs: Track the errors at the bottom of the file, we kept
17485         on going.
17486
17487         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17488         instance if the method we are calling is static!
17489
17490 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17491
17492         * attribute.cs (ApplyAttributes): Make this function filter out
17493         the IndexerName attribute (as that attribute in reality is never
17494         applied) and return the string constant for the IndexerName
17495         attribute. 
17496
17497         * class.cs (TypeContainer.Emit): Validate that all the indexers
17498         have the same IndexerName attribute, and if so, set the
17499         DefaultName attribute on the class. 
17500
17501         * typemanager.cs: The return value might contain other stuff (not
17502         only methods).  For instance, consider a method with an "Item"
17503         property and an Item method.
17504
17505         * class.cs: If there is a problem with the parameter types,
17506         return. 
17507
17508 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17509
17510         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17511         looks at user defined conversion after making a call to 
17512         StandardConversionExists - we need this for overload resolution.
17513
17514         * expression.cs : Update accordingly the various method calls.
17515
17516         This fixes 2 bugs filed against implicit user defined conversions 
17517
17518 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * statement.cs: Track the result of the assignment.
17521
17522 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * expression.cs (MemberAccess): Improved error reporting for
17525         inaccessible members.
17526
17527 2002-05-22  Martin Baulig  <martin@gnome.org>
17528
17529         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17530         itself with debugging support.
17531
17532 2002-05-22  Martin Baulig  <martin@gnome.org>
17533
17534         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17535         Removed, this isn't needed anymore.
17536
17537 2002-05-20  Martin Baulig  <martin@gnome.org>
17538
17539         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17540         be underlying type for an enum.
17541
17542 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17543
17544         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17545         that splits out the loading of just the core types.
17546
17547         * rootcontext.cs (ResolveCore): Split the struct resolution in
17548         two, so we can load the enumeration underlying types before any
17549         enums are used.
17550
17551         * expression.cs (Is): Bandaid until we fix properly Switch (see
17552         bug #24985 for details).
17553
17554         * typemanager.cs (ImplementsInterface): The hashtable will contain
17555         a null if there are no interfaces implemented.
17556
17557 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17558
17559         * cs-parser.jay (indexer_declarator): It is fine to have array
17560         parameters
17561
17562 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17563
17564         * typemanager.cs: (RegisterBuilder): New function used to register
17565         TypeBuilders that implement interfaces.  Since
17566         TypeBuilder.GetInterfaces (as usual) does not work with lame
17567         Reflection.Emit. 
17568         (AddUserType): register interfaces.
17569
17570         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17571         dealing with TypeBuilder.  Also, arrays are showing up as
17572         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17573         methods can not be invoked on them!
17574
17575         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17576         (ImplicitReferenceConversionExists): Split out from
17577         StandardConversionExists. 
17578
17579         * expression.cs (As): We were only implementing one of the three
17580         cases for the as operator.  We now implement them all.
17581         (Is): Implement the various other cases for Is as well.
17582
17583         * typemanager.cs (CACHE): New define used to control if we want or
17584         not the FindMembers cache.  Seems to have a negative impact on
17585         performance currently
17586
17587         (MemberLookup): Nested types have full acess to
17588         enclosing type members
17589
17590         Remove code that coped with instance/static returns for events, we
17591         now catch this in RealFindMembers.
17592
17593         (RealFindMembers): only perform static lookup if the instance
17594         lookup did not return a type or an event.  
17595
17596 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17597
17598         * assign.cs (CompoundAssign): We pass more semantic information
17599         now to Compound Assignments than we did before: now we have all
17600         the information at hand, and now we resolve the target *before* we
17601         do the expression expansion, which allows the "CacheValue" method
17602         to have the effect we intended (before, a [x] += 1 would generate
17603         two differen ArrayAccess expressions from the ElementAccess,
17604         during the resolution process).
17605
17606         (CompoundAssign.DoResolve): Resolve target and original_source here.
17607
17608 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
17609
17610         * expression.cs (ArrayAccess): dropped debugging information. 
17611
17612         * typemanager.cs: Small bug fix: I was always returning i_members,
17613         instead of one of i_members or s_members (depending on which had
17614         the content).
17615
17616         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
17617         method is invoked before any code generation takes place, and it
17618         is a mechanism to inform that the expression will be invoked more
17619         than once, and that the method should use temporary values to
17620         avoid having side effects
17621
17622         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17623
17624         * ecore.cs (Expression.CacheTemporaries): Provide empty default
17625         implementation.
17626
17627         * expression.cs (Indirection, ArrayAccess): Add support for
17628         CacheTemporaries in these two bad boys. 
17629
17630         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17631         ldobj or ldind_ref.  
17632         (StoreFromPtr): Handle stobj as well.
17633
17634         * expression.cs (UnaryMutator): Share more code.
17635
17636         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17637         down: I was not tracking the Filter function as well, which
17638         was affecting the results of the cache.
17639
17640 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
17641
17642         * attribute.cs: Remove the hack to handle the CharSet property on
17643         StructLayouts. 
17644
17645 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17646
17647         * attribute.cs (DoResolve): More uglyness, we now only try to
17648         resolve the attribute partially, to extract the CharSet
17649         information (only if we are a StructLayout attribute).  Otherwise 
17650
17651         (GetExtraTypeInfo): Add some code to conditionally kill in the
17652         future this.   I am more and more convinced that the .NET
17653         framework has special code to handle the attribute setting on
17654         certain elements.
17655
17656         * expression.cs (IsParamsMethodApplicable): Revert my previous
17657         foreach change here, it was wrong.
17658
17659 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17660
17661         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17662         (pp_expr): do not abort on unknown input, just return.
17663         (eval): abort if there are pending chars.
17664
17665         * attribute.cs (Attribute.Resolve): Positional parameters are
17666         optional.  Deal with that case.
17667
17668         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17669         the Ansi/Unicode/Auto information for the type.
17670
17671         (TypeContainer.DefineType): instantiate the EmitContext here, as
17672         we will be using it during the type definition (to resolve
17673         attributes) and during the emit phase.
17674
17675         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17676         to pull type information out of the attributes
17677
17678         (Attribute.Resolve): track the constructor builder, and allow for
17679         multiple invocations (structs and classes will use this).
17680
17681         * ecore.cs (MemberLookupFinal): new version with all the
17682         parameters customizable.
17683
17684         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17685         constructors.  Return if the result value is null (as the error
17686         would have been flagged already by MemberLookupFinal)
17687
17688         Do not allow instances of abstract classes or interfaces to be
17689         created.
17690
17691         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17692         We have to compare the assembly property here when dealing with
17693         FamANDAssem and Assembly access modifiers, because we might be
17694         creating an assembly from *modules* (that means that we are not
17695         getting TypeBuilders for types defined in other modules that are
17696         part of this assembly).
17697
17698         (Method.Emit): If the method is marked abstract and has a body,
17699         emit an error. 
17700
17701         (TypeContainer.DefineMembers): If both the defined member and the
17702         parent name match are methods, then do not emit any warnings: let
17703         the Method.Define routine take care of flagging warnings.  But if
17704         there is a mismatch (method overrides something else, or method is
17705         overriwritten by something, then emit warning).
17706
17707         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17708         set to null, this means `do not check for the return type on the
17709         signature'. 
17710
17711         (Method.Define): set the return type for the method signature to
17712         null, so that we get methods with the same name and parameters and
17713         different return types.  This is used to flag warning 114 (you are
17714         hiding a method, and you probably want to use the new/override
17715         keywords instead).
17716
17717         * typemanager.cs (MemberLookup): Implemented proper access
17718         control, closing a long standing set of bug reports.  The problem
17719         was that the Framework only has two bits: Public and NonPublic,
17720         and NonPublic includes private and protected methods, but we need
17721         to enforce the FamANDAssem, FamOrAssem and Family. 
17722
17723 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17724
17725         * statement.cs (GotoCase): Return true: Ammounts to giving up
17726         knowledge on whether we return or not, and letting the other case
17727         be responsible for it.
17728
17729 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17730
17731         * driver.cs: Do not load directories for each file processed, only
17732         do it if there is a pattern.
17733
17734         * ecore.cs: Report readonly assigns here as well, as we might have
17735         been resolved only by MemberAccess.
17736
17737         (SimpleName.SimpleNameResolve): Also be useful for LValue
17738         resolution.   We need this to propagate assign to local readonly variables
17739
17740         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17741         do not want to reuse potential criteria memory.
17742
17743         * class.cs (MyEventBuilder): Set reflected_type;
17744
17745         * ecore.cs (Constantify): Added support for constifying bools.
17746
17747         (RootContext.LookupType): Added a cache for values looked up in
17748         the declaration space.
17749
17750         * typemanager.cs (FindMembers): Now is a front-end to
17751         RealFindMembers, and provides a two-level hashtable-based cache to
17752         the request.  
17753
17754         15% performance improvement: from 22.5 to 19.2 seconds.
17755
17756         * expression.cs (IsParamsMethodApplicable): use foreach.
17757         (Invocation.DoResolve): ditto.
17758         (New.DoResolve): ditto.
17759         (ArrayCreation.DoResolve): ditto.
17760
17761         * ecore.cs (FindMostEncompassingType): use foreach.
17762
17763         * delegate.cs (NewDelegate.DoResolve): Use foreach
17764
17765         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17766         (RemoveMethods): use foreach.
17767
17768         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17769         nested foreach statements instead of for, and also break out of
17770         the inner loop once a match is found.
17771
17772         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17773
17774 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17775
17776         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17777         we actually unwrap the expression to allow for extra information
17778         to be extracted. 
17779
17780         * expression.cs: Use Shr_Un on unsigned operations. 
17781
17782 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17783
17784         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17785         applicable operators was not being considered correctly. This closes
17786         the bug Miguel reported.
17787
17788 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17789
17790         * attribute.cs: check that the type derives from System.Attribute
17791         and report the correct error in that case (moved the duplicate code to
17792         its own method, too).
17793
17794 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17795
17796         * attribute.cs: lookup attribute type name as the spec says: first the
17797         bare attribute name and then name + "Attribute" (nant compiles with
17798         mcs after this fix).
17799
17800 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17803         Because of the way we parse things, we should try to see if a
17804         UIntConstant can fit in an integer.
17805
17806 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17807
17808         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17809         when we are in an explicit context.
17810
17811         (ConvertReferenceExplicit): When converting from Iface type S to Class
17812         T make sure the rules are implemented as an OR.
17813
17814         * parameter.cs (ParameterType): Make it a property for now although the
17815         purpose really isn't anything immediate.
17816
17817         * expression.cs (Is*Applicable): Do better checking on the parameter type
17818         of a ref/out parameter. The ones from the system assemblies are already 
17819         marked with the correct type so we don't need to do any correction.
17820
17821         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17822         the object type is standard too so include that.
17823
17824 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17825
17826         * ecore.cs (StandardConversionExists): Augment with missing code:
17827         deal with IntConstant, LongConstants and Enumerations.
17828
17829         * assign.cs: Report the error, instead of failing silently
17830
17831         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17832         typecontainer that they are declared, because the
17833         typecontainer/namespace will have the list of using clauses that
17834         need to be applied.
17835
17836         Assembly Attributes were escaping the normal registration
17837         mechanism. 
17838
17839         (EmitCode): Apply attributes within an EmitContext that represents
17840         the container they were declared on.
17841
17842         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17843
17844 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17845
17846         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17847         Revamp completely - make much cleaner as we now operate only
17848         on a set of Types.
17849
17850         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17851         to implement the logic detailed in the spec more correctly.
17852
17853         (UserDefinedConversion): Update accordingly.
17854
17855 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17856
17857         * statement.cs: Return flow analysis information up.
17858
17859         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17860         and the default.
17861
17862         (token): Do not consume an extra character before calling
17863         decimal_digits.
17864
17865 2002-05-06  Piers Haken <piersh@friskit.com>
17866
17867         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17868
17869 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17870
17871         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17872         EmitContext during the instance constructor initializer
17873         resolution, to stop access to instance variables.
17874
17875         This is mandated by the spec, last paragraph of the `constructor
17876         initializers' section. 
17877
17878 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17879
17880         * cs-parser.jay, class.cs (Accessor): new class used to represent
17881         an accessor (get or set).  In the past we used `null' to represent
17882         a missing accessor.  But this is ambiguous because there was no
17883         way to tell in abstract indexers/properties if one of them was
17884         specified.
17885
17886         Now there is a way of addressing that.
17887
17888         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17889         instead of FindMembers.
17890
17891         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17892         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17893
17894         * attribute.cs: Treat indexers and properties as the same in terms
17895         of applying attributes
17896
17897         * ecore.cs (FindMostEncompassedType): Use statically initialized
17898         EmptyExpressions()s like we do elsewhere to avoid creating useless
17899         objects (and we take this out of the tight loop).
17900
17901         (GetConversionOperators): Move the code to extract the actual
17902         operators to a separate routine to clean things up.
17903
17904 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17905
17906         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17907         events are always registered FieldBuilders.
17908
17909         * class.cs (FieldBase): New class shared by Fields 
17910
17911         * delegate.cs: If we are a toplevel delegate, use our full name.
17912         If we are a nested delegate, then only use our tail name.
17913
17914 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17915
17916         * expression.cs (IsApplicable): Ensure that we add the "&" to
17917         ref/out types before comparing it with the type of the argument.
17918
17919         (IsParamsMethodApplicable): Ditto.
17920
17921         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17922         silly me ;-)
17923
17924         * delegate.cs : Handle the case when we have more than one applicable
17925         method. Flag an error only when we finish checking all.
17926
17927 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * expression.cs: Add support for boolean static initializers.
17930
17931 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17934
17935         * parameter.cs (ComputeParameterTypes,
17936         ComputeAndDefineParameterTypes): Better error handling: now we
17937         clear the `types' cache if we fail during any of the type lookups.
17938         We also return the status code correctly to our caller
17939
17940         * delegate.cs: If we fail to define a delegate, abort the extra
17941         steps. 
17942
17943         * expression.cs (Binary.ResolveOperator): for
17944         operator==(object,object) and operator !=(object, object) we also
17945         have to verify that there is an implicit conversion from one to
17946         the other.
17947
17948         (ArrayAccess.DoResolve): Array Access can operate on
17949         non-variables. 
17950
17951 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * assign.cs (CompoundAssign): A new class used as a "flag" that
17954         the assignment actually is happening as part of a compound
17955         assignment operator.
17956
17957         During compound assignment, a few new rules exist to enable things
17958         like:
17959
17960         byte b |= 1 + 2
17961
17962         From the spec:
17963
17964         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17965         to the type of x) if y is implicitly convertible to the type of x,
17966         and the operator is a builtin operator and the return type of the
17967         operator is explicitly convertible to the type of x. 
17968
17969         * rootcontext.cs: Reset warning level to 2.  4 catches various
17970         "interesting" features in mcs, we must clean this up at some
17971         point, but currently am trying to kill other bugs ;-)
17972
17973         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17974         in container classes as well.  
17975
17976         * expression.cs (Binary.ResolveOperator): Handle string case
17977         before anything else (as operator overloading does emit an error
17978         before doing anything else).
17979
17980         This code could go away when we move to a table driven model, but
17981         i could not come up with a good plan last night.
17982
17983 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17984
17985         * typemanager.cs (CSharpName): reimplementation using regex.
17986         * class.cs: added null check for fields in Emit
17987         * rootcontext.cs: set warninglevel to 4
17988
17989 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * typemanager.cs (CSharpName): reimplemented with Lupus
17992         suggestion.
17993
17994 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * statement.cs (If): correclty implement Resolve, because we were
17997         not catching sem errors in there.  The same process is needed
17998         everywhere else. 
17999         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18000
18001
18002         (Statement.Warning_DeadCodeFound): Factorize code.
18003         (While): Report dead code here too.
18004
18005         (Statement): Added Resolve virtual method to allow
18006         for resolution split from the emit code.
18007
18008 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18009
18010         * statement.cs (EmitBoolExpression): No longer try to resolve the
18011         expression here.    
18012         (MakeBoolean): New utility function that resolve, implicitly
18013         converts to boolean and tags the expression. 
18014
18015
18016         (If, Do): Implement dead code elimination.
18017         (While): Implement loop inversion
18018
18019         (Do, While, For, If): Resolve the expression prior to calling our
18020         code generation.
18021
18022 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18023
18024         * class.cs:
18025           - added method Report28 (warning: program has more than one entry point)
18026           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18027           - modified method Method.Define, the part at the end of the method
18028
18029         * rootcontext.cs: added static public Location EntryPointLocation;
18030           
18031         * ../errors/cs0028.cs : Add test case for the above warning.              
18032
18033         * typemanager.cs:
18034           - modified method CSharpName to allow arrays of primitive type to
18035             be printed nicely (e.g. instead of System.Int32[][] it now prints
18036             int[][])
18037           - added method CSharpSignature: returns the signature of a method
18038             in string format to be used in reporting errors, warnings, etc.
18039
18040         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18041         with String.Empty.
18042
18043 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18044
18045         * delegate.cs (Define): Fix extremely silly bug where I was
18046         setting the type of the 'object' parameter of the BeginInvoke
18047         method to System.IAsyncResult instead of System.Object ;-)
18048
18049 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18050
18051         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18052         here. 
18053
18054         (Constructor.Emit): return if we fail to initialize the
18055         constructor.  Another door closed!  
18056
18057         * expression.cs (New.DoResolve): Improve error message (from -6 to
18058         1501).  Use DeclaredOnly lookup to find the exact constructor.
18059
18060         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18061         loop.  This is useful.
18062
18063         * cs-parser.jay: Adjust the default parameters so that destructors
18064         have the proper signature.
18065
18066 2002-04-26  Martin Baulig  <martin@gnome.org>
18067
18068         * driver.cs (LoadAssembly): If `assembly' contains any characters
18069         which are only valid in path names and not in assembly names
18070         (currently slash, backslash and point), use Assembly.LoadFrom ()
18071         instead of Assembly.Load () on the `assembly' (before iteration
18072         over the link_paths).
18073
18074 2002-04-26  Martin Baulig  <martin@gnome.org>
18075
18076         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18077
18078 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18079
18080         * class.cs (Property): use the new typemanager.MemberLookup
18081
18082         (TypeContainer.MemberLookup): Implement using the
18083         TypeManager.MemberLookup now. 
18084
18085         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18086         and return MemberInfos, so that these can be used without an
18087         EmitContext (what we had before).
18088
18089 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18090
18091         * expression.cs: Fix the case where the argument to params if the
18092         type of the params.  I omitted handling this before.   Fixed
18093
18094 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18095
18096         * driver.cs: Call BootCorlib_PopulateCoreType
18097
18098         * class.cs (Property.CheckBase): Check for properties only, not
18099         for all members. 
18100
18101         * interface.cs: Temporary hack: try/catch around the
18102         CustomAttributeBuilder, because I am getting an exception that I
18103         do not understand.
18104
18105         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18106         types whose definitions are required to be there (attributes are
18107         defined before standard types).
18108
18109         Compute definitions as we boot the various types, as they are used
18110         immediately (value_type class will need object_type, but if we do
18111         not initialize object_type, we will pass a null, which will let
18112         the runtime pick the System.Object from the existing corlib, which
18113         is not what we want).
18114
18115 2002-04-22  Patrik Torstensson <totte@labs2.com>
18116
18117         * cs-tokenizer.cs: fixed a number of trim() issues.
18118
18119 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18120
18121         * expression.cs (Argument.Type): Ensure that we return the correct
18122         type when we have out or ref parameters [in which case we 
18123         append a "&"].
18124
18125 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18126
18127         * class.cs (Property, Indexer): Allow extern modifier in there. 
18128
18129         * typemanager.cs (InitBaseTypes): Initializes object_type and
18130         value_type, since those will be used early on during the bootstrap
18131         process to compile corlib.
18132
18133         (InitCoreTypes): Move code from here to InitBaseTypes.
18134
18135 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18138         single-dimension arrays as using the ldlen opcode.  
18139
18140         Daniel Lewis discovered this optimization.  
18141
18142         * typemanager.cs: Add signature for System.Array::get_Length
18143
18144 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18145
18146         * statement.cs: report the error when the foreach does not apply to an
18147         array nor a collection.
18148
18149 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18150
18151         * expression.cs: Add implicit conversions to the operator ~.
18152
18153         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18154
18155         * typemanager.cs: Locate the decimal constructor.
18156
18157 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18158
18159         * attribute.cs: use the new property of TypeOf.
18160         * expression.cs: added 'get' property around typearg.
18161
18162         These changes fix a build breaker reported by NickD. Is this the
18163         correct way to fix?  If not, please, revert my changes and make it
18164         work :-).
18165
18166 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18167
18168         * attribute.cs: Add support for typeof in attribute invocations.
18169         I am not sure that this is right though.
18170
18171 2002-04-14  Duncan Mak  <duncan@ximian.com>
18172
18173         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18174         Binary.Operator.Division case.
18175
18176 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18177
18178         * class.cs (DefineType): Ensure that we do a proper check on
18179         attribute types and also register it with the TypeManager.
18180
18181         (TypeContainer.Targets): The default for attribute types is
18182         AttributeTargets.All.
18183
18184         * attribute.cs (ApplyAttributes): Registering the attribute type
18185         is done elsewhere, not when we discover we have a Usage attribute.
18186
18187 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18188
18189         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18190         and get rid of is_delegate parameter.
18191
18192         * everywhere : update.
18193
18194 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18195
18196         * cs-parser.jay (compilation_unit): Revamp completely to use
18197         some new ideas that I got from Rhys' grammar to solve the problems
18198         with assembly level attributes.
18199
18200         (outer_declaration): New grammar production.
18201
18202         (attribute_sections): Add.
18203
18204         (opt_attributes): Base on attribute_sections
18205
18206         (namespace_declaration): Allow opt_attributes to tackle the case
18207         when we have assembly level attributes - we are clever in this
18208         regard now ;-)
18209
18210         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18211         attributes in the non-global context.
18212
18213         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18214         instead of SetGlobalAttributes.
18215
18216         * class.cs, rootcontext.cs : Ensure we define and generate 
18217         attribute types before anything else.
18218
18219         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18220         and flag the new error -20 for the case when the attribute type
18221         does not have valid targets specified. csc does not catch this.
18222
18223         * ../errors/errors.txt : update for error # -20
18224
18225 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18226
18227         * support.cs (InternalParameters.ParameterModifier): Do some null
18228         checking and return sane values.
18229
18230         * class.cs (Method.Define): If we are a PInvoke method, ensure
18231         that we are static and extern. Report error # 601
18232
18233         * ../errors/cs0601.cs : Add test case for the above error.
18234
18235 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18236
18237         * rootcontext.cs (attribute_types): We need to keep type of
18238         all attribute types separately and emit code for them first.
18239
18240         (RegisterAttribute) : Implement.
18241
18242         * class.cs (DefineType): Check if the current Type is a custom
18243         attribute type and register it accordingly.
18244
18245         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18246         adding the first attribute twice and rename to
18247
18248         (SetGlobalAttributes): this.
18249
18250         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18251         lookups.
18252
18253         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18254         if we are processing global arguments. Hmm, I am unsure of this.
18255
18256 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18257
18258         * expression.cs: added static array of strings to avoid calling
18259         Enum.ToString () for Operator in Binary. Significant recover of
18260         performance.
18261
18262 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18263
18264         * class.cs (FindMembers): Allow the Builders of the various
18265         members to be null.  If they are skip them.  This only happens
18266         during the PInvoke declaration.
18267
18268 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18269
18270         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18271         failure, so we do not keep going afterwards.
18272
18273         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18274         wanted to pass `false' as the `is_delegate' argument.  If this is
18275         the case, why not use delegate_type == null to mean `is_delegate =
18276         false' and anything else as is_delegate = true.
18277
18278 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18279
18280         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18281         code for the section, not the beginning of the tests.
18282
18283 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18284
18285         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18286
18287         * expression.cs (Binary): same.  Warn about errors where we have
18288         Enum/Enum in operator + as well.
18289
18290 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18291
18292         * statement.cs:
18293                 - added support for switch(bool)
18294                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18295                 - add TableSwitchEmit() to handle table-based switch statements
18296
18297 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18298
18299         * expression.cs (Invocation.OverloadResolve): Factor out code which
18300         does parameter compatibility checking with arguments so that we can 
18301         re-use the code even from Delegate.VerifyApplicability
18302
18303         (VerifyArgumentsCompat): Move above code here.
18304
18305         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18306         and instead make a call to the above method.
18307
18308 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18309
18310         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18311         We use it to keep track of classes which are attribute types.
18312
18313 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18314
18315         * delegate.cs (Delegate.Define): Correctly define the types in the
18316         presence of fixed and array parameters.
18317
18318         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18319         doing FindMembers.
18320
18321         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18322         include NonPublic after the first iteration.
18323
18324         * class.cs (Indexer.CheckBase): Only check if both parents are
18325         non-null. 
18326
18327         * cs-parser.jay (accessor_body): If empty, set to null.
18328
18329         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18330         same code path here to resolve constants names that we did have in
18331         MemberAccess.DoResolve.  There is too much code duplicated here.
18332
18333 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18334
18335         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18336
18337         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18338         to MakeUnionSet.
18339
18340         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18341         tokens, numbers and strings.
18342
18343         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18344         parenthesis.
18345
18346         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18347         asyncronous parameters and the regular parameters.  
18348
18349         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18350         specify the target directory.
18351
18352         * expression.cs: (This.DoResolve): Simplify
18353         (As.Emit): Optimize, do not generate IsInst if the expression is
18354         always of the given type.
18355
18356         (Is.DoResolve): Bug fix, we were reporting both always/never for
18357         the is expression.
18358
18359         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18360         creating too many unnecessary arrays.
18361
18362 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18363
18364         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18365         fields instead of rolling our own initializer.   Takes care of all
18366         implicit conversions, and drops unnecessary static checks/argument.
18367
18368 2002-03-31  Dick Porter  <dick@ximian.com>
18369
18370         * driver.cs: use the GetDirectories() return values properly, and
18371         use "/" as path separator.
18372
18373 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * expression.cs (Unary): Optimize - - expr into expr.
18376         (Binary): Optimize a + (-b) into a -b.
18377
18378         * codegen.cs (CodeGen): Made all methods static.
18379
18380 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18381
18382         * rootcontext.cs: 
18383
18384         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18385         TypeBuilder property.
18386
18387         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18388         instead. 
18389
18390         * tree.cs: Removed the various RecordXXXX, and replaced with a
18391         single RecordDecl.  Removed all the accessor methods, and just
18392         left a single access point Type 
18393
18394         * enum.cs: Rename DefineEnum to DefineType.
18395
18396         * decl.cs: New abstract method `DefineType' used to unify the
18397         Defines for Enumerations, Interfaces, TypeContainers and
18398         Delegates.
18399
18400         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18401         LookupBaseClasses method that used to live in class.cs and
18402         interface.cs here, and renamed to FindType.
18403
18404         * delegate.cs: Implement DefineType.  Take advantage of the
18405         refactored pattern for locating the parent builder without taking
18406         the parent_builder argument (which we know does not work if we are
18407         nested, and triggering a toplevel definition).
18408
18409 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18410
18411         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18412         accessibility of a member has changed during override and report
18413         an error if so.
18414
18415         * class.cs (Method.Define, Property.Define): Only complain on
18416         overrides if the method is private, any other accessibility is
18417         fine (and since we just checked the permission is the same, we are
18418         good to go).
18419
18420         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18421         and elif are processed always.  The other pre-processing
18422         directives are only processed if we are "taking" the path
18423
18424 2002-03-29  Martin Baulig  <martin@gnome.org>
18425
18426         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18427         current location is not Null.
18428
18429         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18430         a separate method so we can profile it.
18431
18432         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18433         `span.Seconds' are just seconds, but no minutes or hours.
18434         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18435
18436 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18439         Remove the gratuitous set of Final:
18440
18441                                 // If an interface implementation, then we can set Final.
18442                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18443                                     implementing.DeclaringType.IsInterface)
18444                                         flags |= MethodAttributes.Final;
18445
18446         I do not know what I was smoking when I used that.
18447
18448
18449         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18450         step into fixing the name resolution issues for delegates and
18451         unifying the toplevel name resolution.
18452
18453 2002-03-28  Martin Baulig  <martin@gnome.org>
18454
18455         * class.cs (Method.Emit): If we have a symbol writer, call its
18456         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18457         tell it about the current method.
18458
18459         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18460         writer that we're going to emit the first byte of IL code for a new
18461         statement (a new source line).
18462         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18463         EmitContext.Mark() before emitting any code.
18464
18465         * location.cs (SymbolDocument): Return null when we're Null.
18466
18467         * statement.cs (Statement): Moved the `Location loc' variable here.
18468         (Statement.EmitBoolExpression): If we have a symbol writer, call
18469         ec.Mark() before emitting any code to tell it that we're at the
18470         beginning of a new statement.
18471         (StatementExpression): Added `Location' argument to the constructor.
18472         (Block): Added public readonly variable `StartLocation' and public
18473         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18474         (Block): Added constructor which takes a start and end location.
18475         (Block.SetEndLocation): New method. This sets the end location.
18476         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18477         local variables we create.
18478         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18479         each statement and do also mark the begin and end of the block.
18480
18481         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18482         tell it the current lexer.Location, use Location.Null for the end of the
18483         block.
18484         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18485         current block, set its end location using SetEndLocation().
18486         (statement_expression): StatementExpression constructor now takes the
18487         lexer.Location as additional argument.
18488         (for_statement, declare_local_variables): Likewise.
18489         (declare_local_variables): When creating a new implicit block, use the
18490         new Block constructor and pass it the lexer.Location.
18491
18492 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18493
18494         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18495         members also on the parent interfaces recursively.
18496
18497 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18498
18499         * report.cs: Use new formats, since Gonzalo finished the missing
18500         bits. 
18501
18502         * expression.cs (Binary.ResolveOperator): added missing operator|
18503         operator& and operator^ for bool/bool.
18504
18505         * cs-parser.jay: CheckDef now takes a Location argument that is
18506         used to report errors more precisly (instead of reporting the end
18507         of a definition, we try to track something which is a lot closer
18508         to the source of the problem).
18509
18510         * cs-tokenizer.cs: Track global token use, so we can properly flag
18511         the use of #define/#undef after the first token has been seen.
18512
18513         Also, rename the reportXXXX to Error_DescriptiveName
18514
18515         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18516         TypeContainer, so that Enum and Interface can use this too.
18517
18518         * class.cs (TypeContainer.LookupInterfaceOrClass,
18519         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18520         `builder' argument.  Typically this was used to pass the parent
18521         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18522         the definition).  
18523
18524         The problem is that a nested class could trigger the definition of
18525         a toplevel class, and the builder would be obviously wrong in that
18526         case. 
18527
18528         So we drop this argument, and we compute dynamically the
18529         TypeBuilder/ModuleBuilder (the correct information was available
18530         to us anyways from DeclSpace.Parent)
18531
18532         * interface.cs (Interface.DefineInterface): Drop builder
18533         parameter cleanup like class.cs
18534
18535         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18536         like class.cs
18537
18538         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18539         values. 
18540
18541         (Try.Emit): Propagate the returns value from the statement.
18542
18543         (Return.Emit): Even if we are leavning 
18544
18545         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18546
18547         * modifiers.cs: Fix the computation of MethodAttributes flags.
18548
18549 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18550
18551         * driver.cs: allow compilation of files that start with '/'.
18552         Add a default case when checking the argument of --target.
18553
18554 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18555
18556         * interface.cs: Implement the same search algorithm for types in
18557         the interface code.
18558
18559         * delegate.cs: Do not allow multiple definition.
18560
18561         * Recovered ChangeLog that got accidentally amputated
18562
18563         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18564
18565         * rootcontext.cs: Load manually enum to allow core classes to
18566         contain enumerations.
18567
18568         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18569         Update to new static methods in TypeManager.
18570
18571         * typemanager.cs (GetMethod, GetConstructor): Use our
18572         implementation of FindMembers to find the members, since during
18573         corlib compilation, the types are TypeBuilders and GetMethod and
18574         GetConstructor do not work.
18575
18576         Make all methods in TypeManager static.
18577
18578         (InitCodeHelpers): Split the functionality from
18579         the InitCodeTypes function.
18580
18581         * driver.cs: Call InitCodeHelpers after we have populated the
18582         types. 
18583
18584         * cs-parser.jay (delegate_declaration): we did not used to compute
18585         the delegate name correctly for void delegates.
18586
18587 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * rootcontext.cs (RootContext): Init the interface_resolve_order
18590         and type_container_resolve_order always.
18591
18592         (ResolveCore, BootstrapCorlib_ResolveClass,
18593         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18594         compiler when compiling with --nostdlib
18595
18596         * class.cs (TypeContainer.DefineType): Check that our parent is
18597         not null.  This test is most important when we are bootstraping
18598         the core types.
18599
18600         * codegen.cs: Split out the symbol writing code.
18601
18602 2002-03-25  Martin Baulig  <martin@gnome.org>
18603
18604         * driver.cs (-g): Made -g an alias for --debug.
18605
18606 2002-03-24  Martin Baulig  <martin@gnome.org>
18607
18608         * codegen.cs (SymbolWriter): New public variable. Returns the
18609         current symbol writer.
18610         (CodeGen): Added `bool want_debugging_support' argument to the
18611          constructor. If true, tell the ModuleBuild that we want debugging
18612         support and ask it for the ISymbolWriter.
18613         (Save): If we have a symbol writer, call it's Close() method after
18614         saving the assembly.
18615
18616         * driver.c (--debug): New command line argument to create a
18617         debugger information file.
18618
18619         * location.cs (SymbolDocument): New public property. Returns an
18620         ISymbolDocumentWriter object for the current source file or null
18621         if we don't have a symbol writer.
18622
18623 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * driver.cs (LoadAssembly): Correctly return when all the paths
18626         have been tried and not before.
18627
18628         * statement.cs (Switch.Emit): return the actual coverage for this
18629         statement (returns/not-returns)
18630
18631         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18632         switch of the statement if we are the last switch section.  That
18633         kills two problems: try/catch problems (we used to emit an empty
18634         nop at the end) and switch statements where all branches would
18635         return. 
18636
18637 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * driver.cs: Add default assemblies (the equivalent to the
18640         Microsoft CSC.RSP file)
18641
18642         * cs-tokenizer.cs: When updating `cols and setting it to zero,
18643         also update tokens_seen and set it to false.
18644
18645         * driver.cs: Implement --recurse for Mike.
18646
18647         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18648         correctly splitting out the paths.
18649
18650 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18651
18652         * interface.cs (Interface.PopulateProperty): Instead of using
18653         `parent' as the declaration space for the set parameters, use
18654         `this' 
18655
18656         * support.cs (InternalParameters): InternalParameters constructor
18657         takes a DeclSpace instead of a TypeContainer.
18658
18659         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18660         types are being initialized, load the address of it before calling
18661         the function.  
18662
18663         (New): Provide a mechanism to disable the generation of local
18664         value type temporaries when the caller will be providing us with
18665         an address to store it.
18666
18667         (ArrayCreation.EmitDynamicInitializers): Use it.
18668
18669 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18670
18671         * expression.cs (Invocation.EmitArguments): Only probe for array
18672         property if there is more than one argument.  Sorry about that.
18673
18674         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18675         empty param arrays.
18676
18677         * class.cs (Method.LabelParameters): Fix incorrect code path that
18678         prevented the `ParamArrayAttribute' from being applied to the
18679         params attribute.
18680
18681 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18682
18683         * support.cs (ReflectionParameters): Correctly compute whether the
18684         last argument is a params array.  Fixes the problem with
18685         string.Split ('a')
18686
18687         * typemanager.cs: Make the assemblies array always be non-null
18688         (empty, but non-null)
18689
18690         * tree.cs (RecordDecl): New function that abstracts the recording
18691         of names.  This reports error 101, and provides a pointer to the
18692         previous declaration.  Fixes a crash in the compiler.
18693
18694         * cs-parser.jay (constructor_declaration): Update to new grammar,
18695         and provide a constructor_body that can be empty.
18696
18697 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18698
18699         * driver.cs: Add support for --resources.
18700
18701         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18702         Make all types for the various array helper methods be integer.
18703
18704         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18705         CheckState to ConvCast.
18706
18707         (ConvCast): Now it takes a `checked' state argument, to avoid
18708         depending on the emit context for the conversion, and just using
18709         the resolve time setting.
18710
18711         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18712         instead of Invocation.EmitArguments.  We do not emit the original
18713         arguments, instead we emit those which have been converted to
18714         unsigned int expressions.
18715
18716         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18717
18718         * codegen.cs: ditto.
18719
18720         * expression.cs (LocalVariableReference): Drop the use of the
18721         Store function that depended on the variable index.
18722
18723         * statement.cs (VariableInfo): Drop the `Idx' property from this
18724         class, as this is not taking into account the indexes for
18725         temporaries tat we generate during the execution, getting the
18726         indexes wrong.
18727
18728         * class.cs: First emit class initializers, then call the parent
18729         constructor. 
18730
18731         * expression.cs (Binary): Fix opcode emision.
18732         (UnaryMutator.EmitCode): Support checked code generation
18733
18734         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18735         matches for events for both the Static and Instance scans,
18736         pointing to the same element.   Fix that.
18737
18738 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18739
18740         * rootcontext.cs (ResolveTree): Always set the
18741         interface_resolve_order, because nested interfaces will be calling
18742         into us.
18743
18744         * class.cs (GetInterfaceOrClass): Track the same resolution
18745         process used by TypeManager.LookupType.  This fixes the nested
18746         type lookups in class declarations (separate path from
18747         LookupType). 
18748
18749         (TypeContainer.DefineType): Also define nested interfaces.
18750         (TypeContainer.RegisterOrder): New public function used to
18751         register the order in which child interfaces need to be closed.
18752
18753         Nested interfaces need to be closed after their parents have been
18754         created. 
18755
18756         * interface.cs (InterfaceAttr): Put all the logic for computing
18757         the interface attribute here. 
18758
18759         (DefineInterface): Register our interface order with the
18760         RootContext or with the TypeContainer depending on the case.
18761
18762 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18763
18764         * cs-parser.jay: rework foreach statement to work with the new
18765         changes to the policy on SimpleNames.
18766
18767         * report.cs: support Stacktrace on warnings as well.
18768
18769         * makefile: drop --unsafe and /unsafe from the compile.
18770
18771 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18772
18773         * ecore.cs (StandardConversionExists): Modify to take an Expression
18774         as the first parameter. Ensure we do null -> reference type conversion
18775         checking.
18776
18777         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18778         temporary Expression objects.
18779
18780 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18781
18782         * interface.cs: workaround bug in method overloading resolution
18783         (there is already a bugzilla bug for it).
18784
18785 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18786
18787         We could also solve this problem by having a separate path for
18788         performing type lookups, instead of DoResolve, we could have a
18789         ResolveType entry point, and only participating pieces of the
18790         production (simplename, deref, array) would implement this. 
18791
18792         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18793         signal SimpleName to only resolve type names and not attempt to
18794         resolve anything else.
18795
18796         * expression.cs (Cast): Set the flag.
18797
18798         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18799
18800         * class.cs: Only report 108 if there is no `new' modifier.
18801
18802         * cs-parser.jay: rework foreach statement to work with the new
18803         changes to the policy on SimpleNames.
18804
18805         * report.cs: support Stacktrace on warnings as well.
18806
18807         * makefile: drop --unsafe and /unsafe from the compile.
18808
18809 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18812         lookups here, instead of doing that at parse time.  This means
18813         that our grammar will not introduce `LocalVariableReferences' as
18814         expressions at this point.  That solves the problem of code like
18815         this:
18816
18817         class X {
18818            static void Main ()
18819            { int X = 1;
18820             { X x = null }}}
18821
18822         This is only half the fix.  The full fix requires parameters to
18823         also be handled in this way.
18824
18825         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18826         makes the use more obvious of the DeclSpace.  The
18827         ec.TypeContainer.TypeBuilder is now only used to pull the
18828         TypeBuilder for it.
18829
18830         My theory is that I can get rid of the TypeBuilder completely from
18831         the EmitContext, and have typecasts where it is used (from
18832         DeclSpace to where it matters).  
18833
18834         The only pending problem is that the code that implements Aliases
18835         is on TypeContainer, and probably should go in DeclSpace.
18836
18837         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18838         lookups here, instead of doing that at parse time.  This means
18839         that our grammar will not introduce `LocalVariableReferences' as
18840         expressions at this point.  That solves the problem of code like
18841         this:
18842
18843         class X {
18844            static void Main ()
18845            { int X = 1;
18846             { X x = null }}}
18847
18848         This is only half the fix.  The full fix requires parameters to
18849         also be handled in this way.
18850
18851         * class.cs (Property.DefineMethod): When implementing an interface
18852         method, set newslot, when implementing an abstract method, do not
18853         set the flag (before we tried never setting it, or always setting
18854         it, which is the difference).
18855         (Indexer.DefineMethod): same.
18856         (Method.DefineMethod): same.
18857
18858         * ecore.cs: Only set the status used flag if we get back a Field.
18859
18860         * attribute.cs: Temporary hack, so Paolo can keep working.
18861
18862 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18863
18864         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18865         the unmanaged type in the case we have a MarshalAs attribute.
18866
18867         (Resolve): Handle the case when we are parsing the special MarshalAs
18868         attribute [we need to store the unmanaged type to use later]
18869
18870         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18871         MarshalAs Attribute.
18872
18873         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18874         on parameters and accordingly set the marshalling info.
18875
18876 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18877
18878         * class.cs: Optimizing slightly by removing redundant code after
18879         we switched to the `NoTypes' return value.
18880         (Property.DefineMethod): use NoTypes here too.
18881
18882         This fixes the bug I introduced in my last batch of changes.
18883
18884 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18885
18886         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18887
18888         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18889         Enums since those are types too. 
18890
18891         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18892
18893         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18894         thanks to a call during the lookup process.
18895
18896 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18897
18898         * statement.cs (Foreach): Lots of work to accomodate a particular
18899         kind of foreach statement that I had not kept in mind.  It is
18900         possible to have foreachs on classes that provide a GetEnumerator
18901         method that return objects that implement the "pattern" for using
18902         a foreach, there is no need to support GetEnumerator
18903         specifically. 
18904
18905         This is needed to compile nant.
18906
18907         * decl.cs: Only report 114 if the member is not `Finalize' and if
18908         the warning level is at least 2.
18909
18910         * class.cs: Moved the compare function from Method to
18911         MethodSignature. 
18912
18913         (MethodSignature.InheritableMemberSignatureCompare): Add new
18914         filter function that is used to extract inheritable methods from a
18915         class. 
18916
18917         (Method.Define): Use the new `inheritable_method_signature_filter'
18918         delegate
18919
18920         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18921         command. 
18922
18923 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18924
18925         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18926
18927         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18928
18929         * expression.cs: Pass location information to
18930         ConvertImplicitStandard. 
18931
18932         * class.cs: Added debugging code to track return values from
18933         interfaces. 
18934
18935 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18936
18937         * expression.cs (Is.DoResolve): If either side of the `is' is an
18938         interface, do not flag the warning.
18939
18940         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18941         for interfaces
18942
18943         * report.cs: Allow for --fatal to be used with --probe.
18944
18945         * typemanager.cs (NoTypes): Move the definition for the empty Type
18946         array here. 
18947
18948         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18949         properties. 
18950         (TypeContainer.DefineProxy): New function used to proxy to parent
18951         implementations when implementing interfaces.
18952         (TypeContainer.ParentImplements): used to lookup if our parent
18953         implements a public function that is required by an interface.
18954         (TypeContainer.VerifyPendingMethods): Hook this up.
18955
18956         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18957         `modules' and `assemblies' arraylists into arrays.  We only grow
18958         these are the very early start up of the program, so this improves
18959         the speedof LookupType (nicely measured).
18960
18961         * expression.cs (MakeByteBlob): Replaced unsafe code with
18962         BitConverter, as suggested by Paolo.
18963
18964         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18965         folding of string concatenation, but if either side is a string,
18966         and the other is not, then return null, and let the runtime use
18967         the concatenation on the string plus the object (using
18968         `Object.ToString'). 
18969
18970 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18971
18972         Constant Folding has been implemented now.
18973
18974         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18975         the error instead on types that are not supported in one's
18976         complement. 
18977
18978         * constant.cs (Constant and all children): New set of functions to
18979         perform implict and explicit conversions.
18980
18981         * ecore.cs (EnumConstant): Implement the new functions to perform
18982         conversion by proxying to the child expression.
18983
18984         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18985         own separate setting that can not be turned off from the command
18986         line using --unchecked or --checked and is only controlled using
18987         the checked/unchecked statements and expressions.  This setting is
18988         used by the constant folder to flag errors.
18989
18990         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18991         ConstantCheckState as well.   
18992
18993         During Resolve, they also have to flag the state, because the
18994         constant folder runs completely in the Resolve phase.
18995
18996         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18997         well.
18998
18999 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * cfold.cs: New file, this file contains the constant folder.
19002
19003         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19004         argument to track whether we are using the resulting address to
19005         load or store a value and provide better error messages. 
19006
19007         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19008         new AddressOf arguments.
19009
19010         * statement.cs (Foreach.EmitCollectionForeach): Update
19011
19012         * expression.cs (Argument.Emit): Call AddressOf with proper
19013         arguments to track usage.
19014
19015         (New.DoEmit): Call AddressOf with new arguments.
19016
19017         (Unary.Emit): Adjust AddressOf call.
19018
19019 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19020
19021         * cs-parser.jay (member_access): Change the case for pre-defined types
19022         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19023         this suggestion.
19024
19025         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19026         a method body.
19027
19028         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19029         essentially like methods and apply attributes like MethodImplOptions to them too.
19030
19031         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19032         not being null.
19033
19034         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19035         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19036         is the DeclSpace.
19037
19038         * Update code everywhere accordingly.
19039
19040         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19041
19042         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19043
19044 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19045
19046         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19047         try performing lookups against those instead of jumping straight into using
19048         the 'using' clauses.
19049
19050         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19051
19052         (LookupType): Perform lookups in implicit parents too.
19053
19054         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19055         sequence as RootContext.LookupType. 
19056
19057         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19058         the various cases of namespace lookups into this method.
19059
19060 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19061
19062         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19063         in positional arguments)
19064
19065         * class.cs (Operator): Update the AllowedModifiers to contain
19066         extern. 
19067
19068         * cs-parser.jay: Update operator declaration to allow for the
19069         operator body to be empty.
19070
19071         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19072         values. 
19073
19074 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19075
19076         * class.cs (Method.Emit): Label parameters.
19077
19078         * driver.cs: Return 1 or 0 as the program exit code.
19079
19080 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19081
19082         * expression.cs: Special case the `null' object when trying to
19083         auto-compute the type, as anything can be explicitly converted to
19084         that. 
19085
19086         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19087         spotting this Paolo.
19088
19089         (Expression.ImplicitNumericConversion): Perform comparissions of
19090         the type using the underlying type in the case of an enumeration
19091         rather than using the enumeration type for the compare.
19092
19093         Cope with the underlying == type case, which is not possible to
19094         catch before. 
19095
19096         (Expression.ConvertNumericExplicit): Perform comparissions of
19097         the type using the underlying type in the case of an enumeration
19098         rather than using the enumeration type for the compare.
19099
19100         * driver.cs: If the user does not supply an extension, assume .exe
19101
19102         * cs-parser.jay (if_statement): Rewrote so that we can track the
19103         location for the if statement.
19104
19105         * expression.cs (Binary.ConstantFold): Only concat strings when
19106         the operation is "+", not everything ;-)
19107
19108         * statement.cs (Statement.EmitBoolExpression): Take a location
19109         argument. 
19110         (If, While, Do): Track location.
19111
19112         * expression.cs (Binary.ResolveOperator): In the object + string
19113         case, I was missing a call to ConvertImplicit
19114
19115 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19116
19117         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19118         Location arguments. Ensure we use RootContext.LookupType to do our work
19119         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19120
19121         * interface.cs (PopulateMethod): Handle the type of the parameter being
19122         null gracefully.
19123
19124         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19125         have a params method with no fixed arguments and a call is made with no
19126         arguments.
19127
19128 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19129
19130         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19131         the verbatim-string-literal
19132
19133         * support.cs (InternalParameters.ParameterModifier): handle null
19134         fixed parameters.
19135         (InternalParameters.ParameterType): ditto.
19136
19137         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19138         duplicating the name of the variable parameter.
19139         (GetParameterByName): Fix bug where we were not looking up array
19140         paramters if they were the only present (thanks Paolo!).
19141         (GetParameterInfo): We only have an empty set of types if both
19142         fixed and array are set to null.
19143         (GetParameterInfo-idx): Handle FixedParameter == null
19144
19145         * cs-parser.jay: Handle the case where there is no catch
19146         statements (missing null test).
19147
19148 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19149
19150         * driver.cs (MainDriver): Be conservative on our command line
19151         handling.
19152
19153         Catch DirectoryNotFoundException when calling GetFiles.
19154
19155         (SplitPathAndPattern): Used to split the input specification into
19156         a path and a pattern that we can feed to Directory.GetFiles.
19157
19158 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19159
19160         * statement.cs (Fixed): Implement the last case of the Fixed
19161         statement (string handling).
19162
19163         * expression.cs (StringPtr): New class used to return a char * to
19164         a string;  Used by the Fixed statement.
19165
19166         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19167
19168         * expression.cs (Binary.ResolveOperator): Remove redundant
19169         MemberLookup pn parent type.
19170         Optimize union call, we do not need a union if the types are the same.
19171         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19172         type.
19173
19174         Specialize the use of MemberLookup everywhere, instead of using
19175         the default settings. 
19176
19177         (StackAlloc): Implement stackalloc keyword.
19178
19179         * cs-parser.jay: Add rule to parse stackalloc.
19180
19181         * driver.cs: Handle /h, /help, /?
19182
19183         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19184         before we supported unsafe code.
19185
19186         * makefile: add --unsafe to the self compilation of mcs.
19187
19188 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * expression.cs (PointerArithmetic): New class that is used to
19191         perform pointer arithmetic.
19192         (Binary.Resolve): Handle pointer arithmetic
19193         Handle pointer comparission.
19194         (ArrayPtr): Utility expression class that is used to take the
19195         address of an array.
19196
19197         (ElementAccess): Implement array access for pointers
19198
19199         * statement.cs (Fixed): Implement fixed statement for arrays, we
19200         are missing one more case before we are done.
19201
19202         * expression.cs (Indirection): Implement EmitAssign and set the
19203         ExprClass to Variable.  This allows pointer dereferences to be
19204         treated as variables, and to have values assigned to them.
19205
19206         * ecore.cs (Expression.StoreFromPtr): New utility function to
19207         store values dereferencing.
19208
19209 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19210
19211         * expression.cs (Binary.ResolveOperator): Ensure that we are
19212         not trying to operate on a void type - this fixes the reported
19213         bug.
19214
19215         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19216         the parent implementation is sealed.
19217
19218         * ../errors/cs0239.cs : Add.
19219
19220         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19221
19222         * typemanager.cs (unverifiable_code_type): Corresponds to 
19223         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19224         which have unsafe code in them.
19225
19226         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19227         unsafe context.
19228
19229 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19230
19231         * cs-tokenizer.cs: Add support for @"litreal strings"
19232
19233         Make tokenizer accept pre-processor directives
19234         on any column (remove the old C-like limitation). 
19235
19236         * rootcontext.cs (EmitCode): Emit any global attributes.
19237         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19238
19239         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19240
19241         * cs-parser.jay: Add support for global attributes.  
19242
19243 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19244
19245         * expression.cs (Indirection): New helper class.  Unary will
19246         create Indirection classes to be able to implement the
19247         IMemoryLocation interface on it.
19248
19249 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19250
19251         * cs-parser.jay (fixed_statement): reference the right statement.
19252
19253         * statement.cs (Fixed.Emit): Finish implementing the fixed
19254         statement for the &x case.
19255
19256 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19257
19258         * class.cs (Property.Define, Method.Define): Remove newslot when
19259         `implementing'.  
19260
19261         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19262         wrong.  NewSlot should only be used if the `new' keyword is present.
19263
19264         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19265         locating our system dir.  Sorry about this.
19266
19267 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19268
19269         * driver.cs (GetSystemDir): Compute correctly the location of our
19270         system assemblies.  I was using the compiler directory instead of
19271         the library directory.
19272
19273 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19274
19275         * expression.cs (BetterFunction): Put back in what Miguel commented out
19276         since it is the correct fix. The problem is elsewhere ;-)
19277
19278         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19279         parameters of the parms method are themselves compatible or not !
19280
19281         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19282         to check that a class implements an interface before saying that an implicit
19283         conversion was allowed. Use ImplementsInterface to do the checking.
19284
19285 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19286
19287         * class.cs (Method.Define): Track whether we are an explicit
19288         implementation or not.  And only call DefineMethodOverride if we
19289         are an explicit implementation.
19290
19291         (Property.DefineMethod): Ditto.
19292
19293 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19294
19295         * expression.cs (BetterFunction): Catch hideous bug which was
19296          preventing us from detecting ambiguous calls due to implicit casts i.e
19297         cs0121.
19298
19299 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * support.cs (Pair): Remove un-needed method.  I figured why I was
19302         getting the error in cs-parser.jay, the variable in a foreach loop
19303         is readonly, and the compiler does not really treat this as a variable.
19304
19305         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19306         instead of EQUALS in grammar.  
19307
19308         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19309
19310         * expression.cs (Unary.DoResolve): Check whether the argument is
19311         managed or not.
19312
19313 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19314
19315         * support.cs: Api for Pair to set a value.  Despite the fact that
19316         the variables are public the MS C# compiler refuses to compile
19317         code that accesses the field if the variable is part of a foreach
19318         statement. 
19319
19320         * statement.cs (Fixed): Begin implementation of the fixed
19321         statement.
19322
19323         (Block.AddVariable): Return the VariableInfo on success and null
19324         on failure instead of true/false. 
19325
19326         * cs-parser.jay (foreach): Catch errors on variables already
19327         defined (we were ignoring this value before) and properly unwind
19328         the block hierarchy
19329
19330         (fixed_statement): grammar for the fixed statement.
19331
19332 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19335         pointer types to be incretemented.
19336
19337         (SizeOf): Implement.
19338
19339         * cs-parser.jay (pointer_member_access): Implement
19340         expr->IDENTIFIER production.
19341
19342         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19343         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19344         on safe contexts.
19345
19346         (Unary): Implement indirection.
19347
19348         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19349         use in non-unsafe context).
19350
19351         (SimpleName.DoResolve): Check for pointers in field access on safe
19352         contexts. 
19353
19354         (Expression.LoadFromPtr): Factor the load-indirect code in this
19355         function.  This was duplicated in UnboxCast and ParameterReference
19356
19357 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * expression.cs (ComposedCast): report an error if a pointer cast
19360         is used in a safe region.
19361
19362         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19363         pointer type casts in unsafe context.
19364
19365         * codegen.cs (EmitContext): Set up IsUnsafe.
19366
19367         * cs-parser.jay (non_expression_type): Add productions for pointer
19368         casts. 
19369
19370         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19371         code.  We should not use force into static mode if the method is
19372         not virtual.  Fixes bug in MIS
19373
19374         * statement.cs (Do.Emit, While.Emit, For.Emit,
19375         Statement.EmitBoolExpression): Add support to Do and While to
19376         propagate infinite loop as `I do return' semantics.
19377
19378         Improve the For case to also test for boolean constants.
19379
19380         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19381         to the list of attributes we can add.
19382
19383         Remove `EmitContext' argument.
19384
19385         * class.cs (Method.Define): Apply parameter attributes.
19386         (Constructor.Define): Apply parameter attributes.
19387         (MethodCore.LabelParameters): Move here the core of labeling
19388         parameters. 
19389
19390         * support.cs (ReflectionParameters.ParameterModifier,
19391         InternalParameters.ParameterModifier): Use IsByRef on the type and
19392         only return the OUT bit for these parameters instead of in/out/ref
19393         flags.
19394
19395         This is because I miss-understood things.  The ParameterInfo.IsIn
19396         and IsOut represent whether the parameter has the [In] and [Out]
19397         attributes set.  
19398
19399 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19400
19401         * ecore.cs (FieldExpr.Emit): Release temporaries.
19402
19403         * assign.cs (LocalTemporary.Release): new function.
19404
19405         * codegen.cs (EmitContext.GetTemporaryStorage,
19406         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19407         temporary storage.  Now we can "put back" localbuilders when we
19408         are done with them
19409
19410 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19411
19412         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19413         need to make a copy of the variable to generate verifiable code.
19414
19415 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * driver.cs: Compute dynamically the system directory.
19418
19419         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19420         Slower, but more generally useful.  Used by the abstract
19421         registering implementation. 
19422
19423         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19424         the rules for the special rule on Type/instances.  First check if
19425         we have the same name, and if so, try that special static path
19426         rather than the instance path.
19427
19428 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19431         for, while and if.
19432
19433         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19434         Enum, ValueType, Delegate or Array for non-corlib compiles.
19435
19436         * cs-tokenizer.cs: Catch long identifiers (645)
19437
19438         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19439         piece of code.
19440
19441         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19442         fix, we were returning too early, so we were not registering
19443         pending methods from abstract classes.
19444
19445         Do not register pending methods if the class is abstract.
19446
19447         * expression.cs (Conditional.DoResolve): Report circular implicit
19448         conversions when we neecd to compute it for conditional
19449         expressions. 
19450
19451         (Is.DoResolve): If the expression is always of the provided type,
19452         flag warning 183.  If the expression can not ever be of the
19453         provided type flag warning 184.
19454
19455         * class.cs: Catch 169 as well.
19456
19457         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19458         read. 
19459
19460 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19461
19462         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19463
19464 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * interface.cs: (PopulateMethod): Check for pointers being defined
19467         only if the unsafe context is active.
19468         (PopulateProperty): ditto.
19469         (PopulateIndexer): ditto.
19470
19471         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19472         specified.  If pointers are present, make sure that they are
19473         present in an unsafe context.
19474         (Constructor, Constructor.Define): ditto.
19475         (Field, Field.Define): ditto.
19476         (Property, Property.Define): ditto.
19477         (Event, Event.Define): ditto.
19478
19479         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19480         hashtable if there are classes or structs defined.
19481
19482         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19483         code, as the constant resolution moved.
19484
19485         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19486         the metadata, so we can flag error 133. 
19487
19488         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19489         pointer is being declared in an unsafe context.
19490
19491 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19492
19493         * modifiers.cs (Modifiers.Check): Require a Location argument.
19494         Report error 227 for Unsafe use.
19495
19496         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19497
19498         * statement.cs (For.Emit): If the test is null, then report that
19499         we do `return', as we wont reach anything afterwards.
19500
19501         (Switch.SwitchGoverningType): Track the expression that matched
19502         the conversion.
19503
19504         * driver.cs: Allow negative numbers as an error code to flag.
19505
19506         * cs-parser.jay: Handle 1551.
19507
19508         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19509
19510 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * cs-parser.jay: Report 1518 (type declaration can only contain
19513         class, struct, interface, enum or delegate)
19514
19515         (switch_label): Report 1523 (keywords `case' or `default' must
19516         preced code)
19517
19518         (opt_switch_sections): Report 1522 (empty switch)
19519
19520         * driver.cs: Report 1515 (response file specified multiple times)
19521         Report 1516 (Source file specified multiple times).
19522
19523         * expression.cs (Argument.Resolve): Signal 1510
19524
19525         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19526         access not allowed in static code)
19527
19528 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19529
19530         * typemanager.cs (IsPointerType): Utility method which we are going
19531         to need a lot.
19532
19533         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19534         the object type, so we take care of that.
19535
19536         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19537
19538         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19539         added to non-params parameters :-)
19540
19541         * typemanager.cs (CSharpName): Include 'void' type too. 
19542
19543         (void_ptr_type): Include in the set of core types.
19544
19545         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19546         duplicating code.
19547
19548         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19549         an unsafe context.
19550
19551         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19552         completely forgotten about it.
19553
19554 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19555
19556         * cs-parser.jay (pointer_type): Add. This begins our implementation
19557         of parsing rules for unsafe code.
19558
19559         (unsafe_statement): Implement.
19560
19561         (embedded_statement): Modify to include the above.
19562
19563         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19564
19565         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19566         if the current context is an unsafe one.
19567
19568         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19569         are handled differently, we need separate rules for them.
19570
19571         (local_variable_declaration): Update to use local_variable_pointer_type
19572         to allow variable declarations of unmanaged pointer types.
19573
19574         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19575         in unsafe contexts.
19576
19577         * ../errors/cs0214.cs : Add.
19578
19579 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19580
19581         * makefile: remove 'response' file when cleaning.
19582
19583 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19584
19585         * cs-parser.jay: Report 1524.
19586
19587 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19588
19589         * typemanager.cs (RegisterMethod): drop checking if we have
19590         registered this from here
19591
19592 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * class.cs (Method.EmitDestructor): Implement calling our base
19595         destructor. 
19596
19597         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19598         value of InFinally.
19599
19600         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19601         this routine and will wrap the call in a try/catch block.  Deal
19602         with the case.
19603
19604 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * ecore.cs (Expression.MemberLookup): instead of taking a
19607         parameter `same_type' that was used to tell whether we could
19608         access private members we compute our containing type from the
19609         EmitContext.
19610
19611         (FieldExpr): Added partial support for volatile fields.  This does
19612         not work for volatile fields exposed from assemblies, as I can not
19613         figure out how to extract the modreq from it.
19614
19615         Updated all the source files to use this.
19616
19617         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19618         because it is referenced by MemberLookup very often. 
19619
19620 2002-01-09  Ravi Pratap  <ravi@ximian.com>
19621
19622         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19623         TypeBuilder.GetCustomAttributes to retrieve what we need.
19624
19625         Get rid of redundant default_member_attr_type as this is the same as
19626         default_member_type which already exists.
19627
19628         * interface.cs, attribute.cs : Update accordingly.
19629
19630 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
19631
19632         * typemanager.cs: Enable IndexerPropertyName again.  It does not
19633         work for TYpeBuilders though.  Ravi, can you please fix this?
19634
19635         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19636
19637         * expression.cs (Argument.Emit): Handle the case of ref objects
19638         being passed to ref functions;  
19639
19640         (ParameterReference.EmitLoad): Loads the content of the pointer
19641         without dereferencing.
19642
19643 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19646
19647 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19648
19649         * class.cs (Indexer.DefineMethod): Incorporate the interface
19650         type in the name of the method if we are doing explicit interface
19651         implementation.
19652
19653         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19654
19655         (BetterConversion): Fix extremely trivial bug where we were referring to
19656         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19657         again !
19658
19659         * ../errors/bug16.cs : Add although we have fixed it.
19660
19661 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19662
19663         * expression.cs (BaseIndexer): Begin implementation.
19664
19665         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19666
19667         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19668         production directly to remove a shift/reduce, and implement
19669         explicit interface implementation.
19670
19671         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19672         after a floating point suffix.
19673
19674         * expression.cs (DoNumericPromotions): Improved the conversion for
19675         uint/uint.  If we have a constant, we avoid doing a typecast to a
19676         larger type.
19677
19678         * class.cs (Indexer): Implement explicit interface implementation
19679         for indexers.
19680
19681 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19682
19683         * class.cs: make the default instance constructor public and hidebysig.
19684
19685 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19686
19687         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19688         so we can call it from elsewhere.
19689
19690         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19691         we emit it internally if the class has a defined indexer; otherwise the user
19692         emits it by decorating the class definition with the DefaultMemberAttribute.
19693
19694         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19695         attribute is not used on a type which defines an indexer.
19696
19697         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19698         character when we skip whitespace.
19699
19700         * ../errors/cs0646.cs : Add.
19701
19702 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19705         again. 
19706
19707         * makefile: Add practical target `mcs3.exe' which builds the third
19708         generation compiler. 
19709
19710         * expression.cs (New): Fix structures constructor calling.
19711
19712         * class.cs (Property, Method, Indexer): Emit Final flag on the
19713         method if we are an interface implementation and we are not
19714         abstract. 
19715
19716         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19717         whether this property is referencing a `base' method.
19718
19719         * expression.cs (Invocation.EmitCall): take an extra argument:
19720         is_base, this is used to determine whether the `call' or
19721         `callvirt' opcode should be used.
19722
19723
19724         * delegate.cs: update EmitCall.
19725
19726         * class.cs (Method.Define): Set NewSlot for the cases where we are
19727         not implementing an interface method.
19728
19729         (Property.Define): ditto.
19730
19731 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19734         'r'.  Allows mcs to parse itself fully.
19735
19736 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19737
19738         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19739         of the number of initializers that require the InitializeArray method.
19740
19741         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19742         update the above field where necessary.
19743
19744         (MakeByteBlob): Update accordingly.
19745
19746         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19747         greater than 2.
19748
19749         (EmitDynamicInitializers): Update in accordance with the new optimization.
19750
19751         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19752         same OpCode applies.
19753
19754         * cs-parser.jay : Fix some glaring errors I introduced.
19755
19756 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19757
19758         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19759         so that we can check for name clashes there too.
19760
19761         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19762         for interface indexers.
19763
19764         * interfaces.cs (Define): Emit the default member attribute.
19765
19766         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19767         variable was being referred to while setting the value ;-)
19768
19769 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19770
19771         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19772         byte-by-byte information when we know the data is zero.
19773
19774         Make the block always a multiple of 4, because
19775         DefineInitializedData has a bug.
19776
19777         * assign.cs: Fix, we should assign from the temporary, not from
19778         the source. 
19779
19780         * expression.cs (MakeByteBlob): Fix my incorrect code.
19781
19782 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19783
19784         * typemanager.cs (EnumToUnderlying): This function is used to get
19785         the underlying type from an enumeration, because it does not
19786         always work. 
19787
19788         * constant.cs: Use the I4_S form for values between -128 and 127.
19789
19790         * statement.cs (Block.LookupLabel): Looks up a label.
19791         (Block): Drop support for labeled blocks.
19792
19793         (LabeledStatement): New kind of statement that represents a label
19794         only.
19795
19796         (Goto): Finally implement this bad boy.
19797
19798         * cs-parser.jay: Update to reflect new mechanism to implement
19799         labels.
19800
19801 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19802
19803         * codegen.cs (EmitContext.This): a codegen property that keeps the
19804         a single instance of this instead of creating many different this
19805         instances. 
19806
19807         * delegate.cs (Delegate.DoResolve): Update to use the property;
19808
19809         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19810
19811         * expression.cs (BaseAccess.DoResolve): Ditto.
19812
19813 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19814
19815         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19816         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19817
19818         (InitCoreTypes): Update accordingly.
19819
19820         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19821         so we can quickly store the state.
19822
19823         (ApplyAttributes): Set the correct implementation flags
19824         for InternalCall methods.
19825
19826 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19827
19828         * expression.cs (EmitCall): if a method is not virtual, then do
19829         not use callvirt on it.
19830
19831         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19832         user defined stuff) requires the use of stobj, which takes an
19833         address on the stack instead of an array and an index.  So emit
19834         the Ldelema operation for it.
19835
19836         (EmitStoreOpcode): Use stobj for valuetypes.
19837
19838         (UnaryMutator.EmitCode): Use the right 1 value depending on
19839         whether we are dealing with int64/uint64, float or doubles.
19840
19841         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19842         constructors that I implemented last night.
19843
19844         (Constructor.IsDefault): Fix to work properly for static
19845         constructors.
19846
19847         * cs-parser.jay (CheckDef): report method signature errors.
19848         Update error number 103 to be 132.
19849
19850         * decl.cs: New AdditionResult enumeration value: MethodExists.
19851         Although we do this check for methods later on in the semantic
19852         analysis, catching repeated default constructors is so easy that
19853         we catch these here. 
19854
19855         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19856         promotions code.
19857
19858         (ParameterReference.EmitAssign, Emit): handle
19859         bools as bytes.
19860
19861         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19862         (ArrayAccess.EmitStoreOpcode): ditto.
19863
19864         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19865
19866         * expression.cs (MakeByteBlob): Complete all the missing types
19867         (uint, short, ushort, byte, sbyte)
19868
19869         * class.cs: Only init instance field initializers on instance
19870         constructors. 
19871
19872         Rename `constructors' to instance_constructors. 
19873
19874         (TypeContainer.AddConstructor): Only add constructors to the list
19875         if it is not static.
19876
19877         Make sure that we handle default_static_constructor independently
19878         everywhere where we handle instance_constructors
19879
19880 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * class.cs: Do not lookup or create a base initializer for a
19883         static constructor.
19884
19885         (ConstructorInitializer.Resolve): use the proper type to lookup
19886         for constructors.
19887
19888         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19889
19890         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19891         in DeclSpace. 
19892
19893         * decl.cs: CloseType is now an virtual method, the default
19894         implementation just closes this type.
19895
19896 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19897
19898         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19899         to PreserveSig by default. Also emit HideBySig on such methods.
19900
19901         Basically, set the defaults to standard values.
19902
19903         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19904         argument, if candidate is better, it can't be worse than the best !
19905
19906         (Invocation): Re-write bits to differentiate between methods being
19907         applicable in their expanded form and their normal form - for params
19908         methods of course.
19909
19910         Get rid of use_standard everywhere as only standard conversions are allowed
19911         in overload resolution. 
19912
19913         More spec conformance.
19914
19915 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * driver.cs: Add --timestamp, to see where the compiler spends
19918         most of its time.
19919
19920         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19921         `this' in static code.
19922
19923         (SimpleName.DoResolve): Implement in terms of a helper function
19924         that allows static-references to be passed upstream to
19925         MemberAccess.
19926
19927         (Expression.ResolveWithSimpleName): Resolve specially simple
19928         names when called by MemberAccess to implement the special
19929         semantics. 
19930
19931         (Expression.ImplicitReferenceConversion): Handle conversions from
19932         Null to reference types before others, as Null's type is
19933         System.Object. 
19934
19935         * expression.cs (Invocation.EmitCall): Handle the special case of
19936         calling methods declared on a reference type from a ValueType
19937         (Base classes System.Object and System.Enum)
19938
19939         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19940         the left hand side is a TypeExpr, not on every enumeration. 
19941
19942         (Binary.Resolve): If types are reference types, then do a cast to
19943         object on operators != and == of both arguments.
19944
19945         * typemanager.cs (FindMembers): Extract instance and static
19946         members if requested.
19947
19948         * interface.cs (PopulateProperty): Use void_type instead of null
19949         as the return type for the setter method.
19950
19951         (PopulateIndexer): ditto.
19952
19953 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19954
19955         * support.cs (ReflectionParameters): Fix minor bug where we
19956         were examining the wrong parameter for the ParamArray attribute.
19957
19958         Cope with requests for the type of the parameter at position
19959         greater than the params parameter's. We now return the element
19960         type of the params array as that makes more sense.
19961
19962         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19963         accordingly as we no longer have to extract the element type
19964         ourselves.
19965
19966         (Invocation.OverloadResolve): Update.
19967
19968 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19971         against IEnumerator, test whether the return value is a descendant
19972         of the IEnumerator interface.
19973
19974         * class.cs (Indexer.Define): Use an auxiliary method to implement
19975         the other bits of the method definition.  Begin support for
19976         explicit interface implementation.
19977
19978         (Property.DefineMethod): Use TypeManager.void_type instead of null
19979         for an empty return value.
19980
19981 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19984         dealing with a FieldExpr which is composed of a FieldBuilder, in
19985         the code path we did extract the constant, but we should have
19986         obtained the underlying value to be able to cast it (otherwise we
19987         end up in an infinite loop, this is what Ravi was running into).
19988
19989         (ArrayCreation.UpdateIndices): Arrays might be empty.
19990
19991         (MemberAccess.ResolveMemberAccess): Add support for section
19992         14.5.4.1 that deals with the special case of E.I when E is a type
19993         and something else, that I can be a reference to a static member.
19994
19995         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19996         handle a particular array type to create byte blobs, it is just
19997         something we dont generate byteblobs for.
19998
19999         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20000         arguments. 
20001
20002         * location.cs (Push): remove the key from the hashtable that we
20003         are about to add.   This happens for empty files.
20004
20005         * driver.cs: Dispose files after we have parsed them.
20006
20007         (tokenize): new function that only runs the tokenizer on its
20008         input, for speed testing.
20009
20010 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20011
20012         * class.cs (Event.Define): Define the private field only if there
20013         are no accessors defined.
20014
20015         * expression.cs (ResolveMemberAccess): If there is no associated
20016         field with the event, that means we have an event defined with its
20017         own accessors and we should flag error cs0070 since transforming
20018         ourselves into a field is not valid in that case.
20019
20020         * ecore.cs (SimpleName.DoResolve): Same as above.
20021
20022         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20023         and charset to sane values.
20024
20025 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20026
20027         * assign.cs (DoResolve): Perform check on events only if they 
20028         are being accessed outside the declaring type.
20029
20030         * cs-parser.jay (event_declarations): Update rules to correctly
20031         set the type of the implicit parameter etc.
20032
20033         (add_accessor, remove_accessor): Set current local parameters.
20034
20035         * expression.cs (Binary): For delegate addition and subtraction,
20036         cast the return value from the method into the appropriate delegate
20037         type.
20038
20039 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20040
20041         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20042         of these as the workaround is unnecessary.
20043
20044         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20045         delegate data - none of that is needed at all.
20046
20047         Re-write bits to extract the instance expression and the delegate method
20048         correctly.
20049
20050         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20051         on delegates too.
20052
20053         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20054         of attaching attributes instead of duplicating code everywhere.
20055
20056         * everywhere : Update code to do attribute emission using the above method.
20057
20058 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20059
20060         * expression.cs (IsParamsMethodApplicable): if there are not
20061         parameters, return immediately.
20062
20063         * ecore.cs: The 0 literal can be implicity converted to an enum
20064         type. 
20065
20066         (SimpleName.DoResolve): First lookup the type, then lookup the
20067         members. 
20068
20069         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20070         want to get its address.  If the InstanceExpression is not
20071         addressable, store the result in a temporary variable, then get
20072         the address of it.
20073
20074         * codegen.cs: Only display 219 errors on warning level or above. 
20075
20076         * expression.cs (ArrayAccess): Make it implement the
20077         IMemoryLocation interface.
20078
20079         (Binary.DoResolve): handle the operator == (object a, object b)
20080         and operator != (object a, object b) without incurring into a
20081         BoxedCast (because 5 != o should never be performed).
20082
20083         Handle binary enumerator operators.
20084
20085         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20086         value type, otherwise use Ldelem_ref.
20087
20088         Use precomputed names;
20089
20090         (AddressOf): Implement address of
20091
20092         * cs-parser.jay (labeled_statement): Fix recursive block
20093         addition by reworking the production.
20094
20095         * expression.cs (New.DoEmit): New has a special case:
20096                 
20097                  If we are dealing with a ValueType, we have a few
20098                  situations to deal with:
20099                 
20100                     * The target of New is a ValueType variable, that is
20101                       easy, we just pass this as the variable reference
20102                 
20103                     * The target of New is being passed as an argument,
20104                       to a boxing operation or a function that takes a
20105                       ValueType.
20106                 
20107                       In this case, we need to create a temporary variable
20108                       that is the argument of New.
20109
20110
20111 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20112
20113         * rootcontext.cs (LookupType): Check that current_type is not null before
20114         going about looking at nested types.
20115
20116         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20117         not implement the IAssignMethod interface any more.
20118
20119         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20120         where we tranform them into FieldExprs if they are being resolved from within
20121         the declaring type.
20122
20123         * ecore.cs (SimpleName.DoResolve): Do the same here.
20124
20125         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20126
20127         * ../errors/bug10.cs : Add.
20128
20129         * ../errors/cs0070.cs : Add.
20130
20131         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20132
20133         * assign.cs : Get rid of EventIsLocal everywhere.
20134
20135 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20136
20137         * ecore.cs (ConvertIntLiteral): finished the implementation.
20138
20139         * statement.cs (SwitchLabel): Convert the value we are using as a
20140         key before looking up the table.
20141
20142 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20143
20144         * codegen.cs (EmitTopBlock): Require a Location argument now.
20145
20146         * cs-parser.jay (constructor_declarator): We need to setup
20147         current_local_parameters before we parse the
20148         opt_constructor_initializer, to allow the variables to be bound
20149         to the constructor arguments.
20150
20151         * rootcontext.cs (LookupType): First lookup nested classes in our
20152         class and our parents before we go looking outside our class.
20153
20154         * expression.cs (ConstantFold): Extract/debox the values at the
20155         beginnning. 
20156
20157         * rootcontext.cs (EmitCode): Resolve the constants first before we
20158         resolve the types.  This is not really needed, but it helps debugging.
20159
20160         * statement.cs: report location.
20161
20162         * cs-parser.jay: pass location to throw statement.
20163
20164         * driver.cs: Small bug fix.
20165
20166         * report.cs: Updated format to be 4-zero filled digits.
20167
20168 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20169
20170         * expression.cs (CheckIndices): Fix minor bug where the wrong
20171         variable was being referred to ;-)
20172
20173         (DoEmit): Do not call EmitStaticInitializers when the 
20174         underlying type is System.Object.
20175
20176 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20177
20178         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20179         and do the usual workaround for SRE.
20180
20181         * class.cs (MyEventBuilder.EventType): New member to get at the type
20182         of the event, quickly.
20183
20184         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20185
20186         * assign.cs (Assign.DoResolve): Handle the case when the target
20187         is an EventExpr and perform the necessary checks.
20188
20189         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20190         interface.
20191
20192         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20193
20194         (EventExpr): Set the type in the constructor itself since we 
20195         are meant to be born fully resolved.
20196
20197         (EventExpr.Define): Revert code I wrote earlier.
20198                 
20199         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20200         instance expression is null. The instance expression is a This in that case
20201         or a null, depending on whether it is a static method or not.
20202
20203         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20204         refers to more than one method.
20205
20206         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20207         and accordingly flag errors.
20208
20209 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20210
20211         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20212
20213 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20214
20215         * location.cs (ToString): Provide useful rutine.
20216
20217 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20218
20219         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20220         objects, return the actual integral boxed.
20221
20222         * statement.cs (SwitchLabel): define an ILLabel for each
20223         SwitchLabel. 
20224
20225         (Switch.CheckSwitch): If the value is a Literal, extract
20226         the underlying literal.
20227
20228         Also in the unused hashtable we had, add the SwitchLabel so we can
20229         quickly look this value up.
20230
20231         * constant.cs: Implement a bunch of new constants.  Rewrite
20232         Literal based on this.  Made changes everywhere to adapt to this.
20233
20234         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20235         dereferencing array only once, and also copes with enumrations.
20236
20237         bytes are two bytes wide, not one.
20238
20239         (Cast): Perform constant conversions.
20240
20241         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20242         wrappers to the literals here.
20243
20244         * expression.cs (DoNumericPromotions): long literals can converted
20245         to ulong implicity (this is taken care of elsewhere, but I was
20246         missing this spot).
20247
20248         * ecore.cs (Expression.Literalize): Make the return type Literal,
20249         to improve type checking.
20250
20251         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20252
20253 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20254
20255         * literal.cs: Revert code from ravi that checked the bounds.  The
20256         bounds are sane by the definition of the type itself. 
20257
20258         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20259         need to actually look up in our parent hierarchy for interfaces
20260         implemented. 
20261
20262         * const.cs: Use the underlying type for enumerations
20263
20264         * delegate.cs: Compute the basename for the delegate creation,
20265         that should fix the delegate test case, and restore the correct
20266         Type Lookup semantics in rootcontext
20267
20268         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20269         referencing a nested type with the Reflection API is using the "+"
20270         sign. 
20271
20272         * cs-parser.jay: Do not require EOF token at the end.
20273
20274 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20275
20276         * rootcontext.cs (LookupType): Concatenate type names with
20277         a '.' instead of a '+' The test suite passes again.
20278
20279         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20280         field of the enumeration.
20281
20282         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20283         the case when the member is an EventExpr.
20284
20285         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20286         static has an associated instance expression.
20287
20288         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20289
20290         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20291
20292         * class.cs (Event.Define): Register event and perform appropriate checks
20293         for error #111.
20294
20295         We define the Add and Remove methods even if the use provides none because
20296         in that case, we provide default implementations ourselves.
20297
20298         Define a private field of the type of the event. This is done by the CSC compiler
20299         and we should be doing it too ;-)
20300
20301         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20302         More methods we use in code we generate.
20303
20304         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20305         is important.
20306
20307         (InitCoreTypes): Update accordingly for the above.
20308
20309         * class.cs (Event.Emit): Generate code for default accessors that we provide
20310
20311         (EmitDefaultMethod): Do the job in the above.
20312
20313         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20314         appropriate place.
20315
20316 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20317
20318         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20319         builders even if we were missing one.
20320
20321         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20322         pass the Basename as our class name instead of the Name.  The
20323         basename will be correctly composed for us.
20324
20325         * parameter.cs (Paramters): Now takes a Location argument.
20326
20327         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20328         make all the code call directly LookupType in RootContext and take
20329         this chance to pass the Location information everywhere.
20330
20331         * Everywhere: pass Location information.
20332
20333 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20334
20335         * class.cs (Constructor.Define): Updated way of detecting the
20336         length of the parameters.
20337
20338         (TypeContainer.DefineType): Use basename as the type name for
20339         nested types.
20340
20341         (TypeContainer.Define): Do not recursively define types here, as
20342         definition is taken care in order by the RootContext.
20343
20344         * tree.cs: Keep track of namespaces in a per-file basis.
20345
20346         * parameter.cs (Parameter.ComputeSignature): Update to use
20347         DeclSpace. 
20348
20349         (Parameters.GetSignature): ditto.
20350
20351         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20352         instead of a TypeContainer.
20353
20354         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20355         resolve names.  Because we need to be resolve in our context, not
20356         our parents.
20357
20358         * driver.cs: Implement response files.
20359
20360         * class.cs (TypeContainer.DefineType): If we are defined, do not
20361         redefine ourselves.
20362
20363         (Event.Emit): Emit the code for add/remove handlers.
20364         (Event.Define): Save the MethodBuilders for add/remove.
20365
20366         * typemanager.cs: Use pair here too.
20367
20368         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20369         DictionaryEntry requires the first argument to be non-null.  
20370
20371         (enum_declaration): Compute full name for registering the
20372         enumeration.
20373
20374         (delegate_declaration): Instead of using
20375         formal_parameter_list, use opt_formal_parameter_list as the list
20376         can be empty.
20377
20378         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20379         (EventParsing): New property that controls whether `add' and
20380         `remove' are returned as tokens or identifiers (for events);
20381
20382 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20383
20384         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20385         use MyEventBuilder only and let it wrap the real builder for us.
20386
20387         (MyEventBuilder): Revamp constructor etc.
20388
20389         Implement all operations that we perform on EventBuilder in precisely the same
20390         way here too.
20391
20392         (FindMembers): Update to use the EventBuilder member.
20393
20394         (Event.Emit): Update accordingly.
20395
20396 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20397
20398         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20399         by calling the appropriate methods.
20400
20401         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20402         useful.
20403
20404         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20405
20406 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20407
20408         * delegate.cs (Delegate.Populate): Check that the return type
20409         and various parameters types are indeed accessible.
20410
20411         * class.cs (Constructor.Define): Same here.
20412
20413         (Field.Define): Ditto.
20414
20415         (Event.Define): Ditto.
20416
20417         (Operator.Define): Check that the underlying Method defined itself
20418         correctly - so it's MethodBuilder should not be null.
20419
20420         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20421         expression happens to be null.
20422
20423         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20424         members but as of now we don't seem to be able to do anything really useful with it.
20425
20426         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20427         not the EventBuilder.
20428
20429 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * cs-tokenizer.cs: Add support for defines.
20432         Add support for #if, #elif, #else, #endif
20433
20434         (eval_var): evaluates a variable.
20435         (eval): stubbed for evaluating functions.
20436
20437         * cs-parser.jay: Pass the defines information
20438
20439         * driver.cs: Add --define command line option.
20440
20441         * decl.cs: Move MemberCore here.
20442
20443         Make it the base class for DeclSpace.  This allows us to catch and
20444         report 108 and 109 for everything now.
20445
20446         * class.cs (TypeContainer.Define): Extract all the members
20447         before populating and emit the warning 108 (new keyword required
20448         to override) instead of having each member implement this.
20449
20450         (MemberCore.Define): New abstract method, we will be using this in
20451         the warning reporting engine in Populate.
20452
20453         (Operator.Define): Adjust to new MemberCore protocol. 
20454
20455         * const.cs (Const): This does not derive from Expression, it is a
20456         temporary object we use to create fields, it is a MemberCore. 
20457
20458         * class.cs (Method.Define): Allow the entry point to be in a
20459         specific class.
20460
20461         * driver.cs: Rewrite the argument handler to clean it up a bit.
20462
20463         * rootcontext.cs: Made it just an auxiliary namespace feature by
20464         making everything static.
20465
20466         * driver.cs: Adapt code to use RootContext type name instead of
20467         instance variable.
20468
20469         * delegate.cs: Remove RootContext argument.
20470
20471         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20472         argument. 
20473
20474         * class.cs (Event.Define): The lookup can fail.
20475
20476         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20477
20478         * expression.cs: Resolve the this instance before invoking the code.
20479
20480 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * cs-parser.jay: Add a production in element_access that allows
20483         the thing to become a "type" reference.  This way we can parse
20484         things like "(string [])" as a type.
20485
20486         Note that this still does not handle the more complex rules of
20487         casts. 
20488
20489
20490         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20491
20492         * ecore.cs: (CopyNewMethods): new utility function used to
20493         assemble the list of methods from running FindMembers.
20494
20495         (MemberLookup): Rework FindMembers so that 
20496
20497 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20498
20499         * class.cs (TypeContainer): Remove Delegates who fail to be
20500         defined.
20501
20502         * delegate.cs (Populate): Verify that we dont get null return
20503         values.   TODO: Check for AsAccessible.
20504
20505         * cs-parser.jay: Use basename to emit error 574 (destructor should
20506         have the same name as container class), not the full name.
20507
20508         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20509         possible representation.  
20510
20511         Also implements integer type suffixes U and L.
20512
20513 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20514
20515         * expression.cs (ArrayCreation.DoResolve): We need to do the
20516         argument resolution *always*.
20517
20518         * decl.cs: Make this hold the namespace.  Hold the root context as
20519         well.
20520         (LookupType): Move here.
20521
20522         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20523
20524         * location.cs (Row, Name): Fixed the code, it was always returning
20525         references to the first file.
20526
20527         * interface.cs: Register properties defined through interfaces.
20528
20529         * driver.cs: Add support for globbing on the command line
20530
20531         * class.cs (Field): Make it derive from MemberCore as well.
20532         (Event): ditto.
20533
20534 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20535
20536         * class.cs (Event::Define): Check that the type of the event is a delegate
20537         type else flag error #66.
20538
20539         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20540         same.
20541
20542         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20543         values of EntryPoint, CharSet etc etc.
20544
20545         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20546
20547         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20548         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20549         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20550         which needs this to do its work.
20551
20552         * ../errors/cs0066.cs : Add.
20553
20554 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20555
20556         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20557         helper functions.
20558
20559         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20560         clears out the parameters field.
20561         (MemberSignatureCompare): Cleanup
20562
20563         (MemberCore): New base class used to share code between MethodCore
20564         and Property.
20565
20566         (RegisterRequiredImplementations) BindingFlags.Public requires
20567         either BindingFlags.Instace or Static.  Use instance here.
20568
20569         (Property): Refactored code to cope better with the full spec.
20570
20571         * parameter.cs (GetParameterInfo): Return an empty array instead
20572         of null on error.
20573
20574         * class.cs (Property): Abstract or extern properties have no bodies.
20575
20576         * parameter.cs (GetParameterInfo): return a zero-sized array.
20577
20578         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20579         method modifier validation to the typecontainer so we can reuse
20580         this on properties.
20581
20582         (MethodCore.ParameterTypes): return an empty sized array of types.
20583
20584         (Property.Define): Test property modifier validity.
20585
20586         Add tests for sealed/override too.
20587
20588         (Method.Emit): abstract or extern methods have no bodies.
20589
20590 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20591
20592         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20593         thing.
20594
20595         (Method::Define, ::Emit): Modify accordingly.
20596
20597         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20598
20599         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20600
20601         * makefile: Pass in /unsafe.
20602
20603 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
20604
20605         * class.cs (MakeKey): Kill routine.
20606
20607         * class.cs (TypeContainer.Define): Correctly define explicit
20608         method implementations (they require the full interface name plus
20609         the method name).
20610
20611         * typemanager.cs: Deply the PtrHashtable here and stop using the
20612         lame keys.  Things work so much better.
20613
20614         This of course broke everyone who depended on `RegisterMethod' to
20615         do the `test for existance' test.  This has to be done elsewhere.
20616
20617         * support.cs (PtrHashtable): A hashtable that avoid comparing with
20618         the object stupid Equals method (because, that like fails all over
20619         the place).  We still do not use it.
20620
20621         * class.cs (TypeContainer.SetRequiredInterface,
20622         TypeContainer.RequireMethods): Killed these two routines and moved
20623         all the functionality to RegisterRequiredImplementations.
20624
20625         (TypeContainer.RegisterRequiredImplementations): This routine now
20626         registers all the implementations required in an array for the
20627         interfaces and abstract methods.  We use an array of structures
20628         which can be computed ahead of time to reduce memory usage and we
20629         also assume that lookups are cheap as most classes will not
20630         implement too many interfaces.
20631
20632         We also avoid creating too many MethodSignatures.
20633
20634         (TypeContainer.IsInterfaceMethod): Update and optionally does not
20635         clear the "pending" bit if we find that there are problems with
20636         the declaration.
20637
20638         (TypeContainer.VerifyPendingMethods): Update to report errors of
20639         methods that look like implementations but are not.
20640
20641         (TypeContainer.Define): Add support for explicit interface method
20642         implementation. 
20643
20644 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
20645
20646         * typemanager.cs: Keep track of the parameters here instead of
20647         being a feature of the TypeContainer.
20648
20649         * class.cs: Drop the registration of parameters here, as
20650         InterfaceMethods are also interface declarations.
20651
20652         * delegate.cs: Register methods with the TypeManager not only with
20653         the TypeContainer.  This code was buggy.
20654
20655         * interface.cs: Full registation here.
20656
20657 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20658
20659         * expression.cs: Remove reducer for binary expressions, it can not
20660         be done this way.
20661
20662         * const.cs: Put here the code that used to go into constant.cs
20663
20664         * constant.cs: Put here the code for constants, this is a new base
20665         class for Literals.
20666
20667         * literal.cs: Make Literal derive from Constant.
20668
20669 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20670
20671         * statement.cs (Return.Emit): Report error 157 if the user
20672         attempts to return from a finally block.
20673
20674         (Return.Emit): Instead of emitting a return, jump to the end of
20675         the function.
20676
20677         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20678         LocalBuilder to store the result of the function.  ReturnLabel is
20679         the target where we jump.
20680
20681
20682 2001-12-09  Radek Doulik  <rodo@ximian.com>
20683
20684         * cs-parser.jay: remember alias in current namespace
20685
20686         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20687         namespaces
20688
20689         * class.cs (LookupAlias): lookup alias in my_namespace
20690
20691         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20692         aliases hashtable
20693         (LookupAlias): lookup alias in this and if needed in parent
20694         namespaces
20695
20696 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20697
20698         * support.cs: 
20699
20700         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20701         making things static.  I need this to avoid passing the
20702         TypeContainer when calling ParameterType.
20703
20704         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20705         that did string manipulation to compute the type and then call
20706         GetType.  Use Parameter.ParameterType instead.
20707
20708         * cs-tokenizer.cs: Consume the suffix for floating values.
20709
20710         * expression.cs (ParameterReference): figure out whether this is a
20711         reference parameter or not.  Kill an extra variable by computing
20712         the arg_idx during emission.
20713
20714         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20715         function that returns whether a parameter is an out/ref value or not.
20716
20717         (Parameter.ParameterType): The type of the parameter (base,
20718         without ref/out applied).
20719
20720         (Parameter.Resolve): Perform resolution here.
20721         (Parameter.ExternalType): The full type (with ref/out applied).
20722
20723         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20724         support for expressions on the using statement.
20725
20726 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20727
20728         * statement.cs (Using.EmitLocalVariableDecls): Split the
20729         localvariable handling of the using statement.
20730
20731         (Block.EmitMeta): Keep track of variable count across blocks.  We
20732         were reusing slots on separate branches of blocks.
20733
20734         (Try.Emit): Emit the general code block, we were not emitting it. 
20735
20736         Check the type of the declaration to be an IDisposable or
20737         something that can be implicity converted to it. 
20738
20739         Emit conversions if required.
20740
20741         * ecore.cs (EmptyExpression): New utility class.
20742         (Expression.ImplicitConversionExists): New utility function.
20743
20744 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20745
20746         * statement.cs (Using): Implement.
20747
20748         * expression.cs (LocalVariableReference): Support read only variables.
20749
20750         * statement.cs: Remove the explicit emit for the Leave opcode.
20751         (VariableInfo): Add a readonly field.
20752
20753 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * ecore.cs (ConvCast): new class used to encapsulate the various
20756         explicit integer conversions that works in both checked and
20757         unchecked contexts.
20758
20759         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20760         properly generate the overflow opcodes.
20761
20762 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20763
20764         * statement.cs: The correct type for the EmptyExpression is the
20765         element_type, not the variable type.  Ravi pointed this out.
20766
20767 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20768
20769         * class.cs (Method::Define): Handle PInvoke methods specially
20770         by using DefinePInvokeMethod instead of the usual one.
20771
20772         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20773         above to do the task of extracting information and defining the method.
20774
20775 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20776
20777         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20778         of the condition for string type.
20779
20780         (Emit): Move that here. 
20781
20782         (ArrayCreation::CheckIndices): Keep string literals in their expression
20783         form.
20784
20785         (EmitDynamicInitializers): Handle strings appropriately.
20786
20787 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * codegen.cs (EmitContext): Replace multiple variables with a
20790         single pointer to the current Switch statement.
20791
20792         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20793         EmitContext.
20794
20795 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20796
20797         * statement.cs 
20798
20799         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20800         default'.
20801
20802         (Foreach.Emit): Foreach on arrays was not setting
20803         up the loop variables (for break/continue).
20804
20805         (GotoCase): Semi-implented.
20806
20807 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20808
20809         * attribute.cs (CheckAttribute): Handle system attributes by using
20810         Attribute.GetAttributes to examine information we need.
20811
20812         (GetValidPlaces): Same here.
20813
20814         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20815
20816         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20817
20818         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20819
20820         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20821
20822         (Method::Emit): Handle the case when we are a PInvoke method.
20823
20824 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20825
20826         * expression.cs: Use ResolveWithSimpleName on compound names.
20827
20828 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20829
20830         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20831         before trying to reduce it.
20832
20833         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20834
20835         * constant.cs (LookupConstantValue): Implement.
20836
20837         (EmitConstant): Use the above in emitting the constant.
20838
20839         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20840         that are user-defined by doing a LookupConstantValue on them.
20841
20842         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20843         too, like above.
20844
20845 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20846
20847         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20848
20849         (BaseAccess.DoResolve): Implement.
20850
20851         (MemberAccess.DoResolve): Split this routine into a
20852         ResolveMemberAccess routine that can be used independently
20853
20854 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20857         As that share bits of the implementation.  Is returns a boolean,
20858         while As returns the Type that is being probed.
20859
20860 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20861
20862         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20863         instead of a Literal - much easier.
20864
20865         (EnumInTransit): Remove - utterly useless :-)
20866
20867         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20868
20869         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20870
20871         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20872         chain when we have no associated expression.
20873
20874 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20875
20876         * constant.cs (Define): Use Location while reporting the errror.
20877
20878         Also emit a warning when 'new' is used and there is no inherited
20879         member to hide.
20880
20881         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20882         populated.
20883
20884         (LookupEnumValue): Implement to lookup an enum member's value and define it
20885         if necessary.
20886
20887         (Populate): Re-write accordingly to use the above routine.
20888
20889 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20890
20891         * expression.cs (This): Fix prototype for DoResolveLValue to
20892         override the base class DoResolveLValue.
20893
20894         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20895         declarations) 
20896
20897         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20898         (we need to load the address of the field here).  This fixes
20899         test-22. 
20900
20901         (FieldExpr.DoResolveLValue): Call the DoResolve
20902         function to initialize the Instance expression.
20903
20904         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20905         correctly the GetEnumerator operation on a value type.
20906
20907         * cs-parser.jay: Add more simple parsing error catches.
20908
20909         * statement.cs (Switch): Add support for string switches.
20910         Handle null specially.
20911
20912         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20913
20914 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20915
20916         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20917
20918         (declare_local_constant): New helper function.
20919
20920         * statement.cs (AddConstant): Keep a separate record of constants
20921
20922         (IsConstant): Implement to determine if a variable is a constant.
20923
20924         (GetConstantExpression): Implement.
20925
20926         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20927
20928         * statement.cs (IsVariableDefined): Re-write.
20929
20930 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20931
20932         * class.cs (TypeContainer::FindMembers): Look for constants
20933         in the case when we are looking for MemberTypes.Field
20934
20935         * expression.cs (MemberAccess::DoResolve): Check that in the
20936         case we are a FieldExpr and a Literal, we are not being accessed
20937         by an instance reference.
20938
20939         * cs-parser.jay (local_constant_declaration): Implement.
20940
20941         (declaration_statement): Implement for constant declarations.
20942
20943 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20944
20945         * statement.cs (Switch): Catch double defaults.
20946
20947         (Switch): More work on the switch() statement
20948         implementation.  It works for integral values now, need to finish
20949         string support.
20950
20951
20952 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20953
20954         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20955         integer literals into other integer literals.  To be used by
20956         switch. 
20957
20958 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20959
20960         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20961         some memory.
20962
20963         (EmitDynamicInitializers): Cope with the above since we extract data
20964         directly from ArrayData now.
20965
20966         (ExpectInitializers): Keep track of whether initializers are mandatory
20967         or not.
20968
20969         (Bounds): Make it a hashtable to prevent the same dimension being 
20970         recorded for every element in that dimension.
20971
20972         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20973         from being found.
20974
20975         Also fix bug which was causing the indices to be emitted in the reverse
20976         order.
20977
20978 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20979
20980         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20981         unfinished.  They do not work, because the underlying code is
20982         sloppy.
20983
20984 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20985
20986         * cs-parser.jay: Remove bogus fixme.
20987
20988         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20989         on Switch statement.
20990
20991 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20992
20993         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20994         the same. 
20995
20996         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20997         parameter. Apparently, any expression is allowed. 
20998
20999         (ValidateInitializers): Update accordingly.
21000
21001         (CheckIndices): Fix some tricky bugs thanks to recursion.
21002
21003         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21004         I was being completely brain-dead.
21005
21006         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21007         and re-write acordingly.
21008
21009         (DelegateInvocation): Re-write accordingly.
21010
21011         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21012
21013         (MakeByteBlob): Handle types more correctly.
21014
21015         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21016         initialization from expressions but it is incomplete because I am a complete
21017         Dodo :-|
21018
21019 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21022         on If.  Basically, we have to return `true' (ie, we do return to
21023         our caller) only if both branches of the if return.
21024
21025         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21026         short-circuit operators, handle them as short circuit operators. 
21027
21028         (Cast.DoResolve): Resolve type.
21029         (Cast.Cast): Take an expression as the target type.
21030
21031         * cs-parser.jay (cast_expression): Remove old hack that only
21032         allowed a limited set of types to be handled.  Now we take a
21033         unary_expression and we resolve to a type during semantic
21034         analysis.
21035
21036         Use the grammar productions from Rhys to handle casts (this is
21037         not complete like Rhys syntax yet, we fail to handle that corner
21038         case that C# has regarding (-x), but we will get there.
21039
21040 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21041
21042         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21043         field which is an array type.
21044
21045         * cs-parser.jay (declare_local_variables): Support array initialization too.
21046
21047         * typemanager.cs (MakeKey): Implement.
21048
21049         (everywhere): Use the above appropriately.
21050
21051         * cs-parser.jay (for_statement): Update for array initialization while
21052         declaring variables.
21053
21054         * ecore.cs : The error message was correct, it's the variable's names that
21055         were misleading ;-) Make the code more readable.
21056
21057         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21058         the correct type etc.
21059
21060         (ConvertExplicit): Handle Enum types by examining the underlying type.
21061
21062 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21063
21064         * parameter.cs (GetCallingConvention): Always return
21065         CallingConventions.Standard for now.
21066
21067 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21068
21069         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21070         and `r' after calling DoNumericPromotions.
21071
21072         * ecore.cs: Fix error message (the types were in the wrong order).
21073
21074         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21075         BindingFlags.Instance as well 
21076
21077         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21078         implicit int literal conversion in an empty cast so that we
21079         propagate the right type upstream.
21080
21081         (UnboxCast): new class used to unbox value types.
21082         (Expression.ConvertExplicit): Add explicit type conversions done
21083         by unboxing.
21084
21085         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21086         the target type before applying the implicit LongLiterals to ULong
21087         literal cast.
21088
21089 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21090
21091         * cs-parser.jay (for_statement): Reworked the way For works: now
21092         we declare manually any variables that are introduced in
21093         for_initializer to solve the problem of having out-of-band code
21094         emition (that is what got for broken).
21095
21096         (declaration_statement): Perform the actual variable declaration
21097         that used to be done in local_variable_declaration here.
21098
21099         (local_variable_declaration): Do not declare anything, just pass
21100         the information on a DictionaryEntry
21101
21102 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21103
21104         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21105         re-write of the logic to now make it recursive.
21106
21107         (UpdateIndices): Re-write accordingly.
21108
21109         Store element data in a separate ArrayData list in the above methods.
21110
21111         (MakeByteBlob): Implement to dump the array data into a byte array.
21112
21113 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21114
21115         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21116         into CheckIndices.
21117
21118         * constant.cs (Define): Implement.
21119
21120         (EmitConstant): Re-write fully.
21121
21122         Pass in location info.
21123
21124         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21125         respectively.
21126
21127         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21128         DictionaryEntry since we need location info too.
21129
21130         (constant_declaration): Update accordingly.
21131
21132         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21133         code into another method : UpdateIndices.
21134
21135 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21136
21137         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21138         some type checking etc.
21139
21140 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21141
21142         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21143         bits to provide dimension info if the user skips doing that.
21144
21145         Update second constructor to store the rank correctly.
21146
21147 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21148
21149         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21150         and try to implement.
21151
21152         * ../errors/cs0150.cs : Add.
21153
21154         * ../errors/cs0178.cs : Add.
21155
21156 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21157
21158         * statement.cs: Implement foreach on multi-dimensional arrays. 
21159
21160         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21161         name of the params argument.
21162
21163         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21164         initializing the array.
21165
21166         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21167         we can use this elsewhere.
21168
21169         * statement.cs: Finish implementation of foreach for single
21170         dimension arrays.
21171
21172         * cs-parser.jay: Use an out-of-band stack to pass information
21173         around, I wonder why I need this.
21174
21175         foreach_block: Make the new foreach_block the current_block.
21176
21177         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21178         function used to return a static Parameters structure.  Used for
21179         empty parameters, as those are created very frequently.
21180
21181         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21182
21183 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21184
21185         * interface.cs : Default modifier is private, not public. The
21186         make verify test passes again.
21187
21188 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21189
21190         * support.cs (ReflectionParameters): Fix logic to determine
21191         whether the last parameter is a params one. Test 9 passes again.
21192
21193         * delegate.cs (Populate): Register the builders we define with
21194         RegisterParameterForBuilder. Test 19 passes again.
21195
21196         * cs-parser.jay (property_declaration): Reference $6 instead
21197         of $$ to get at the location.
21198
21199         (indexer_declaration): Similar stuff.
21200
21201         (attribute): Ditto.
21202
21203         * class.cs (Property): Register parameters for the Get and Set methods
21204         if they exist. Test 23 passes again.
21205
21206         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21207         call to EmitArguments as we are sure there aren't any params arguments. 
21208         Test 32 passes again.
21209
21210         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21211         IndexOutOfRangeException. 
21212
21213         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21214         Test 33 now passes again.
21215
21216 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21219         broke a bunch of things.  Will have to come up with a better way
21220         of tracking locations.
21221
21222         * statement.cs: Implemented foreach for single dimension arrays.
21223
21224 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21227         an error.  This removes the lookup from the critical path.
21228
21229         * cs-parser.jay: Removed use of temporary_loc, which is completely
21230         broken. 
21231
21232 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21233
21234         * support.cs (ReflectionParameters.ParameterModifier): Report
21235         whether the argument is a PARAMS argument or not.
21236
21237         * class.cs: Set the attribute `ParamArrayAttribute' on the
21238         parameter argument.
21239
21240         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21241         and cons_param_array_attribute (ConstructorInfo for
21242         ParamArrayAttribute)., 
21243
21244         * codegen.cs: Emit the return using the `Return' statement, that
21245         way we can report the error correctly for missing return values. 
21246
21247         * class.cs (Method.Emit): Clean up.
21248
21249         * expression.cs (Argument.Resolve): Take another argument: the
21250         location where this argument is used.  Notice that this is not
21251         part of the "Argument" class as to reduce the size of the
21252         structure (we know the approximate location anyways).
21253
21254         Test if the argument is a variable-reference, if not, then
21255         complain with a 206.
21256
21257         (Argument.Emit): Emit addresses of variables.
21258
21259         (Argument.FullDesc): Simplify.
21260
21261         (Invocation.DoResolve): Update for Argument.Resolve.
21262
21263         (ElementAccess.DoResolve): ditto.
21264
21265         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21266         method should be virtual, as this method is always virtual.
21267
21268         (NewDelegate.DoResolve): Update for Argument.Resolve.
21269
21270         * class.cs (ConstructorInitializer.DoResolve): ditto.
21271
21272         * attribute.cs (Attribute.Resolve): ditto.
21273
21274 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21275
21276         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21277
21278         * expression.cs (ParameterReference): Drop IStackStorage and implement
21279         IAssignMethod instead. 
21280
21281         (LocalVariableReference): ditto.
21282
21283         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21284         IAssignMethod instead. 
21285
21286 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21287
21288         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21289         enumerations that are used in heavily used structures derive from
21290         byte in a laughable and pathetic attempt to reduce memory usage.
21291         This is the kind of pre-optimzations that you should not do at
21292         home without adult supervision.
21293
21294         * expression.cs (UnaryMutator): New class, used to handle ++ and
21295         -- separatedly from the other unary operators.  Cleans up the
21296         code, and kills the ExpressionStatement dependency in Unary.
21297
21298         (Unary): Removed `method' and `Arguments' from this class, making
21299         it smaller, and moving it all to SimpleCall, so I can reuse this
21300         code in other locations and avoid creating a lot of transient data
21301         strucutres when not required.
21302
21303         * cs-parser.jay: Adjust for new changes.
21304
21305 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * enum.cs (Enum.Populate): If there is a failure during
21308         definition, return
21309
21310         * cs-parser.jay (opt_enum_base): we used to catch type errors
21311         here, but this is really incorrect.  The type error should be
21312         catched during semantic analysis.
21313
21314 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21315
21316         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21317         current_local_parameters as expected since I, in my stupidity, had forgotten
21318         to do this :-)
21319
21320         * attribute.cs (GetValidPlaces): Fix stupid bug.
21321
21322         * class.cs (Method::Emit): Perform check on applicability of attributes.
21323
21324         (Constructor::Emit): Ditto.
21325
21326         (Field::Emit): Ditto.
21327
21328         (Field.Location): Store location information.
21329
21330         (Property, Event, Indexer, Operator): Ditto.
21331
21332         * cs-parser.jay (field_declaration): Pass in location for each field.
21333
21334         * ../errors/cs0592.cs : Add.
21335
21336 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21337
21338         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21339
21340         (InitCoreTypes): Update accordingly.
21341
21342         (RegisterAttrType, LookupAttr): Implement.
21343
21344         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21345         info about the same.
21346
21347         (Resolve): Update to populate the above as necessary.
21348
21349         (Error592): Helper.
21350
21351         (GetValidPlaces): Helper to the above.
21352
21353         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21354
21355         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21356
21357 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21358
21359         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21360
21361         * ../errors/cs0617.cs : Add.
21362
21363 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21364
21365         * enum.cs (Emit): Rename to Populate to be more consistent with what
21366         we expect it to do and when exactly it is called.
21367
21368         * class.cs, rootcontext.cs : Update accordingly.
21369
21370         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21371         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21372
21373         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21374
21375         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21376         of a fieldinfo using the above, when dealing with a FieldBuilder.
21377
21378 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21379
21380         * ../errors/cs0031.cs : Add.
21381
21382         * ../errors/cs1008.cs : Add.
21383
21384         * ../errrors/cs0543.cs : Add.
21385
21386         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21387         enum type.
21388
21389         (FindMembers): Implement.
21390
21391         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21392         enums and delegates too.
21393
21394         (enum_types): Rename to builder_to_enum.
21395
21396         (delegate_types): Rename to builder_to_delegate.
21397
21398         * delegate.cs (FindMembers): Implement.
21399
21400 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21401
21402         * typemanager.cs (IsEnumType): Implement.
21403
21404         * enum.cs (Emit): Re-write parts to account for the underlying type
21405         better and perform checking etc.
21406
21407         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21408         of the underlying type.
21409
21410         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21411         value
21412
21413         * enum.cs (error31): Helper to report error #31.
21414
21415         * cs-parser.jay (enum_declaration): Store location of each member too.
21416
21417         * enum.cs (member_to_location): New hashtable. 
21418
21419         (AddEnumMember): Update location hashtable.
21420
21421         (Emit): Use the location of each member while reporting errors.
21422
21423 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21424
21425         * cs-parser.jay: A for_initializer if is a
21426         local_variable_declaration really ammount to have an implicit
21427         block with the variable declaration and no initializer for for.
21428
21429         * statement.cs (For.Emit): Cope with null initializers.
21430
21431         This fixes the infinite loop on for initializers.
21432
21433 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21434
21435         * enum.cs: More cleanup.
21436
21437         * ecore.cs: Remove dead code.
21438
21439         * class.cs (Property.Emit): More simplification.
21440         (Event.Emit): ditto.
21441
21442         Reworked to have less levels of indentation.
21443
21444 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21445
21446         * class.cs (Property): Emit attributes.
21447
21448         (Field): Ditto.
21449
21450         (Event): Ditto.
21451
21452         (Indexer): Ditto.
21453
21454         (Operator): Ditto.
21455
21456         * enum.cs (Emit): Ditto.
21457
21458         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21459         Enums too.
21460
21461         * class.cs (Field, Event, etc.): Move attribute generation into the
21462         Emit method everywhere.
21463
21464         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21465         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21466         as we had no way of defining nested enums !
21467
21468         * rootcontext.cs : Adjust code accordingly.
21469
21470         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21471
21472 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21473
21474         * expression.cs (EvalConstantExpression): Move into ecore.cs
21475
21476         * enum.cs (Enum): Rename some members and make them public and readonly
21477         according to our convention.
21478
21479         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21480         nothing else.
21481
21482         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21483
21484         (Enum::Emit): Write a simple version for now which doesn't try to compute
21485         expressions. I shall modify this to be more robust in just a while.
21486
21487         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21488
21489         (TypeContainer::CloseType): Create the Enum types too.
21490
21491         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21492
21493         * expression.cs (EvalConstantExpression): Get rid of completely.
21494
21495         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21496         user-defined values and other cases.
21497
21498         (IsValidEnumLiteral): Helper function.
21499
21500         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21501         out there in the case we had a literal FieldExpr.
21502
21503         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21504
21505         (Literalize): Revamp a bit to take two arguments.
21506
21507         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21508
21509 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21510
21511         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21512
21513         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21514
21515         (Resolve): Use the above to ensure we have proper initializers.
21516
21517 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21518
21519         * expression.cs (Expression::EvalConstantExpression): New method to 
21520         evaluate constant expressions.
21521
21522         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21523
21524 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21525
21526         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21527         in an array.
21528
21529         (Binary.ResolveOperator): Handle operator != (object a, object b)
21530         and operator == (object a, object b);
21531
21532         (Binary.DoNumericPromotions): Indicate whether the numeric
21533         promotion was possible.
21534
21535         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21536         Implement.  
21537
21538         Made the ArrayAccess implement interface IAssignMethod instead of
21539         IStackStore as the order in which arguments are passed reflects
21540         this.
21541
21542         * assign.cs: Instead of using expr.ExprClass to select the way of
21543         assinging, probe for the IStackStore/IAssignMethod interfaces.
21544
21545         * typemanager.cs: Load InitializeArray definition.
21546
21547         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21548         static data that can be used to initialize arrays. 
21549
21550 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21551
21552         * expression.cs: Handle operator== and operator!= for booleans.
21553
21554         (Conditioal.Reduce): Implement reducer for the ?: operator.
21555
21556         (Conditional.Resolve): Implement dead code elimination.
21557
21558         (Binary.Resolve): Catch string literals and return a new
21559         concatenated string.
21560
21561         (Unary.Reduce): Implement reduction of unary expressions.
21562
21563         * ecore.cs: Split out the expression core handling here.
21564
21565         (Expression.Reduce): New method used to perform constant folding
21566         and CSE.  This is needed to support constant-expressions. 
21567
21568         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21569         targets, and optimize for !x.
21570
21571 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21572
21573         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21574         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21575         set custom atttributes.
21576
21577         * literal.cs (Literal::GetValue): New abstract method to return the actual
21578         value of the literal, cast as an object.
21579
21580         (*Literal): Implement GetValue method.
21581
21582         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21583         expressions to the arraylist but objects of type Argument.
21584
21585         * class.cs (TypeContainer::Emit): Emit our attributes too.
21586
21587         (Method::Emit, Constructor::Emit): Ditto.
21588
21589         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21590         to be ignoring earlier.
21591
21592 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21593
21594         * attribute.cs (AttributeSection::Define): Implement to do the business
21595         of constructing a CustomAttributeBuilder.
21596
21597         (Attribute): New trivial class. Increases readability of code.  
21598
21599         * cs-parser.jay : Update accordingly.
21600
21601         (positional_argument_list, named_argument_list, named_argument): New rules
21602
21603         (attribute_arguments): Use the above so that we are more correct.
21604
21605 2001-11-02  Ravi Pratap  <ravi@ximian.com>
21606
21607         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21608         to perform all checks for a method with a params parameter.
21609
21610         (Invocation::OverloadResolve): Update to use the above method and therefore
21611         cope correctly with params method invocations.
21612
21613         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
21614         params too.
21615
21616         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21617         constructors in our parent too because we can't afford to miss out on 
21618         protected ones ;-)
21619
21620         * attribute.cs (AttributeSection): New name for the class Attribute
21621
21622         Other trivial changes to improve readability.
21623
21624         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21625         use the new class names.
21626
21627 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21628
21629         * class.cs (Method::Define): Complete definition for params types too
21630
21631         (Indexer::Define): Ditto.
21632
21633         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21634         Cope everywhere with a request for info about the array parameter.
21635
21636 2001-11-01  Ravi Pratap  <ravi@ximian.com>
21637
21638         * tree.cs (RecordNamespace): Fix up to check for the correct key.
21639
21640         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
21641         local_variable_type to extract the string corresponding to the type.
21642
21643         (local_variable_type): Fixup the action to use the new helper method.
21644
21645         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21646         go.
21647
21648         * expression.cs : Clean out code which uses the above.
21649
21650 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21651
21652         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21653         and bale out if necessary by returning a false.
21654
21655         (RegisterProperty): Ditto.
21656
21657         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21658         and print out appropriate error messages.
21659
21660         * interface.cs (everywhere): Ditto.
21661
21662         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21663         location to constructor.
21664
21665         * class.cs (Property, Event, Indexer): Update accordingly.
21666
21667         * ../errors/cs111.cs : Added.
21668
21669         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21670         of a method, as laid down by the spec.
21671
21672         (Invocation::OverloadResolve): Use the above method.
21673
21674 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21675
21676         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21677         now take a TypeContainer and a Parameters object.
21678
21679         (ParameterData): Modify return type of ParameterModifier method to be 
21680         Parameter.Modifier and not a string.
21681
21682         (ReflectionParameters, InternalParameters): Update accordingly.
21683
21684         * expression.cs (Argument::GetParameterModifier): Same here.
21685
21686         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21687         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21688         symbol in it at all so maybe this is only for now.
21689
21690 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21691
21692         * support.cs (InternalParameters): Constructor now takes an extra argument 
21693         which is the actual Parameters class.
21694
21695         (ParameterDesc): Update to provide info on ref/out modifiers.
21696
21697         * class.cs (everywhere): Update call to InternalParameters to pass in
21698         the second argument too.
21699
21700         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21701         to return the modifier info [ref/out etc]
21702
21703         (InternalParameters, ReflectionParameters): Implement the above.
21704
21705         * expression.cs (Argument::ParameterModifier): Similar function to return
21706         info about the argument's modifiers.
21707
21708         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21709         too.
21710
21711         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21712         a new SetFormalParameters object which we pass to InternalParameters.
21713
21714 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21715
21716         * expression.cs (NewArray): Merge into the ArrayCreation class.
21717
21718 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21719
21720         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21721         NewUserdefinedArray into one as there wasn't much of a use in having
21722         two separate ones.
21723
21724         * expression.cs (Argument): Change field's name to ArgType from Type.
21725
21726         (Type): New readonly property which returns the proper type, taking into 
21727         account ref/out modifiers.
21728
21729         (everywhere): Adjust code accordingly for the above.
21730
21731         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21732         whether we are emitting for a ref or out parameter.
21733
21734         * expression.cs (Argument::Emit): Use the above field to set the state.
21735
21736         (LocalVariableReference::Emit): Update to honour the flag and emit the
21737         right stuff.
21738
21739         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21740
21741         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21742
21743         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21744
21745         (ReflectionParameters, InternalParameters): Implement the above method.
21746
21747         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21748         reporting errors.
21749
21750         (Invocation::FullMethodDesc): Ditto. 
21751
21752 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21753
21754         * cs-parser.jay: Add extra production for the second form of array
21755         creation. 
21756
21757         * expression.cs (ArrayCreation): Update to reflect the above
21758         change. 
21759
21760         * Small changes to prepare for Array initialization.
21761
21762 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21763
21764         * typemanager.cs (ImplementsInterface): interface might be null;
21765         Deal with this problem;
21766
21767         Also, we do store negative hits on the cache (null values), so use
21768         this instead of calling t.GetInterfaces on the type everytime.
21769
21770 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21771
21772         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21773
21774         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21775         split functionality out into different classes.
21776
21777         (New::FormArrayType): Move into NewBuiltinArray.
21778
21779         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21780         quite useless.
21781
21782         (NewBuiltinArray): New class to handle creation of built-in arrays.
21783
21784         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21785         account creation of one-dimensional arrays.
21786
21787         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21788
21789         (NewUserdefinedArray::DoResolve): Implement.
21790
21791         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21792
21793         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21794         we maintain inside the TypeManager. This is necessary to perform lookups on the
21795         module builder.
21796
21797         (LookupType): Update to perform GetType on the module builders too.     
21798
21799         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21800
21801         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21802
21803 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21804
21805         * expression.cs (New::DoResolve): Implement guts of array creation.
21806
21807         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21808
21809 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * expression.cs: Fix bug I introduced lsat night that broke
21812         Delegates. 
21813
21814         (Expression.Resolve): Report a 246 error (can not resolve name)
21815         if we find a SimpleName in the stream.
21816
21817         (Expression.ResolveLValue): Ditto.
21818
21819         (Expression.ResolveWithSimpleName): This function is a variant of
21820         ResolveName, this one allows SimpleNames to be returned without a
21821         warning.  The only consumer of SimpleNames is MemberAccess
21822
21823 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21824
21825         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21826         might arrive here.  I have my doubts that this is correct.
21827
21828         * statement.cs (Lock): Implement lock statement.
21829
21830         * cs-parser.jay: Small fixes to support `lock' and `using'
21831
21832         * cs-tokenizer.cs: Remove extra space
21833
21834         * driver.cs: New flag --checked, allows to turn on integer math
21835         checking. 
21836
21837         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21838         Threading.Monitor.Exit 
21839
21840 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21841
21842         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21843         Expression Class to be IndexerAccess.
21844
21845         Notice that Indexer::DoResolve sets the eclass to Value.
21846
21847 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21848
21849         * class.cs (TypeContainer::Emit): Emit code for indexers.
21850
21851         * assign.cs (IAssignMethod): New interface implemented by Indexers
21852         and Properties for handling assignment.
21853
21854         (Assign::Emit): Simplify and reuse code. 
21855
21856         * expression.cs (IndexerAccess, PropertyExpr): Implement
21857         IAssignMethod, clean up old code. 
21858
21859 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21860
21861         * typemanager.cs (ImplementsInterface): New method to determine if a type
21862         implements a given interface. Provides a nice cache too.
21863
21864         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21865         method.
21866
21867         (ConvertReferenceExplicit): Ditto.
21868
21869         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21870         various methods, with correct names etc.
21871
21872         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21873         Operator.UnaryNegation.
21874
21875         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21876         we have a unary plus or minus operator.
21877
21878         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21879         UnaryMinus.
21880
21881         * everywhere : update accordingly.
21882
21883         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21884         respectively.
21885
21886         * class.cs (Method::Define): For the case where we are implementing a method
21887         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21888         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21889
21890 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21891
21892         * interface.cs (FindMembers): Implement to work around S.R.E
21893         lameness.
21894
21895         * typemanager.cs (IsInterfaceType): Implement.
21896
21897         (FindMembers): Update to handle interface types too.
21898
21899         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21900         use IsAssignableFrom as that is not correct - it doesn't work.
21901
21902         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21903         and accordingly override EmitStatement.
21904
21905         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21906         using the correct logic :-)
21907
21908 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21909
21910         * ../errors/cs-11.cs : Add to demonstrate error -11 
21911
21912 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21913
21914         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21915         then pass this as a hint to ResolveLValue.
21916
21917         * expression.cs (FieldExpr): Add Location information
21918
21919         (FieldExpr::LValueResolve): Report assignment to readonly
21920         variable. 
21921
21922         (Expression::ExprClassFromMemberInfo): Pass location information.
21923
21924         (Expression::ResolveLValue): Add new method that resolves an
21925         LValue. 
21926
21927         (Expression::DoResolveLValue): Default invocation calls
21928         DoResolve. 
21929
21930         (Indexers): New class used to keep track of indexers in a given
21931         Type. 
21932
21933         (IStackStore): Renamed from LValue, as it did not really describe
21934         what this did.  Also ResolveLValue is gone from this interface and
21935         now is part of Expression.
21936
21937         (ElementAccess): Depending on the element access type
21938
21939         * typemanager.cs: Add `indexer_name_type' as a Core type
21940         (System.Runtime.CompilerServices.IndexerNameAttribute)
21941
21942         * statement.cs (Goto): Take a location.
21943
21944 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21945
21946         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21947         if two delegates are compatible.
21948
21949         (NewDelegate::DoResolve): Update to take care of the case when
21950         we instantiate a delegate from another delegate.
21951
21952         * typemanager.cs (FindMembers): Don't even try to look up members
21953         of Delegate types for now.
21954
21955 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21956
21957         * delegate.cs (NewDelegate): New class to take care of delegate
21958         instantiation.
21959
21960         * expression.cs (New): Split the delegate related code out into 
21961         the NewDelegate class.
21962
21963         * delegate.cs (DelegateInvocation): New class to handle delegate 
21964         invocation.
21965
21966         * expression.cs (Invocation): Split out delegate related code into
21967         the DelegateInvocation class.
21968
21969 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21970
21971         * expression.cs (New::DoResolve): Implement delegate creation fully
21972         and according to the spec.
21973
21974         (New::DoEmit): Update to handle delegates differently.
21975
21976         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21977         because of which we were printing out arguments in reverse order !
21978
21979         * delegate.cs (VerifyMethod): Implement to check if the given method
21980         matches the delegate.
21981
21982         (FullDelegateDesc): Implement.
21983
21984         (VerifyApplicability): Implement.
21985
21986         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21987         delegate invocations too.
21988
21989         (Invocation::Emit): Ditto.
21990
21991         * ../errors/cs1593.cs : Added.
21992
21993         * ../errors/cs1594.cs : Added.
21994
21995         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21996
21997 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21998
21999         * typemanager.cs (intptr_type): Core type for System.IntPtr
22000
22001         (InitCoreTypes): Update for the same.
22002
22003         (iasyncresult_type, asynccallback_type): Ditto.
22004
22005         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22006         correct.
22007
22008         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22009         too.
22010
22011         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22012         the builders for the 4 members of a delegate type :-)
22013
22014         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22015         type.
22016
22017         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22018
22019         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22020
22021 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22022
22023         * statement.cs (Break::Emit): Implement.   
22024         (Continue::Emit): Implement.
22025
22026         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22027         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22028         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22029         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22030         end loop
22031
22032         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22033         properties that track the label for the current loop (begin of the
22034         loop and end of the loop).
22035
22036 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22037
22038         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22039         use of emitting anything at all.
22040
22041         * class.cs, rootcontext.cs : Get rid of calls to the same.
22042
22043         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22044
22045         (Populate): Define the constructor correctly and set the implementation
22046         attributes.
22047
22048         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22049         have been defined.
22050
22051         (AddDelegateType): Implement.
22052
22053         (IsDelegateType): Implement helper method.
22054
22055         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22056
22057         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22058         and accordingly handle it.
22059
22060         * delegate.cs (Populate): Take TypeContainer argument.
22061         Implement bits to define the Invoke method. However, I still haven't figured out
22062         how to take care of the native int bit :-(
22063
22064         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22065         Qualify the name of the delegate, not its return type !
22066
22067         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22068         conversion.
22069
22070         (StandardConversionExists): Checking for array types turns out to be recursive.
22071
22072         (ConvertReferenceExplicit): Implement array conversion.
22073
22074         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22075
22076 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22077
22078         * cs-parser.jay (delegate_declaration): Store the fully qualified
22079         name as it is a type declaration.
22080
22081         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22082         readonly.
22083
22084         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22085         as TypeContainer::DefineType.
22086
22087         (Populate): Method in which all the definition of the various methods (Invoke)
22088         etc is done.
22089
22090         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22091         see.
22092
22093         (CloseDelegate): Finally creates the delegate.
22094
22095         * class.cs (TypeContainer::DefineType): Update to define delegates.
22096         (Populate, Emit and CloseType): Do the same thing here too.
22097
22098         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22099         delegates in all these operations.
22100
22101 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22102
22103         * expression.cs: LocalTemporary: a new expression used to
22104         reference a temporary that has been created.
22105
22106         * assign.cs: Handle PropertyAccess back here, so that we can
22107         provide the proper semantic access to properties.
22108
22109         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22110         a few more explicit conversions. 
22111
22112         * modifiers.cs: `NEW' modifier maps to HideBySig.
22113
22114         * expression.cs (PropertyExpr): Make this into an
22115         ExpressionStatement, and support the EmitStatement code path. 
22116
22117         Perform get/set error checking, clean up the interface.
22118
22119         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22120         them into toplevel access objects.
22121
22122 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22123
22124         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22125         SRE.
22126
22127         * typemanager.cs: Keep track here of our PropertyBuilders again to
22128         work around lameness in SRE.
22129
22130 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22131
22132         * expression.cs (LValue::LValueResolve): New method in the
22133         interface, used to perform a second resolution pass for LValues. 
22134
22135         (This::DoResolve): Catch the use of this in static methods.
22136
22137         (This::LValueResolve): Implement.
22138
22139         (This::Store): Remove warning, assigning to `this' in structures
22140         is 
22141
22142         (Invocation::Emit): Deal with invocation of
22143         methods on value types.  We need to pass the address to structure
22144         methods rather than the object itself.  (The equivalent code to
22145         emit "this" for structures leaves the entire structure on the
22146         stack instead of a pointer to it). 
22147
22148         (ParameterReference::DoResolve): Compute the real index for the
22149         argument based on whether the method takes or not a `this' pointer
22150         (ie, the method is static).
22151
22152         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22153         value types returned from functions when we need to invoke a
22154         method on the sturcture.
22155
22156
22157 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22158
22159         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22160         defining the type in the Modulebuilder or Typebuilder. This is to take
22161         care of nested types which need to be defined on the TypeBuilder using
22162         DefineNestedMethod.
22163
22164         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22165         methods in RootContext, only ported to be part of TypeContainer.
22166
22167         (TypeContainer::GetInterfaceOrClass): Ditto.
22168
22169         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22170
22171         * interface.cs (Interface::DefineInterface): New method. Does exactly
22172         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22173         too.
22174
22175         (Interface::GetInterfaces): Move from RootContext here and port.
22176
22177         (Interface::GetInterfaceByName): Same here.
22178
22179         * rootcontext.cs (ResolveTree): Re-write.
22180
22181         (PopulateTypes): Re-write.
22182
22183         * class.cs (TypeContainer::Populate): Populate nested types too.
22184         (TypeContainer::Emit): Emit nested members too.
22185
22186         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22187         instead just use the name argument passed in as it is already fully
22188         qualified.
22189
22190         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22191         to TypeContainer mapping to see if a type is user-defined.
22192
22193         * class.cs (TypeContainer::CloseType): Implement. 
22194
22195         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22196         the default constructor.
22197
22198         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22199         twice.
22200
22201         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22202
22203         * interface.cs (CloseType): Create the type here.
22204
22205         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22206         the hierarchy.
22207
22208         Remove all the methods which are now in TypeContainer.
22209
22210 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22211
22212         * delegate.cs (Define): Re-write bits to define the delegate
22213         correctly.
22214
22215 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22216
22217         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22218
22219         * expression.cs (ImplicitReferenceConversion): handle null as well
22220         as a source to convert to any reference type.
22221
22222         * statement.cs (Return): Perform any implicit conversions to
22223         expected return type.  
22224
22225         Validate use of return statement.  
22226
22227         * codegen.cs (EmitContext): Pass the expected return type here.
22228
22229         * class.cs (Method, Constructor, Property): Pass expected return
22230         type to EmitContext.
22231
22232 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * expression.cs: Make DoResolve take an EmitContext instead of a
22235         TypeContainer.
22236
22237         Replaced `l' and `location' for `loc', for consistency.
22238
22239         (Error, Warning): Remove unneeded Tc argument.
22240
22241         * assign.cs, literal.cs, constant.cs: Update to new calling
22242         convention. 
22243
22244         * codegen.cs: EmitContext now contains a flag indicating whether
22245         code is being generated in a static method or not.
22246
22247         * cs-parser.jay: DecomposeQI, new function that replaces the old
22248         QualifiedIdentifier.  Now we always decompose the assembled
22249         strings from qualified_identifier productions into a group of
22250         memberaccesses.
22251
22252 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22253
22254         * rootcontext.cs: Deal with field-less struct types correctly now
22255         by passing the size option to Define Type.
22256
22257         * class.cs: Removed hack that created one static field. 
22258
22259 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22260
22261         * statement.cs: Moved most of the code generation here. 
22262
22263 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22264
22265         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22266         seem very right.
22267
22268         (ElementAccess): Remove useless bits for now - keep checks as the spec
22269         says.
22270
22271 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22272
22273         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22274         and start performing checks according to the spec.
22275
22276 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22277
22278         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22279         rank_specifiers instead.
22280
22281         (rank_specifiers): Change the order in which the rank specifiers are stored
22282
22283         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22284
22285         * expression.cs (ElementAccess): Implement the LValue interface too.
22286
22287 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22288
22289         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22290         except that user defined conversions are not included.
22291
22292         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22293         perform the conversion of the return type, if necessary.
22294
22295         (New::DoResolve): Check whether we are creating an array or an object
22296         and accordingly do the needful.
22297
22298         (New::Emit): Same here.
22299
22300         (New::DoResolve): Implement guts of array creation.
22301
22302         (New::FormLookupType): Helper function.
22303
22304 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22305
22306         * codegen.cs: Removed most of the code generation here, and move the
22307         corresponding code generation bits to the statement classes. 
22308
22309         Added support for try/catch/finalize and throw.
22310
22311         * cs-parser.jay: Added support for try/catch/finalize.
22312
22313         * class.cs: Catch static methods having the flags override,
22314         virtual or abstract.
22315
22316         * expression.cs (UserCast): This user cast was not really doing
22317         what it was supposed to do.  Which is to be born in fully resolved
22318         state.  Parts of the resolution were being performed at Emit time! 
22319
22320         Fixed this code.
22321
22322 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22323
22324         * expression.cs: Implicity convert the result from UserCast.
22325
22326 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22327
22328         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22329         prevented it from working correctly. 
22330
22331         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22332         merely ConvertImplicit.
22333
22334 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22335
22336         * typemanager.cs: Make the LookupTypeContainer function static,
22337         and not per-instance.  
22338
22339         * class.cs: Make static FindMembers (the one that takes a Type
22340         argument). 
22341
22342         * codegen.cs: Add EmitForeach here.
22343
22344         * cs-parser.jay: Make foreach a toplevel object instead of the
22345         inline expansion, as we need to perform semantic analysis on it. 
22346
22347 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22348
22349         * expression.cs (Expression::ImplicitUserConversion): Rename to
22350         UserDefinedConversion.
22351
22352         (Expression::UserDefinedConversion): Take an extra argument specifying 
22353         whether we look for explicit user conversions too.
22354
22355         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22356
22357         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22358
22359         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22360         with the appropriate arguments.
22361
22362         * cs-parser.jay (cast_expression): Record location too.
22363
22364         * expression.cs (Cast): Record location info.
22365
22366         (Expression::ConvertExplicit): Take location argument.
22367
22368         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22369         to determine if we are doing explicit conversions.
22370
22371         (UserCast::Emit): Update accordingly.
22372
22373         (Expression::ConvertExplicit): Report an error if everything fails.
22374
22375         * ../errors/cs0030.cs : Add.
22376
22377 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22380         virtual and newslot bits. 
22381
22382         * class.cs (TypeContainer::RegisterRequiredImplementations):
22383         Record methods we need.
22384
22385         (TypeContainer::MakeKey): Helper function to make keys for
22386         MethodBases, since the Methodbase key is useless.
22387
22388         (TypeContainer::Populate): Call RegisterRequiredImplementations
22389         before defining the methods.   
22390
22391         Create a mapping for method_builders_to_methods ahead of time
22392         instead of inside a tight loop.
22393
22394         (::RequireMethods):  Accept an object as the data to set into the
22395         hashtable so we can report interface vs abstract method mismatch.
22396
22397 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22398
22399         * report.cs: Make all of it static.
22400
22401         * rootcontext.cs: Drop object_type and value_type computations, as
22402         we have those in the TypeManager anyways.
22403
22404         Drop report instance variable too, now it is a global.
22405
22406         * driver.cs: Use try/catch on command line handling.
22407
22408         Add --probe option to debug the error reporting system with a test
22409         suite. 
22410
22411         * report.cs: Add support for exiting program when a probe
22412         condition is reached.
22413
22414 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22415
22416         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22417         we do a forcible conversion regardless of type, to check if 
22418         ForceConversion returns a null.
22419
22420         (Binary::error19): Use location to report error.
22421
22422         (Unary::error23): Use location here too.
22423
22424         * ../errors/cs0019.cs : Check in.
22425
22426         * ../errors/cs0023.cs : Check in.
22427
22428         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22429         case of a non-null MethodInfo object with a length of 0 !
22430
22431         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22432         an applicable member - according to the spec :-)
22433         Also fix logic to find members in base types.
22434
22435         (Unary::ResolveOperator): Same here.
22436
22437         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22438         as I was getting thoroughly confused between this and error19 :-)
22439
22440         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22441         (::FindMostEncompassedType): Implement.
22442         (::FindMostEncompassingType): Implement.
22443         (::StandardConversionExists): Implement.
22444
22445         (UserImplicitCast): Re-vamp. We now need info about most specific
22446         source and target types so that we can do the necessary conversions.
22447
22448         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22449         mathematical union with no duplicates.
22450
22451 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22452
22453         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22454         in order from base classes to child classes, so that we can in
22455         child classes look up in our parent for method names and
22456         attributes (required for handling abstract, virtual, new, override
22457         constructs: we need to instrospect our base class, and if we dont
22458         populate the classes in order, the introspection might be
22459         incorrect.  For example, a method could query its parent before
22460         the parent has any methods and would determine that the parent has
22461         no abstract methods (while it could have had them)).
22462
22463         (RootContext::CreateType): Record the order in which we define the
22464         classes.
22465
22466 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22467
22468         * class.cs (TypeContainer::Populate): Also method definitions can
22469         fail now, keep track of this.
22470
22471         (TypeContainer::FindMembers): Implement support for
22472         DeclaredOnly/noDeclaredOnly flag.
22473
22474         (Constructor::Emit) Return the ConstructorBuilder.
22475
22476         (Method::Emit) Return the MethodBuilder. 
22477         Check for abstract or virtual methods to be public.
22478
22479         * rootcontext.cs (RootContext::CreateType): Register all the
22480         abstract methods required for the class to be complete and the
22481         interface methods that must be implemented. 
22482
22483         * cs-parser.jay: Report error 501 (method requires body if it is
22484         not marked abstract or extern).
22485
22486         * expression.cs (TypeOf::Emit): Implement.
22487
22488         * typemanager.cs: runtime_handle_type, new global type.
22489
22490         * class.cs (Property::Emit): Generate code for properties.
22491
22492 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22493
22494         * expression.cs (Unary::ResolveOperator): Find operators on base type
22495         too - we now conform exactly to the spec.
22496
22497         (Binary::ResolveOperator): Same here.
22498
22499         * class.cs (Operator::Define): Fix minor quirk in the tests.
22500
22501         * ../errors/cs0215.cs : Added.
22502
22503         * ../errors/cs0556.cs : Added.
22504
22505         * ../errors/cs0555.cs : Added.
22506
22507 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22508
22509         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22510         single integer which is really efficient
22511
22512 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22513
22514         *  expression.cs (Expression::ImplicitUserConversion): Use location
22515         even in the case when we are examining True operators.
22516  
22517         * class.cs (Operator::Define): Perform extensive checks to conform
22518         with the rules for operator overloading in the spec.
22519
22520         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22521         some of the other conversions mentioned in the spec.
22522
22523         * typemanager.cs (array_type): New static member for the System.Array built-in
22524         type.
22525
22526         (cloneable_interface): For System.ICloneable interface.
22527
22528         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22529         we start resolving the tree and populating types.
22530
22531         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22532  
22533 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22534
22535         * expression.cs (Expression::ExprClassFromMemberInfo,
22536         Expression::Literalize): Create literal expressions from
22537         FieldInfos which are literals.
22538
22539         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22540         type casts, because they were wrong.  The test suite in tests
22541         caught these ones.
22542
22543         (ImplicitNumericConversion): ushort to ulong requires a widening
22544         cast. 
22545
22546         Int32 constant to long requires widening cast as well.
22547
22548         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22549         for integers because the type on the stack is not i4.
22550
22551 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22552
22553         * expression.cs (report118): require location argument. 
22554
22555         * parameter.cs: Do not dereference potential null value.
22556
22557         * class.cs: Catch methods that lack the `new' keyword when
22558         overriding a name.  Report warnings when `new' is used without
22559         anything being there to override.
22560
22561         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22562
22563         * class.cs: Only add constructor to hashtable if it is non-null
22564         (as now constructors can fail on define).
22565
22566         (TypeManager, Class, Struct): Take location arguments.
22567
22568         Catch field instance initialization in structs as errors.
22569
22570         accepting_filter: a new filter for FindMembers that is static so
22571         that we dont create an instance per invocation.
22572
22573         (Constructor::Define): Catch errors where a struct constructor is
22574         parameterless 
22575
22576         * cs-parser.jay: Pass location information for various new
22577         constructs. 
22578
22579         * delegate.cs (Delegate): take a location argument.
22580
22581         * driver.cs: Do not call EmitCode if there were problesm in the
22582         Definition of the types, as many Builders wont be there. 
22583
22584         * decl.cs (Decl::Decl): Require a location argument.
22585
22586         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22587         into integers, and find the most appropiate integer for it.
22588
22589         * literal.cs: Implement ULongLiteral.
22590
22591         * rootcontext.cs: Provide better information about the location of
22592         failure when CreateType fails.
22593
22594 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22595
22596         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22597         as well.
22598
22599         * expression.cs (Binary::CheckShiftArguments): Add missing type
22600         computation.
22601         (Binary::ResolveOperator): Add type to the logical and and logical
22602         or, Bitwise And/Or and Exclusive Or code paths, it was missing
22603         before.
22604
22605         (Binary::DoNumericPromotions): In the case where either argument
22606         is ulong (and most signed types combined with ulong cause an
22607         error) perform implicit integer constant conversions as well.
22608
22609 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22610
22611         * expression.cs (UserImplicitCast): Method should always be
22612         non-null. 
22613         (Invocation::BetterConversion): Simplified test for IntLiteral.
22614
22615         (Expression::ImplicitNumericConversion): Split this routine out.
22616         Put the code that performs implicit constant integer conversions
22617         here. 
22618
22619         (Expression::Resolve): Become a wrapper around DoResolve so we can
22620         check eclass and type being set after resolve.
22621
22622         (Invocation::Badness): Remove this dead function
22623
22624         (Binary::ResolveOperator): Do not compute the expensive argumnets
22625         unless we have a union for it.
22626
22627         (Probe::Emit): Is needs to do an isinst and then
22628         compare against null.
22629
22630         (::CanConvert): Added Location argument.  If the Location argument
22631         is null (Location.Null), then we do not report errors.  This is
22632         used by the `probe' mechanism of the Explicit conversion.  We do
22633         not want to generate an error for something that the user
22634         explicitly requested to be casted.  But the pipeline for an
22635         explicit cast first tests for potential implicit casts.
22636
22637         So for now, if the Location is null, it means `Probe only' to
22638         avoid adding another argument.   Might have to revise this
22639         strategy later.
22640
22641         (ClassCast): New class used to type cast objects into arbitrary
22642         classes (used in Explicit Reference Conversions).
22643
22644         Implement `as' as well.
22645
22646         Reverted all the patches from Ravi below: they were broken:
22647
22648                 * The use of `level' as a mechanism to stop recursive
22649                   invocations is wrong.  That was there just to catch the
22650                   bug with a strack trace but not as a way of addressing
22651                   the problem.
22652
22653                   To fix the problem we have to *understand* what is going
22654                   on and the interactions and come up with a plan, not
22655                   just get things going.
22656
22657                 * The use of the type conversion cache that I proposed
22658                   last night had an open topic: How does this work across
22659                   protection domains.  A user defined conversion might not
22660                   be public in the location where we are applying the
22661                   conversion, a different conversion might be selected
22662                   (ie, private A->B (better) but public B->A (worse),
22663                   inside A, A->B applies, but outside it, B->A will
22664                   apply).
22665
22666                 * On top of that (ie, even if the above is solved),
22667                   conversions in a cache need to be abstract.  Ie, `To
22668                   convert from an Int to a Short use an OpcodeCast', not
22669                   `To convert from an Int to a Short use the OpcodeCast on
22670                   the variable 5' (which is what this patch was doing).
22671
22672 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22673
22674         * expression.cs (Invocation::ConversionExists): Re-write to use
22675         the conversion cache
22676
22677         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22678         cache all conversions done, not just user-defined ones.
22679
22680         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22681         to determine if a conversion exists instead of acutually trying to 
22682         perform the conversion. It's faster too.
22683
22684         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22685         and only then attempt the implicit conversion.
22686
22687 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22688
22689         * expression.cs (ConvertImplicit): Use a cache for conversions
22690         already found. Check level of recursion and bail out if necessary.
22691
22692 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22693
22694         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22695         Export standard methods that we expect for string operations.
22696
22697         * statement.cs (Block::UsageWarning): Track usage of variables and
22698         report the errors for not used variables.
22699
22700         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22701         operator. 
22702
22703 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22704
22705         * codegen.cs: remove unnneded code 
22706
22707         * expression.cs: Removed BuiltinTypeAccess class
22708
22709         Fix the order in which implicit conversions are
22710         done.  
22711
22712         The previous fixed dropped support for boxed conversions (adding a
22713         test to the test suite now)
22714
22715         (UserImplicitCast::CanConvert): Remove test for source being null,
22716         that code is broken.  We should not feed a null to begin with, if
22717         we do, then we should track the bug where the problem originates
22718         and not try to cover it up here.
22719
22720         Return a resolved expression of type UserImplicitCast on success
22721         rather than true/false.  Ravi: this is what I was talking about,
22722         the pattern is to use a static method as a "constructor" for
22723         objects. 
22724
22725         Also, do not create arguments until the very last minute,
22726         otherwise we always create the arguments even for lookups that
22727         will never be performed. 
22728
22729         (UserImplicitCast::Resolve): Eliminate, objects of type
22730         UserImplicitCast are born in a fully resolved state. 
22731
22732         * typemanager.cs (InitCoreTypes): Init also value_type
22733         (System.ValueType). 
22734
22735         * expression.cs (Cast::Resolve): First resolve the child expression.
22736
22737         (LValue): Add new method AddressOf to be used by
22738         the `&' operator.  
22739
22740         Change the argument of Store to take an EmitContext instead of an
22741         ILGenerator, because things like FieldExpr need to be able to call
22742         their children expression to generate the instance code. 
22743
22744         (Expression::Error, Expression::Warning): Sugar functions for
22745         reporting errors.
22746
22747         (Expression::MemberLookup): Accept a TypeContainer instead of a
22748         Report as the first argument.
22749
22750         (Expression::ResolvePrimary): Killed.  I still want to improve
22751         this as currently the code is just not right.
22752
22753         (Expression::ResolveMemberAccess): Simplify, but it is still
22754         wrong. 
22755
22756         (Unary::Resolve): Catch errors in AddressOf operators.
22757
22758         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22759         index to a byte for the short-version, or the compiler will choose
22760         the wrong Emit call, which generates the wrong data.
22761
22762         (ParameterReference::Emit, ::Store): same.
22763
22764         (FieldExpr::AddressOf): Implement.
22765
22766         * typemanager.cs: TypeManager: made public variable instead of
22767         property.
22768
22769         * driver.cs: document --fatal.
22770
22771         * report.cs (ErrorMessage, WarningMessage): new names for the old
22772         Error and Warning classes.
22773
22774         * cs-parser.jay (member_access): Turn built-in access to types
22775         into a normal simplename
22776
22777 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22778
22779         * expression.cs (Invocation::BetterConversion): Fix to cope
22780         with q being null, since this was introducing a bug.
22781
22782         * expression.cs (ConvertImplicit): Do built-in conversions first.
22783
22784 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22785
22786         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22787
22788 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22789
22790         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22791         I had introduced long ago (what's new ?).
22792
22793         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22794         the work of all the checking. 
22795         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22796         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22797
22798         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22799         that is the right way. 
22800
22801         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22802         overloading resolution. Use everywhere instead of cutting and pasting code.
22803
22804         (Binary::ResolveOperator): Use MakeUnionSet.
22805
22806         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22807         we have to convert to bool types. Not complete yet.
22808
22809 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22810
22811         * typemanager.cs (TypeManager::CSharpName): support ushort.
22812
22813         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22814         to provide an expression that performsn an implicit constant int
22815         conversion (section 6.1.6).
22816         (Expression::ConvertImplicitRequired): Reworked to include
22817         implicit constant expression conversions.
22818
22819         (Expression::ConvertNumericExplicit): Finished.
22820
22821         (Invocation::Emit): If InstanceExpression is null, then it means
22822         that we perform a call on this.
22823
22824 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22825
22826         * expression.cs (Unary::Emit): Remove some dead code.
22827         (Probe): Implement Resolve and Emit for `is'.
22828         (Expression::ConvertImplicitRequired): Attempt to do constant
22829         expression conversions here.  Maybe should be moved to
22830         ConvertImplicit, but I am not sure.
22831         (Expression::ImplicitLongConstantConversionPossible,
22832         Expression::ImplicitIntConstantConversionPossible): New functions
22833         that tell whether is it possible to apply an implicit constant
22834         expression conversion.
22835
22836         (ConvertNumericExplicit): Started work on explicit numeric
22837         conversions.
22838
22839         * cs-parser.jay: Update operator constants.
22840
22841         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22842         (Parameters::GetSignature): Hook up VerifyArgs here.
22843         (Parameters::VerifyArgs): Verifies that no two arguments have the
22844         same name. 
22845
22846         * class.cs (Operator): Update the operator names to reflect the
22847         ones that the spec expects (as we are just stringizing the
22848         operator names).
22849
22850         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22851         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22852         previous usage did only work for our methods.
22853         (Expression::ConvertImplicit): Handle decimal implicit numeric
22854         conversions as well.
22855         (Expression::InternalTypeConstructor): Used to invoke constructors
22856         on internal types for default promotions.
22857
22858         (Unary::Emit): Implement special handling for the pre/post
22859         increment/decrement for overloaded operators, as they need to have
22860         the same semantics as the other operators.
22861
22862         (Binary::ResolveOperator): ditto.
22863         (Invocation::ConversionExists): ditto.
22864         (UserImplicitCast::Resolve): ditto.
22865
22866 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22867
22868         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22869         operator, return after emitting body. Regression tests pass again !
22870
22871         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22872         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22873         (Invocation::OverloadResolve): Ditto.
22874         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22875
22876         * everywhere : update calls to the above methods accordingly.
22877
22878 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22879
22880         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22881
22882         * expression.cs (ExpressionStatement): New base class used for
22883         expressions that can appear in statements, so that we can provide
22884         an alternate path to generate expression that do not leave a value
22885         on the stack.
22886
22887         (Expression::Emit, and all the derivatives): We no longer return
22888         whether a value is left on the stack or not.  Every expression
22889         after being emitted leaves a single value on the stack.
22890
22891         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22892         facilties of ExpressionStatement if possible.
22893
22894         * cs-parser.jay: Update statement_expression.
22895
22896 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22897
22898         * driver.cs: Change the wording of message
22899
22900 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22901
22902         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22903         the type of the expression to the return type of the method if
22904         we have an overloaded operator match ! The regression tests pass again !
22905         (Unary::ResolveOperator): Ditto.
22906
22907         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22908         to find "op_Implicit", not "implicit" ;-)
22909         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22910         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22911
22912         * everywhere : Correct calls to the above accordingly.
22913
22914         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22915         (ConvertImplicit): Do user-defined conversion if it exists.
22916
22917 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22918
22919         * assign.cs: track location.
22920         (Resolve): Use implicit conversions on assignment.
22921
22922         * literal.cs: Oops.  Not good, Emit of short access values should
22923         pass (Bytes) or the wrong argument will be selected.
22924
22925         * expression.cs (Unary::Emit): Emit code for -expr.
22926
22927         (Unary::ResolveOperator): Handle `Substract' for non-constants
22928         (substract from zero from the non-constants).
22929         Deal with Doubles as well. 
22930
22931         (Expression::ConvertImplicitRequired): New routine that reports an
22932         error if no implicit conversion exists. 
22933
22934         (Invocation::OverloadResolve): Store the converted implicit
22935         expressions if we make them
22936
22937 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22938
22939         * class.cs (ConstructorInitializer): Take a Location argument.
22940         (ConstructorBaseInitializer): Same here.
22941         (ConstructorThisInitializer): Same here.
22942
22943         * cs-parser.jay : Update all calls accordingly.
22944
22945         * expression.cs (Unary, Binary, New): Take location argument.
22946         Update accordingly everywhere.
22947
22948         * cs-parser.jay : Update all calls to the above to take a location
22949         argument.
22950
22951         * class.cs : Ditto.
22952
22953 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22954
22955         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22956         (Invocation::BetterConversion): Same here
22957         (Invocation::ConversionExists): Ditto.
22958
22959         (Invocation::ConversionExists): Implement.
22960
22961 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22962
22963         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22964         Also take an additional TypeContainer argument.
22965
22966         * All over : Pass in TypeContainer as argument to OverloadResolve.
22967
22968         * typemanager.cs (CSharpName): Update to check for the string type and return
22969         that too.
22970
22971         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22972         a given method.
22973
22974 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22975
22976         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22977         (Invocation::BetterFunction): Implement.
22978         (Invocation::BetterConversion): Implement.
22979         (Invocation::ConversionExists): Skeleton, no implementation yet.
22980
22981         Okay, things work fine !
22982
22983 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22984
22985         * typemanager.cs: declare and load enum_type, delegate_type and
22986         void_type. 
22987
22988         * expression.cs (Expression::Emit): Now emit returns a value that
22989         tells whether a value is left on the stack or not.  This strategy
22990         might be reveted tomorrow with a mechanism that would address
22991         multiple assignments.
22992         (Expression::report118): Utility routine to report mismatches on
22993         the ExprClass.
22994
22995         (Unary::Report23): Report impossible type/operator combination
22996         utility function.
22997
22998         (Unary::IsIncrementableNumber): Whether the type can be
22999         incremented or decremented with add.
23000         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23001         complemented. 
23002         (Unary::ResolveOperator): Implement ++, !, ~,
23003
23004         (Invocation::Emit): Deal with new Emit convetion.
23005
23006         * All Expression derivatives: Updated their Emit method to return
23007         whether they leave values on the stack or not.
23008
23009         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23010         stack for expressions that are statements. 
23011
23012 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23013
23014         * expression.cs (LValue): New interface.  Must be implemented by
23015         LValue objects.
23016         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23017         LValue interface.
23018
23019         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23020         interface for generating code, simplifies the code.
23021
23022 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23023
23024         * expression.cs (everywhere): Comment out return statements in ::Resolve
23025         methods to avoid the warnings.
23026
23027 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23028
23029         * driver.cs (parse): Report error 2001 if we can not open the
23030         source file.
23031
23032         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23033         not resolve it.
23034
23035         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23036         object. 
23037
23038         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23039         otherwise nested blocks end up with the same index.
23040
23041         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23042
23043         * expression.cs:  Instead of having FIXMEs in the Resolve
23044         functions, throw exceptions so it is obvious that we are facing a
23045         bug. 
23046
23047         * cs-parser.jay (invocation_expression): Pass Location information.
23048
23049         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23050         Use a basename for those routines because .NET does not like paths
23051         on them. 
23052
23053         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23054         already defined.
23055
23056 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23057
23058         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23059         are loading the correct data types (throws an exception if not).
23060         (TypeManager::InitCoreTypes): Use CoreLookupType
23061
23062         * expression.cs (Unary::ResolveOperator): return the child
23063         expression for expressions which are just +expr.
23064         (Unary::ResolveOperator): Return negative literals for -LITERAL
23065         expressions (otherwise they are Unary {Literal}).
23066         (Invocation::Badness): Take into account `Implicit constant
23067         expression conversions'.
23068
23069         * literal.cs (LongLiteral): Implement long literal class.
23070         (IntLiteral): export the `Value' of the intliteral. 
23071
23072 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23073
23074         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23075
23076         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23077         instead of 'Operator'
23078
23079         * expression.cs (Binary::ResolveOperator): Update accordingly.
23080         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23081         and 'Minus'
23082
23083         * cs-parser.jay (unary_expression): Update to use the new names.
23084
23085         * gen-treedump.cs (GetUnary): Same here.
23086
23087         * expression.cs (Unary::Resolve): Implement.
23088         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23089         operators are found instead of making noise ;-)
23090         (Unary::ResolveOperator): New method to do precisely the same thing which
23091         Binary::ResolveOperator does for Binary expressions.
23092         (Unary.method, .Arguments): Add.
23093         (Unary::OperName): Implement.   
23094         (Unary::ForceConversion): Copy and Paste !
23095
23096         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23097         a unary operator.
23098
23099         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23100         for the inbuilt operators. Only overloading works for now ;-)
23101
23102 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23103
23104         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23105         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23106
23107         * expression.cs (This::Emit): Implement. 
23108         (This::Resolve): Implement.
23109         (TypeOf:Resolve): Implement.
23110         (Expression::ResolveSimpleName): Add an implicit this to instance
23111         field references. 
23112         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23113         Bind instance variable to Field expressions.
23114         (FieldExpr::Instance): New field used to track the expression that
23115         represents the object instance.
23116         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23117         binding 
23118         (FieldExpr::Emit): Implement.
23119
23120         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23121         the last instruction contains a return opcode to avoid generating
23122         the last `ret' instruction (this generates correct code, and it is
23123         nice to pass the peverify output).
23124
23125         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23126         initializer for static and instance variables.
23127         (Constructor::Emit): Allow initializer to be null in the case of
23128         static constructors.  Only emit initializer for instance
23129         constructors. 
23130
23131         (TypeContainer::FindMembers): Return a null array if there are no
23132         matches.
23133
23134         Also fix the code for the MemberTypes.Method branch, as it was not
23135         scanning that for operators (or tried to access null variables before).
23136
23137         * assign.cs (Assign::Emit): Handle instance and static fields. 
23138
23139         * TODO: Updated.
23140
23141         * driver.cs: Stop compilation if there are parse errors.
23142
23143         * cs-parser.jay (constructor_declaration): Provide default base
23144         initializer for non-static constructors.
23145         (constructor_declarator): Do not provide a default base
23146         initializers if none was specified.
23147         Catch the fact that constructors should not have parameters.
23148
23149         * class.cs: Do not emit parent class initializers for static
23150         constructors, that should be flagged as an error.
23151
23152 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23153
23154         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23155         Move back code into TypeContainer::Populate.
23156
23157 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23158
23159         * class.cs (TypeContainer::AddConstructor): Fix the check to
23160         compare against Name, not Basename. 
23161         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23162
23163         * cs-parser.jay : Update accordingly.
23164
23165         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23166         for methods, don't forget to look into the operators too.
23167         (RegisterMethodBuilder): Helper method to take care of this for
23168         methods, constructors and operators.
23169         (Operator::Define): Completely revamp.
23170         (Operator.OperatorMethod, MethodName): New fields.
23171         (TypeContainer::Populate): Move the registering of builders into
23172         RegisterMethodBuilder.
23173         (Operator::Emit): Re-write.
23174
23175         * expression.cs (Binary::Emit): Comment out code path to emit method
23176         invocation stuff for the case when we have a user defined operator. I am
23177         just not able to get it right !
23178
23179 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23180
23181         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23182         argument. 
23183
23184         (Expression::MemberLookup): Provide a version that allows to
23185         specify the MemberTypes and BindingFlags. 
23186
23187         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23188         so it was not fetching variable information from outer blocks.
23189
23190         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23191         Beforefieldinit as it was buggy.
23192
23193         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23194         that Ravi put here.  
23195
23196         * class.cs (Constructor::Emit): Only emit if block is not null.
23197         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23198         deal with this by semantically definining it as if the user had
23199         done it.
23200
23201         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23202         constructors as we now "emit" them at a higher level.
23203
23204         (TypeContainer::DefineDefaultConstructor): Used to define the
23205         default constructors if none was provided.
23206
23207         (ConstructorInitializer): Add methods Resolve and Emit. 
23208
23209         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23210
23211 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23212
23213         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23214         the default constructor builder with our hashtable for methodbuilders
23215         to methodcores.
23216
23217         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23218         and argument_count is 0 in which case we have a match.
23219         (Binary::ResolveOperator): More null checking and miscellaneous coding
23220         style cleanup.
23221
23222 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23223
23224         * rootcontext.cs (IsNameSpace): Compare against null.
23225
23226         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23227
23228         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23229         and Unary::Operator.
23230
23231         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23232         accordingly.
23233
23234         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23235         we have overloaded operators.
23236         (Binary::ResolveOperator): Implement the part which does the operator overload
23237         resolution.
23238
23239         * class.cs (Operator::Emit): Implement.
23240         (TypeContainer::Emit): Emit the operators we have too.
23241
23242         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23243         the case when we have a user-defined operator.
23244
23245 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23246
23247         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23248
23249 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23250
23251         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23252         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23253         (Constructor::Emit): Implement.
23254         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23255         if we have no work to do. 
23256         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23257         Emit method.
23258
23259         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23260         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23261
23262         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23263         of parent.parent.
23264
23265 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23266
23267         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23268         in the source.
23269         (Tree::RecordNamespace): Method to do what the name says ;-)
23270         (Tree::Namespaces): Property to get at the namespaces hashtable.
23271
23272         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23273         keep track.
23274
23275         * rootcontext.cs (IsNamespace): Fixed it :-)
23276
23277 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23278
23279         * class.cs (TypeContainer::FindMembers): Add support for
23280         constructors. 
23281         (MethodCore): New class that encapsulates both the shared aspects
23282         of a Constructor and a Method.  
23283         (Method, Constructor): Factored pieces into MethodCore.
23284
23285         * driver.cs: Added --fatal which makes errors throw exceptions.
23286         Load System assembly as well as part of the standard library.
23287
23288         * report.cs: Allow throwing exceptions on errors for debugging.
23289
23290         * modifiers.cs: Do not use `parent', instead use the real type
23291         container to evaluate permission settings.
23292
23293         * class.cs: Put Ravi's patch back in.  He is right, and we will
23294         have to cope with the
23295
23296 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23297
23298         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23299         FamORAssem, not FamANDAssem.
23300
23301 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23302
23303         * driver.cs: Added --parse option that only parses its input files
23304         and terminates.
23305
23306         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23307         incorrect.  IsTopLevel is not used to tell whether an object is
23308         root_types or not (that can be achieved by testing this ==
23309         root_types).  But to see if this is a top-level *class* (not
23310         necessarly our "toplevel" container). 
23311
23312 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23313
23314         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23315         parent instead of a direct call to GetType.
23316
23317 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23318
23319         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23320         Modifiers.TypeAttr. This should just be a call to that method.
23321
23322         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23323         object so that we can determine if we are top-level or not.
23324
23325         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23326         TypeContainer too.
23327
23328         * enum.cs (Enum::Define): Ditto.
23329
23330         * modifiers.cs (FieldAttr): Re-write.
23331
23332         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23333         (TypeContainer::HaveStaticConstructor): New property to provide access
23334         to precisely that info.
23335
23336         * modifiers.cs (MethodAttr): Re-write.
23337         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23338
23339         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23340         of top-level types as claimed.
23341
23342 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23343
23344         * expression.cs (MemberLookup): Fruitless attempt to lookup
23345         constructors.  Maybe I need to emit default constructors?  That
23346         might be it (currently .NET emits this for me automatically).
23347         (Invocation::OverloadResolve): Cope with Arguments == null.
23348         (Invocation::EmitArguments): new function, shared by the new
23349         constructor and us.
23350         (Invocation::Emit): Handle static and instance methods.  Emit
23351         proper call instruction for virtual or non-virtual invocations.
23352         (New::Emit): Implement.
23353         (New::Resolve): Implement.
23354         (MemberAccess:Resolve): Implement.
23355         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23356         to track instances.
23357         (FieldExpr::Resolve): Set type.
23358
23359         * support.cs: Handle empty arguments.
23360                 
23361         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23362         SimpleLookup): Auxiliary routines to help parse a qualifier
23363         identifier.  
23364
23365         Update qualifier_identifier rule.
23366
23367         * codegen.cs: Removed debugging messages.
23368
23369         * class.cs: Make this a global thing, this acts just as a "key" to
23370         objects that we might have around.
23371
23372         (Populate): Only initialize method_builders_to_methods once.
23373
23374         * expression.cs (PropertyExpr): Initialize type from the
23375         PropertyType. 
23376
23377         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23378         Resolve pattern.  Attempt to implicitly convert value to boolean.
23379         Emit code.
23380
23381         * expression.cs: Set the type for the int32/int32 argument case.
23382         (Binary::ResolveOperator): Set the return type to boolean for
23383         comparission operators
23384
23385         * typemanager.cs: Remove debugging print code.
23386
23387         (Invocation::Resolve): resolve type.
23388
23389         * class.cs: Allocate a MemberInfo of the correct size, as the code
23390         elsewhere depends on the test to reflect the correct contents.
23391
23392         (Method::) Keep track of parameters, due to System.Reflection holes
23393
23394         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23395         mapping here.
23396
23397         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23398         of the exact size and return that.
23399
23400         (Class::LookupMethodByBuilder): New function that maps
23401         MethodBuilders to its methods.  Required to locate the information
23402         on methods because System.Reflection bit us again.
23403
23404         * support.cs: New file, contains an interface ParameterData and
23405         two implementations: ReflectionParameters and InternalParameters
23406         used to access Parameter information.  We will need to grow this
23407         as required.
23408
23409         * expression.cs (Invocation::GetParameterData): implement a cache
23410         and a wrapper around the ParameterData creation for methods. 
23411         (Invocation::OverloadResolve): Use new code.
23412
23413 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23414
23415         * class.cs (TypeContainer::EmitField): Remove and move into 
23416         (Field::Define): here and modify accordingly.
23417         (Field.FieldBuilder): New member.
23418         (TypeContainer::Populate): Update accordingly.
23419         (TypeContainer::FindMembers): Implement.
23420
23421 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * statement.cs: (VariableInfo::VariableType): New field to be
23424         initialized with the full type once it is resolved. 
23425
23426 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23427
23428         * parameter.cs (GetParameterInfo): Use a type cache to compute
23429         things only once, and to reuse this information
23430
23431         * expression.cs (LocalVariableReference::Emit): Implement.
23432         (OpcodeCast::Emit): fix.
23433
23434         (ParameterReference::Resolve): Implement.
23435         (ParameterReference::Emit): Implement.
23436
23437         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23438         that are expressions need to stay as Expressions.
23439
23440         * typemanager.cs (CSharpName): Returns the C# name of a type if
23441         possible. 
23442
23443         * expression.cs (Expression::ConvertImplicit): New function that
23444         implements implicit type conversions.
23445
23446         (Expression::ImplicitReferenceConversion): Implements implicit
23447         reference conversions.
23448
23449         (EmptyCast): New type for transparent casts.
23450
23451         (OpcodeCast): New type for casts of types that are performed with
23452         a sequence of bytecodes.
23453
23454         (BoxedCast): New type used for casting value types into reference
23455         types.  Emits a box opcode.
23456
23457         (Binary::DoNumericPromotions): Implements numeric promotions of
23458         and computation of the Binary::Type.
23459
23460         (Binary::EmitBranchable): Optimization.
23461
23462         (Binary::Emit): Implement code emission for expressions.
23463
23464         * typemanager.cs (TypeManager): Added two new core types: sbyte
23465         and byte.
23466
23467 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23468
23469         * class.cs (TypeContainer::FindMembers): Method which does exactly
23470         what Type.FindMembers does, only we don't have to use reflection. No
23471         implementation yet.
23472
23473         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23474         typecontainer objects as we need to get at them.
23475         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23476
23477         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23478         typecontainer object.
23479
23480         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23481         of just a Report object.
23482
23483 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23484
23485         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23486         "remove_"
23487         (TypeContainer::Populate): Now define the delegates of the type too.
23488         (TypeContainer.Delegates): Property to access the list of delegates defined
23489         in the type.
23490
23491         * delegates.cs (Delegate::Define): Implement partially.
23492
23493         * modifiers.cs (TypeAttr): Handle more flags.
23494
23495 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23496
23497         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23498         and not <=
23499         (Operator::Define): Re-write logic to get types by using the LookupType method
23500         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23501         (Indexer::Define): Ditto.
23502         (Event::Define): Ditto.
23503         (Property::Define): Ditto.
23504
23505 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23506
23507         * class.cs (TypeContainer::Populate): Now define operators too. 
23508         (TypeContainer.Operators): New property to access the list of operators
23509         in a type.
23510         (Operator.OperatorMethodBuilder): New member to hold the method builder
23511         for the operator we are defining.
23512         (Operator::Define): Implement.
23513
23514 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23515
23516         * class.cs (Event::Define): Make the prefixes of the accessor methods
23517         addOn_ and removeOn_ 
23518
23519         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23520         of the location being passed in too. Ideally, this should go later since all
23521         error reporting should be done through the Report object.
23522
23523         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23524         (Populate): Iterate thru the indexers we have and define them too.
23525         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23526         for the get and set accessors.
23527         (Indexer::Define): Implement.
23528
23529 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23530
23531         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23532         my previous implementation, did not work.
23533
23534         * typemanager.cs: Add a couple of missing types (the longs).
23535
23536         * literal.cs: Use TypeManager.bool_type instead of getting it.
23537
23538         * expression.cs (EventExpr): New kind of expressions.
23539         (Expressio::ExprClassFromMemberInfo): finish
23540
23541 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23542
23543         * assign.cs: Emit stores to static fields differently.
23544
23545 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23546
23547         * Merge in changes and adjust code to tackle conflicts. Backed out my
23548         code in Assign::Resolve ;-) 
23549
23550 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23551
23552         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23553         instead Report.Error and also pass in the location.
23554         (CSharpParser::Lexer): New readonly property to return the reference
23555         to the Tokenizer object.
23556         (declare_local_variables): Use Report.Error with location instead of plain 
23557         old error.
23558         (CheckDef): Ditto.
23559
23560         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23561         (Operator.CheckBinaryOperator): Ditto.
23562
23563         * cs-parser.jay (operator_declarator): Update accordingly.
23564
23565         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23566         (CheckBinaryOperator): Same here.
23567
23568         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23569         on the name without any prefixes of namespace names etc. This is because we
23570         already might have something already fully qualified like 
23571         'System.Console.WriteLine'
23572
23573         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23574
23575 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23576
23577         * cs-tokenizer.cs (location): Return a string which also contains
23578         the file name.
23579
23580         * expression.cs (ElementAccess): New class for expressions of the
23581         type 'element access.'
23582         (BaseAccess): New class for expressions of the type 'base access.'
23583         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23584         respectively.
23585
23586         * cs-parser.jay (element_access): Implement action.
23587         (base_access): Implement actions.
23588         (checked_expression, unchecked_expression): Implement.
23589
23590         * cs-parser.jay (local_variable_type): Correct and implement.
23591         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23592
23593         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23594
23595         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23596         name and the specifiers.
23597
23598         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23599
23600         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
23601         making them all public ;-)
23602
23603         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23604         class anyways.
23605
23606 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
23607
23608         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23609         PropertyExprs.
23610         (FieldExpr, PropertyExprs): New resolved expressions.
23611         (SimpleName::MemberStaticCheck): Perform static checks for access
23612         to non-static fields on static methods. Maybe this should be
23613         generalized for MemberAccesses. 
23614         (SimpleName::ResolveSimpleName): More work on simple name
23615         resolution. 
23616
23617         * cs-parser.jay (primary_expression/qualified_identifier): track
23618         the parameter index.
23619
23620         * codegen.cs (CodeGen::Save): Catch save exception, report error.
23621         (EmitContext::EmitBoolExpression): Chain to expression generation
23622         instead of temporary hack.
23623         (::EmitStatementExpression): Put generic expression code generation.
23624
23625         * assign.cs (Assign::Emit): Implement variable assignments to
23626         local variables, parameters and fields.
23627
23628 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
23629
23630         * statement.cs (Block::GetVariableInfo): New method, returns the
23631         VariableInfo for a variable name in a block.
23632         (Block::GetVariableType): Implement in terms of GetVariableInfo
23633
23634         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23635         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23636
23637 2001-09-06  Ravi Pratap  <ravi@ximian.com>
23638
23639         * cs-parser.jay (operator_declaration): Continue on my quest : update
23640         to take attributes argument.
23641         (event_declaration): Ditto.
23642         (enum_declaration): Ditto.
23643         (indexer_declaration): Ditto.
23644
23645         * class.cs (Operator::Operator): Update constructor accordingly.
23646         (Event::Event): Ditto.
23647
23648         * delegate.cs (Delegate::Delegate): Same here.
23649
23650         * enum.cs (Enum::Enum): Same here.
23651
23652 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23653
23654         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23655
23656         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23657
23658         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23659         being passed around as an arraylist.
23660         (Attributes::AddAttribute): Method to add attribute sections.
23661
23662         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23663         (struct_declaration): Update accordingly.
23664         (constant_declaration): Update.
23665         (field_declaration): Update.
23666         (method_header): Update.
23667         (fixed_parameter): Update.
23668         (parameter_array): Ditto.
23669         (property_declaration): Ditto.
23670         (destructor_declaration): Ditto.
23671
23672         * class.cs (Struct::Struct): Update constructors accordingly.
23673         (Class::Class): Ditto.
23674         (Field::Field): Ditto.
23675         (Method::Method): Ditto.
23676         (Property::Property): Ditto.
23677         (TypeContainer::OptAttribute): update property's return type.
23678
23679         * interface.cs (Interface.opt_attributes): New member.
23680         (Interface::Interface): Update to take the extra Attributes argument.
23681
23682         * parameter.cs (Parameter::Parameter): Ditto.
23683
23684         * constant.cs (Constant::Constant): Ditto.
23685
23686         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23687         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23688         the attributes as a parameter.
23689         (InterfaceProperty): Update constructor call.
23690         (InterfaceEvent): Ditto.
23691         (InterfaceMethod): Ditto.
23692         (InterfaceIndexer): Ditto.
23693
23694         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23695         pass the attributes too.
23696         (interface_event_declaration): Ditto.
23697         (interface_property_declaration): Ditto.
23698         (interface_method_declaration): Ditto.
23699         (interface_declaration): Ditto.
23700
23701 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23702
23703         * class.cs (Method::Define): Track the "static Main" definition to
23704         create an entry point. 
23705
23706         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23707         EntryPoint if we find it. 
23708
23709         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23710         (EmitContext::ig): Make this variable public.
23711
23712         * driver.cs: Make the default output file be the first file name
23713         with the .exe extension.  
23714
23715         Detect empty compilations
23716
23717         Handle various kinds of output targets.  Handle --target and
23718         rename -t to --dumper.
23719
23720         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23721         methods inherited from Expression return now an Expression.  This
23722         will is used during the tree rewriting as we resolve them during
23723         semantic analysis.
23724
23725         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23726         the spec.  Missing entirely is the information about
23727         accessability of elements of it.
23728
23729         (Expression::ExprClassFromMemberInfo): New constructor for
23730         Expressions that creates a fully initialized Expression based on
23731         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23732         a Type.
23733
23734         (Invocation::Resolve): Begin implementing resolution of invocations.
23735
23736         * literal.cs (StringLiteral):  Implement Emit.
23737
23738 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23739
23740         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23741         member.
23742
23743 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23744
23745         * cs-parser.jay (attribute_arguments): Implement actions.
23746         (attribute): Fix bug in production. Implement action.
23747         (attribute_list): Implement.
23748         (attribute_target): Implement.
23749         (attribute_target_specifier, opt_target_specifier): Implement
23750         (CheckAttributeTarget): New method to check if the attribute target
23751         is valid.
23752         (attribute_section): Implement.
23753         (opt_attributes): Implement.
23754
23755         * attribute.cs : New file to handle attributes.
23756         (Attribute): Class to hold attribute info.
23757
23758         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23759         (attribute_section): Modify production to use 2 different rules to 
23760         achieve the same thing. 1 s/r conflict down !
23761         Clean out commented, useless, non-reducing dimension_separator rules.
23762
23763         * class.cs (TypeContainer.attributes): New member to hold list
23764         of attributes for a type.
23765         (Struct::Struct): Modify to take one more argument, the attribute list.
23766         (Class::Class): Ditto.
23767         (Field::Field): Ditto.
23768         (Method::Method): Ditto.
23769         (Property::Property): Ditto.
23770
23771         * cs-parser.jay (struct_declaration): Update constructor call to
23772         pass in the attributes too.
23773         (class_declaration): Ditto.
23774         (constant_declaration): Ditto.
23775         (field_declaration): Ditto.
23776         (method_header): Ditto.
23777         (fixed_parameter): Ditto.
23778         (parameter_array): Ditto.
23779         (property_declaration): Ditto.
23780
23781         * constant.cs (Constant::Constant): Update constructor similarly.
23782         Use System.Collections.
23783
23784         * parameter.cs (Parameter::Parameter): Update as above.
23785
23786 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23787
23788         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23789         (TypeContainer.delegates): New member to hold list of delegates.
23790
23791         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23792         this time as I seem to be on crack ;-)
23793
23794 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23795
23796         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23797         tell whether an identifier represents a namespace.
23798
23799         * expression.cs (NamespaceExpr): A namespace expression, used only
23800         temporarly during expression resolution.
23801         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23802         utility functions to resolve names on expressions.
23803
23804 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23805
23806         * codegen.cs: Add hook for StatementExpressions. 
23807
23808         * class.cs: Fix inverted test for static flag in methods.
23809
23810 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23811
23812         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23813         to make it coincide with MS' number.
23814         (Operator::CheckBinaryOperator): Ditto.
23815
23816         * ../errors/errors.txt : Remove error numbers added earlier.
23817
23818         * ../errors/cs1019.cs : Test case for error # 1019
23819
23820         * ../errros/cs1020.cs : Test case for error # 1020
23821
23822         * cs-parser.jay : Clean out commented cruft.
23823         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23824         used anywhere - non-reducing rule.
23825         (namespace_declarations): Non-reducing rule - comment out.
23826
23827         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23828         with TypeContainer::AddEnum.
23829
23830         * delegate.cs : New file for delegate handling classes.
23831         (Delegate): Class for declaring delegates.
23832
23833         * makefile : Update.
23834
23835         * cs-parser.jay (delegate_declaration): Implement.
23836
23837 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23838
23839         * class.cs (Event::Define): Implement.
23840         (Event.EventBuilder): New member.
23841
23842         * class.cs (TypeContainer::Populate): Update to define all enums and events
23843         we have.
23844         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23845         readonly fields for all these cases ?
23846
23847 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23848
23849         * class.cs (Property): Revamp to use the convention of making fields readonly.
23850         Accordingly modify code elsewhere.
23851
23852         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23853         the Define method of the Property class.
23854
23855         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23856         trivial bug.
23857         (TypeContainer::Populate): Update to define all the properties we have. Also
23858         define all enumerations.
23859
23860         * enum.cs (Define): Implement.
23861
23862 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23863
23864         * cs-parser.jay (overloadable_operator): The semantic value is an
23865         enum of the Operator class.
23866         (operator_declarator): Implement actions.
23867         (operator_declaration): Implement.
23868
23869         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23870         validity of definitions.
23871         (Operator::CheckBinaryOperator): Static method to check for binary operators
23872         (TypeContainer::AddOperator): New method to add an operator to a type.
23873
23874         * cs-parser.jay (indexer_declaration): Added line to actually call the
23875         AddIndexer method so it gets added ;-)
23876
23877         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23878         already taken care of by the MS compiler ?  
23879
23880 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23881
23882         * class.cs (Operator): New class for operator declarations.
23883         (Operator::OpType): Enum for the various operators.
23884
23885 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23886
23887         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23888         ostensibly handle this in semantic analysis.
23889
23890         * cs-parser.jay (general_catch_clause): Comment out
23891         (specific_catch_clauses, specific_catch_clause): Ditto.
23892         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23893         (catch_args, opt_catch_args): New productions.
23894         (catch_clause): Rewrite to use the new productions above
23895         (catch_clauses): Modify accordingly.
23896         (opt_catch_clauses): New production to use in try_statement
23897         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23898         and re-write the code in the actions to extract the specific and
23899         general catch clauses by being a little smart ;-)
23900
23901         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23902         Hooray, try and catch statements parse fine !
23903
23904 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23905
23906         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23907         string from the hashtable of variables.
23908
23909         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23910         I end up making that mistake ;-)
23911         (catch_clauses): Fixed gross error which made Key and Value of the 
23912         DictionaryEntry the same : $1 !!
23913
23914 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23915
23916         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23917
23918         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23919         when the add and remove accessors are specified. 
23920
23921 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23922
23923         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23924         information about indexer_declarator.
23925         (indexer_declarator): Implement actions.
23926         (parsing_indexer): New local boolean used to keep track of whether
23927         we are parsing indexers or properties. This is necessary because 
23928         implicit_parameters come into picture even for the get accessor in the 
23929         case of an indexer.
23930         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23931
23932         * class.cs (Indexer): New class for indexer declarations.
23933         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23934         (TypeContainer::indexers): New member to hold list of indexers for the
23935         type.
23936
23937 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23938
23939         * cs-parser.jay (add_accessor_declaration): Implement action.
23940         (remove_accessor_declaration): Implement action.
23941         (event_accessors_declaration): Implement
23942         (variable_declarators): swap statements for first rule - trivial.
23943
23944         * class.cs (Event): New class to hold information about event
23945         declarations.
23946         (TypeContainer::AddEvent): New method to add an event to a type
23947         (TypeContainer::events): New member to hold list of events.
23948
23949         * cs-parser.jay (event_declaration): Implement actions.
23950
23951 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23952
23953         * cs-parser.jay (dim_separators): Implement. Make it a string
23954         concatenating all the commas together, just as they appear.
23955         (opt_dim_separators): Modify accordingly
23956         (rank_specifiers): Update accordingly. Basically do the same
23957         thing - instead, collect the brackets here.
23958         (opt_rank_sepcifiers): Modify accordingly.
23959         (array_type): Modify to actually return the complete type string
23960         instead of ignoring the rank_specifiers.
23961         (expression_list): Implement to collect the expressions
23962         (variable_initializer): Implement. We make it a list of expressions
23963         essentially so that we can handle the array_initializer case neatly too.
23964         (variable_initializer_list): Implement.
23965         (array_initializer): Make it a list of variable_initializers
23966         (opt_array_initializer): Modify accordingly.
23967
23968         * expression.cs (New::NType): Add enumeration to help us
23969         keep track of whether we have an object/delegate creation
23970         or an array creation.
23971         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23972         members to hold data about array creation.
23973         (New:New): Modify to update NewType
23974         (New:New): New Overloaded contructor for the array creation
23975         case.
23976
23977         * cs-parser.jay (array_creation_expression): Implement to call
23978         the overloaded New constructor.
23979
23980 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23981
23982         * class.cs (TypeContainer::Constructors): Return member
23983         constructors instead of returning null.
23984
23985 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23986
23987         * typemanager.cs (InitCoreTypes): Initialize the various core
23988         types after we have populated the type manager with the user
23989         defined types (this distinction will be important later while
23990         compiling corlib.dll)
23991
23992         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23993         on Expression Classification.  Now all expressions have a method
23994         `Resolve' and a method `Emit'.
23995
23996         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23997         generation from working.     Also add some temporary debugging
23998         code. 
23999
24000 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24001
24002         * codegen.cs: Lots of code generation pieces.  This is only the
24003         beginning, will continue tomorrow with more touches of polish.  We
24004         handle the fundamentals of if, while, do, for, return.  Others are
24005         trickier and I need to start working on invocations soon.
24006
24007         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24008         s.InitStatement. 
24009
24010         * codegen.cs (EmitContext): New struct, used during code
24011         emission to keep a context.   Most of the code generation will be
24012         here. 
24013
24014         * cs-parser.jay: Add embedded blocks to the list of statements of
24015         this block.  So code generation proceeds in a top down fashion.
24016
24017 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24018
24019         * statement.cs: Add support for multiple child blocks.
24020
24021 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24022
24023         * codegen.cs (EmitCode): New function, will emit the code for a
24024         Block of code given a TypeContainer and its ILGenerator. 
24025
24026         * statement.cs (Block): Standard public readonly optimization.
24027         (Block::Block constructors): Link children. 
24028         (Block::Child): Child Linker.
24029         (Block::EmitVariables): Emits IL variable declarations.
24030
24031         * class.cs: Drop support for MethodGroups here, delay until
24032         Semantic Analysis.
24033         (Method::): Applied the same simplification that I did before, and
24034         move from Properties to public readonly fields.
24035         (Method::ParameterTypes): Returns the parameter types for the
24036         function, and implements a cache that will be useful later when I
24037         do error checking and the semantic analysis on the methods is
24038         performed.
24039         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24040         and made a method, optional argument tells whether this is a class
24041         or a structure to apply the `has-this' bit.
24042         (Method::GetCallingConvention): Implement, returns the calling
24043         convention. 
24044         (Method::Define): Defines the type, a second pass is performed
24045         later to populate the methods.
24046
24047         (Constructor::ParameterTypes): implement a cache similar to the
24048         one on Method::ParameterTypes, useful later when we do semantic
24049         analysis. 
24050
24051         (TypeContainer::EmitMethod):  New method.  Emits methods.
24052
24053         * expression.cs: Removed MethodGroup class from here.
24054
24055         * parameter.cs (Parameters::GetCallingConvention): new method.
24056
24057 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24058
24059         * class.cs (TypeContainer::Populate): Drop RootContext from the
24060         argument. 
24061
24062         (Constructor::CallingConvention): Returns the calling convention.
24063         (Constructor::ParameterTypes): Returns the constructor parameter
24064         types. 
24065
24066         (TypeContainer::AddConstructor): Keep track of default constructor
24067         and the default static constructor.
24068
24069         (Constructor::) Another class that starts using `public readonly'
24070         instead of properties. 
24071
24072         (Constructor::IsDefault): Whether this is a default constructor. 
24073
24074         (Field::) use readonly public fields instead of properties also.
24075
24076         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24077         track of static constructors;  If none is used, turn on
24078         BeforeFieldInit in the TypeAttributes. 
24079
24080         * cs-parser.jay (opt_argument_list): now the return can be null
24081         for the cases where there are no arguments. 
24082
24083         (constructor_declarator): If there is no implicit `base' or
24084         `this', then invoke the default parent constructor. 
24085
24086         * modifiers.cs (MethodAttr): New static function maps a set of
24087         modifiers flags into a MethodAttributes enum
24088         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24089         MethodAttr, TypeAttr to represent the various mappings where the
24090         modifiers are used.
24091         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24092
24093 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24094
24095         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24096         method arguments.
24097
24098         * interface.cs (PopulateIndexer): Implemented the code generator
24099         for interface indexers.
24100
24101 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * interface.cs (InterfaceMemberBase): Now we track the new status
24104         here.  
24105
24106         (PopulateProperty): Implement property population.  Woohoo!  Got
24107         Methods and Properties going today. 
24108
24109         Removed all the properties for interfaces, and replaced them with
24110         `public readonly' fields. 
24111
24112 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24113
24114         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24115         initialize their hashtables/arraylists only when they are needed
24116         instead of doing this always.
24117
24118         * parameter.cs: Handle refs and out parameters.
24119
24120         * cs-parser.jay: Use an ArrayList to construct the arguments
24121         instead of the ParameterCollection, and then cast that to a
24122         Parameter[] array.
24123
24124         * parameter.cs: Drop the use of ParameterCollection and use
24125         instead arrays of Parameters.
24126
24127         (GetParameterInfo): Use the Type, not the Name when resolving
24128         types. 
24129
24130 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24131
24132         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24133         and instead use public readonly fields.
24134
24135         * class.cs: Put back walking code for type containers.
24136
24137 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24138
24139         * class.cs (MakeConstant): Code to define constants.
24140
24141         * rootcontext.cs (LookupType): New function.  Used to locate types 
24142
24143
24144 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24145
24146         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24147         this System.Reflection code is.  Kudos to Microsoft
24148
24149         * typemanager.cs: Implement a type cache and avoid loading all
24150         types at boot time.  Wrap in LookupType the internals.  This made
24151         the compiler so much faster.  Wow.  I rule!
24152
24153         * driver.cs: Make sure we always load mscorlib first (for
24154         debugging purposes, nothing really important).
24155
24156         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24157         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24158
24159         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24160         on namespaces that have been imported using the `using' keyword.
24161
24162         * class.cs (TypeContainer::TypeAttr): Virtualize.
24163         (Class::TypeAttr): Return attributes suitable for this bad boy.
24164         (Struct::TypeAttr): ditto.
24165         Handle nested classes.
24166         (TypeContainer::) Remove all the type visiting code, it is now
24167         replaced with the rootcontext.cs code
24168
24169         * rootcontext.cs (GetClassBases): Added support for structs. 
24170
24171 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24172
24173         * interface.cs, statement.cs, class.cs, parameter.cs,
24174         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24175         Drop use of TypeRefs, and use strings instead.
24176
24177 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24178
24179         * rootcontext.cs: 
24180
24181         * class.cs (Struct::Struct): set the SEALED flags after
24182         checking the modifiers.
24183         (TypeContainer::TypeAttr): new property, returns the
24184         TypeAttributes for a class.  
24185
24186         * cs-parser.jay (type_list): Oops, list production was creating a
24187         new list of base types.
24188
24189         * rootcontext.cs (StdLib): New property.
24190         (GetInterfaceTypeByName): returns an interface by type name, and
24191         encapsulates error handling here.
24192         (GetInterfaces): simplified.
24193         (ResolveTree): Encapsulated all the tree resolution here.
24194         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24195         types. 
24196
24197         * driver.cs: Add support for --nostdlib, to avoid loading the
24198         default assemblies.
24199         (Main): Do not put tree resolution here. 
24200
24201         * rootcontext.cs: Beginning of the class resolution.
24202
24203 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24204
24205         * rootcontext.cs: Provide better error reporting. 
24206
24207         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24208
24209         * rootcontext.cs (CreateInterface): Handle the case where there
24210         are no parent interfaces.
24211
24212         (CloseTypes): Routine to flush types at the end.
24213         (CreateInterface): Track types.
24214         (GetInterfaces): Returns an array of Types from the list of
24215         defined interfaces.
24216
24217         * typemanager.c (AddUserType): Mechanism to track user types (puts
24218         the type on the global type hash, and allows us to close it at the
24219         end). 
24220
24221 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24222
24223         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24224         RecordInterface instead.
24225
24226         * cs-parser.jay: Updated to reflect changes above.
24227
24228         * decl.cs (Definition): Keep track of the TypeBuilder type that
24229         represents this type here.  Not sure we will use it in the long
24230         run, but wont hurt for now.
24231
24232         * driver.cs: Smaller changes to accomodate the new code.
24233
24234         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24235         when done. 
24236
24237         * rootcontext.cs (CreateInterface):  New method, used to create
24238         the System.TypeBuilder type for interfaces.
24239         (ResolveInterfaces): new entry point to resolve the interface
24240         hierarchy. 
24241         (CodeGen): Property, used to keep track of the code generator.
24242
24243 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * cs-parser.jay: Add a second production for delegate_declaration
24246         with `VOID'.
24247
24248         (enum_body): Put an opt_comma here instead of putting it on
24249         enum_body or enum_member_declarations so we can handle trailing
24250         commas on enumeration members.  Gets rid of a shift/reduce.
24251
24252         (type_list): Need a COMMA in the middle.
24253
24254         (indexer_declaration): Tell tokenizer to recognize get/set
24255
24256         * Remove old targets.
24257
24258         * Re-add the parser target.
24259
24260 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24261
24262         * cs-parser.jay: Add precendence rules for a number of operators
24263         ot reduce the number of shift/reduce conflicts in the grammar.
24264
24265 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24266
24267         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24268         and put it here.
24269
24270         Get rid of old crufty code.
24271
24272         * rootcontext.cs: Use this to keep track of the parsed
24273         representation and the defined types available to the program. 
24274
24275         * gen-treedump.cs: adjust for new convention.
24276
24277         * type.cs: Split out the type manager, and the assembly builder
24278         from here. 
24279
24280         * typemanager.cs: the type manager will live here now.
24281
24282         * cil-codegen.cs: And the code generator here. 
24283
24284 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24285
24286         * makefile: Fixed up for easy making.
24287
24288 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24289
24290         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24291         the 
24292
24293         (unary_expression): Expand pre_increment_expression and
24294         post_decrement_expression to reduce a shift/reduce.
24295
24296 2001-07-11  Simon Cozens
24297
24298         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24299
24300         Improve allow_keyword_as_indent name.
24301
24302 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24303
24304         * Adjustments for Beta2. 
24305
24306 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24307
24308         * decl.cs: Added `Define' abstract method.
24309         (InTransit): new property, used to catch recursive definitions. 
24310
24311         * interface.cs: Implement `Define'. 
24312
24313         * modifiers.cs: Map Modifiers.constants to
24314         System.Reflection.TypeAttribute flags.
24315
24316         * class.cs: Keep track of types and user-defined types.
24317         (BuilderInit): New method for creating an assembly
24318         (ResolveType): New function to launch the resolution process, only
24319         used by interfaces for now.
24320
24321         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24322         that are inserted into the name space. 
24323
24324 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24325
24326         * ARGH.  I have screwed up my tree so many times due to the use of
24327         rsync rather than using CVS.  Going to fix this at once. 
24328
24329         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24330         load types.
24331
24332 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24333
24334         * Experiment successful: Use System.Type rather that our own
24335         version of Type.  
24336
24337 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24338
24339         * cs-parser.jay: Removed nsAliases from here.
24340
24341         Use new namespaces, handle `using XXX;' 
24342
24343         * namespace.cs: Reimplemented namespace handling, use a recursive
24344         definition of the class.  Now we can keep track of using clauses
24345         and catch invalid using clauses.
24346
24347 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24348
24349         * gen-treedump.cs: Adapted for all the renaming.
24350
24351         * expression.cs (Expression): this class now has a Type property
24352         which returns an expression Type.
24353
24354         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24355         `Type', as this has a different meaning now in the base
24356
24357 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24358
24359         * interface.cs, class.cs: Removed from all the sources the
24360         references to signature computation, as we can not do method
24361         signature computation during the parsing time, as we are not
24362         trying to solve at that point distinguishing:
24363
24364         class X {
24365                 void a (Blah x) {}
24366                 void a (NS.Blah x) {}
24367         }
24368
24369         Which depending on the context might be valid or not, as we do not
24370         know if Blah is the same thing as NS.Blah at that point.
24371
24372         * Redid everything so the code uses TypeRefs now instead of
24373         Types.  TypeRefs are just temporary type placeholders, that need
24374         to be resolved.  They initially have a pointer to a string and the
24375         current scope in which they are used.  This is used later by the
24376         compiler to resolve the reference to an actual Type. 
24377
24378         * DeclSpace is no longer a CIR.Type, and neither are
24379         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24380         are all DeclSpaces, but no Types. 
24381
24382         * type.cs (TypeRefManager): This implements the TypeRef manager,
24383         which keeps track of all the types that need to be resolved after
24384         the parsing has finished. 
24385
24386 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24387
24388         * ARGH.  We are going to have to store `foreach' as a class rather
24389         than resolving it, as we need to verify error 1579 after name
24390         resolution.   *OR* we could keep a flag that says `This request to
24391         IEnumerator comes from a foreach statement' which we can then use
24392         to generate the error.
24393
24394 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24395
24396         * class.cs (TypeContainer.AddMethod): we now add methods to the
24397         MethodGroup instead of the method hashtable.  
24398
24399         * expression.cs: Add MethodGroup abstraction, which gets us one
24400         step closer to the specification in the way we handle method
24401         declarations.  
24402
24403         * cs-parser.jay (primary_expression): qualified_identifier now
24404         tried to match up an identifier to a local variable reference or
24405         to a parameter reference.
24406
24407         current_local_parameters is now a parser global variable that
24408         points to the current parameters for the block, used during name
24409         lookup.
24410
24411         (property_declaration): Now creates an implicit `value' argument to
24412         the set accessor.
24413
24414 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24415
24416         * parameter.cs: Do not use `param' arguments as part of the
24417         signature, per the spec.
24418
24419 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24420
24421         * decl.cs: Base class for classes, structs and interfaces.  This
24422         is the "Declaration Space" 
24423
24424         * cs-parser.jay: Use CheckDef for checking declaration errors
24425         instead of having one on each function.
24426
24427         * class.cs: Factor out some code for handling error handling in
24428         accordance to the "Declarations" section in the "Basic Concepts"
24429         chapter in the ECMA C# spec.
24430
24431         * interface.cs: Make all interface member classes derive from
24432         InterfaceMemberBase.
24433
24434 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24435
24436         * Many things: all interfaces are parsed and generated in
24437         gen-treedump.  Support for member variables, constructors,
24438         destructors, properties, constants is there.
24439
24440         Beginning of the IL backend, but very little done, just there for
24441         testing purposes. 
24442
24443 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24444
24445         * cs-parser.jay: Fix labeled statement.
24446
24447         * cs-tokenizer.cs (escape): Escape " and ' always.
24448         ref_line, ref_name: keep track of the line/filename as instructed
24449         by #line by the compiler.
24450         Parse #line.
24451
24452 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24453
24454         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24455         to match the values in System.CodeDOM.
24456
24457         Divid renamed to Divide.
24458
24459         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24460         statements. 
24461         (Statements.set): remove.
24462
24463         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24464         statements. 
24465
24466         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24467         falseStatements always have valid values. 
24468
24469         * cs-parser.jay: Use System.CodeDOM now.
24470